Файл: modules/news/delete.php
Строк: 55
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 11.11.2015
* Модифицировал densnet
*/
require_once H . 'sys/inc/start.php';
require_once H . 'sys/inc/compress.php';
require_once H . 'sys/inc/sess.php';
require_once H . 'sys/inc/settings.php';
require_once H . 'sys/inc/db_connect.php';
require_once H . 'sys/inc/ipua.php';
require_once H . 'sys/inc/fnc.php';
require_once H . '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 = 'comm'>";
echo "Вы действительно хотите удалить эту новость?<br />";
echo "<a href = '?delete=$news[id]&ok' class = 'btn btn-success'>Да</a> ";
echo "<a href = '?news=$news[id]' class='btn btn-default'><b>Нет</b></a>";
echo "</div>";
echo "<div class = 'comm'><a href = '?news=$news[id]'><span class='glyphicon glyphicon-arrow-left'></span> Вернуться в новость</a></div>";
}