Файл: lenta_set.php
Строк: 98
<?
include_once 'connect.php';
$get=intval($_GET['id']);
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '$get'"));
$q=mysql_fetch_array(mysql_query("SELECT * FROM `lenta_chit` WHERE `user` = '$get'"));
if (isset($_POST['lenta_forum']) && $_POST['lenta_forum']==1)
{
$q['lenta_forum']=1;
mysql_query("UPDATE `lenta_chit` SET `lenta_forum` = '1' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
else
{
$q['lenta_forum']=0;
mysql_query("UPDATE `lenta_chit` SET `lenta_forum` = '0' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
if (isset($_POST['lenta_obmen']) && $_POST['lenta_obmen']==1)
{
$q['lenta_obmen']=1;
mysql_query("UPDATE `lenta_chit` SET `lenta_obmen` = '1' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
else
{
$q['lenta_obmen']=0;
mysql_query("UPDATE `lenta_chit` SET `lenta_obmen` = '0' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
if (isset($_POST['lenta_comm']) && $_POST['lenta_comm']==1)
{
$q['lenta_comm']=1;
mysql_query("UPDATE `lenta_chit` SET `lenta_comm` = '1' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
else
{
$q['lenta_comm']=0;
mysql_query("UPDATE `lenta_chit` SET `lenta_comm` = '0' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
if (isset($_POST['lenta_blog']) && $_POST['lenta_blog']==1)
{
$q['lenta_blog']=1;
mysql_query("UPDATE `lenta_chit` SET `lenta_blog` = '1' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
else
{
$q['lenta_blog']=0;
mysql_query("UPDATE `lenta_chit` SET `lenta_blog` = '0' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
if (isset($_POST['lenta_foto']) && $_POST['lenta_foto']==1)
{
$q['lenta_foto']=1;
mysql_query("UPDATE `lenta_chit` SET `lenta_foto` = '1' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
else
{
$q['lenta_foto']=0;
mysql_query("UPDATE `lenta_chit` SET `lenta_foto` = '0' WHERE `user` = '$u[id]' AND `chit` = '$get' LIMIT 1");
}
$title = $title.' | Настройка уведомлений | '.$ank['login'];
include_once 'head.php';
echo "<div class='div'>Выберите какие хотите получать уведомления от пользователя:</div>";
echo "<div class='div'>";
echo "<form method='post'>n";
#echo "<label><input type='checkbox' name='lenta_forum'".($q['lenta_forum']=1?" checked='checked'":null)." value='1' />Уведомлять о новых темах в форуме</label><br />n";
#echo "<label><input type='checkbox' name='lenta_obmen'".($q['lenta_obmen']=1?" checked='checked'":null)." value='1' />Уведомлять о новых файлах</label><br />n";
#echo "<label><input type='checkbox' name='lenta_foto'".($q['lenta_foto']=1?" checked='checked'":null)." value='1' />Уведомлять о новых фото</label><br />n";
#echo "<label><input type='checkbox' name='lenta_comm'".($q['lenta_comm']=1?" checked='checked'":null)." value='1' />Уведомлять о вступлении в сообщества</label><br />n";
echo "<label><input type='checkbox' name='lenta_blog'".($q['lenta_blog']=1?" checked='checked'":null)." value='1' />Уведомлять о создании дневника</label><br />n";
echo "<input type='submit' name='save' value='Сохранить' />n";
echo "</form></div>n";
echo"<div class='div'>- <a href='lenta_user.php'>Назад в ленту</a></div>";
include_once 'foot.php';
?>