Файл: user/bookmark/forum.php
Строк: 94
<?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';
only_reg();
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
if ($ank['id'] == 0) {
$ank = get_user($ank['id']);
require_once 'sys/inc/thead.php';
aut();
echo "<div class = 'foot'>";
echo "Это страничка системы!";
echo "</div>";
require_once '../../sys/inc/tfoot.php';
}
$ank = get_user($ank['id']);
if (!$ank) {
header("Location: /index.php?" . SID);
exit;
}
$set['title'] = 'Закладки - Форум';
require_once '../../sys/inc/thead.php';
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_zakl` WHERE `id_user` = '$ank[id]'"), 0);
$k_page = k_page($k_post, $set['p_str']);
$page = page($k_page);
$start = $set['p_str'] * $page - $set['p_str'];
echo "<div class = 'menu_razd'>Интересные темы</div>";
if ($k_post == 0) {
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет результатов";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `forum_zakl` WHERE `id_user` = '$ank[id]' ORDER BY `time_obn` DESC LIMIT $start, $set[p_str]");
while ($zakl = mysql_fetch_assoc($q)) {
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `id` = '$zakl[id_them]' LIMIT 1"), 0) == 1) {
$them = mysql_fetch_assoc(mysql_query("SELECT * FROM `forum_t` WHERE `id` = '$zakl[id_them]' LIMIT 1"));
$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"));
$k_p = 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);
$k_n_p = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `id_forum` = '$forum[id]' AND `id_razdel` = '$razdel[id]' AND `id_them` = '$them[id]' AND `time` > '$zakl[time]'"), 0);
$page_z = k_page($k_p - $k_n_p + 1, $set['p_str']);
if ($k_n_p == 0) {
$k_n_p = NULL;
} else {
$k_n_p = "/+$k_n_p";
}
echo "<table class = 'foot'><tr><td class = 'null'>";
echo "<img src = '/style/icons/them_$them[up]$them[close].png' /> <a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=$page_z'>$them[name]</a> ";
echo "<span class = 'count1'>";
echo "<a href = '/forum/$forum[id]/$razdel[id]/$them[id]/?page=end'>$k_p$k_n_p</a>";
echo "</span><br/>";
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $them[id_user] LIMIT 1"));
echo "<img src = '/style/icons/xfn.png' /> Автор: <a href = '/info.php?id=$ank[id]'>";
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 `id` 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>";
}
}
echo "<div class = 'foot'>";
echo "<img src = '/style/icons/left.png' /> <a href = 'index.php'>Вернуться к закладкам</a><br/>";
echo "<img src = '/style/icons/left.png' /> <a href = '/forum/'>Форум</a>";
echo "</div>";
require_once '../../sys/inc/tfoot.php';