Файл: new.php
Строк: 30
<?php
##################################
# new.php #
##################################
# Форум на MySQL #
#Афтар : Morgan #
#ICQ : 530-648 #
#Email : bcc11@mail.ru #
##################################
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';
echo '</div><div class="main">
Новые посты
</div><div class="fon">';
$postof = mysql_num_rows(mysql_query('SELECT id FROM `posts`'));
if($postof>10)
{
$posl = $postof - 10;
$post = mysql_query("SELECT id_forum,id_theme,id FROM `posts` LIMIT $posl,10");
while($new_post = mysql_fetch_array($post))
{
$forum = mysql_fetch_array(mysql_query("SELECT id,name FROM `forums` WHERE `id`='$new_post[id_forum]' LIMIT 1"));
$theme = mysql_fetch_array(mysql_query("SELECT id,name,author_id FROM `themes` WHERE `id`='$new_post[id_theme]'LIMIT 1"));
echo '<a href="forum.php?id='.$forum['id'].'">'.$forum['name'].'</a> => <a href="theme.php?id='.$theme['id'].'">'.$theme['name'].'</a> => <a href="user.php?id='.$theme['author_id'].'">'.mysql_result(mysql_query('SELECT `login` FROM `users` WHERE `id`='.$theme['author_id']),0).'</a><br/>';
}
}else{echo '10 постов еще нет!';}
echo '</div><br/>
';
require_once 'includes/foot.php';
##################################
# © Все права защищены #
##################################
?>