Просмотр файла modules/forum/new_posts.php

Размер файла: 1.78Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $locate = 'in_forum';
  9.  
  10.  
  11. $title = $lang->word('new_messages').' | '.$lang->word('forum');
  12. require_once(SYS.'/view/header.php');
  13. $tpl->div('title', $lang->word('new_messages').' | '.$lang->word('forum'));
  14. $topic_r = $db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."'")->rowCount();
  15. $pages = new Paginator($topic_r, $ames);
  16. if($topic_r == 0) {
  17. echo $tpl->div('menu', $lang->word('no_posts'));
  18. }
  19. else {
  20. $topic_q = $db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."' ORDER BY time DESC LIMIT $start, $ames");
  21. while($topic = $topic_q->fetch()) {
  22. echo '<div class="menu">';
  23. $topic_u = $db->query("SELECT * FROM `forum_t` WHERE `id` = '". $topic['topic_id']."' LIMIT 1")->fetch();
  24. $topic_i = $db->query("SELECT * FROM `forum_pt` WHERE `id` = '". $topic['id']."' ORDER BY time ASC LIMIT 1")->fetch();
  25. $topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic_u['id']."' ORDER BY time DESC LIMIT 1")->fetch();
  26. echo ' '. output($topic['text']).'<br/> [<small class="gray">'. tnick($topic_i['user_id']).' / '. rtime($topic_i['time']).' / <a href="/forum/topic'. $topic['topic_id'] .'/?page=end">'. $topic_u['name'] .'</a> (<span class="green">+'. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '". $topic_u['id'] ."' AND `time` > '". (time()-60*60*24) ."'")->rowCount().'</span>)</small>]
  27. </div>';
  28. }
  29. $pages->view('/forum/new_posts/?');
  30. }
  31. $tpl->div('block', NAV . ' <a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
  32. require_once(SYS.'/view/footer.php');
  33. ?>