File size: 2.17Kb
<?php
require_once('inc/config.php');
if($_SET['vid'] == 1){
$sqlc = mysql_query("SELECT * FROM `cat` WHERE `id_cat`=0");
if(mysql_num_rows($sqlc) == 0){
echo '<div class="error">Разделов пока нет</div>';
}else{
while($sc = mysql_fetch_array($sqlc)){
$cat = mysql_result(mysql_query("SELECT COUNT(*) FROM `cat` WHERE `id_cat`='".intval($sc['id'])."'"), 0 );
echo '<div class="menu">» <a href="cat.php?id='.$sc['id'].'">'.$sc['name'].'</a> ('.$cat.')</div>';
}
}
}else{
$sqlc = mysql_query("SELECT * FROM `cat` WHERE `id_cat`=0");
if(mysql_num_rows($sqlc) == 0){
echo '<div class="error">Разделов пока нет</div>';
}else{
while($sc = mysql_fetch_array($sqlc)){
echo '<div class="cmenu">';
echo '<div class="bmenu">'.$sc['name'].'</div>';
$sqlf = mysql_query("SELECT * FROM `cat` WHERE `id_cat`='".intval($sc['id'])."'");
if(mysql_num_rows($sqlf) == 0){
echo '<div class="error">Раздел пуст</div>';
}else{
while($sf = mysql_fetch_array($sqlf)){
$tem = mysql_result(mysql_query("SELECT COUNT(*) FROM `temy` WHERE `id_cat`='".intval($sf['id'])."'"), 0 );
echo '<div class="menu">» <a href="forum.php?id='.$sf['id'].'">'.$sf['name'].'</a> ('.$tem.')</div>';
}
}
echo '</div>';
}
}
}
$us = mysql_result(mysql_query("SELECT COUNT(*) FROM `users`"), 0 );
echo '<div class="menu">';
if($s['status'] == 0 ){
echo '» <a href="auth.php">Вход</a><br/>
» <a href="reg.php">Регистрация</a><br/>';
}else{
if($s['status'] == 9){ echo '» <a href="admin/admin.php">Админ панель</a><br/>'; }
echo '» <a href="quest.php">Личные данные</a><br/>';
echo '» <a href="exit.php">Выход</a><br/>';
}
echo '» <a href="user.php">Нас уже</a>: '.$us.'<br/>';
echo '</div>';
$bd1=mysql_query("select * from newprivat where `ind`='".$s['login']."'");
if($newmess=mysql_fetch_array($bd1)){
echo '<center><a href="privat.php">Есть не прочитанные личные сообщения</a></center><br/>';
}
$result = mysql_query("SELECT COUNT(*) FROM online_user ");
$posts = mysql_result($result,0);
echo '<center>На сайте '.$posts.' чел </center>';
require_once('inc/end.php');
?>