File size: 755B
<?php
$tema_forum = mysql_result(mysql_query('select count(`id`) from `forum_tema`'),0);
$forum_post = mysql_result(mysql_query('select count(`id`) from `forum_post`'),0);
echo '<div class="title"><a href="'.$HOME.'/forum/"> Форум мастеров </a> ('.$tema_forum.' / '.$forum_post.')</div>';
$forum = mysql_query("SELECT * FROM `forum_tema` ORDER BY `up` DESC LIMIT 5");
while($a = mysql_fetch_assoc($forum))
{
if($a['status'] == 0) {
$stat = 'tem';
}elseif($a['status'] == 1){
$stat = 'close';
}
echo '<div class="menu"><img src="/style/img/'.$stat.'.png"> <a href="/forum/tema'.$a['id'].'" class="k_menu"> '.$a['name'].' ('.mysql_result(mysql_query('select count(`id`) from `forum_post` WHERE `tema` = "'.$a['id'].'"'),0).')</div></a>';
}
?>