File size: 2.32Kb
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.ru *
**********************************/
$page = 'index';
$locate = 'in_index';
$title = $lang->word('home');
require_once(SYS.'/view/header.php');
// $tpl->div('title', $lang->word('news'));
if($system['open_news'] == 'yes') { $tpl->div('menu', NEWS_ICON .' <a href="/news/">'. $lang->word('news') .'</a> '. $stat->news() .'<br/>');
$stat->last_news();
}
$tpl->div('title', $lang->word('menu'));
if($system['open_chat'] == 'yes') { $tpl->div('menu', CHAT_ICON .' <a href="/chat/">'. $lang->word('chat') .'</a> '. $stat->chat() .'<br/>'); }
if($system['open_forum'] == 'yes') { $tpl->div('menu', FORUM_ICON .' <a href="/forum/">'. $lang->word('forum') .'</a> '. $stat->forum() .'<br/>');
$topic_r = $db->query("SELECT * FROM `forum_t` WHERE `time_last_post` > '". (time()-60*60*24) ."'")->rowCount();
if($topic_r !=0) {
$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");
while($topic = $topic_q->fetch()) {
echo '<div class="post">';
if ($topic['closed'] == 1 && $topic['attach'] == 1) echo img('pin-closed.png');
else if ($topic['attach'] == 1) echo img('pin.png');
else if ($topic['closed'] == 1) echo img('topic_closed.png');
else echo img('topic.png');
$topic_a = $db->query("SELECT * FROM `forum_pt` WHERE `topic_id` = '". $topic['id']."' ORDER BY time DESC LIMIT 1")->fetch();
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>]
</div>';
}
}
}
if($system['open_share'] == 'yes') { $tpl->div('menu', SHARE_ICON .' <a href="/share/">'. $lang->word('share') .'</a> '. $stat->share() .'<br/>'); }
echo htmlspecialchars_decode($system['mainpage']);
$tpl->div('menu', img('info.png') .' <a href="/pages/faq.php">'. $lang->word('faq') .'</a><br/>');
$tpl->div('menu', USERS_ICON .' <a href="/users/">'. $lang->word('users') .'</a> '. $stat->users() .'<br/>');
require_once(SYS.'/view/footer.php');
?>