Файл: www/album/settings.php
Строк: 35
<?php
include '../config.php';
if(!isset($aut)){
div('Ошибка');
echo 'Вы не авторизованы';
}else{
if(!isset($_POST['str']) or !isset($_POST['prev']) or !isset($_POST['com'])){
div('Настройки альбомов');
$se=mysql_fetch_array(mysql_query("SELECT * FROM `alb_set` WHERE `id_user`='$aut[id]'"));
echo '» <a href="my_alb.php">Редактирование</a><br/><br/>';
echo '<form action="settings.php?rnd='.$rand.'" method="POST">
<b>Элементов на страницу (2-30)</b><br/>
<input type="text" name="str" size="3" value="'.$se['str'].'"><br/>
<b>Положение превью</b><br/>
<select name="prev">
<option value="0"';
if($se['prev']==0){echo ' selected';}
echo'>Справа</option>
<option value="1"';
if($se['prev']==1){echo ' selected';}
echo'>По центру</option>
<option value="2"';
if($se['prev']==2){echo ' selected';}
echo'>Слева</option>
</select><br/>
<b>Комментарии</b><br/>
<select name="com">
<option value="0"';
if($se['com']==0){echo ' selected';}
echo'>Новые внизу</option>
<option value="1"';
if($se['com']==1){echo ' selected';}
echo'>Новые вверху</option>
</select><br/><br/>
<b>Прочее</b><br/>
» <a href="my_alb.php?act=ank_av_del">Удалить аватар</a><br/>
» <a href="my_alb.php?act=gb_logo_del">Удалить лого гостевой</a><br/><br/>
<input type="submit" value="Сохранить"></form>';
}else{
$str=intval($_POST['str']);
$str=(isset($str) and is_numeric($str) and $str>1)?$str:2;
$str=(isset($str) and is_numeric($str) and $str<=30)?$str:30;
$com=intval($_POST['com']);
$prev=intval($_POST['prev']);
mysql_query("UPDATE `alb_set` SET `str`='$str', `prev`='$prev', `com`='$com' WHERE `id_user`='$aut[id]'");
header('location: settings.php');}}
echo '</div>';
include '../foot.php';
echo '</div>';
?>