
<?
echo "<div class='navig_niz'><center>Активные темы форума</center></div>\n";
echo "<div class=\"main_menu\">\n";
$adm_add=NULL;
$adm_add2=NULL;
if (!isset($user) || $user['level']==0){
$q222=mysql_query("SELECT * FROM `forum_f` WHERE `adm` = '1'");
while ($adm_f = mysql_fetch_assoc($q222))
{
$adm_add[]="`id_forum` <> '$adm_f[id]'";
}
if (sizeof($adm_add)!=0)
$adm_add2=' WHERE'.implode(' AND ', $adm_add);
}
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`$adm_add2"),0);
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `forum_t`$adm_add2 ORDER BY `time` DESC LIMIT 5");
if (mysql_num_rows($q)==0) {
echo "<center><font color='red'>Активных тем нет</font></center>\n";
}
while ($them = mysql_fetch_assoc($q))
{
$forum=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_f` WHERE `id` = '$them[id_forum]' LIMIT 1"));
$razdel=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_r` WHERE `id` = '$them[id_razdel]' LIMIT 1"));
//$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$post[id_them]' LIMIT 1"));
$ank=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
if ($set['set_show_icon']==2){
echo "<td class='icon48' rowspan='2'>\n";
echo "<img src='/style/themes/$set[set_them]/forum/48/them_$them[up]$them[close].png' />";
echo "</td>\n";
}
elseif ($set['set_show_icon']==1)
{
//echo "  <td class='icon14'>\n"; если хотите чтоб показовали иконки уберите этот текст и 2слеша // перед оператором
//echo "<img src='/style/themes/$set[set_them]/forum/14/them_$them[up]$them[close].png' alt='' />"; если хотите чтоб показывало иконки, уберите этот текст и 2слеша // перед оператором
}
echo "<div class=\"lincs_menu\"><div class=\"lincs\">\n";
echo " <img src='/images/fort.png' alt='' /> <a href='/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a>[<a href='/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'> ".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'AND `id_them` = '$them[id]'"),0)."</a>]\n";
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_p` WHERE `id_them` = '$them[id]' AND `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
echo "<a href='/info.php?id=$ank[id]' title='Анкета \"$ank[nick]\"'><span style=\"colorank[ncolor]\">$ank[nick]</span></a> [".vremja($post['time'])."]<br />\n";
echo "</div></div>\n";
}
echo "</div>\n";
?>

