Файл: user/avatar_comm_del.php
Строк: 34
<?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']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `avatar_comments` WHERE `id` = '" . intval($_GET['id']) . "'"), 0) == 1) {
$post = mysql_fetch_assoc(mysql_query("SELECT * FROM `avatar_comments` WHERE `id` = '" . intval($_GET['id']) . "' LIMIT 1"));
$ank = get_user($post['id_user']);
if ($user['group_access'] >= 7 || $user['id'] == $ank['id']) {
admin_log('Аватарка', 'Удаление сообщения', "Удаление сообщения от $ank[nick]");
mysql_query("DELETE FROM `avatar_comments` WHERE `id` = '$post[id]'");
}
}
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != NULL) {
header("Location: " . $_SERVER['HTTP_REFERER']);
} else {
header("Location: index.php?" . SID);
}