|
<?php
/*
#Бесплатный WAP движок StrongCMS
#Официальный сайт поддержки: http://strongcms.ru
*/
####### Вывод категории ######
$forum_k = $db->super_query("SELECT * FROM `forum_kat` WHERE `id` = '".$id."'");
$forum_r = $db->super_query("SELECT * FROM `forum_razdel` WHERE `id` = '".$forum_k['razdel']."'");
#заголовок>шапка
$title = $forum_k['name'];
require ('../system/head.php');
if (!$forum_k)
err($title, 'Такого раздела существует!');
echo '<div class="title"><a href="'.HOME.'/forum/">Форум</a> | <a href="'.HOME.'/forum/razdel'.$forum_r['id'].'">'.$forum_r['name'].'</a> | '.$forum_k['name'].'</div>';
require ('menu.php');
$count = $db->super_query("SELECT COUNT(*) as count FROM `forum_tema` WHERE `kat` = '".$id."'");
$start = nav($count['count']);
$forum_t = $db->query("SELECT * FROM `forum_tema` WHERE `kat` = '".$id."' ORDER BY `id` and `status` = '2' DESC LIMIT ".$start['s'].",".$max);
if ($user)
echo '<a href="/forum/nt'.$id.'" class="menudiv"><img src="'.HOME.'/images/add.png" alt="*" /> Новая тема</a>';
while ($a = $db->fetch_assoc($forum_t))
{
if ($a['status'] == 0)
$icon = 'tem';
elseif ($a['status'] == 1)
$icon = 'close';
elseif ($a['status'] == 2)
$icon = 'top';
$cnt = $db->super_query('select count(id) as count from `forum_post` where `tema` = "'.$a['id'].'" and `kat` = "'.$id.'" ');
echo '<table cols="2" width="100%" cellpadding="0" cellspacing="0" style="font-size:11px;"><tr>
<td class="menudiv" width="95%"><a href="/forum/tema'.$a['id'].'" class="menudiv"><img width="10" height="10" src="/images/'.$icon.'.png" alt="*" /> '.$a['name'].'</a></td>
<td class="menudiv" style="text-align:center;" width="5%"><a href="/forum/tema'.$a['id'].'?selection=top" class="menudiv"><span class="counts_forum"><b>'.$cnt['count'].'</b></span></td></a>
</tr></table>';
}
if ($start['k_post'] < 1)
echo msg('В данном подразделе тем нет!');
if ($start['k_page'] > 1)
echo str(HOME.'/forum/kat'.$id.'?', $start['k_page'], $start['page']); // Вывод страниц
require ('footers.php');
?>