<?
err();

$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'];
echo "<table class='post'>\n";
$q=mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0) {
echo "   <tr>\n";
echo "  <div class='komm'>\n";
echo "Нет разделов\n";
echo "</div>\n";
}
while ($razdel = mysql_fetch_assoc($q))
{
echo "   <tr>\n";

if($num==1){
echo "  <td class='userline'>\n";
$num=0;
}else{
echo "  <td class='userline'>\n";
$num=1;}
echo "<a href='/forum/$forum[id]/$razdel[id]/'><font color='black'>$razdel[name]</font></a> <font color='#71706e'>[".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0)."]</font><br/>\n";

}
echo "</table>\n";
if ($k_page>1)str("/forum/$forum[id]/?",$k_page,$page); // Вывод страниц
?>