<?
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_themes` ORDER BY `id` DESC limit 10"), 0);

if ( $all == 0) {
    echo 'Темы еще не созданы.<br/>';
    pod_navig();
    foot();
    exit();
    
}



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

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

$all_posts = mysql_result(mysql_query("SELECT count(*) FROM `forum_msg` WHERE `theme` = '$themes[id]'"), 0);

echo "<div class='link2'><img src=\"../images/document.png\" alt=\".\"/> <a href=\"theme.php?razdel=".num($themes['razdel_id'])."&pod_forum=".num($themes['pod_forum'])."&theme=".$themes['id']."\">".$themes['name']."</a> [".$all_posts."]</div>"; 


}



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