View file forum/razd.php

File size: 2.15Kb
<?
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
if($_GET['id_cat']){$id = $_GET['id_cat'];}
$title_foru = mysql_fetch_array(mysql_query("SELECT * FROM forum_cat WHERE id=$id"));
$shcmsengine['title'] = 'Форум - '.$title_foru['name'].'';
include_once'../template/head.php';
  $allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM forum_razd WHERE id_cat=$id"),0);
  $newlist = new Navigation($allfield, // кол-во полей для вывода
                            10,         // выводить 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">В категории <b>'.$title_foru['name'].'</b> отсутствуют разделы</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">Тем: '.$them_count.'<br/>Ответов: '.$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($users_nav['team'] == 6){echo '<div class="user_foot">Навигация</div>';
echo '<div class="posts"><a href="/forum/new.razd.php?id='.$id.'">Создать раздел</a></div>';
echo '<div class="posts"><a href="/forum/edit.cat.php?id='.$id.'">Параметры категории</a></div>';
echo '<div class="posts"><a href="/forum/delete.cat.php?id='.$id.'">Удаление категории</a></div>';}

include_once'../template/foot.php';

?>