Файл: forum/inc/forum.php
Строк: 13
<?php
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_r` WHERE `id_forum` = '$forum[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
$q = mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
echo "<div class = 'blok'>Разделы</div>";
if (mysql_num_rows($q) == 0) {
echo "<table class = 'razd'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет разделов";
echo "</td></tr></table>";
}
while ($razdel = mysql_fetch_assoc($q)) {
echo "<table class = 'razd'><tr><td class = 'null'>";
echo "<span class = 'icon icon92' /> <a href = '/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a> ";
echo "<span class = 'count'>";
echo mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"), 0) . " +" . mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"), 0);
echo "</span></td></tr></table>";
}
if ($k_page > 1) {
str("/forum/$forum[id]/?", $k_page, $page);
}