Просмотр файла forum/razd.php

Размер файла: 2.46Kb
<?
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'] = 'Форум - '.$title_forum['name'].'';
include_once'../template/head.php';
echo '<div class="maintext"><a href="index.php">Все категории</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"> В категории <b>'.$title_forum['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($user4['team'] == 6)
    {
        echo '<div class="maintitle mainrazd">Навигация</div>';
        echo '<div class="maintext"><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></div>';
    }

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