Файл: modules/news/settings.php
Строк: 80
<?php
/* DCMS S (Special)
* Версия файла 0.0.1
* Дата последнего редактирования 25.11.2015
* Модифицировал densnet
*/
require_once '../../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';
user::access('adm_news_add', null, 'index.php?' . SID);
user::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 "<form class='list-group-item' action='/modules/news/?settings&$passgen' method='POST'>";
echo "<label class='c-input c-checkbox'><input type='checkbox'" . ($user['set_news'] ? " checked='checked'" : null) . " name='set_news' value='1' /><span class='c-indicator'></span> Изображения в новостях</label><br />";
echo "<label class='c-input c-checkbox'><input type='checkbox'" . ($user['set_news_comments'] ? " checked='checked'" : null) . " name='set_news_comments' value='1' /><span class='c-indicator'></span> Вывод комментариев</label><br />";
echo "<button name='save' class='btn btn-success'><span class='fa fa-save'></span> Сохранить</button>";
echo "</form>";
echo "<div class='list-group-item'><a href='/modules/news/'><span class='fa fa-arrow-left'></span> Новости</a></div>";
require_once H . 'sys/inc/tfoot.php';