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

Размер файла: 2.47Kb
<?
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
if($_GET['id_razd']){$id = $_GET['id_razd'];}
$title_foru = mysql_fetch_array(mysql_query("SELECT * FROM `forum_razd` WHERE `id`='$id'"));
$shcmsengine['title'] = 'Форум - '.$title_foru['name'].'';
include_once'../template/head.php';


    $allfield = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_them` WHERE `id_razd`='$id'"),0);
    $newlist = new Navigation($allfield,10, true);   
    $catr = mysql_query("SELECT * FROM `forum_them` WHERE `id_razd`='$id' ORDER BY `id` ". $newlist->limit()."");
    $catw = mysql_fetch_array($catr);

        if(!$id)
        {
            errors("Раздел отсутствует");
            include_once'../template/foot.php';
            header("Refresh: 1; url=/forum/");
            exit();
        }
        if($catw == null)
        {
            echo '<div class="posts">В разделе <b>'.$title_foru['name'].'</b> нет тем.</div>';
        }
        else
        {
            do
            {
                $count_forum = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_mess` WHERE `id_them`='$catw[id]'"),0);
                echo '<div class="posts">';
                echo '<img src="/forum/icon/icon_them/them.gif"/> <a href="message.php?id='.$catw['id'].'">'.$catw['name'].'</a>  ';
        if($catw['close'] == 1)
		{
            echo '<span style="color:red">тема закрыта</span>';
	    }
            echo '<span class="count maintime">Ответов: '.$count_forum.'</span>';
            echo '<br/>Создана: '.$timedate->times($catw['time']).'';
            echo '</div>';
            }
            while($catw = mysql_fetch_array($catr));
			
        echo '<div class="pages">';
        echo $newlist->pagination("id=$id");
        echo '</div>';
        }

    if($user_id)
    {
        echo '<div class="maintitle mainrazd">Навигация</div>';
        echo '<div class="maintext"><div class="posts"><a href="/forum/new.them.php?id='.$id.'">Открыть новую тему</a></div>';
            if($user4['team'] == 6)
            {
                echo '<div class="posts"><a href="/forum/edit.razd.php?id='.$id.'">Параметры раздела</a></div>';
                echo '<div class="posts"><a href="/forum/delete.razd.php?id='.$id.'">Удаление раздела</a></div>';
			}
                echo '</div>';
    }
include_once'../template/foot.php';

?>