Файл: news/delete.php
Строк: 45
<?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 = 'err'>";
echo "Вы действительно хотите удалить эту новость?<br />";
echo "<a href='?news=$news[id]'>Нет</a> | <a href='?delete=$news[id]&ok'>Да</a>";
echo "</div>";
}