Файл: user/notification/set_user.php
Строк: 177
<?php
/* DCMS Special
* Дата последнего редактирования 15.12.2015
* Модифицировал densnet
*/
foreach (array('start', 'compress', 'sess', 'settings', 'db_connect', 'ipua', 'fnc', 'user') as $inc) {
require_once "../../sys/inc/{$inc}.php";
}
only_reg();
$set['title'] = 'Уведомления';
require_once H . 'sys/inc/thead.php';
aut();
err();
#Навигация
echo "<ol class='breadcrumb'>";
echo "<li><a href='/'><span class='fa fa-home fa-fw'></span></a></li>";
echo "<li><a href='/info.php?id=$user[id]'>$user[nick]</a></li>";
echo "<li class='active'>Уведомления</li>";
echo "</ol>";
echo "<div class='card'>";
echo "<div class='card-header'>Уведомления</div>";
$get = $_GET['id'];
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '$get'"));
$q = mysql_fetch_array(mysql_query("SELECT * FROM `friends` WHERE `user` = '$get'"));
only_reg();
if (isset($_POST['save'])) {
$q['lenta_forum'] = (isset($_POST['lenta_forum']) && $_POST['lenta_forum']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_forum` = '" . mysql_real_escape_string($q['lenta_forum']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_foto'] = (isset($_POST['lenta_foto']) && $_POST['lenta_foto']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_foto` = '" . mysql_real_escape_string($q['lenta_foto']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_obmen'] = (isset($_POST['lenta_obmen']) && $_POST['lenta_obmen']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_obmen` = '" . mysql_real_escape_string($q['lenta_obmen']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_avatar'] = (isset($_POST['lenta_avatar']) && $_POST['lenta_avatar']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_avatar` = '" . mysql_real_escape_string($q['lenta_avatar']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_friends'] = (isset($_POST['lenta_friends']) && $_POST['lenta_friends']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_friends` = '" . mysql_real_escape_string($q['lenta_friends']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_diary'] = (isset($_POST['lenta_diary']) && $_POST['lenta_diary']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_diary` = '" . mysql_real_escape_string($q['lenta_diary']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
$q['lenta_news'] = (isset($_POST['lenta_news']) && $_POST['lenta_news']) ? '1' : '0';
mysql_query("UPDATE `friends` SET `lenta_news` = '" . mysql_real_escape_string($q['lenta_news']) . "' WHERE `user` = '$get' AND `friends` = '$user[id]' LIMIT 1");
if (!isset($err)) {
msg('Изменения успешно приняты');
}
}
err();
echo "<div class='list-group-item' style='margin: -1px;'><center><b>Настройки $ank[nick]</b></center></div>";
echo "<form class='card-block' method='POST'>";
echo "<label class='c-input c-checkbox'><input name='lenta_friends' value='1' type='checkbox' " . ($q['lenta_friends'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-users fa-fw'></i> Уведомления о новых друзьях</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_diary' value='1' type='checkbox' " . ($q['lenta_diary'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-book fa-fw'></i> Уведомления о новых дневниках</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_forum' value='1' type='checkbox' " . ($q['lenta_forum'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-file-text fa-fw'></i> Уведомления о новых темах в форуме</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_foto' value='1' type='checkbox' " . ($q['lenta_foto'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-camera fa-fw'></i> Уведомления о новых фото</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_news' value='1' type='checkbox' " . ($q['lenta_news'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-rss-square fa-fw'></i> Уведомления о комментариях в новостях</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_avatar' value='1' type='checkbox' " . ($q['lenta_avatar'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-image fa-fw'></i> Уведомления о смене аватаров</label><br />";
echo "<label class='c-input c-checkbox'><input name='lenta_obmen' value='1' type='checkbox' " . ($q['lenta_obmen'] ? " checked='checked'" : null) . "><span class='c-indicator'></span> <i class='fa fa-file fa-fw'></i> Уведомления о новых файлах</label><br />";
echo "<button class='btn btn-success' name='save'><i class='fa fa-save fa-fw'></i> Сохранить</button>";
echo "</form>";
echo "</div>";
echo "<div class='list-group-item'><a href='index.php?act=feed' style='margin: -1px;'><i class='fa fa-arrow-left fa-fw'></i> Вернуться</a></div>";
require_once H . 'sys/inc/tfoot.php';
echo "</div>";
require_once H . 'sys/inc/tfoot.php';