Просмотр файла setting/settingsave.php

Размер файла: 1.95Kb
<?php
include_once "../config.php";
include_once "../inc/inc.php";
include_once "../inc/func.php";
include_once "../inc/user.php";
include_once "../inc/gzip.php";
include_once "../inc/online.php";

if ($kto == 'user') {
    echo '<center>Настройки сайта</center><hr>';
    $id = $usdata['id'];
    $id = (int)$id;
    if ($id == 0) {
        echo'Произошла ошибка. <a href="/index.php">Главная</a>';
        include_once "../themes/$theme/foot.php";
        exit;
    } 
    $query = "SELECT id FROM " . $pref . "useres WHERE id=" . $id;
    $res = mysql_query($query);
    $res = implode(mysql_fetch_array($res, MYSQL_ASSOC));
    if ($res == '') {
        echo 'Произошла ошибка. <a href="/index.php">Главная</a>';
        include_once "../themes/$theme/foot.php";
        exit;
    } 
    $query = "SELECT * FROM " . $pref . "useres WHERE id=" . $id;
    $ddd = mysql_fetch_array(mysql_query($query));

    $skin = htmlspecialchars(stripslashes($skin));
    $inguest = (int)$inguest;
    $intema = (int)$intema;
    $inpost = (int)$inpost;
    $infile = (int)$infile;
    $innewses = (int)$innewses;

    if (filetype($skin) != 'dir') {
        $skin = 'default';
    } 
    if ($inguest == 0) {
        $inguest = 10;
    } 
    if ($intema == 0) {
        $intema = 10;
    } 
    if ($inpost == 0) {
        $inpost = 10;
    } 
    if ($infile == 0) {
        $infile = 10;
    } 
    if ($innewses == 0) {
        $innewses = 10;
    } 

    $query = 'UPDATE ' . $pref . 'useres SET theme="' . $skin . '", kolbook = ' . $inguest . ', kolforum_thema = ' . $intema . ', kolforum_post = ' . $inpost . ', indown = ' . $infile . ', innews = ' . $innewses . ' WHERE id=' . $id;
    mysql_query($query) or die ('ERROR');
    header("Location: index.php?asd=ok");
    exit;
} else {
    header("Location: /index.php");
    exit;
} 
// include_once "../themes/$theme/foot.php";
?>