Файл: forum/inc/razdel.php
Строк: 10
<?
err();
aut();
if (isset($user) && (!isset($_SESSION['time_c_t_forum']) || $_SESSION['time_c_t_forum']<$time-600 || $user['level']>0)){
echo '<a class="link" href="/forum/' . $forum['id'] . '/' . $razdel['id'] . '/?act=new"><i class="fas fa-plus-circle"></i> Добавить тему</a>';
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
echo '<table class="post">';
$q=mysql_query("SELECT * FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' ORDER BY `up` DESC,`time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo '<div class="gmenu">Раздел пуст</div>';
}
while ($them = mysql_fetch_assoc($q)){
echo '<a class="link" href="/forum/' . $forum['id'] . '/' . $razdel['id'] . '/' . $them['id'] . '/"><img src="/style/themes/' . $set['set_them'] . '/forum/14/them_' . $them['up'] . $them['close'] . '.png"> ' . text($them['name']) . '
<span class="c">' . mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]'"),0) . '</span></a>';
}
echo '</table>';
if ($k_page>1)str("/forum/$forum[id]/$razdel[id]/?",$k_page,$page); // Вывод страниц
?>