View file setting/setting.php

File size: 2.43Kb
<?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";
include_once "../themes/$theme/index.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));

    echo '<form name="" action="settingsave.php" method="post">';
    echo 'Тема<br>';
    echo '<select name="skin"><option value="' . $ddd['theme'] . '">' . $ddd['theme'] . '</option>';
    $dir = opendir ("../themes");
    while ($file = readdir ($dir)) {
        if (!eregi("[^a-z0-9_-]", $file) && ($file != $ddd['theme'])) {
            echo '<option value="' . $file . '">' . $file . '</option>';
        }
    }
    echo '</select><br>';
    closedir ($dir);
    echo 'Количество постов в гостевой<br>';
    echo '<input name="inguest" type="text" value="' . $ddd['kolbook'] . '"><br>';
    echo 'Количество тем в форуме<br>';
    echo '<input name="intema" type="text" value="' . $ddd['kolforum_thema'] . '"><br>';
    echo 'Количество постов в форуме<br>';
    echo '<input name="inpost" type="text" value="' . $ddd['kolforum_post'] . '"><br>';
    echo 'Количество файлов на страницу<br>';
    echo '<input name="infile" type="text" value="' . $ddd['indown'] . '"><br>';
    echo 'Количество новостей на страницу<br>';
    echo '<input name="innewses" type="text" value="' . $ddd['innews'] . '"><br><br>';
    echo '<input type="submit" value="Изменить">';
    echo '</form>';
} else {
    echo 'Вы не авторизированы';
}

include_once "../themes/$theme/foot.php";

?>