Файл: forum/inc/razdel.php
Строк: 50
<?
auter();
err();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),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` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' ORDER BY `up` DESC,`time` DESC LIMIT $start, $set[p_str]");
if (mysql_num_rows($q)==0)
{
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='err'>";
echo "В этом разделе темы отсуствуют!";
echo "</td>";
echo "</tr></table>";
}
while ($them = mysql_fetch_assoc($q))
{
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
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'><b>";
}
$post1=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` ASC LIMIT 1"));
$ank=get_user($post1['id_user']);
echo "<img src='/s-klub/img/who.png'> Автор: <a href='/info.php?id=$ank[id]' title='Анкета ".$ank['nick']."'>";
echo GradientText("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</a> ".online($ank['id'])." (".vremja($them['time_create']).")<br />";
$post2=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=get_user($post2['id_user']);
echo "<img src='/s-klub/img/who.png'> Посл.: <a href='/info.php?id=$ank2[id]' title='Анкета ".$ank2['nick']."'>";
echo GradientText("$ank2[nick]", "$ank2[ncolor]", "$ank2[ncolor2]");
echo "</a> ".online($ank2['id'])." (".vremja($post2['time']).")<br />";
echo "</b></td>";
echo "</tr></table>";
}
if ($k_page>1)
{
str("/forum/$forum[id]/$razdel[id]/?",$k_page,$page);
}
?>