Файл: public_html/modules/forum/index.php
Строк: 33
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
$locate = 'in_forum';
$title = $lang->word('forum');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('forum'));
$forums_r = $db->query("SELECT * FROM `forum`")->rowCount();
if($forums_r == 0) {
echo $tpl->div('menu', $lang->word('no_forums'));
}
else {
$forums_q = $db->query("SELECT * FROM `forum` ORDER BY pos");
while($forums = $forums_q->fetch()) {
$tpl->div('menu', img('forum_1.png') .' <a href="/forum/'. $forums['id'] .'/">'. $forums['name'] .'</a> ['. $db->query("SELECT * FROM `forum_c` WHERE `f_id` = '". $forums['id'] ."'")->rowCount() .'] ' . ($user['level'] >= 6 ? ' <span style="float:right">( <a href="/forum/delete_forum/'.$forums['id'].'/">'.img('delete_11.png').'</a> | <a href="/forum/edit_forum/'.$forums['id'].'/">'.img('edit_11.png').'</a> )</span>' : NULL) .'<br/>
<small>'.$forums['desc'].'</small>');
}
}
$tpl->div('post', NAV. '<a href="/forum/new_topics/">'. $lang->word('new_topics').'</a> ['.$db->query("SELECT * FROM `forum_t` WHERE `time_last_post` > '". (time()-60*60*24) ."'")->rowCount().']<br/>'
. NAV . '<a href="/forum/new_posts/">'. $lang->word('new_messages').'</a> ['.$db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."'")->rowCount().']');
$tpl->div('block', NAV .' <a href="/forum/search">'. $lang->word('search') .'</a><br/> ' . ($user['level'] >=6 ? NAV.' <a href="/forum/add_forum/">'. $lang->word('create_forum') .'</a><br/>' : NULL) . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>