Файл: forum/index.php
Строк: 26
<?php
include_once '../system/head.php';
echo'<div class="menu" style="text-align:center;"><a href="/new_posts.php">[Последние посты]</a> | <a href="/new_themes.php">[Последние темы]</a></div>';
$total=mysql_num_rows(mysql_query("select * from `razdel`"));
if($total){
$sql=mysql_query("select * from `razdel` order by `id`");
while($res=mysql_fetch_assoc($sql)){
echo'<div class="menu"><b>'.$res['name'].'</b><br />';
$sql1=mysql_query("select * from `forum` where `razdel`='$res[id]'");
while($res1=mysql_fetch_assoc($sql1)){
echo'<a href="/forum/forum.php?id='.$res1['id'].'" style="margin:3%;text-align:center;">- '.$res1['name'].'</a><span style="float:right;">['.mysql_num_rows(mysql_query("SELECT id FROM `themes` WHERE `id_forum`='$res1[id]'")).'/'.mysql_num_rows(mysql_query("SELECT id FROM `posts` WHERE `id_forum`='$res1[id]'")).']</span><br />';
}
echo'</div>';
}
}else{echo'<div class="menu">Разделов еще нет</div>';}
if($user['level']>0)echo'<div class="menu"><a href="/index.php?mode=admin&fid=set_for" style="display:block;text-align:center;">Управление форумом</a></div>';
require_once '../system/foot.php';
?>