Просмотр файла forum/index.php

Размер файла: 2.21Kb
<?php
##################################
#           index.php            #
##################################
#   Форум на MySQL               #
#Афтар : Morgan                  #
#ICQ : 530-648                   #
#Email : [email protected]           #
##################################
 require_once 'includes/start.php';
 require_once 'includes/functions.php';
 require_once 'includes/db.php';
 require_once 'includes/avt.php';
 require_once 'includes/other.php';
 require_once 'includes/head.php';
$forums_res = mysql_query('SELECT id,name FROM `forums`');
echo '</div>';
if(mysql_num_rows($forums_res)==0)
{echo '<div class="main">
Форумы пока не созданы!</div>
';}
else
{

  while($forum = mysql_fetch_array($forums_res))
{
echo '<div class="main">
<a href="forum.php?id='.$forum['id'].'">'.$forum['name'].'</a>['.mysql_num_rows(mysql_query("SELECT id FROM `themes` WHERE `id_forum`='$forum[id]'")).'/'.mysql_num_rows(mysql_query("SELECT id FROM `posts` WHERE `id_forum`='$forum[id]'")).']';
if($user_inf['dol']=='admin')
echo '   <a href="admin.php?mode=del&id_forum='.$forum['id'].'">[del]</a> <a href="admin.php?mode=change&what=forum&id='.$forum['id'].'">[изм]</a>';
echo '
</div>
';
}
}
if($user_inf['dol']=='admin') echo '&bull; <a href="admin.php?mode=add&what=forum">Добавить форум</a><br />';
echo '<div class="fon">';

if($status == 'logined')
{
echo '&bull; <a href="online.php">OnLine : '.mysql_num_rows(mysql_query('SELECT `id` FROM online')).'</a><br />';
echo '
&bull; <a href="user.php?id='.$user_inf['id'].'">Профиль</a><br />';
if(mysql_num_rows(mysql_query('SELECT id FROM `posts`'))>10)echo '&bull; <a href="new.php">Последние 10 постов</a><br />';

}

else {
echo '&bull; OnLine : '.mysql_num_rows(mysql_query('SELECT `id` FROM online')).'<br />';
echo '
&bull; <a href="enter.php">Вход</a><br />
&bull; <a href="reg.php">Регистрация</a><br />';}
echo'&bull; <a href="stat.php">Статистика форума</a><br />';
echo '</div>';
 require_once 'includes/foot.php';
##################################
#      © Все права защищены      #
##################################
?>