Файл: news/delete.php
Строк: 56
<?php
/*
* Новости
* DCMS Special
* Модифицировал densnet
* Файл delete.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';
$news = mysql_fetch_array(mysql_query("SELECT * FROM `news` WHERE `id` = '" . intval($_GET['delete']) . "' LIMIT 1"));
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `news` WHERE `id` = '$news[id]'"), 0) == 0) {
header("Location:?");
exit;
}
if (user_access('adm_news_delete')) {
if (isset($_GET['ok'])) {
mysql_query("DELETE FROM `news_like` WHERE `id_news` = '$news[id]' LIMIT 1");
mysql_query("DELETE FROM `news_hide` WHERE `nid` = '$news[id]' LIMIT 1");
mysql_query("DELETE FROM `news_komm` WHERE `id_news` = '$news[id]' LIMIT 1");
mysql_query("DELETE FROM `news` WHERE `id` = '$news[id]' LIMIT 1");
header("Location: ?");
}
err();
echo "<div class = 'razd'>";
echo "Вы действительно хотите удалить эту новость?<br />";
echo "<a href = '?delete=$news[id]&ok' class = 'button left on'><span class = 'label'>Да</span></a>";
echo "<a class = 'button middle'><span class = 'label'>Подтверждение</span></a>";
echo "<a href = '?news=$news[id]' class = 'button right on'><span class = 'label'>Нет</span></a>";
echo "</div>";
}