Файл: public_html/modules/forum/forum.php
Строк: 37
<?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';
if(!isset($_GET['f_id'])) { go('/forum/'); }
$f_id = abs(intval($_GET['f_id']));
if($db->query("SELECT * FROM `forum` WHERE `id` = '". $f_id ."'")->rowCount() == 0) {
$title = $lang->word('forum');
require_once(SYS.'/view/header.php');
$tpl->div('menu', $lang->word('forum_not_exists'));
$tpl->div('block', NAV.' <a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
$forumf = $db->query("SELECT * FROM `forum` WHERE `id` = '". $f_id ."'")->fetch();
$title = $forumf['name'] .' | '.$lang->word('forum');
require_once(SYS.'/view/header.php');
$tpl->div('title', $forumf['name'] .' | '.$lang->word('forum'));
$forum_r = $db->query("SELECT * FROM `forum_c` WHERE `f_id` = '". $f_id ."'")->rowCount();
if($forum_r == 0) {
echo $tpl->div('menu', $lang->word('no_subforums'));
}
else {
$forum_q = $db->query("SELECT * FROM `forum_c` WHERE `f_id` = '". $f_id ."' ORDER BY pos");
while($forum = $forum_q->fetch()) {
$tpl->div('menu', img('forum_2.png') .'<a href="/forum/cat/'. $forum['id'] .'/">'. $forum['name'] .'</a> ['. $db->query("SELECT * FROM `forum_t` WHERE `cat_id` = '". $forum['id'] ."'")->rowCount() .'] ' . ($user['level'] >= 6 ? ' <span style="float:right">( <a href="/forum/delete_cat/'.$forum['id'].'/">'.img('delete_11.png').'</a> | <a href="/forum/edit_cat/'.$forum['id'].'/">'.img('edit_11.png').'</a> )</span>' : NULL) .' <br/>
<small>'. $forum['desc'] .'</small>');
}
}
$tpl->div('block', ($user['level'] >=6 ? NAV.' <a href="/forum/add_subforum/'. $f_id .'/">'. $lang->word('create_subforum') .'</a><br/>' : NULL) . NAV . ' <a href="/forum/">'. $lang->word('forum') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>