' . $lng_forum['forum_closed'] . '
';
if (!$user_id) {
if (isset($_GET['newup']))
$_SESSION['uppost'] = 1;
if (isset($_GET['newdown']))
$_SESSION['uppost'] = 0;
}
if ($id) {
/*
-----------------------------------------------------------------
Определяем тип запроса (каталог, или тема)
-----------------------------------------------------------------
*/
$type = mysql_query("SELECT * FROM `forum` WHERE `id`= '$id'");
if (!mysql_num_rows($type)) {
// Если темы не существует, показываем ошибку
echo functions::display_error($lng_forum['error_topic_deleted'], '' . functions::forum_new(1) . '
' .
'' . functions::display_menu($tree) . '
' .
'';
/*
-----------------------------------------------------------------
Отрбражаем содержимое форума
-----------------------------------------------------------------
*/
switch ($type1['type']) {
case 'f':
/*
-----------------------------------------------------------------
Список разделов форума
-----------------------------------------------------------------
*/
$req = mysql_query("SELECT `id`, `text`, `soft` FROM `forum` WHERE `type`='r' AND `refid`='$id' ORDER BY `realid`");
$total = mysql_num_rows($req);
if ($total) {
while ($res = mysql_fetch_assoc($req)) {
echo $i % 2 ? '' : '
';
$coltem = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `refid` = '" . $res['id'] . "'"), 0);
echo '
' . $res['text'] . '';
if ($coltem)
echo " [$coltem]";
if (!empty($res['soft']))
echo '
' . $res['soft'] . '
';
echo '
';
++$i;
}
unset($_SESSION['fsort_id']);
unset($_SESSION['fsort_users']);
} else {
echo '';
}
echo '
' . $lng['total'] . ': ' . $total . '
';
break;
case 'r':
/*
-----------------------------------------------------------------
Список топиков
-----------------------------------------------------------------
*/
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='t' AND `refid`='$id'" . ($rights >= 7 ? '' : " AND `close`!='1'")), 0);
if ($user_id && !$ban['1'] && !$ban['11']) {
// Кнопка создания новой темы
echo '';
}
if ($total) {
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " AND `refid`='$id' ORDER BY `vip` DESC, `time` DESC LIMIT $start, $kmess");
while ($res = mysql_fetch_assoc($req)) {
if($res['close'])
echo '