Файл: user/settings/set_index.php
Строк: 119
<?php
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['ok'])){
if (isset($_POST['index6']) && ($_POST['index6']==0 || $_POST['index6']==1)){
$user['index6']=intval($_POST['index6']);
mysql_query("UPDATE `user` SET `index6` = '$user[index6]' WHERE `id` = '$user[id]' LIMIT 1");
} else {
$user['index6']=0;
mysql_query("UPDATE `user` SET `index6` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['index5']) && ($_POST['index5']==0 || $_POST['index5']==1)){
$user['index5']=intval($_POST['index5']);
mysql_query("UPDATE `user` SET `index5` = '$user[index5]' WHERE `id` = '$user[id]' LIMIT 1");
}else{
$user['index5']=0;
mysql_query("UPDATE `user` SET `index5` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['index4']) && ($_POST['index4']==0 || $_POST['index4']==1)){
$user['index4']=intval($_POST['index4']);
mysql_query("UPDATE `user` SET `index4` = '$user[index4]' WHERE `id` = '$user[id]' LIMIT 1");
}else{
$user['index4']=0;
mysql_query("UPDATE `user` SET `index4` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['index3']) && ($_POST['index3']==0 || $_POST['index3']==1)){
$user['index3']=intval($_POST['index3']);
mysql_query("UPDATE `user` SET `index3` = '$user[index3]' WHERE `id` = '$user[id]' LIMIT 1");
}else{
$user['index3']=0;
mysql_query("UPDATE `user` SET `index3` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
if (isset($_POST['index2']) && ($_POST['index2']==0 || $_POST['index2']==1)){
$user['index2']=intval($_POST['index2']);
mysql_query("UPDATE `user` SET `index2` = '$user[index2]' WHERE `id` = '$user[id]' LIMIT 1");
}else{
$user['index2']=0;
mysql_query("UPDATE `user` SET `index2` = '0' WHERE `id` = '$user[id]' LIMIT 1");
}
msg("Настройки вида главного меню успешно сохранены.");
}
echo "<form method='post' action='?$passgen'>";
echo "<input type='checkbox' name='index2'".($user['index2']?" checked='checked'":null)." value='1' />Последние темы форума<br/>";
echo "<input type='checkbox' name='index3'".($user['index3']?" checked='checked'":null)." value='1' />Последние сообщения с беседки<br/>";
echo "<input type='checkbox' name='index4'".($user['index4']?" checked='checked'":null)." value='1' />Лента анкет (Ленейка)<br/>";
echo "<input type='checkbox' name='index5'".($user['index5']?" checked='checked'":null)." value='1' />Мини-чат<br/>";
echo "<input type='checkbox' name='index6'".($user['index6']?" checked='checked'":null)." value='1' />Последние вопросы<br/>";
echo "<input type='submit' name='ok' value='Сохранить настройки'><a href='index.php'>Отмена</a></form>";
include_once '../../sys/inc/tfoot.php';
?>