Вход Регистрация
Файл: public_html/pages/setting.php
Строк: 126
<?php
#-----------------------------------------------------#
#          ********* ROTORCMS *********               #
#              Made by  :  VANTUZ                     #
#               E-mail  :  visavi.net@mail.ru         #
#                 Site  :  http://pizdec.ru           #
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#    
require_once ('../includes/start.php');
require_once (
'../includes/functions.php');
require_once (
'../includes/header.php');
include_once (
'../themes/' $config['themes'] . '/index.php');

if (isset(
$_GET['act'])) {
  
$act check($_GET['act']);
} else {
  
$act 'index';


show_title('site.png''Мои настройки');
$config['newtitle'] = 'Мои настройки';

if (
is_user()) {
  switch (
$act):
  
# ###########################################################################################
  # #                                    Главная страница                                    ##
  # ###########################################################################################
  
case 'index':

    echo 
'<div class="form">';
    echo 
'<form method="post" action="setting.php?act=edit&amp;uid=' $_SESSION['token'] . '&amp;' SID '">';

    echo 
'Wap-тема по умолчанию:<br />';
    echo 
'<select name="themes">';
    
$globthemes glob(BASEDIR "themes/*"GLOB_ONLYDIR);
    foreach (
$globthemes as $themes) {
      
$selected = ($udata['users_themes'] == basename($themes)) ? ' selected="selected"' '';
      echo 
'<option value="' basename($themes) . '"' $selected '>' basename($themes) . '</option>';
    } 
    echo 
'</select><br />';

    echo 
'Сообщений в гостевой:<br /><input name="postguest" value="' $udata['users_postguest'] . '" /><br />';
    echo 
'Новостей на стр.:<br /><input name="postnews" value="' $udata['users_postnews'] . '" /><br />';
    echo 
'Писем в привате на стр.:<br /><input name="postprivat" value="' $udata['users_postprivat'] . '" /><br />';
    echo 
'Сообщений в форуме:<br /><input name="postforum" value="' $udata['users_postforum'] . '" /><br />';
    echo 
'Тем в форуме:<br /><input name="themesforum" value="' $udata['users_themesforum'] . '" /><br />';
    echo 
'Объявлений на стр.:<br /><input name="postboard" value="' $udata['users_postboard'] . '" /><br />';

    
$arrtimezone = array('-12''-11''-10''-9''-8''-7''-6''-5''-4''-3''-2''-1''0''+1''+2''+3''+4''+5''+6''+7''+8''+9''+10''+11''+12');
    echo 
'Временной сдвиг:<br />';
    echo 
'<select name="timezone">';
    foreach(
$arrtimezone as $zone) {
      
$selected = ($udata['users_timezone'] == $zone) ? ' selected="selected"' '';
      echo 
'<option value="' $zone '"' $selected '>' $zone '</option>';
    } 
    echo 
'</select><br />';

    echo 
'Вывод часов: ';
    
$checked = ($udata['users_showtime'] == 1) ? ' checked="checked"' '';
    echo 
'<input name="showtime" type="checkbox" value="1"' $checked ' /><br />';

    echo 
'BB-Панель: ';
    
$checked = ($udata['users_bbpanel'] == 1) ? ' checked="checked"' '';
    echo 
'<input name="bbpanel" type="checkbox" value="1"' $checked ' /><br />';

    echo 
'Привязка к IP: ';
    
$checked = ($udata['users_ipbinding'] == 1) ? ' checked="checked"' '';
    echo 
'<input name="ipbinding" type="checkbox" value="1"' $checked ' /><br />';

    echo 
'Быстрый переход: ';
    
$checked = ($udata['users_navigation'] == 1) ? ' checked="checked"' '';
    echo 
'<input name="navigation" type="checkbox" value="1"' $checked ' /><br />';

    echo 
'<input value="Изменить" type="submit" /></form></div><br />';

    echo 
'* Значение всех полей (max.50)<br /><br />';
    break;
  
# ###########################################################################################
  # #                                       Изменение                                        ##
  # ###########################################################################################
  
case 'edit':

    
$uid check($_GET['uid']);
    
$themes check($_POST['themes']);
    
$postguest abs(intval($_POST['postguest']));
    
$postnews abs(intval($_POST['postnews']));
    
$postprivat abs(intval($_POST['postprivat']));
    
$postforum abs(intval($_POST['postforum']));
    
$themesforum abs(intval($_POST['themesforum']));
    
$postboard abs(intval($_POST['postboard']));
    
$timezone check($_POST['timezone']);
    
$showtime = (empty($_POST['showtime'])) ? 1;
    
$bbpanel = (empty($_POST['bbpanel'])) ? 1;
    
$ipbinding = (empty($_POST['ipbinding'])) ? 1;
    
$navigation = (empty($_POST['navigation'])) ? 1;

    if (
$uid == $_SESSION['token']) {
      if (
preg_match('|^[a-z0-9_-]+$|i'$themes)) {
        if (
file_exists(BASEDIR "themes/$themes/index.php")) {
          if (
$postguest >= && $postguest <= 50) {
            if (
$postnews >= && $postnews <= 50) {
              if (
$postprivat >= && $postprivat <= 50) {
                if (
$postforum >= && $postforum <= 50) {
                  if (
$themesforum >= && $themesforum <= 50) {
                    if (
$postboard >= && $postboard <= 50) {
                      if (
preg_match('|^[-+]{0,1}[0-9]{1,2}$|'$timezone)) {
                        
DB :: $dbh -> query("UPDATE `users` SET `users_themes`=?, `users_postguest`=?, `users_postnews`=?, `users_postprivat`=?, `users_postforum`=?, `users_themesforum`=?, `users_postboard`=?, `users_timezone`=?, `users_showtime`=?, `users_bbpanel`=?, `users_ipbinding`=?, `users_navigation`=? WHERE users_login=?", array($themes$postguest$postnews$postprivat$postforum$themesforum$postboard$timezone$showtime$bbpanel$ipbinding$navigation$log));

                        if (!empty(
$_SESSION['my_themes'])) {
                          
$_SESSION['my_themes'] = "";
                          unset(
$_SESSION['my_themes']);
                        } 

                        
$_SESSION['note'] = 'Настройки успешно изменены!';
                        
header ("Location: setting.php?" SID);
                        exit;
                      } else {
                        
show_error('Ошибка! Временной сдвиг. (Допустимый диапазон -12 — +12 часов)!');
                      } 
                    } else {
                      
show_error('Ошибка! Объявления. (Допустимое значение от 3 до 50)!');
                    } 
                  } else {
                    
show_error('Ошибка! Темы в форуме. (Допустимое значение от 3 до 50)!');
                  } 
                } else {
                  
show_error('Ошибка! Сообщения в форуме. (Допустимое значение от 3 до 50)!');
                } 
              } else {
                
show_error('Ошибка! Приватные сообщения. (Допустимое значение от 3 до 50)!');
              } 
            } else {
              
show_error('Ошибка! Новости. (Допустимое значение от 3 до 50)!');
            } 
          } else {
            
show_error('Ошибка! Сообщения в гостевой. (Допустимое значение от 3 до 50)!');
          } 
        } else {
          
show_error('Ошибка! Данный скин не установлен на сайте!');
        } 
      } else {
        
show_error('Ошибка! Недопустимое название скина!');
      } 
    } else {
      
show_error('Ошибка! Неверный идентификатор сессии, повторите действие!!');
    } 

    echo 
'<img src="../images/img/back.gif" alt="image" /> <a href="setting.php?' SID '">Вернуться</a><br />';
    break;

  default:
    
header("location: setting.php?" SID);
    exit;
    endswitch;
  } else {
  
show_login('Вы не авторизованы, чтобы изменять настройки, необходимо');


echo 
'<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' SID '">На главную</a>';

include_once (
"../themes/" $config['themes'] . "/foot.php");

?>
Онлайн: 0
Реклама