Файл: modules/news/delete.php
Строк: 83
<?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 "<nav class='navbar navbar-light' style='background-color: #607D8B; color: #fff;'>";
echo "<ul class='nav navbar-nav'>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='/'><i class='material-icons'>home</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='/modules/news/'>Новости</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link' href='/modules/news/?news=$news[id]'>" . cutStr($news['title'], 30) . "</a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'><i class='material-icons'>keyboard_arrow_right</i></a></li>";
echo "<li class='nav-item' style='margin-left: 1px;'><a class='nav-link'>Удаление</a></li>";
echo "</ul>";
echo "</nav>";
echo "<div class='list-group-item'>";
echo "Вы действительно хотите удалить эту новость?<br />";
echo "<a href='?delete=$news[id]&ok' class='waves-effect waves-light btn'><i class='material-icons'>delete</i> Да</a> ";
echo "<a href='?news=$news[id]' class='btn btn-secondary'><b>Нет</b></a>";
echo "</div>";
}