Файл: sys/includes/forum_nw.php
Строк: 49
<?
$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);
}
}
$q=mysql_query("SELECT * FROM `forum_t` $adm_add2 ORDER BY `time` DESC LIMIT 5");
if (mysql_num_rows($q)!=0)
{
echo "<table style='width:100%' cellspacing='0' cellpadding='0'><tr>";
echo "<td class='title'>";
echo "<span style='float : left;'>";
echo "<img src='/s-klub/img/a-down.png'>";
echo "</span>";
echo "<span style='float : right;'>";
echo "<img src='/s-klub/img/a-down.png'>";
echo "</span>";
echo "<b>Последние темы форума</b>";
echo "</td>";
echo "</tr></table>";
}
while ($them=mysql_fetch_assoc($q))
{
echo "<table style='width:100%' cellspacing='0' cellpadding='0'><tr>";
$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"));
$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'>";
echo "<img src='/s-klub/img/big/them_$them[up]$them[close].png'/>";
echo "</td>";
}
else if ($set['set_show_icon']==1)
{
echo "<td class='icon14'>";
echo "<img src='/s-klub/img/them_$them[up]$them[close].png' alt='' />";
echo "</td>";
}
echo "<td class='p_t'><b>";
echo "<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";
echo "</b></td>";
echo "</tr>";
echo "<tr>";
if ($set['set_show_icon']==1)
{
echo "<td class='p_m' colspan='2'>";
}else{
echo "<td class='p_m'>";
}
if ($them['close']==1)
{
echo '<img src="/s-klub/img/rules.png"> <b>Тема закрыта для обсуждения!</b>';
}else{
$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"));
$ank2=mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
echo "<img src='/s-klub/img/who.png'> <b>Посл.:</b> ";
echo "<span style='float : right;'>";
echo "<img src='/s-klub/img/time.png'> <b>".vremja($post['time'])."</b>";
echo "</span>";
if ($ank2['id']==0)
{
echo "<img src='/s-klub/img/who.png' alt='' /> ";
echo "<b>Система</b><br />";
}else{
echo "<b><a href='/info.php?id=$ank2[id]' title='Анкета ".$ank2['nick']."'>";
echo GradientText("$ank2[nick]", "$ank2[ncolor]", "$ank2[ncolor2]");
echo "</a></b> ".online($ank2['id'])."<br />";
}
}
echo "</td>";
echo "</tr></table>";
}
?>