Файл: modules/forum/index.php
Строк: 39
<?php
$module = 'forum';
require_once 'core/recursion.php';
switch ($act) {
case 'index':
$total = DB::run()->querySingle("select count(`id`) from `forum_categs` where `parentid` = 0;");
if ($total)
{
$query = DB::run()->query("select * from `forum_categs` where `parentid` = 0 ORDER BY `order`");
}
$config['newtitle'] = $lang['Forum'];
$tpl['file'] = 'forum';
require_once 'core/header.php';
break;
case 'viewcateg':
$categ = DB::run()->queryFetch("select * from `forum_categs` where `id` = ?;", array($id));
if ($categ)
{
$totalSubCateg = DB::run()->querySingle("select count(`id`) from `forum_categs` where `parentid` = ?;", array($categ['id']));
if ($totalSubCateg)
{
$querySubCategs = DB::run()->query("select * from `forum_categs` where `parentid` = ? ORDER BY `order`", array($categ['id']));
}
$total = DB::run()->querySingle("select count(`id`) from `forum_threads` where `categid` = ?;", array($categ['id']));
if ($total)
{
require_once 'core/navsetvars.php';
$query = DB::run()->query("select * from `forum_threads` where `categid` = ? ORDER BY `sticky` DESC, `updtime` DESC LIMIT $start, $config[ipp];", array($categ['id']));
}
$fcategid = '%forum'.$categ['id'].'%';
$totalModers = DB::run()->querySingle("select count(`id`) from `users` where `access` LIKE ?;", array($fcategid));
if ($totalModers)
{
$moderquery = DB::run()->query("select `id` from `users` where `access` LIKE ?;", array($fcategid));
}
$config['newtitle'] = $categ['name'];
$tpl['title'] = '<a href="/forum">'.$lang['Forum'].'</a> '.showPath(getPath($categ['id'])).' » '.$categ['name'];
$tpl['file'] = 'forum_viewcateg';
require_once 'core/header.php';
}
else
{
redirect(HTTPHOME);
}
break;
}
require_once 'thread.php';