Файл: user/bookmark/users.php
Строк: 59
<?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) {
header("Location: /index.php?" . SID);
exit;
}
if (isset($user) && isset($_GET['delete']) && $user['id'] == $ank['id']) {
mysql_query("DELETE FROM `bookmark_user` WHERE `id` = '" . intval($_GET['delete']) . "' AND `id_user` = '$user[id]' LIMIT 1");
msg("Закладка удалена");
header("Location: ?page=" . intval($_GET['page']) . "" . SID);
exit;
}
if (!$ank) {
header("Location: /index.php?" . SID);
exit;
}
$set['title'] = 'Закладки - Люди';
require_once '../../sys/inc/thead.php';
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `bookmark_user` 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 = 'blok'>Интересные люди</div>";
if ($k_post == 0) {
echo "<table class = 'blok'><tr><td class = 'null'>";
echo "<img src = '/style/icons/bullet_error.png' /> Нет результатов";
echo "</td></tr></table>";
}
$q = mysql_query("SELECT * FROM `bookmark_user` WHERE `id_user` = '$ank[id]' ORDER BY id DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank_p = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_people] LIMIT 1"));
echo "<table class = 'razd'><tr><td class = 'icon14'>";
avatar($ank_p['id'], '30');
echo "</td><td class = 'null'>";
echo "<div class = 'right' id = 'hides'>" . vremja($post['time']) . "</div>";
echo "<b>";
echo user($ank_p['id']);
echo "</b><br />";
echo "<img src = '/style/icons/mail.png' /> <a href = '/mail.php?id=$ank[id]'>Написать</a>";
if ($ank['id'] == $user['id']) {
echo "<div class = 'right' id = 'hide'>";
echo "<a href = '?delete=$post[id]&page=$page' title = 'Удалить'><img src = '/style/icons/cross.png' /></a>";
echo "</div>";
}
echo "</td></tr></table>";
}
echo "<a href = '/user/bookmark/index.php?id=$ank[id]'><div class = 'razd'><img src = '/style/icons/left.png' /> Вернуться</div></a>";
if ($k_page > 1) {
str('?', $k_page, $page);
}
require_once '../../sys/inc/tfoot.php';