Файл: modules/news/settings.php
Строк: 87
<?php
/* DCMS Special
* Дата последнего редактирования 10.12.2015
* Модифицировал densnet
*/
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
require_once "../../sys/inc/{$inc}.php";
}
only_reg();
if (isset($_POST['save'])) {
$user['set_news'] = (isset($_POST['set_news']) && $_POST['set_news']) ? '1' : '0';
mysql_query("UPDATE `user` SET `set_news` = '" . mysql_real_escape_string($user['set_news']) . "' WHERE `id` = '$user[id]' LIMIT 1");
$user['set_news_comments'] = (isset($_POST['set_news_comments']) && $_POST['set_news_comments']) ? '1' : '0';
mysql_query("UPDATE `user` SET `set_news_comments` = '" . mysql_real_escape_string($user['set_news_comments']) . "' WHERE `id` = '$user[id]' LIMIT 1");
if (!isset($err)) {
msg('Изменения успешно приняты');
}
}
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'>Настройки</a></li>";
echo "</ul>";
echo "</nav>";
echo "<form class='list-group-item' action='?settings&$passgen' method='POST'>";
echo "<div class='switch'>";
echo "<label><input type='checkbox' " . ($user['set_news'] ? " checked='checked'" : null) . " name='set_news' value='1'><span class='lever'></span>Изображения в новостях</label>";
echo "</div>";
echo "<div class='switch'>";
echo "<label><input type='checkbox' " . ($user['set_news_comments'] ? " checked='checked'" : null) . " name='set_news_comments' value='1'><span class='lever'></span>Вывод комментариев</label>";
echo "</div><br />";
echo "<button name='save' class='waves-effect waves-light btn'><i class='material-icons'>save</i> Сохранить</button>";
echo "</form>";
require_once H . 'sys/inc/tfoot.php';