Файл: forum/new_p.php
Строк: 70
<?php
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
$set['title'] = "Форум - новое в темах";
require_once '../sys/inc/thead.php';
aut();
$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 $start, $set[p_str]");
echo "<div class = 'menu_razd'>Обновленные темы</div>";
if (mysql_num_rows($q) == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет результатов";
echo "</td></tr></table>";
}
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"));
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/them_$them[up]$them[close].png' /> <a href = '/forum/$them[id_forum]/$them[id_razdel]/$them[id]/'>$them[name]</a> ";
echo "<span class = 'count1'>";
echo "<a href = '/forum/$them[id_forum]/$them[id_razdel]/$them[id]/?page=end'>" . mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_them` = '$them[id]'"), 0) . "</a>";
echo "</span><br />";
echo "<a href = '/forum/$forum[id]/'>$forum[name]</a> | <a href = '/forum/$forum[id]/$razdel[id]/'>$razdel[name]</a><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><br />";
echo "<img src = '/style/icons/time.png' /> " . vremja($post['time']) . " ";
echo "</td></tr></table>";
}
#Вывод страниц
if ($k_page > 1) {
str("?", $k_page, $page);
}
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/'>Форум</a>";
echo "</div>";
require_once '../sys/inc/tfoot.php';