Файл: forum/inc/razdel.php
Строк: 54
<?php
err();
aut();
if (isset($user) && (!isset($_SESSION['time_c_t_forum']) || $_SESSION['time_c_t_forum'] < $time - 600 || $user['level'] > 0)) {
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/page_white_add.png' /> <a href = '/forum/$forum[id]/$razdel[id]/?act=new'>Новая тема</a><br />";
echo "<img src = '/style/icons/page_white_h.png' /> <a href = '/forum/$forum[id]/$razdel[id]/?act=newop'>Новый опрос</a><br />";
echo "</div>";
}
$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 class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет тем в разделе "$razdel[name]"";
echo "</td></tr></table>";
}
while ($them = mysql_fetch_assoc($q)) {
echo "<table class = 'foot'><tr><td class = 'null'>";
$prosm = mysql_result(mysql_query("SELECT `prosm` FROM `forum_t` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id` = '$them[id]'"), 0);
echo "<img src = '/style/icons/them_$them[up]$them[close].png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/'>$them[name]</a> ";
echo "<span class = 'count1'>";
echo "<img src = '/style/icons/comment_white_mini.png' />" . 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);
echo "</span><span class = 'count1'>";
echo "<img src = '/style/icons/eye_mini.png' /> $prosm";
echo "</span><br />";
$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 = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post1[id_user] LIMIT 1"));
echo "<img src = '/style/icons/xfn.png' /> Автор: ";
echo "<a href = '/info.php?id=$ank[id]'>n";
echo text::gradient("$ank[nick] ", "$ank[ncolor]", "$ank[ncolor2]");
echo "</a> | ";
$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 "<a href = '/info.php?id=$ank2[id]'>n";
echo text::gradient("$ank2[nick] ", "$ank2[ncolor]", "$ank2[ncolor2]");
echo "</a>";
echo "</td></tr></table>";
}
if ($k_page > 1) {
str("/forum/$forum[id]/$razdel[id]/?", $k_page, $page);
}