File size: 2.6Kb
<?
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
if($_GET['id'])
{
$id = $_GET['id'];
}
$title_forum = mysql_fetch_array(mysql_query("SELECT * FROM `forum_cat` WHERE `id`='$id'"));
$shcmsengine['title'] = Lang::get('Форум - %s',$title_forum['name']);
include_once'../template/head.php';
echo '<div class="maintext"><a href="index.php">'.Lang::get('Все категории').'</a> | <strong>'.$title_forum['name'].'</strong></div>';
$allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_razd` WHERE `id_cat`='$id'"),0);
$newlist = new Navigation($allfield, 10, true);
$catr = mysql_query("SELECT * FROM `forum_razd` WHERE `id_cat`= '$id' ORDER BY `id` DESC ". $newlist->limit()."");
$catw = mysql_fetch_array($catr);
if($catw == null)
{
echo '<div class="posts"><img class="img_s" src="/template/icon/empty.png"> '.Lang::get('В категории <b>%s</b> отсутствуют разделы',$title_forum['name']).'</div>';
}
else
{
do
{
$them_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them` WHERE `id_razd` = '$catw[id]'"),0);
$mess_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_razd` = '$catw[id]'"),0);
echo '<div class="maintitle"><img src="/forum/icon/icon_razd/'.$catw['icon'].'"/> <a href="them.php?id='.$catw['id'].'">'.$catw['name'].'</a> </div>';
echo '<div class="maintext"><div class="mainforum">'.Lang::get('Тем:').$them_count.'<br/>'.Lang::get('Ответов:').$mess_count.'</div>';
if($catw['message'])
{
echo '<br/>'.$catw['message'];
}
echo '</div>';
}
while($catw = mysql_fetch_array($catr));
echo '<div class="pages">';
echo $newlist->pagination('id='.$id.'');
echo '</div>';
}
if($user4['team'] == 6)
{
echo '<div class="maintitle mainrazd">'.Lang::get('Навигация').'</div>';
echo '<div class="maintext"><div class="posts"><a href="/forum/new.razd.php?id='.$id.'">'.Lang::get('Создать раздел').'</a></div>';
echo '<div class="posts"><a href="/forum/edit.cat.php?id='.$id.'">'.Lang::get('Параметры категории').'</a></div>';
echo '<div class="posts"><a href="/forum/delete.cat.php?id='.$id.'">'.Lang::get('Удаление категории').'</a></div></div>';
}
include_once'../template/foot.php';
?>