Файл: modules/forum/index.php
Строк: 42
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$locate = 'in_forum';
$title = _t('forum');
include_header($title);
$tpl->div('title', _t('forum'));
$forums_r = $db->query("SELECT * FROM `forum`")->rowCount();
if($forums_r == 0)
{
echo $tpl->div('menu', _t('no_forums'));
}
else
{
$forums_q = $db->query("SELECT * FROM `forum` ORDER BY pos");
while($forums = $forums_q->fetch())
{
$tpl->div('menu', NAV . ' <a href="/forum/category/'. $forums['id'] .'/">'. $forums['name'] .'</a> ('. $db->query("SELECT * FROM `forum_c` WHERE `f_id` = '". $forums['id'] ."'")->rowCount() .') ' . (User::level() >= 6 ? ' [<a href="/forum/delete_forum/'.$forums['id'].'/">'.img('delete.png').'</a> | <a href="/forum/edit_forum/'.$forums['id'].'/">'.img('edit.png').'</a>]' : NULL) .'<br/>
<small>'.$forums['desc'].'</small>');
}
}
$tpl->div('post', NAV. '<a href="/forum/new_topics/">'. _t('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/">'. _t('new_messages').'</a> ('.$db->query("SELECT * FROM `forum_pt` WHERE `time` > '". (time()-60*60*24) ."'")->rowCount().')');
$tpl->div('block', NAV .' <a href="/forum/search">'. _t('search') .'</a><br/> ' . (User::level() >=6 ? NAV.' <a href="/forum/add_forum/">'. _t('create_forum') .'</a><br/>' : NULL) . HICO .' <a href="/">'. _t('home') .'</a>');
include_footer();
?>