File size: 2.24Kb
<?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($user_inf['dol']=='admin')
{
echo'Добавить форум :<form method="post" action="dob.php">
Название:<br><input name="name" maxlength="30" value="new"><br>
Анонимный?:<br>
<select name="pol">
<option value="1">Да</option>
<option value="2">Нет</option>
</select>
<hr><input type="submit" value="ХУЯРИМ!"></form>
';}
if(mysql_num_rows($forums_res)==0)
{echo 'Форумы пока не созданы!<br />';}
else
{
echo '</div>';
while($forum = mysql_fetch_array($forums_res))
{
echo '<div class="main">';
if($user_inf['dol']=='admin')
{
echo'<a href="admin.php?mode=delf&id_forum='.$forum['id'].'">[x]</a>';
echo'<a href="admin.php?mode=editf&id_forum='.$forum['id'].'">[e]</a>';
}
echo'<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">
• ';
if($status == 'logined')echo '<a href="exit.php">Выход</a>['.$user_inf['login'].']<br />
• <a href="mail.php">Ваша почта</a><br>
• <a href="game.php">Игры на посты</a><br>
• <a href="new.php">Последние 10 постов</a><br />
';
else {echo '<a href="enter.php">Вход</a><br />
• <a href="reg.php">Регистрация</a><br />';}
echo'• <a href="stat.php">Статистика форума</a><br />';
echo '</div>';
require_once 'includes/foot.php';
##################################
# © Все права защищены #
##################################
?>