<?php

err();
aut();

echo '<div class="">';

$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 '<div class="menu"><a href="/forum/">Форумы</a> | '.$forum['name'].'</div>';

if($k_post==0){
	echo '<div class="red">Нет разделов</div>';
	}

$q=mysql_query("SELECT * FROM `forum_r` WHERE `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while($razdel = mysql_fetch_array($q)){

		echo '<div class="str">

<img src="http://vrozetke.ru/style/themes/green/graph/folder.png" alt="i" />

<a href="/forum/'.$forum['id'].'/'.$razdel['id'].'/">'.$razdel['name'].'</a> ('.mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0).')<br />';
	echo '</div>';
	}



if($k_page>1){
	str("/forum/$forum[id]/?",$k_page,$page);
	}
	echo '<div class="menu"><a href="/forum/">Форумы</a> | '.$forum['name'].'</div>';

?>