File size: 1.21Kb
<?php
$set = htmlspecialchars($_GET["set"]);
define('HOME', $_SERVER[DOCUMENT_ROOT]);
include_once HOME.'/sys/inc/start.php';
$doc = new document(6);
if(!$set){
header("Location: http://news.emwap.ru");
}
if($set == 1){
$counts_on_page = htmlspecialchars(mysql_real_escape_string(intval($_POST["counts_on_page"])));
$social = htmlspecialchars(mysql_real_escape_string(intval($_POST["social"])));
if(empty($counts_on_page)){
$counts_on_page = '5';
}
if($social > 1){
$social = '1';
}
if(isset($_POST["ok"])){
mysql_query ("UPDATE `wn_set` SET `counts_on_page` = '$counts_on_page', `social_buttons` = '$social'");
header("Location: /worldnews/panel?go=settings&edit=done");
}else{
header("Location: /worldnews/panel?go=settings&edit=err");
}
}
if($set == 2){
$format_widget = htmlspecialchars(mysql_real_escape_string(intval($_POST["format_widget"])));
if($format_widget > 3){
$format_widget = '1';
}
if(isset($_POST["ok"])){
mysql_query ("UPDATE `wn_set` SET `format_widget` = '$format_widget'");
header("Location: /worldnews/panel?go=set_widget&edit=done");
}else{
header("Location: /worldnews/panel?go=set_widget&edit=err");
}
}
?>