Файл: user/notification_set.php
Строк: 186
<?php
#DCMS Special Six (v6.x.x)
#Автор модификации (densnet)
#densnet@spaces.ru
#d-se.ru
require_once '../sys/inc/start.php';
require_once '../sys/inc/compress.php';
require_once '../sys/inc/sess.php';
require_once '../sys/inc/settings.php';
require_once '../sys/inc/db_connect.php';
require_once '../sys/inc/ipua.php';
require_once '../sys/inc/fnc.php';
require_once '../sys/inc/user.php';
if (isset($user)) {
$ank['id'] = $user['id'];
}
if (isset($_GET['id'])) {
$ank['id'] = intval($_GET['id']);
}
$ank = user::get_user($ank['id']);
if (!$ank || $ank['id'] == 0) {
header("Location: /index.php?" . SID);
exit;
}
user::only_reg();
$friends = mysql_fetch_array(mysql_query("SELECT * FROM `friends` WHERE `user` = '" . $user['id'] . "' AND `friends` = '$ank[id]' AND `i` = '1'"));
if (isset($_POST['save'])) {
if (isset($_POST['lenta_foto']) && ($_POST['lenta_foto'] == 0 || $_POST['lenta_foto'] == 1)) {
mysql_query("UPDATE `friends` SET `lenta_foto` = '" . intval($_POST['lenta_foto']) . "' WHERE `user` = '$user[id]' AND `friends` = '$ank[id]'");
}
if (isset($_POST['lenta_avatar']) && ($_POST['lenta_avatar'] == 0 || $_POST['lenta_avatar'] == 1)) {
mysql_query("UPDATE `friends` SET `lenta_avatar` = '" . intval($_POST['lenta_avatar']) . "' WHERE `user` = '$user[id]' AND `friends` = '$ank[id]'");
}
if (isset($_POST['lenta_friends']) && ($_POST['lenta_friends'] == 0 || $_POST['lenta_friends'] == 1)) {
mysql_query("UPDATE `friends` SET `lenta_friends` = '" . intval($_POST['lenta_friends']) . "' WHERE `user` = '$user[id]' AND `friends` = '$ank[id]'");
}
if (isset($_POST['lenta_news']) && ($_POST['lenta_news'] == 0 || $_POST['lenta_news'] == 1)) {
mysql_query("UPDATE `friends` SET `lenta_news` = '" . intval($_POST['lenta_news']) . "' WHERE `user` = '$user[id]' AND `friends` = '$ank[id]'");
}
if (isset($_POST['lenta_forum']) && ($_POST['lenta_forum'] == 0 || $_POST['lenta_forum'] == 1)) {
mysql_query("UPDATE `friends` SET `lenta_forum` = '" . intval($_POST['lenta_forum']) . "' WHERE `user` = '$user[id]' AND `friends` = '$ank[id]'");
}
msg('Изменения успешно приняты');
header('Location: notification.php?act=feed');
exit;
}
$set['title'] = 'Настройка уведомлений для ' . $ank['nick'];
require_once '../sys/inc/thead.php';
title();
err();
aut();
echo "<form class = 'razd' action = '?id=$ank[id]' method = 'POST'>";
echo "Уведомления о новых друзьях $ank[nick].<br />";
echo "<input name = 'lenta_friends' type = 'radio' " . ($friends['lenta_friends'] == 1 ? ' checked = "checked"' : null) . " value = '1' /> Да ";
echo "<input name = 'lenta_friends' type = 'radio' " . ($friends['lenta_friends'] == 0 ? ' checked = "checked"' : null) . " value = '0' /> Нет <br />";
echo "Уведомления о новых темах $ank[nick] в форуме.<br />";
echo "<input name = 'lenta_forum' type = 'radio' " . ($friends['lenta_forum'] == 1 ? ' checked = "checked"' : null) . " value = '1' /> Да ";
echo "<input name = 'lenta_forum' type = 'radio' " . ($friends['lenta_forum'] == 0 ? ' checked = "checked"' : null) . " value = '0' /> Нет <br />";
echo "Уведомления о новых фото $ank[nick].<br />";
echo "<input name = 'lenta_foto' type = 'radio' " . ($friends['lenta_foto'] == 1 ? ' checked = "checked"' : null) . " value = '1' /> Да ";
echo "<input name = 'lenta_foto' type = 'radio' " . ($friends['lenta_foto'] == 0 ? ' checked = "checked"' : null) . " value = '0' /> Нет <br />";
echo "Уведомления о новых сообщениях в новостях $ank[nick].<br />";
echo "<input name = 'lenta_news' type = 'radio' " . ($friends['lenta_news'] == 1 ? ' checked = "checked"' : null) . " value = '1' /> Да ";
echo "<input name = 'lenta_news' type = 'radio' " . ($friends['lenta_news'] == 0 ? ' checked = "checked"' : null) . " value = '0' /> Нет <br />";
echo "Уведомления о смене аватаров $ank[nick].<br />";
echo "<input name = 'lenta_avatar' type = 'radio' " . ($friends['lenta_avatar'] == 1 ? ' checked = "checked"' : null) . " value = '1' /> Да ";
echo "<input name = 'lenta_avatar' type = 'radio' " . ($friends['lenta_avatar'] == 0 ? ' checked = "checked"' : null) . " value = '0' /> Нет <br />";
echo "<button class = 'active' name = 'save'>";
echo " Сохранить изменения";
echo "</button></form>";
require_once '../sys/inc/tfoot.php';