Changeset 218
- Timestamp:
- 07/02/10 10:31:36 (19 months ago)
- Location:
- branches/fuze
- Files:
-
- 2 edited
-
core/classes/user.class.php (modified) (6 diffs)
-
templates/_default_/components/com_users_profile.tpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/fuze/core/classes/user.class.php
r181 r218 404 404 } 405 405 406 $sql = "SELECT DISTINCT c.id, c.content, c.target as target, c.target_id as target_id, c.user_id, c.target_link, u.id as user_id, u.nickname as nickname, u.login as login, 407 IF(DATE_FORMAT(c.pubdate, '%d-%m-%Y')=DATE_FORMAT(NOW(), '%d-%m-%Y'), DATE_FORMAT(c.pubdate, '<strong>Cåãîäíÿ</strong> â %H:%i'), 408 IF(DATEDIFF(NOW(), c.pubdate)=1, DATE_FORMAT(c.pubdate, 'Â÷åðà â %H:%i'),DATE_FORMAT(c.pubdate, '%d, %M') )) as pubdate 406 $sql = "SELECT DISTINCT c.id, c.content, c.target as target, c.target_id as target_id, c.user_id, c.target_link, u.id as user_id, u.nickname as nickname, u.login as login, c.pubdate as pubdate 409 407 FROM cms_comments c, cms_users u 410 408 WHERE c.user_id = u.id AND ({$friends_sql}) … … 421 419 422 420 while ($comment = $inDB->fetch_assoc($result)){ 423 $comment['pubdate'] = $inCore-> getRusDate($comment['pubdate']);421 $comment['pubdate'] = $inCore->dateFormat($comment['pubdate']); 424 422 if (sizeof($comment['content'])>50){ 425 423 $comment['content'] = substr($comment['content'], 0, 50) . '...'; … … 466 464 u.nickname as nickname, 467 465 u.login as login, 468 IF(DATE_FORMAT(p.pubdate, '%d-%m-%Y')=DATE_FORMAT(NOW(), '%d-%m-%Y'), DATE_FORMAT(p.pubdate, '<strong>Cåãîäíÿ</strong> â %H:%i'), 469 IF(DATEDIFF(NOW(), p.pubdate)=1, DATE_FORMAT(p.pubdate, 'Â÷åðà â %H:%i'),DATE_FORMAT(p.pubdate, '%d, %M') )) as pubdate 466 p.pubdate as pubdate 470 467 FROM cms_blog_posts p, cms_users u, cms_blogs b 471 468 WHERE p.blog_id = b.id AND p.user_id = u.id AND ({$friends_sql}) … … 485 482 486 483 while ($post = $inDB->fetch_assoc($result)){ 487 $post['pubdate'] = $inCore-> getRusDate($post['pubdate']);484 $post['pubdate'] = $inCore->dateFormat($post['pubdate']); 488 485 $post['url'] = $model->getPostURL(0, $post['bloglink'], $post['seolink']); 489 486 $posts[] = $post; … … 518 515 if ($id < sizeof($friends)-1){ $friends_sql .= ' OR '; } 519 516 } 520 521 $sql = "SELECT DISTINCT p.id, p.title, p.user_id, u.id as user_id, u.nickname as nickname, u.login as login, 522 IF(DATE_FORMAT(p.pubdate, '%d-%m-%Y')=DATE_FORMAT(NOW(), '%d-%m-%Y'), DATE_FORMAT(p.pubdate, '<strong>Cåãîäíÿ</strong> â %H:%i'), 523 IF(DATEDIFF(NOW(), p.pubdate)=1, DATE_FORMAT(p.pubdate, 'Â÷åðà â %H:%i'),DATE_FORMAT(p.pubdate, '%d, %M') )) as pubdate 517 // Ïîëó÷àåì ôîòî èç îáùåé ãàëåðåè 518 $sql = "SELECT p.id, p.title, u.nickname as nickname, u.login as login, p.pubdate as pubdate 524 519 FROM cms_photo_files p, cms_users u 525 520 WHERE p.user_id = u.id AND ({$friends_sql}) … … 530 525 531 526 $result = $inDB->query($sql); 532 533 $photos = array(); 534 535 if (!$inDB->num_rows($result)){ return false; } 527 //Ïîëó÷àåì ëè÷íûå ôîòîãðàôèè 528 $private_sql = "SELECT p.id, p.title, p.user_id, u.nickname as nickname, u.login as login, p.pubdate as pubdate 529 FROM cms_user_photos p, cms_users u 530 WHERE p.user_id = u.id AND ({$friends_sql}) 531 ORDER BY p.pubdate DESC 532 "; 533 if ($limit) { $private_sql .= 'LIMIT '.$limit; } 534 $private_res = $inDB->query($private_sql); 535 536 $photos = array(); 537 538 if (!$inDB->num_rows($result) && !$inDB->num_rows($private_res)){ return false; } 539 540 if ($inDB->num_rows($private_res)) { 541 while($photo = $inDB->fetch_assoc($private_res)){ 542 $photo['pubdate'] = $inCore->dateFormat($photo['pubdate']); 543 $photos[] = $photo; 544 } 545 } 536 546 537 547 while ($photo = $inDB->fetch_assoc($result)){ 538 $photo['pubdate'] = $inCore-> getRusDate($photo['pubdate']);548 $photo['pubdate'] = $inCore->dateFormat($photo['pubdate']); 539 549 $photos[] = $photo; 540 550 } 541 551 //Âûáèðàåì ïîñëåäíèå $limit ôîòî èç îáùåãî ìàññèâà 552 $total = sizeof($photos); 553 554 if ($total){ 555 $page_photos = array(); 556 for($p=0; $p<$limit; $p++){ 557 if ($photos[$p]){ 558 $page_photos[] = $photos[$p]; 559 } 560 } 561 $photos = $page_photos; unset($page_photos); 562 } 542 563 return $photos; 543 564 -
branches/fuze/templates/_default_/components/com_users_profile.tpl
r181 r218 310 310 <td> 311 311 <a href="{profile_url login=$photo.login}" class="nickname">{$photo.nickname}</a> → 312 {if $photo.user_id} 313 <a href="/users/{$photo.user_id}/photo{$photo.id}.html">{$photo.title}</a> 314 {else} 312 315 <a href="/photos/photo{$photo.id}.html">{$photo.title}</a> 316 {/if} 313 317 </td> 314 318 </tr>
Note: See TracChangeset
for help on using the changeset viewer.
