Файл: modules/news/delete.php
Строк: 51
<?php
/* DCMS Special
* Дата последнего редактирования 11.12.2015
* Модифицировал densnet
*/
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
require_once "../../sys/inc/{$inc}.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 (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 "<ol class='breadcrumb'>";
echo "<li><a href='/'><span class='fa fa-home fa-fw'></span></a></li>";
echo "<li><a href='/modules/news/'>Новости</a></li>";
if (IS_WEB) {
echo "<li><a href='/modules/news/?news=$news[id]'>" . utf8_substr($news['title'], 30) . "</a></li>";
} else {
echo "<li><a href='/modules/news/?news=$news[id]'>" . utf8_substr($news['title'], 15) . "</a></li>";
}
echo "<li class='active'>Удаление</li>";
echo "</ol>";
echo "<div class='list-group-item'>";
echo "Вы действительно хотите удалить эту новость?<br />";
echo "<a href='?delete=$news[id]&ok' class='btn btn-success'><span class='fa fa-trash-o fa-fw'></span> Да</a> ";
echo "<a href='?news=$news[id]' class='btn btn-secondary'><b>Нет</b></a>";
echo "</div>";
}