Файл: user/ban.php
Строк: 83
<?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';
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
} else {
header("Location: /index.php?" . SID);
exit;
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$ank[id]' LIMIT 1"), 0) == 0) {
header("Location: /index.php?" . SID);
exit;
}
$ank = get_user($ank['id']);
$set['title'] = 'История нарушений/Банов ' . $ank['nick'];
require_once '../sys/inc/thead.php';
title();
if (isset($_GET['unset']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$ank[id]' AND `id` = '" . intval($_GET['unset']) . "'"), 0) && user_access('user_ban_unset')) {
$ban_info = mysql_fetch_assoc(mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' AND `id` = '" . intval($_GET['unset']) . "'"));
$ank2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '$ban_info[id_ban]' LIMIT 1"));
}
err();
aut();
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `ban` 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'];
if ($k_post == 0) {
echo "<div class = 'razd'>";
echo "<img src = '/style/img/error.png' /> Нет результатов";
echo "</div>";
}
$q = mysql_query("SELECT * FROM `ban` WHERE `id_user` = '$ank[id]' ORDER BY `time` DESC LIMIT $start, $set[p_str]");
while ($post = mysql_fetch_assoc($q)) {
$ank2 = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_ban] LIMIT 1"));
echo "<table class = 'razd'><tr><td class = 'icon48'>";
avatar($ank2['id'], '48');
echo "</td><td class = 'null'>";
echo "Забанилn";
echo " <a href='/info.php?id=$ank2[id]'>$ank2[nick]</a><br />Бан до <font color = 'red'>" . vremja($post['time']) . "</font><br/>Причина:<b>n";
echo text::toOutput($post['prich']) . "</b><br />n";
if ($post['time'] > $time && user_access('user_ban_unset')) {
echo "<a href='?id=$ank[id]&unset=$post[id]'>Снять бан</a><br />n";
}
echo "</td></tr></table>";
}
if ($k_page > 1) {
str('?id=' . $ank['id'] . '&', $k_page, $page);
} // Вывод страниц
echo "<div class = 'razd'>n";
echo img('left.png')." <a href = '/user/anketa/index.php?id=$ank[id]'>Назад</a>";
echo "</div>";
require_once '../sys/inc/tfoot.php';