Файл: new_posts.php
Строк: 12
<?
$title='Последние посты';
include_once 'system/head.php';
echo'<div class="head"><b><a href="forum">Форум</a> / '.$title.'</b></div>';
$sex = mysql_query ("select * from `posts` ORDER BY `id` DESC LIMIT $set[p_str]");
$total = mysql_result(mysql_query("select count(*) from `posts`"),0);
if($total>0){
while ($fex = mysql_fetch_array ($sex)){ $theme = mysql_fetch_array(mysql_query('SELECT * FROM `themes` WHERE `id`='.$fex[id_theme].'')); $avtor = mysql_fetch_array(mysql_query('SELECT * FROM `user` WHERE `id`='.$fex[author_id].'')); echo'<div class="menu">'.nl2br(smiles(bb_code(protect($fex['text'])))).'..<br /> В теме : <a href="/forum/theme.php?id='.$theme['id'].'&page=end">'.$theme['name'].'</a><br> От кого : <a href="profile'.$avtor['id'].'">'.$avtor['login'].'</a></div>'; }
}else{echo'<div class="menu">Постов еще нет</div>';}
include_once 'system/foot.php';
?>