<?php
#-----------------------------------------------------#
# ********* ROTORCMS ********* #
# Made by : VANTUZ #
# E-mail : [email protected] #
# Site : http://pizdec.ru #
# WAP-Site : http://visavi.net #
# ICQ : 36-44-66 #
# Вы не имеете право вносить изменения в код скрипта #
# для его дальнейшего распространения #
#-----------------------------------------------------#
require_once ('../includes/start.php');
require_once ('../includes/functions.php');
require_once ('../includes/header.php');
include_once ('../themes/' . $config['themes'] . '/index.php');
$config['spamlist'] = 10;
if (isset($_GET['act'])) {
$act = check($_GET['act']);
} else {
$act = 'forum';
}
if (isset($_GET['start'])) {
$start = abs(intval($_GET['start']));
} else {
$start = 0;
}
if (is_admin(array(101, 102, 103))) {
show_title('site.png', 'Список жалоб');
$config['newtitle'] = 'Список жалоб';
switch ($act):
# ###########################################################################################
# # Форум ##
# ###########################################################################################
case 'forum':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalguest = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalpriv = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalwall = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalload = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
$totalblog = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
echo '<b>Форум</b> (' . $total . ') / <a href="spam.php?act=guest&' . SID . '">Гостевая (' . $totalguest . ')</a> / <a href="spam.php?act=privat&' . SID . '">Приват (' . $totalpriv . ')</a> / <a href="spam.php?act=wall&' . SID . '">Стена</a> (' . $totalwall . ') / <a href="spam.php?act=load&' . SID . '">Скрипты</a> (' . $totalload . ') / <a href="spam.php?act=blog&' . SID . '">Блоги</a> (' . $totalblog . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(1));
echo '<form action="spam.php?act=del&ref=forum&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('spam.php?act=forum&', $config['spamlist'], $start, $total);
page_strnavigation('spam.php?act=forum&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Гостевая ##
# ###########################################################################################
case 'guest':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalforum = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalpriv = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalwall = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalload = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
$totalblog = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
echo '<a href="spam.php?act=forum&' . SID . '">Форум (' . $totalforum . ')</a> / <b>Гостевая</b> (' . $total . ') / <a href="spam.php?act=privat&' . SID . '">Приват (' . $totalpriv . ')</a> / <a href="spam.php?act=wall&' . SID . '">Стена</a> (' . $totalwall . ') / <a href="spam.php?act=load&' . SID . '">Скрипты</a> (' . $totalload . ') / <a href="spam.php?act=blog&' . SID . '">Блоги</a> (' . $totalblog . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(2));
echo '<form action="spam.php?act=del&ref=guest&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('spam.php?act=guest&', $config['spamlist'], $start, $total);
page_strnavigation('spam.php?act=guest&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Приват ##
# ###########################################################################################
case 'privat':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalforum = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalguest = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalwall = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalload = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
$totalblog = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
echo '<a href="spam.php?act=forum&' . SID . '">Форум (' . $totalforum . ')</a> / <a href="spam.php?act=guest&' . SID . '">Гостевая</a> (' . $totalguest . ') / <b>Приват (' . $total . ')</b> / <a href="spam.php?act=wall&' . SID . '">Стена</a> (' . $totalwall . ') / <a href="spam.php?act=load&' . SID . '">Скрипты</a> (' . $totalload . ') / <a href="spam.php?act=blog&' . SID . '">Блоги</a> (' . $totalblog . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(3));
echo '<form action="spam.php?act=del&ref=privat&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('spam.php?act=privat&', $config['spamlist'], $start, $total);
page_strnavigation('spam.php?act=privat&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Стена сообщений ##
# ###########################################################################################
case 'wall':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalforum = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalguest = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalpriv = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalload = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
$totalblog = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
echo '<a href="spam.php?act=forum&' . SID . '">Форум (' . $totalforum . ')</a> / <a href="spam.php?act=guest&' . SID . '">Гостевая</a> (' . $totalguest . ') / <a href="spam.php?act=privat&' . SID . '">Приват</a> (' . $totalpriv . ') / <b>Стена</b> (' . $total . ') / <a href="spam.php?act=load&' . SID . '">Скрипты</a> (' . $totalload . ') / <a href="spam.php?act=blog&' . SID . '">Блоги</a> (' . $totalblog . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(4));
echo '<form action="spam.php?act=del&ref=wall&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('spam.php?act=wall&', $config['spamlist'], $start, $total);
page_strnavigation('spam.php?act=wall&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Комментарии в скриптах ##
# ###########################################################################################
case 'load':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
$totalforum = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalguest = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalpriv = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalwall = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalblog = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
echo '<a href="spam.php?act=forum&' . SID . '">Форум (' . $totalforum . ')</a> / <a href="spam.php?act=guest&' . SID . '">Гостевая</a> (' . $totalguest . ') / <a href="spam.php?act=privat&' . SID . '">Приват</a> (' . $totalpriv . ') / <a href="spam.php?act=wall&' . SID . '">Стена</a> (' . $totalwall . ') / <b>Скрипты</b> (' . $total . ') / <a href="spam.php?act=blog&' . SID . '">Блоги</a> (' . $totalblog . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(5));
echo '<form action="spam.php?act=del&ref=load&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_jumpnavigation('spam.php?act=load&', $config['spamlist'], $start, $total);
page_strnavigation('spam.php?act=load&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Комментарии в блогах ##
# ###########################################################################################
case 'blog':
$total = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(6));
$totalforum = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(1));
$totalguest = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(2));
$totalpriv = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(3));
$totalwall = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(4));
$totalload = DB :: $dbh -> querySingle("SELECT count(*) FROM `spam` WHERE `spam_key`=?;", array(5));
echo '<a href="spam.php?act=forum&' . SID . '">Форум (' . $totalforum . ')</a> / <a href="spam.php?act=guest&' . SID . '">Гостевая</a> (' . $totalguest . ') / <a href="spam.php?act=privat&' . SID . '">Приват</a> (' . $totalpriv . ') / <a href="spam.php?act=wall&' . SID . '">Стена</a> (' . $totalwall . ') / <a href="spam.php?act=load&' . SID . '">Скрипты</a> (' . $totalload . ') / <b>Блоги</b> (' . $total . ')<br /><br />';
if ($total > 0) {
if ($start >= $total) {
$start = 0;
}
$queryban = DB :: $dbh -> query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(6));
echo '<form action="spam.php?act=del&ref=blog&start=' . $start . '&uid=' . $_SESSION['token'] . '&' . SID . '" method="post">';
echo '<div class="form">';
echo '<input type="checkbox" name="all" onchange="for (i in this.form.elements) this.form.elements[i].checked = this.checked" /> <b>Отметить все</b>';
echo '</div>';
while ($data = $queryban -> fetch()) {
echo '<div class="b">';
echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> ';
echo '<img src="../images/img/files.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data['spam_login'] . '&' . SID . '">' . nickname($data['spam_login']) . '</a></b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>';
echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />';
echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />';
echo 'Жалоба: <a href="../pages/anketa.php?uz=' . $data['spam_user'] . '&' . SID . '">' . nickname($data['spam_user']) . '</a> (' . date_fixed($data['spam_addtime']) . ')</div>';
}
echo '<br /><input type="submit" value="Удалить выбранное" /></form>';
page_strnavigation('spam.php?act=blog&', $config['spamlist'], $start, $total);
if (is_admin(array(101, 102))) {
echo '<img src="../images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '&' . SID . '">Очистить</a><br />';
}
} else {
show_error('Жалоб еще нет!');
}
break;
# ###########################################################################################
# # Удаление сообщений ##
# ###########################################################################################
case "del":
$uid = check($_GET['uid']);
$ref = check($_GET['ref']);
if (isset($_POST['del'])) {
$del = intar($_POST['del']);
} else {
$del = 0;
}
if ($uid == $_SESSION['token']) {
if (!empty($del)) {
$del = implode(',', $del);
DB :: $dbh -> query("DELETE FROM `spam` WHERE `spam_id` IN (" . $del . ");");
$_SESSION['note'] = 'Выбранные жалобы успешно удалены!';
header ("Location: spam.php?act=$ref&start=$start&" . SID);
exit;
} else {
show_error('Ошибка! Отсутствуют выбранные жалобы!');
}
} else {
show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
}
echo '<img src="../images/img/back.gif" alt="image" /> <a href="spam.php?start=' . $start . '&' . SID . '">Вернуться</a><br />';
break;
# ###########################################################################################
# # Очистка жалоб ##
# ###########################################################################################
case 'clear':
$uid = check($_GET['uid']);
if ($uid == $_SESSION['token']) {
if (is_admin(array(101, 102))) {
DB :: $dbh -> query("TRUNCATE `spam`;");
$_SESSION['note'] = 'Жалобы успешно очищены!';
header ("Location: spam.php?" . SID);
exit;
} else {
show_error('Ошибка! Очищать жалобы могут только админы!');
}
} else {
show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
}
echo '<img src="../images/img/back.gif" alt="image" /> <a href="spam.php?' . SID . '">Вернуться</a><br />';
break;
default:
header("location: spam.php?" . SID);
endswitch;
echo '<img src="../images/img/panel.gif" alt="image" /> <a href="index.php?' . SID . '">В админку</a><br />';
echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a><br />';
} else {
header ('Location: ' . BASEDIR . 'index.php?' . SID);
exit;
}
include_once ('../themes/' . $config['themes'] . '/foot.php');
?>