Файл: forum/inc/forum.php
Строк: 42
<?
auter();
err();
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_r` WHERE `id_forum` = '$forum[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_r` WHERE `id_forum` = '$forum[id]' ORDER BY `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 ($razdel = mysql_fetch_assoc($q))
{
echo "<table style='width:100%' cellspacing='1' cellpadding='1'><tr>";
echo "<td class='icon14'>";
echo "<img src='/s-klub/img/forum.png'>";
echo "</td>";
echo "<td class='p_t'><b>";
echo "<a href='/forum/$forum[id]/$razdel[id]/'>$razdel[name] (".mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0).'/'.mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]'"),0).")</a>n";
echo "</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td class='p_m' colspan='2'>";
$them=mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id_razdel` = '$razdel[id]' AND `id_forum` = '$forum[id]' ORDER BY `time` DESC LIMIT 1"));
if ($them!=NULL)
{
$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']);
$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 `id` DESC LIMIT 1"));
$ank2=get_user($post2['id_user']);
echo "<img src='/s-klub/img/opis.png'> <b>".$them['name']." (".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).")</b><br />";
echo "<img src='/s-klub/img/who.png'> ";
echo GradientText("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo " ".online($ank['id'])." <b>/</b> <img src='/s-klub/img/who.png'> ";
echo GradientText("$ank2[nick]", "$ank2[ncolor]", "$ank2[ncolor2]");
echo "".online($ank['id'])."<br />";
echo "<img src='/s-klub/img/time.png'> <b>".vremja($post2['time'])."</b><br />";
}else{
echo "<img src='/s-klub/img/rules.png'> <b>Тем пока нет :(</b>";
}
echo "</td>n";
echo "</tr>n";
}
echo "</table>n";
if ($k_page>1)str("/forum/$forum[id]/?",$k_page,$page);
?>