View file index.php

File size: 1.56Kb
<?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/head.php';
$forums_res = mysql_query('SELECT id,name FROM `forums`');
if(mysql_num_rows($forums_res)==0)
{echo 'Форумы пока не созданы!<br />';}
else
{
echo '</div>';

  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]'")).']
</div>
';
}
}

echo '<div class="fon">
&bull; ';
if($status == 'logined')echo '<a href="exit.php">Выход</a>['.$user_inf['login'].']<br />
&bull; <a href="new.php">Последние 10 постов</a><br />
';
else {echo '<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';
##################################
#      © Все права защищены      #
##################################
?>