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

Размер файла: 2.27Kb
  1. <?php
  2. /**********************************
  3. * @package: PerfCMS *
  4. * @year: 2012 *
  5. * @author: Artas *
  6. * @link: http://perfcms.pp.ua *
  7. **********************************/
  8. $page = 'index';
  9. $locate = 'in_index';
  10. $title = $lang->word('home');
  11. require_once(SYS.'/view/header.php');
  12. // $tpl->div('title', $lang->word('news'));
  13. if($system['open_news'] == 'yes') { $tpl->div('menu', NEWS_ICON .' <a href="/news/">'. $lang->word('news') .'</a> '. $stat->news() .'<br/>');
  14. $stat->last_news();
  15. }
  16. $tpl->div('title', $lang->word('menu'));
  17. if($system['open_chat'] == 'yes') { $tpl->div('menu', CHAT_ICON .' <a href="/chat/">'. $lang->word('chat') .'</a> '. $stat->chat() .'<br/>'); }
  18. if($system['open_forum'] == 'yes') { $tpl->div('menu', FORUM_ICON .' <a href="/forum/">'. $lang->word('forum') .'</a> '. $stat->forum() .'<br/>');
  19. $topic_r = $db->query("SELECT * FROM `forum_t` WHERE `time_last_post` > '". (time()-60*60*24) ."'")->rowCount();
  20. if($topic_r !=0) {
  21. $topic_q = $db->query("SELECT * FROM `forum_t` WHERE `time_last_post` > '". (time()-60*60*24) ."' ORDER BY time_last_post DESC LIMIT 0, 6");
  22. while($topic = $topic_q->fetch()) {
  23. echo '<div class="post">';
  24. if ($topic['closed'] == 1 && $topic['attach'] == 1) echo img('pin-closed.png');
  25. else if ($topic['attach'] == 1) echo img('pin.png');
  26. else if ($topic['closed'] == 1) echo img('topic_closed.png');
  27. else echo img('topic.png');
  28. $topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic['id']."' ORDER BY time DESC LIMIT 1")->fetch();
  29. echo '<a href="/forum/topic'. $topic['id'] .'/">'. $topic['name'] .'</a> ('. $db->query("SELECT id FROM `forum_pt` WHERE `topic_id` = '". $topic['id'] ."'")->rowCount().')<a href="/forum/topic'. $topic['id'] .'/?page=end">»</a> <br/> [<small class="gray">'. tnick($topic_a['user_id']).' / '. rtime($topic_a['time']).'</small>]
  30. </div>';
  31. }
  32. }
  33. }
  34. if($system['open_share'] == 'yes') { $tpl->div('menu', SHARE_ICON .' <a href="/share/">'. $lang->word('share') .'</a> '. $stat->share() .'<br/>'); }
  35. $tpl->div('menu', img('info.png') .' <a href="/pages/faq.php">'. $lang->word('faq') .'</a><br/>');
  36. $tpl->div('menu', USERS_ICON .' <a href="/users/">'. $lang->word('users') .'</a> '. $stat->users() .'<br/>');
  37. require_once(SYS.'/view/footer.php');
  38. ?>