[php]/////////////////
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_forum_files`" . ($rights >= 7 ? '' : " WHERE `del` != '1'"
), 0);
echo '<div class="menu">РАзделы форума</div>';
$req = mysql_query("SELECT `id`, `text`, `soft` FROM `forum` WHERE `type`='f' ORDER BY `realid`"
;
$i = 0;
while (($res = mysql_fetch_array($req)) !== false) {
echo $i % 2 ? '<div class="list2">' : '<div class="list1">';
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='r' and `refid`='" . $res['id'] . "'"
, 0);
echo '<a href="forum/index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> [' . $count . ']';
if (!empty($res['soft']))
echo '<div class="sub"><span class="gray">' . $res['soft'] . '</span></div>';
echo '</div>';
++$i;
}[/php]
вот как выглядит