<?
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';

only_reg();
$set['title']='Настройки чата';
include_once '../sys/inc/thead.php';
title();

if (isset($_POST['save'])){

if (isset($_POST['zebra_forum']) && ($_POST['zebra_forum']==1 || $_POST['zebra_forum']==0))
{
$user['zebra_forum']=intval($_POST['zebra_forum']);
mysql_query("UPDATE `user` SET `zebra_forum` = '$user[zebra_forum]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Ошибка показа зебры';

if (isset($_POST['vkl_post']) && ($_POST['vkl_post']==1 || $_POST['vkl_post']==0))
{
$user['vkl_post']=intval($_POST['vkl_post']);
mysql_query("UPDATE `user` SET `vkl_post` = '$user[vkl_post]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Ошибка показа включения постов';

if (isset($_POST['set_files']) && ($_POST['set_files']==1 || $_POST['set_files']==0))
{
$user['set_files']=intval($_POST['set_files']);
mysql_query("UPDATE `user` SET `set_files` = '$user[set_files]' WHERE `id` = '$user[id]' LIMIT 1");
}
else $err='Ошибка режима файлов';

if (!isset($err))msg('Изменения успешно приняты');
}
err();

echo "<form method='post' action='?$passgen'>\n";
echo "<div class='textmes'>";
echo "Выгрузка файлов на форум:<br />\n<select name='set_files'>\n";
echo "<option value='1'".($user['set_files']==1?" selected='selected'":null).">Показывать поле</option>\n";
echo "<option value='0'".($user['set_files']==0?" selected='selected'":null).">Не использовать выгрузку</option>\n";
echo "</select><br />\n";
echo "Форум в клетку (как лист)<br />\n<select name='zebra_forum'>\n";
echo "<option value='1'".($user['zebra_forum']==1?" selected='selected'":null).">Да</option>\n";
echo "<option value='0'".($user['zebra_forum']==0?" selected='selected'":null).">Нет</option>\n";
echo "</select><br />\n";

echo "Включить показ постов в форуме (рядом с моим ником)<br />\n<select name='vkl_post'>\n";
echo "<option value='1'".($user['vkl_post']==1?" selected='selected'":null).">Нет</option>\n";
echo "<option value='0'".($user['vkl_post']==0?" selected='selected'":null).">Да</option>\n";
echo "</select><br />\n";

echo "<input type='submit' name='save' value='Сохранить' />\n";
echo "</form>\n";
echo "</div>\n";
echo "<div class='rekl'>";
echo "<img src='/style/back.gif' alt='' class='icon'/>\n";
echo " <a href='/umenu.php'>Мое меню</a> <br/>\n";
echo "</div>\n";
include_once '../sys/inc/tfoot.php';
?>