View file user/tape/subscr_settings/index.php

File size: 9.36Kb
<?
include_once $_SERVER['DOCUMENT_ROOT'] . '/sys/inc/home.php';
include_once H.'sys/inc/start.php';
include_once H.'sys/inc/compress.php';
include_once H.'sys/inc/sess.php';
include_once H.'sys/inc/settings.php';
include_once H.'sys/inc/db_connect.php';
include_once H.'sys/inc/ipua.php';
include_once H.'sys/inc/fnc.php';
include_once H.'sys/inc/adm_check.php';
include_once H.'sys/inc/user.php';

if (isset($user)){
	$ank['id'] = $user['id']; 
}
if (isset($_GET['uid'])){
	$ank['id'] = intval($_GET['uid']); 
}

$ank = get_user($ank['id']);
 
// Запрет если Система или не юзер!
if(!$ank || $ank['id'] == 0){
	header("Location: /?".SID);
	exit;
}

// Запрет если пробуем просмотреть у себя)
if($user['id'] == $ank['id']){
	header("Location: /user/tape/".SID);
	exit;
}

only_reg();

$frend = mysql_fetch_array(mysql_query("SELECT * FROM `frends` WHERE `user` = '".$user['id']."' AND `frend` = '$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 `frends` SET `lenta_foto` = '".intval($_POST['lenta_foto'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента файлов 
if (isset($_POST['lenta_obmen']) && ($_POST['lenta_obmen']==0 || $_POST['lenta_obmen']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_obmen` = '".intval($_POST['lenta_obmen'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента смены аватара 
if (isset($_POST['lenta_avatar']) && ($_POST['lenta_avatar']==0 || $_POST['lenta_avatar']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_avatar` = '".intval($_POST['lenta_avatar'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента новых друзей 
if (isset($_POST['lenta_frends']) && ($_POST['lenta_frends']==0 || $_POST['lenta_frends']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_frends` = '".intval($_POST['lenta_frends'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента статусов 
if (isset($_POST['lenta_status']) && ($_POST['lenta_status']==0 || $_POST['lenta_status']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_status` = '".intval($_POST['lenta_status'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента оценок статуса 

if (isset($_POST['lenta_status_like']) && ($_POST['lenta_status_like']==0 || $_POST['lenta_status_like']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_status_like` = '".intval($_POST['lenta_status_like'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента дневников 
if (isset($_POST['lenta_notes']) && ($_POST['lenta_notes']==0 || $_POST['lenta_notes']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_notes` = '".intval($_POST['lenta_notes'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 

// Лента форум 
if (isset($_POST['lenta_forum']) && ($_POST['lenta_forum']==0 || $_POST['lenta_forum']==1)) 
{ 
mysql_query("UPDATE `frends` SET `lenta_forum` = '".intval($_POST['lenta_forum'])."' WHERE `user` = '$user[id]' AND `frend` = '$ank[id]'"); 
} 


$_SESSION['message'] = 'Изменения успешно приняты'; 
header('Location: ?uid='.$ank['id'].''); 
exit; 
} 
$set['title'] = 'Настройки уведомлений : ' .$ank['nick'] . ' : Лента : ' . $user['nick'];
include_once H.'sys/inc/thead.php';

title();
err();
aut();

?>
<link rel="stylesheet" href="/user/tape/style.css" type="text/css" />
<div class="main_bg">

<div class="lc_br wbg font0 relative oh" id="header_path">  
<a href="/" style="font-size:0;"> <img src="/user/tape/ico/home.png" alt=""> </a>     
<span class="lc_brw"> <img src="/user/tape/ico/sep.png" alt="" class="lc_br_sep"> 
<a href="/info.php?id=<?= $user['id']?>"><?= $user['nick']?></a> </span>    
<span class="lc_brw"> <img src="/user/tape/ico/sep.png" alt="" class="lc_br_sep"> 
<a href="/user/tape/">Лента</a> </span> 
<span class="lc_brw"> <img src="/user/tape/ico/sep.png" alt="" class="lc_br_sep"> 
<a href="/user/tape/subscr/?uid=<?= $ank['id']?>"><?= $ank['nick']?></a> </span>   
<span class="lc_brw"> 
<img src="/user/tape/ico/sep.png" alt="" class="lc_br_sep"> <span class="lc_br_text">Настройки уведомлений</span> 
</span>       
</div>
<?


echo "<form action='?uid=$ank[id]' method=\"post\">"; 

?>
<div class="header upcs">       <b class="m">Уведомления от <?= $ank['nick']?> </b> </div>
<div class="wrapper"> 
<div class="bord-botm pad_b_a">
<?

 // Лента друзей 
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых друзьях:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_frends' type='radio' ".($frend['lenta_frends']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_frends' type='radio' ".($frend['lenta_frends']==0?' checked="checked"':null)." value='0' /> Нет "; 
?>
</label>
<?
echo "</div>"; 

 // Лента Дневников  
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых дневниках:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<? 
echo "<input name='lenta_notes' type='radio' ".($frend['lenta_notes']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_notes' type='radio' ".($frend['lenta_notes']==0?' checked="checked"':null)." value='0' /> Нет ";
?>
</label>
<? 
echo "</div>"; 

 // Лента Форума 
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых темах в форуме:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?  
echo "<input name='lenta_forum' type='radio' ".($frend['lenta_forum']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_forum' type='radio' ".($frend['lenta_forum']==0?' checked="checked"':null)." value='0' /> Нет ";
?>
</label>
<? 
echo "</div>"; 

 // Лента фото 
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых фото:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_foto' type='radio' ".($frend['lenta_foto']==1?' checked="checked"':null)." value='1' /> Да "; 
echo "<input name='lenta_foto' type='radio' ".($frend['lenta_foto']==0?' checked="checked"':null)." value='0' /> Нет "; 
echo "</div>"; 

 // Лента о смене аватара 
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о смене аватара:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_avatar' type='radio' ".($frend['lenta_avatar']==1?' checked="checked"':null)." value='1' /> Да ";
?>
</label>
<? 
echo "<input name='lenta_avatar' type='radio' ".($frend['lenta_avatar']==0?' checked="checked"':null)." value='0' /> Нет ";
?>
</label>
<? 
echo "</div>"; 

 // Лента файлов  
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых файлах:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_obmen' type='radio' ".($frend['lenta_obmen']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_obmen' type='radio' ".($frend['lenta_obmen']==0?' checked="checked"':null)." value='0' /> Нет ";
?>
</label>
<? 
echo "</div>"; 

 // Лента статусов 
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о новых статусах:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_status' type='radio' ".($frend['lenta_status']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_status' type='radio' ".($frend['lenta_status']==0?' checked="checked"':null)." value='0' /> Нет "; 
?>
</label>
<?
echo "</div>"; 

 // Лента оценок статуса  
?>
<div class="stnd_padd"> 
<label style="margin-bottom: 6px" class="lbl">Уведомления о "Like" к статусам друзей:</label>      
<label style="margin-bottom: 3px" class="input-radio"> 
<?
echo "<input name='lenta_status_like' type='radio' ".($frend['lenta_status_like']==1?' checked="checked"':null)." value='1' /> Да "; 
?>
</label>
<?
echo "<input name='lenta_status_like' type='radio' ".($frend['lenta_status_like']==0?' checked="checked"':null)." value='0' /> Нет "; 
?>
</label>
</div>
</div>
<table class="table__wrap"> <tbody><tr> 
<td class="table__cell" width="50%"> 
<!-- --><!-- --><!-- --><!-- --><!-- -->
<button type="submit" name="save" value="Сохранить" class="  link  blue full is_final    " id="cfms">
<!--   -->
<img src="/user/tape/ico/ok_blue.png" alt="" class="m"> 
<!--   -->
<span class="m"> Сохранить</span>
<!-- -->
</button>
<!-- --><!-- --> 
</td>
<td class="table__cell table__cell_last" width="50%">     
<a href="/user/tape/subscr/?uid=<?= $ank['id']?>" class="link         "> <span>Отменить</span>  </a>    
</td>
</tr> </tbody></table>

</div>
</form>
<?


include_once H.'sys/inc/tfoot.php';
?>