Файл: mob-lave.ru/moduls/forum/forum_menu.php
Строк: 47
<?php
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_forum_them`"),0) == false) echo '<div class="mess">Тем нет</div>';
$q = mysql_query("SELECT * FROM `$system[perfix]_forum_them` ORDER BY `times` DESC LIMIT 3");
while($post = mysql_fetch_assoc($q)){
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_forum_komm` WHERE `id_them` = '".num($post[id])."'"),0);
$count_new = mysql_result(mysql_query("SELECT COUNT(*) FROM `$system[perfix]_forum_komm` WHERE `time` > '".$ftime."' && `id_them` = '$post[id]'"), 0);
if ($count_new==0)$count_new=NULL;else $count_new='<font color=red><smile><sup>+'.$count_new.'</sup></smile></font>';
$avtor = mysql_fetch_assoc(mysql_query("SELECT `id`,`login` FROM `$system[perfix]_users` WHERE `id` = '".num($post[avtor])."'"));
$komm = mysql_fetch_assoc(mysql_query("SELECT `id_user` FROM `$system[perfix]_forum_komm` WHERE `id_them` = '".num($post[id])."' ORDER BY `id` DESC"));
$otvet = mysql_fetch_assoc(mysql_query("SELECT `id`,`login` FROM `$system[perfix]_users` WHERE `id` = '".num($komm[id_user])."'"));
echo '<div class="menu_touch"><a href="/moduls/forum/'.num($post['id_razd']).'/'.num($post['id_podrazd']).'/'.num($post['id']).'">';
if($count != 0) $posl = ' '.$z.' '.$otvet['login'];
if($post['sort'] == 0 && $post['close'] == 1) echo ' <img src="/design/images/site/them_close.png" alt="Тема закрыта"/> ';
else if($post['sort'] == 0 && $post['close'] == 0) echo ' <img src="/design/images/site/them.png" alt="Тема открыта"/> ';
else if($post['sort'] > 0 && $post['close'] == 0) echo ' <img src="/design/images/site/them_top.png" alt="Тема закреплена"/> ';
else if($post['sort'] > 0 && $post['close'] == 1) echo ' <img src="/design/images/site/them_top_close.png" alt="Тема закреплена и закрыта"/> ';
if($post['screen1'] != 0 or $post['screen2'] != 0 or $post['screen3'] != 0) echo '<img src="/design/images/site/anchor.png"/> ';
echo '<b>'.text($post['title']).'</b> <span class="count">'.$count.' '.$count_new.'</span><br/>';
echo $avtor['login']. $posl ;
echo '</a></div>';
}
?>