<?
include '../config.php';
include '../func.php';
head();
ban();

/////////////////////////////


if ( $id_session )
mysql_query("UPDATE `profile` SET `online` = 'forum' WHERE `id` = '".$id_session."'");



echo head . "<b>Новые посты</b>" . div;  



$all = mysql_result(mysql_query("SELECT count(*) FROM `forum_msg` ORDER BY `id` DESC limit 10"), 0);

if ( $all == 0) {
    echo 'Еще никто ничего не писал.<br/>';
    pod_navig();
    foot();
    exit();
    
}



$result = mysql_query("SELECT * FROM forum_msg ORDER BY `id` DESC limit 10");

while($post = mysql_fetch_assoc($result)){



echo "<div class='link2'><b>".user($post['user_id']).":</b> ".$post['msg']."<br/>"; 

$theme = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_themes` WHERE `id` = '".$post['theme']."'"));

echo '<br/><a href="theme.php?razdel='.$theme['razdel_id'].'&pod_forum='.$theme['pod_forum'].'&theme='.$theme['id'].'">Перейти в тему <b>'.$theme['name'].'</b></a></div>';
}



echo '</div>';
pod_navig();
foot();
?>