Просмотр файла admin/config.php

Размер файла: 56.49Kb
<?php
#############################################
# 0JXRgdC70Lgg0YLRiyDRh9C40YLQsNC10YjRjCDRj #
# dGC0L4g0YHQvtC+0LHRidC10L3QuNC1LCDQt9C90L #
# DRh9C40YIg0YLRiyDQvdC10LzQvdC+0LPQviDQt9C #
#          90LDQtdGI0YwgUEhQIQ==            #
#__---------------------------------------__#
#__        0JrQu9C40Log0JrQu9GD0LE=       __#
#  ---------------------------------------  #
# 0JDQstGC0L7RgCA6IE1vcmdhbg==              #
# SUNRIDog0L3QtSDRgdC60LDQttGDIHhE          #
#                                           #
#############################################

require '../inc/start.php';
require '../inc/regvars.php';
require '../inc/db.php';
require '../inc/config.php';
require '../inc/funct.php';
require '../inc/antidos.php';
require '../inc/gzip.php';
require '../inc/header.php';


only_reg('/aut.php?',true);

if($user_prof['admin']<3){location('menu/index.php');}


$title = 'Настройки';
require '../inc/head.php';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes' && $_POST['in_script']!=1)location('admin/config.php');

 switch($mode = (!empty($_GET['mode'])) ? $_GET['mode'] : '')
{
	default:
echo '<div class="sec">
Настройки
</div><div class="vstavka">
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=all">Общие настройки</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=show">Отображение информации</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=sec">Настройки защиты</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=cache">Настройки кэширования</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=antispam">Настройки антиспама</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=enabled">Настройки доступа</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=logs">Логирование</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=prices">Цены / Стоимости</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=games">Настройки игр</a></div>
<div class="ad"><img src="/pic/element.png"/> <a href="config.php?mode=debag">Режим отладки</a></div>
';

break;
##########################
 case 'all':

echo '<div class="sec">
Общие настройки
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
 $link_name = obr($_POST['link_name'],'string',100);
 $link_url = obr($_POST['link_url'],'string',100);
 $copy_in_code = obr($_POST['copy_in_code'],'string',1000);
 $title = obr($_POST['title'],'string',250);
 $podarok = obr($_POST['podarok'],'integer',5);
 $ref_prem = substr(abs($_POST['ref_prem']),0,10);
 $email = obr($_POST['email'],'string',70);
 $wmr = obr($_POST['wmr'],'string',13);
 $time_of_a_life = obr($_POST['time_of_a_life'],'integer',20);
 $timestamp = obr($_POST['timestamp'],'string',6);
 $receivecredits_usualclick = obr($_POST['receivecredits_usualclick'],'integer',5);
 $receivecredits_confirmedclick  = obr($_POST['receivecredits_confirmedclick'],'integer',5);
 $min_birzh_count = obr($_POST['min_birzh_count'],'integer',10);
 $min_birzh_price = substr(abs($_POST['min_birzh_price']),0,10);
 $min_birzh_in = obr($_POST['min_birzh_in'],'integer',10);
 $min_birzh_out = obr($_POST['min_birzh_out'],'integer',10);
 $min_task_credits = obr($_POST['min_task_credits'],'integer',10);
 $min_limit_hours = obr($_POST['min_limit_hours'],'integer',10);
 $max_sites = obr($_POST['max_sites'],'integer',7);
 $dolj_act_sites = obr($_POST['dolj_act_sites'],'integer',7);
 $dolj_act_trans = obr($_POST['dolj_act_trans'],'integer',7);
 $reg_message = obr($_POST['reg_message'],'string',500);


 if(query("UPDATE `$db[prefix]config` SET `link_name`='$link_name',`link_url`='$link_url',`copy_in_code`='$copy_in_code',`title`='$title',`podarok`='$podarok',`ref_prem`='$ref_prem',`email`='$email',`wmr`='$wmr',`time_of_a_life`='$time_of_a_life',`timestamp`='$timestamp',`receivecredits_usualclick`='$receivecredits_usualclick',`receivecredits_confirmedclick`='$receivecredits_confirmedclick',`min_birzh_count`='$min_birzh_count',`min_birzh_price`='$min_birzh_price',`min_birzh_in`='$min_birzh_in',`min_birzh_out`='$min_birzh_out',`min_task_credits`='$min_task_credits',`min_limit_hours`='$min_limit_hours',`max_sites`='$max_sites',`dolj_act_sites`='$dolj_act_sites',`dolj_act_trans` = '$dolj_act_trans',`reg_message`='$reg_message' WHERE `id`='1'"))
  {
echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=all">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
echo '<form action="config.php?mode=all&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Копирайт : <br />
<input name="link_name" type="text" value="'.$config['link_name'].'" maxlength="100" /><br />
Ссылка : <br />
<input name="link_url" type="text" value="'.$config['link_url'].'" maxlength="100" /><br />
Копирайт в коде : <br />
&lt;!-- <input name="copy_in_code" type="text" value="'.$config['copy_in_code'].'" maxlength="1000"> --&gt;<br />
Заголовок страниц : <br />
<input name="title" type="text" value="'.$config['title'].'" maxlength="250" /><br />
Количество кредитов после регистрации : <br />
<input name="podarok" type="text" value="'.$config['podarok'].'" maxlength="5" size="5"/><br />
Кредита(ов) получает пользователь от реферальского клика : <br />
<input name="ref_prem" type="text" value="'.$config['ref_prem'].'" maxlength="10" /><br />
Email администрации : <br />
<input name="email" type="text" value="'.$config['email'].'" maxlength="70" /><br />
WMR кошелек админстрации : <br />
<input name="wmr" type="text" value="'.$config['wmr'].'" maxlength="13" /><br />
Время жизни юзера в OnLine(в сек.) : <br />
<input name="time_of_a_life" type="text" value="'.$config['time_of_a_life'].'"><br />
Временной сдвиг (+1,-1) : <br />
<input name="timestamp" type="text" value="'.$config['timestamp'].'" size="5" maxlength="5"><br />
<hr/>
Стоимость обычного клика (кредитов) : <br />
<input name="receivecredits_usualclick" type="text" value="'.$config['receivecredits_usualclick'].'" size="5" maxlength="5"><br />
Стоимость клика с подтверждением (кредитов) : <br />
<input name="receivecredits_confirmedclick" type="text" value="'.$config['receivecredits_confirmedclick'].'" size="5" maxlength="5"><br />
<br />
Минимальное количество кредитов на продажу : <br />
<input name="min_birzh_count" type="text" value="'.$config['min_birzh_count'].'" size="7" maxlength="10"><br />
Минимальная цена за 1 кредит : <br />
<input name="min_birzh_price" type="text" value="'.$config['min_birzh_price'].'" size="6" maxlength="10"><br />
Минимум рублей для ввода : <br />
<input name="min_birzh_in" type="text" value="'.$config['min_birzh_in'].'" size="7" maxlength="10"><br />
Минимум рублей для вывода : <br />
<input name="min_birzh_out" type="text" value="'.$config['min_birzh_out'].'" size="7" maxlength="10"><br />
<hr/>
Минимум кредитов за задания : <br />
<input name="min_task_credits" type="text" value="'.$config['min_task_credits'].'" size="7" maxlength="10"><br />
Минимум часов для перехода : <br />
<input name="min_limit_hours" type="text" value="'.$config['min_limit_hours'].'" size="7" maxlength="10"><br />
Максимальное количество площадок : <br />
<input name="max_sites" type="text" value="'.$config['max_sites'].'" size="7" maxlength="7"><br />
Нужное количество площадок(включенных) для статуса \'активный\' : <br />
<input name="dolj_act_sites" type="text" value="'.$config['dolj_act_sites'].'" size="7" maxlength="7"><br />
Нужное количество переходов для статуса \'активный\' : <br />
<input name="dolj_act_trans" type="text" value="'.$config['dolj_act_trans'].'" size="7" maxlength="7"><br />
<hr/>
Письмо в приват после регистрации нового юзера : <br />
<textarea name="reg_message" rows="5" cols="25">'.$config['reg_message'].'</textarea><br />
<input type="submit" value="Сохранить" />
</form>';
 }

break;
##########################
case 'show':
echo '<div class="sec">
Настройки отображения информации
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
 $welcome = utf_substr(trim($_POST['welcome']),0,500);
 $on_page = obr($_POST['on_page'],'integer',7);
 $style_wap_res = obr($_POST['style_wap'],'string',250);
 $style_wap = (filetype(D.'style/'.$style_wap_res) &&  file_exists(D.'style/'.$style_wap_res)=='dir') ? $style_wap_res : $config['style_wap'] ;
 $style_web_res = obr($_POST['style_web'],'string',250);
 $style_web = (filetype(D.'style/'.$style_web_res) &&  file_exists(D.'style/'.$style_web_res)=='dir') ? $style_web_res : $config['style_web'] ;
 $counters_wap = utf_substr(trim($_POST['counters_wap']),0,1000);
 $counters_web = utf_substr(trim($_POST['counters_web']),0,1000);
 $timegenerate = obr($_POST['timegenerate'],'integer',1);
 $traffick = obr($_POST['traffick'],'integer',1);
 $hostshits = obr($_POST['hostshits'],'integer',1);
 $status_color_1 = obr ($_POST['status_color_1'],'string',7);
 $status_color_2 = obr ($_POST['status_color_2'],'string',7);
 $status_color_3 = obr ($_POST['status_color_3'],'string',7);
 if(query("UPDATE `$db[prefix]config` SET `counters_wap`='$counters_wap',`counters_web`='$counters_web',`show_welcome`='$welcome',`on_page`='$on_page',`style_wap`='$style_wap',`style_web`='$style_web',`show_timegenerate`='$timegenerate',`show_traffick`='$traffick',`show_hostshits`='$hostshits',`show_status_color_1`='$status_color_1',`show_status_color_2`='$status_color_2',`show_status_color_3`='$status_color_3' WHERE `id`='1'"))
  {
  echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=show">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
 echo '<form action="config.php?mode=show&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Приветствие (500 симв., можно исользовать HTML теги) : <br />
<textarea name="welcome" rows="5" cols="27" wrap="off">'.$config['show_welcome'].'</textarea><br />
Элементов на страницу : <br />
<input name="on_page" type="text" value="'.$config['on_page'].'" maxlength="7" size="7"/><br />
Стандартный дизайн сайта (WAP) : <br />
<select name="style_wap" size="1">';
$resdir_wap = opendir(D.'style/');
 while($styles_wap = readdir($resdir_wap))
{
if(filetype(D.'style/'.$styles_wap)=='dir' && file_exists(D.'style/'.$styles_wap.'/style.css'))
 {
 echo '<option value="'.$styles_wap.'"';  if($config['style_wap']==$styles_wap)echo 'selected="selected"';  echo ' >'.$styles_wap.'</option>';
 }
}
echo '</select><br />
Стандартный дизайн сайта (WEB) : <br />
<select name="style_web" size="1">';
$resdir_web = opendir(D.'style/');
 while($styles_web = readdir($resdir_web))
{
if(filetype(D.'style/'.$styles_web)=='dir' && file_exists(D.'style/'.$styles_web.'/style.css'))
 {
 echo '<option value="'.$styles_web.'"';  if($config['style_web']==$styles_web)echo 'selected="selected"';  echo ' >'.$styles_web.'</option>';
 }
}
echo '</select><br />
Цвет статуса главного админа : <br />
<input name="status_color_3" type="text" value="'.$config['show_status_color_3'].'" size="7" maxlength="7"><br />
Цвет статуса простого админа : <br />
<input name="status_color_2" type="text" value="'.$config['show_status_color_2'].'" size="7" maxlength="7"><br />
Цвет статуса модератора : <br />
<input name="status_color_1" type="text" value="'.$config['show_status_color_1'].'" size="7" maxlength="7"><br />
Показывать время генерации : <br />
<select size="1" name="timegenerate">
  <option value="0" '; if($config['show_timegenerate']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['show_timegenerate']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['show_timegenerate']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['show_timegenerate']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
 <option value="4" '; if($config['show_timegenerate']==4)echo 'selected="selected"'; echo '>-Не показывать</option>
</select><br />
Показывать количество трафика : <br />
<select size="1" name="traffick">
  <option value="0" '; if($config['show_traffick']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['show_traffick']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['show_traffick']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['show_traffick']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['show_traffick']==4)echo 'selected="selected"'; echo '>-Не показывать</option>
</select><br />
Показывать посещаемость (хостов/хитов) : <br />
<select size="1" name="hostshits">
  <option value="0" '; if($config['show_hostshits']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['show_hostshits']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['show_hostshits']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['show_hostshits']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['show_hostshits']==4)echo 'selected="selected"'; echo '>-Не показывать</option>
</select><br />
<br />
<hr/>
Счетчики на WAP темах (макс 1000 симв.) : <br />
<textarea name="counters_wap" rows="6" cols="27">'.$config['counters_wap'].'</textarea><br />
Счетчики на WEB темах (макс 1000 симв.) : <br />
<textarea name="counters_web" rows="6" cols="27">'.$config['counters_web'].'</textarea><br />
<input type="submit" value="Сохранить" />
</form>
';

//Показывать : <br />
//<input name="show_" type="radio" value="1" '; if($config['show_']==1)echo 'checked="checked"'; echo ' >Да
//<input name="show_" type="radio" value="0" '; if($config['show_']==0)echo 'checked="checked"'; echo ' >Нет
//<br />

/*




Показывать <select size="1" name="">
  <option value="0" '; if($config['']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['']==1)echo 'selected="selected"'; echo '>>=Модераторам</option>
  <option value="2" '; if($config['']==2)echo 'selected="selected"'; echo '>>=Админам</option>
  <option value="3" '; if($config['']==3)echo 'selected="selected"'; echo '>Главным админам</option>
</select><br />



---------------------------------

Показывать время генерации : <br />
<input name="timegenerate" type="radio" value="1" '; if($config['show_timegenerate']==1)echo 'checked="checked"'; echo ' >Да
<input name="timegenerate" type="radio" value="0" '; if($config['show_timegenerate']==0)echo 'checked="checked"'; echo ' >Нет
<br />
Показывать количество трафика : <br />
<input name="traffick" type="radio" value="1" '; if($config['show_traffick']==1)echo 'checked="checked"'; echo ' >Да
<input name="traffick" type="radio" value="0" '; if($config['show_traffick']==0)echo 'checked="checked"'; echo ' >Нет
<br />
Показывать посещаемость (хостов/хитов) : <br />
<input name="hostshits" type="radio" value="1" '; if($config['show_hostshits']==1)echo 'checked="checked"'; echo ' >Да
<input name="hostshits" type="radio" value="0" '; if($config['show_hostshits']==0)echo 'checked="checked"'; echo ' >Нет
<br />

*/

 }


break;
##########################
case 'enabled':
echo '<div class="sec">
Настройки доступа
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {

function check($value)
{
if($value == 0 || $value == 1 || $value == 2 || $value == 3 || $value == 4){return $value;}
else{return 0;}
}

 $perehod = check(obr($_POST['perehod'],'integer',1));
 $games = check(obr($_POST['games'],'integer',1));
 $perevod = check(obr($_POST['perevod'],'integer',1));
 $birzha = check(obr($_POST['birzha'],'integer',1));
 $tasks = check(obr($_POST['birzha'],'integer',1));
 $users_reklama = check(obr($_POST['users_reklama'],'integer',1));
 $bank = check(obr($_POST['bank'],'integer',1));
 $forum = check(obr($_POST['forum'],'integer',1));
 $private = check(obr($_POST['private'],'integer',1));
 $mini_chat = check(obr($_POST['mini_chat'],'integer',1));
 $sites = check(obr($_POST['sites'],'integer',1));
 $settings = check(obr($_POST['settings'],'integer',1));
 $ref = check(obr($_POST['ref'],'integer',1));
 $stat = check(obr($_POST['stat'],'integer',1));
 $laut = check(obr($_POST['laut'],'integer',1));
 $votes = check(obr($_POST['votes'],'integer',1));
 $tops = check(obr($_POST['tops'],'integer',1));

 $gb = check(obr($_POST['gb'],'integer',1));


 // $ = check(obr($_POST[''],'integer',1));
 // ,`enable_`='$'

 if(query("UPDATE `$db[prefix]config` SET `enable_perehod` = '$perehod',`enable_games` = '$games',`enable_perevod` = '$perevod',`enable_birzha` = '$birzha',`enable_tasks` = '$tasks',`enable_users_reklama` = '$users_reklama',`enable_bank` = '$bank',`enable_forum` = '$forum',`enable_private` = '$private',`enable_mini_chat` = '$mini_chat',`enable_sites` = '$sites',`enable_settings` = '$settings',`enable_ref` = '$ref',`enable_stat` = '$stat',`enable_log_aut` = '$laut',`enable_votes` = '$votes',`enable_tops`='$tops',`enable_gb` = '$gb' WHERE `id`='1'"))
  {
  echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=enabled">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
 echo '<form action="config.php?mode=enabled&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Переход по ссылкам  : <br />
<select size="1" name="perehod">
  <option value="0" '; if($config['enable_perehod']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_perehod']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_perehod']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_perehod']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_perehod']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Игры на кредиты : <br />
<select size="1" name="games">
  <option value="0" '; if($config['enable_games']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_games']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_games']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_games']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_games']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Перевод кредитов : <br />
<select size="1" name="perevod">
  <option value="0" '; if($config['enable_perevod']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_perevod']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_perevod']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_perevod']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_perevod']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Биржа : <br />
<select size="1" name="birzha">
  <option value="0" '; if($config['enable_birzha']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_birzha']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_birzha']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_birzha']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_birzha']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Задания : <br />
<select size="1" name="tasks">
  <option value="0" '; if($config['enable_tasks']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_tasks']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_tasks']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_tasks']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_tasks']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Реклама на сайте : <br />
<select size="1" name="users_reklama">
  <option value="0" '; if($config['enable_users_reklama']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_users_reklama']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_users_reklama']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_users_reklama']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_users_reklama']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Банк : <br />
<select size="1" name="bank">
  <option value="0" '; if($config['enable_bank']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_bank']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_bank']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_bank']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_bank']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Форум: <br />
<select size="1" name="forum">
  <option value="0" '; if($config['enable_forum']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_forum']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_forum']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_forum']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_forum']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Приват : <br />
<select size="1" name="private">
  <option value="0" '; if($config['enable_private']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_private']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_private']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_private']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_private']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Мини-чат : <br />
<select size="1" name="mini_chat">
  <option value="0" '; if($config['enable_mini_chat']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_mini_chat']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_mini_chat']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_mini_chat']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_mini_chat']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Площадки: <br />
<select size="1" name="sites">
  <option value="0" '; if($config['enable_sites']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_sites']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_sites']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_sites']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_sites']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Настройки : <br />
<select size="1" name="settings">
  <option value="0" '; if($config['enable_settings']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_settings']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_settings']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_settings']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_settings']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Реф система : <br />
<select size="1" name="ref">
  <option value="0" '; if($config['enable_ref']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_ref']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_ref']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_ref']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_ref']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Статистика : <br />
<select size="1" name="stat">
  <option value="0" '; if($config['enable_stat']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_stat']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_stat']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_stat']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_stat']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Логи авторизаций : <br />
<select size="1" name="laut">
  <option value="0" '; if($config['enable_log_aut']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_log_aut']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_log_aut']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_log_aut']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_log_aut']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Голосования : <br />
<select size="1" name="votes">
  <option value="0" '; if($config['enable_votes']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_votes']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_votes']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_votes']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_votes']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Рейтинги : <br />
<select size="1" name="tops">
  <option value="0" '; if($config['enable_tops']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_tops']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_tops']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_tops']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_tops']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />
Гостевая : <br />
<select size="1" name="gb">
  <option value="0" '; if($config['enable_gb']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_gb']==1)echo 'selected="selected"'; echo '>Только авторизованным</option>
  <option value="2" '; if($config['enable_gb']==2)echo 'selected="selected"'; echo '>**Админам</option>
</select><br />
<input type="submit" value="Сохранить" />
</form>
';
/*

: <br />
<select size="1" name="">
  <option value="0" '; if($config['enable_']==0)echo 'selected="selected"'; echo '>Всем</option>
  <option value="1" '; if($config['enable_']==1)echo 'selected="selected"'; echo '>*Модераторам</option>
  <option value="2" '; if($config['enable_']==2)echo 'selected="selected"'; echo '>**Админам</option>
  <option value="3" '; if($config['enable_']==3)echo 'selected="selected"'; echo '>***Главным админам</option>
  <option value="4" '; if($config['enable_']==4)echo 'selected="selected"'; echo '>-Не доступно</option>
</select><br />

*/


 }


break;
##########################
case 'sec':
echo '<div class="sec">
Настройки защиты
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
$send_pass = obr($_POST['send_pass'],'integer',1);
$checking_getvars = obr($_POST['checking_getvars'],'integer',1);
$sqlinj_time = obr($_POST['sqlinj_time'],'integer',7);
$restore_pass = obr($_POST['restore_pass'],'integer',1);
$min_login = obr($_POST['min_login'],'integer',15);
$min_pass = obr($_POST['min_pass'],'integer',15);

$time_antidos = substr(abs($_POST['time_antidos']),0,4);
$time_antidos = (preg_match('|^([0-9]{1,3})(\.([0-9]*))?$|',$time_antidos)) ? $time_antidos : '0.05' ;
$time_antidos_ban = obr($_POST['time_antidos_ban'],'integer',7);

$interval_trans = obr($_POST['interval_trans'],'integer',5);
$reason = obr($_POST['reason'],'string',300);
$time_ban_clicks = obr($_POST['time_ban_clicks'],'integer',7);
$clicks_for_ban = obr($_POST['clicks_for_ban'],'integer',5);
$time_life_cookies = (obr($_POST['time_life_cookies'],'integer',7) * 86400);
$pok_mysql_errors = obr($_POST['pok_mysql_errors'],'integer',1);
$open_reg = obr($_POST['open_reg'],'integer',1);
$idle_time = obr($_POST['idle_time'],'integer',10);
$podpar_attempts = obr($_POST['podpar_attempts'],'integer',5);
$podpar_time = obr($_POST['podpar_time'],'integer',7);

  if(query("UPDATE `$db[prefix]config` SET `send_pass`='$send_pass',`checking_getvars`='$checking_getvars',`banip_sqlinj_time`='$sqlinj_time',`restore_pass`='$restore_pass',`min_login`='$min_login',`min_pass`='$min_pass',`time_antidos`='$time_antidos',`time_antidos_ban`='$time_antidos_ban',`interval_trans`='$interval_trans',`reason`='$reason',`time_ban_clicks`='$time_ban_clicks',`clicks_for_ban`='$clicks_for_ban',`open_reg`='$open_reg',`pok_mysql_errors`='$pok_mysql_errors' ,`idle_time`='$idle_time',`banip_podpar_attempts`='$podpar_attempts',`banip_podpar_time`='$podpar_time',`time_life_cookies`='$time_life_cookies' WHERE `id`='1'"))
  {
echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=sec">&lt;&lt;&lt;Назад</a><br />
';
  }

 }
else
 {
echo '<form action="config.php?mode=sec&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Мин. длина логина : <br />
<input name="min_login" type="text" value="'.$config['min_login'].'" /><br />
Мин. длина пароля : <br />
<input name="min_pass" type="text" value="'.$config['min_pass'].'" /><br />
Время простоя сессии, после чего она разрушаеться (в сек., 0 - бесконечно) : <br />
<input name="idle_time" type="text" value="'.$config['idle_time'].'"><br />
Период антидоса (в сек,к примеру 0.5) : <br />
<input name="time_antidos" type="text" value="'.$config['time_antidos'].'" size="4" maxlength="4" /><br />
Время бана за попытку доса (в сек.) : <br />
<input name="time_antidos_ban" type="text" value="'.$config['time_antidos_ban'].'" maxlength="7" size="7"><br />
Время жизни куков (в днях, если выключить то 0) : <br />
<input name="time_life_cookies" type="text" value="'.($config['time_life_cookies']/86400).'" maxlength="7" size="7"><br />
Регистрация открыта : <br />
<input type="radio" name="open_reg" value="1"'; if($config['open_reg']==1)echo ' checked="checked"'; echo ' />Да
<input type="radio" name="open_reg" value="0"'; if($config['open_reg']==0)echo ' checked="checked"'; echo ' />Нет
<br />
Есть возможность смены забытого пароля : <br />
<input type="radio" name="restore_pass" value="1"'; if($config['restore_pass']==1)echo ' checked="checked"'; echo ' />Да
<input type="radio" name="restore_pass" value="0"'; if($config['restore_pass']==0)echo ' checked="checked"'; echo ' />Нет
<br />
При регистрации отправлять пароль на email : <br />
<input type="radio" name="send_pass" value="1"'; if($config['send_pass']==1)echo ' checked="checked"'; echo ' />Да
<input type="radio" name="send_pass" value="0"'; if($config['send_pass']==0)echo ' checked="checked"'; echo ' />Нет
<br />
Проверять входящие данные(GET) на SQL иньекции (может замедлить скорость скрипта) : <br />
<input type="radio" name="checking_getvars" value="1"'; if($config['checking_getvars']==1)echo ' checked="checked"'; echo ' />Да
<input type="radio" name="checking_getvars" value="0"'; if($config['checking_getvars']==0)echo ' checked="checked"'; echo ' />Нет
<br />
Показывать ошибки MySQL БД : <br />
<input type="radio" name="pok_mysql_errors" value="1"'; if($config['pok_mysql_errors']==1)echo ' checked="checked"'; echo ' />Да
<input type="radio" name="pok_mysql_errors" value="0"'; if($config['pok_mysql_errors']==0)echo ' checked="checked"'; echo ' />Нет
<br />
Время бана за попытку SQL иньекции (в сек.) : <br />
<input name="sqlinj_time" type="text" value="'.$config['banip_sqlinj_time'].'" maxlength="7" size="7"><br />
<hr/>
Интервал между кликами (в сек.) : <br />
<input name="interval_trans" type="text" value="'.$config['interval_trans'].'" maxlength="5" size="5"/><br />
Причина бана за частые клики (300 симв.) : <br />
<textarea name="reason" rows="5" cols="25" wrap="on">'.$config['reason'].'</textarea><br />
Время бана за частые клики (в сек.) : <br />
<input name="time_ban_clicks" type="text" value="'.$config['time_ban_clicks'].'" maxlength="7" size="7"/><br />
Количество "неполных" кликов, после которых юзер баниться : <br />
<input name="clicks_for_ban" type="text" value="'.$config['clicks_for_ban'].'" maxlength="5" size="5"/><br />
<hr/>
Количество попыток ввода пароля после чего IP баниться : <br />
<input name="podpar_attempts" type="text" value="'.$config['banip_podpar_attempts'].'" maxlength="5" size="5"><br />
Время бана за попытку подбора пароля (в сек.) : <br />
<input name="podpar_time" type="text" value="'.$config['banip_podpar_time'].'" maxlength="7" size="7"><br />
<input type="submit" value="Сохранить" />
</form>
';
 }


break;
##########################
case 'cache':
echo '<div class="sec">
Настройки кэширования
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
 $cache_users = obr($_POST['cache_users'],'integer',7);
 $cache_dost_links = obr($_POST['cache_users'],'integer',7);
 $cache_clicks = obr($_POST['cache_clicks'],'integer',7);
 $cache_clicks_all = obr($_POST['cache_clicks_all'],'integer',7);
 $cache_sites = obr($_POST['cache_sites'],'integer',7);
 $cache_news = obr($_POST['cache_news'],'integer',7);
 $cache_actions = obr($_POST['cache_actions'],'integer',7);
 $cache_mini_chat = obr($_POST['cache_mini_chat'],'integer',7);
 $cache_gb = obr($_POST['cache_gb'],'integer',7);
/*
$cache_ = obr($_POST['cache_'],'integer',7);
,`cache_limit_col`='$cache_'
*/
 if(query("UPDATE `$db[prefix]config` SET `cache_limit_colusers`='$cache_users',`cache_limit_coldost_links`='$cache_dost_links',`cache_limit_colclicks`='$cache_clicks',`cache_limit_colclicks_all`='$cache_clicks_all',`cache_limit_colsites`='$cache_sites',`cache_limit_colnews`='$cache_news',`cache_limit_colactions`='$cache_actions',`cache_limit_colmini_chat`='$cache_mini_chat',`cache_limit_colgb` = '$cache_gb'  WHERE `id`='1'"))
  {
  echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=cache">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
 echo '<form action="config.php?mode=cache&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Период кэширования количества пользователей (в сек.) : <br />
<input name="cache_users" type="text" value="'.$config['cache_limit_colusers'].'" size="4" maxlength="4"><br />
Период кэширования количества доступных ссылок (в сек.) : <br />
<input name="cache_users" type="text" value="'.$config['cache_limit_coldost_links'].'" size="4" maxlength="4"><br />
Период кэширования количества кликов сегодня (в сек.) : <br />
<input name="cache_clicks" type="text" value="'.$config['cache_limit_colclicks'].'" size="4" maxlength="4"><br />
Период кэширования количества кликов всего (в сек.) : <br />
<input name="cache_clicks_all" type="text" value="'.$config['cache_limit_colclicks_all'].'" size="4" maxlength="4"><br />
Период кэширования количества площадок (в сек.) : <br />
<input name="cache_sites" type="text" value="'.$config['cache_limit_colsites'].'" size="4" maxlength="4"><br />
Период кэширования количества новостей (в сек.) : <br />
<input name="cache_news" type="text" value="'.$config['cache_limit_colnews'].'" size="4" maxlength="4"><br />
Период кэширования количества акций (в сек.) : <br />
<input name="cache_actions" type="text" value="'.$config['cache_limit_colactions'].'" size="4" maxlength="4"><br />
Период кэширования количества записей в мини-чате (в сек.) : <br />
<input name="cache_mini_chat" type="text" value="'.$config['cache_limit_colmini_chat'].'" size="4" maxlength="4"><br />
Период кэширования количества записей в гостевой (в сек.) : <br />
<input name="cache_gb" type="text" value="'.$config['cache_limit_colgb'].'" size="4" maxlength="4"><br />
<input type="submit" value="Сохранить" />
</form>';
 }


/*
Период кэшиования количества  (в сек.) : <br />
<input name="cache_" type="text" value="'.$config['cache_limit_col'].'" size="7" maxlength="7"><br />
*/

break;
##########################
case 'antispam':
echo '<div class="sec">
Настройки анти спама
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
 $forum_pe = obr($_POST['forum_pe'],'integer',7);
 $all = obr($_POST['all'],'integer',7);
 $minlen_ftheme = obr($_POST['minlen_ftheme'],'integer',7);
 $minlen_fpost = obr($_POST['minlen_fpost'],'integer',7);
 $bot_code = obr($_POST['bot_code'],'integer',1);

 if(query("UPDATE `$db[prefix]config` SET  `antispam_forum_pe`='$forum_pe',`antispam_all`='$all',`antispam_minlen_ftheme`='$minlen_ftheme',`antispam_minlen_fpost`='$minlen_fpost',`antispam_bot_code`='$bot_code'  WHERE `id`='1'"))
  {
  echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=antispam">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
 echo '<form action="config.php?mode=antispam&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Время антиспама (в сек.) : <br />
<input name="all" type="text" value="'.$config['antispam_all'].'" size="4" maxlength="4"><br />
Время доступа для редактировании поста на форуме (в сек.) : <br />
<input name="forum_pe" type="text" value="'.$config['antispam_forum_pe'].'" size="4" maxlength="4"><br />
Минимальное количество символов в форуме -> теме: <br />
<input name="minlen_ftheme" type="text" value="'.$config['antispam_minlen_ftheme'].'" size="4" maxlength="4"><br />
Минимальное количество символов в форуме -> посте : <br />
<input name="minlen_fpost" type="text" value="'.$config['antispam_minlen_fpost'].'" size="4" maxlength="4"><br />
<hr/>
Вводить код подтверждения в виде : <br />
<select size="1" name="bot_code">
  <option value="0" '; if($config['antispam_bot_code']==0)echo 'selected="selected"'; echo '>-Не использовать</option>
  <option value="1" '; if($config['antispam_bot_code']==1)echo 'selected="selected"'; echo '>Текста</option>
  <option value="2" '; if($config['antispam_bot_code']==2)echo 'selected="selected"'; echo '>Изображения</option>
</select><br />
<input type="submit" value="Сохранить" />
</form>
';

 }

//Время антиспама при (в сек.) : <br />
//<input name="" type="text" value="'.$config['antispam_'].'" size="7" maxlength="7"><br />

break;
##########################
case 'logs':
echo '<div class="sec">
Логирование
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {


 $hosts = obr($_POST['hosts'],'integer',1);
 $hosts_pages = obr($_POST['hosts_pages'],'integer',1);
 $errors = obr($_POST['errors'],'integer',1);
 $querys = obr($_POST['querys'],'integer',1);
 $obmen = obr($_POST['obmen'],'integer',1);
 $auth = obr($_POST['auth'],'integer',1);

 if(query("UPDATE `$db[prefix]config` SET `logs_hosts` = '$hosts',`logs_hosts_pages` = '$hosts_pages',`logs_errors` = '$errors',`logs_querys` = '$querys',`logs_obmen` = '$obmen',`logs_auth` = '$auth' WHERE `id`='1'"))
  {
  echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=antispam">&lt;&lt;&lt;Назад</a><br />
';
  }
 }
else
 {
 echo '<form action="config.php?mode=logs&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Посещаемость  : <br />
<input name="hosts" type="radio" value="1"'.($config['logs_hosts']== 1 ? 'checked="checked"' : null ).' >Да
<input name="hosts" type="radio" value="0"'.($config['logs_hosts']== 0 ? 'checked="checked"' : null ).' >Нет
<br />
&nbsp;Посещамость по страницам : <br />
&nbsp;<input name="hosts_pages" type="radio" value="1"'.($config['logs_hosts_pages']== 1 ? 'checked="checked"' : null ).' >Да
&nbsp;<input name="hosts_pages" type="radio" value="0"'.($config['logs_hosts_pages']== 0 ? 'checked="checked"' : null ).' >Нет
&nbsp;<br />
Ошибки сервера (403,404) : <br />
<input name="errors" type="radio" value="1"'.($config['logs_errors']== 1 ? 'checked="checked"' : null ).' >Да
<input name="errors" type="radio" value="0"'.($config['logs_errors']== 0 ? 'checked="checked"' : null ).' >Нет
<br />
MySQL запросы : <br />
<input name="querys" type="radio" value="1"'.($config['logs_querys']== 1 ? 'checked="checked"' : null ).' >Да
<input name="querys" type="radio" value="0"'.($config['logs_querys']== 0 ? 'checked="checked"' : null ).' >Нет
<br />
Обмены кредитов : <br />
<input name="obmen" type="radio" value="1"'.($config['logs_obmen']==1 ? 'checked="checked"' : null ).' >Да
<input name="obmen" type="radio" value="0"'.($config['logs_obmen']==0 ? 'checked="checked"' : null ).' >Нет
<br />
Входы : <br />
<input name="auth" type="radio" value="1"'.($config['logs_auth']== 1 ? 'checked="checked"' : null ).' >Да
<input name="auth" type="radio" value="0"'.($config['logs_auth']== 0 ? 'checked="checked"' : null ).' >Нет
<br />
<input type="submit" value="Сохранить" />
</form>
';
# '.($config['logs_']== ? 'checked="checked"' : null ).'
 }

/*

 : <br />
<input name="" type="radio" value="1"'.($config['logs_']== 1 ? 'checked="checked"' : null ).' >Да
<input name="" type="radio" value="0"'.($config['logs_']== 0 ? 'checked="checked"' : null ).' >Нет
<br />

*/

break;

##########################
case 'games':

echo '<div class="sec">
Настройки игр
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {
$game_enable_test = obr($_POST['game_enable_test'],'integer',1);
$game_chislo_on = obr($_POST['game_chislo_on'],'integer',1);
$game_chislo_min = obr($_POST['game_chislo_min'],'integer',5);
$game_chislo_max = obr($_POST['game_chislo_max'],'integer',5);
$game_coin_on = obr($_POST['game_coin_on'],'integer',1);
$game_coin_min = obr($_POST['game_coin_min'],'integer',5);
$game_coin_max = obr($_POST['game_coin_max'],'integer',5);
$game_kosti_on = obr($_POST['game_kosti_on'],'integer',1);
$game_kosti_min = obr($_POST['game_kosti_min'],'integer',5);
$game_kosti_max = obr($_POST['game_kosti_max'],'integer',5);
$game_bandit_on = obr($_POST['game_bandit_on'],'integer',1);
$game_bandit_rate = obr($_POST['game_bandit_rate'],'integer',5);
$game_bandit_won = obr($_POST['game_bandit_won'],'integer',5);

  if(query("UPDATE `$db[prefix]config` SET  `game_enable_test`='$game_enable_test',`game_chislo_on`='$game_chislo_on',`game_chislo_min`='$game_chislo_min',`game_chislo_max`='$game_chislo_max',`game_coin_on`='$game_coin_on',`game_coin_min`='$game_coin_min',`game_coin_max`='$game_coin_max',`game_kosti_on`='$game_kosti_on',`game_kosti_min`='$game_kosti_min',`game_kosti_max`='$game_kosti_max',`game_bandit_on`='$game_bandit_on',`game_bandit_rate`='$game_bandit_rate',`game_bandit_won`='$game_bandit_won' WHERE `id`='1'"))
  {
echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=games">&lt;&lt;&lt;Назад</a><br />
';
  }

 }
else
 {
echo '<form action="config.php?mode=games&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Есть возможность играть на просто так : <br />
<input name="game_enable_test" type="radio" value="1"'.($config['game_enable_test'] == 1 ? ' checked="checked"' : null ).'>Да <input name="game_enable_test" type="radio" value="0"'.($config['game_enable_test'] == 0 ? ' checked="checked"' : null ).'>Нет<br />
&nbsp;&bull; <b>Угадай число</b><br />
Игра доступна : <br />
<input name="game_chislo_on" type="radio" value="1"'; if($config['game_chislo_on']==1) echo ' checked="checked'; echo ' "> Да <input name="game_chislo_on" type="radio" value="0"'; if($config['game_chislo_on']==0) echo ' checked="checked'; echo ' ">Нет <br />';
echo 'Минимальная ставка в игре : <br />
<input name="game_chislo_min" type="text" value="'.$config['game_chislo_min'].'" maxlength="5" size="5" /><br />
Максимальная ставка в игре : <br />
<input name="game_chislo_max" type="text" value="'.$config['game_chislo_max'].'" maxlength="5" size="5"  /><br />
<br />
&nbsp;&bull; <b>Орел/Решка</b><br />
Игра доступна : <br />
<input name="game_coin_on" type="radio" value="1"'; if($config['game_coin_on']==1) echo ' checked="checked'; echo ' "> Да <input name="game_coin_on" type="radio" value="0"'; if($config['game_coin_on']==0) echo ' checked="checked'; echo ' ">Нет <br />';
echo 'Минимальная ставка в игре  : <br />
<input name="game_coin_min" type="text" value="'.$config['game_coin_min'].'" maxlength="5" size="5"  /><br />
Максимальная ставка в игре : <br />
<input name="game_coin_max" type="text" value="'.$config['game_coin_max'].'" maxlength="5" size="5"  /><br />
<br />
&nbsp;&bull; <b>Кости</b><br />
Игра доступна : <br />
<input name="game_kosti_on" type="radio" value="1"'; if($config['game_kosti_on']==1) echo ' checked="checked'; echo ' "> Да <input name="game_kosti_on" type="radio" value="0"'; if($config['game_kosti_on']==0) echo ' checked="checked'; echo ' ">Нет <br />';
echo 'Минимальная ставка в игре : <br />
<input name="game_kosti_min" type="text" value="'.$config['game_kosti_min'].'" maxlength="5" size="5"  /><br />
Максимальная ставка в игре : <br />
<input name="game_kosti_max" type="text" value="'.$config['game_kosti_max'].'" maxlength="5" size="5"  /><br />
<br />
&nbsp;&bull; <b>Бандит</b><br />
Игра доступна : <br />
<input name="game_bandit_on" type="radio" value="1"'; if($config['game_bandit_on']==1) echo ' checked="checked'; echo ' "> Да <input name="game_bandit_on" type="radio" value="0"'; if($config['game_bandit_on']==0) echo ' checked="checked'; echo ' ">Нет <br />';
echo 'Ставка в игре : <br />
<input name="game_bandit_rate" type="text" value="'.$config['game_bandit_rate'].'" maxlength="5" size="5"  /><br />
Большой куш : <br />
<input name="game_bandit_won" type="text" value="'.$config['game_bandit_won'].'" maxlength="5" size="5"  /><br />
<input type="submit" value="Сохранить" />
</form>
';
 }

break;
##########################
case 'prices':

echo '<div class="sec">
Цены / Стоимости
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {

 $forum_t = substr(abs($_POST['forum_t']),0,4);
 $forum_p = substr(abs($_POST['forum_p']),0,4);
 $votes = substr(abs($_POST['votes']),0,4);
 $bad_trans = substr(abs($_POST['bad_trans']),0,4);
 $users_reklama = substr(abs($_POST['users_reklama']),0,4);

  if(query("UPDATE `$db[prefix]config` SET `price_forum_t` = '$forum_t',`price_forum_p` = '$forum_p',`price_votes` = '$votes',`price_bad_trans` = '$bad_trans',`price_users_reklama` = '$users_reklama'  WHERE `id`='1'"))
  {
echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />
';
  }
 else
  {
  echo 'Ошибка!<br />
<a href="config.php?mode=prices">&lt;&lt;&lt;Назад</a><br />
';
  }

 }
else
 {
echo '<form action="config.php?mode=prices&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
- пользователи получают кредитов ...<br />
за тему на форуме : <br />
<input name="forum_t" type="text" value="'.$config['price_forum_t'].'" size="4" maxlength="4"><br />
за пост на форуме : <br />
<input name="forum_p" type="text" value="'.$config['price_forum_p'].'" size="4" maxlength="4"><br />
за голосование : <br />
<input name="votes" type="text" value="'.$config['price_votes'].'" size="4" maxlength="4"><br />
- пользователи теряют кредитов ...<br />
за недопереход : <br />
<input name="bad_trans" type="text" value="'.$config['price_bad_trans'].'" size="4" maxlength="4"><br />
за один день размещения рекламы : <br />
<input name="users_reklama" type="text" value="'.$config['price_users_reklama'].'" size="4" maxlength="4"><br />
<input type="submit" value="Сохранить" />
</form>
';
 }

break;
##########################
case 'debag':

echo '<div class="sec">
Режим отладки
</div><div class="vstavka">
';

if(isset($_GET['confirm']) && $_GET['confirm']=='yes')
 {

 $debag = obr($_POST['debag'],'integer');
 $code = my_md5(obr($_POST['secret_code'],'string'));

 if($code == $config['secret_code'])
  {
  if(query("UPDATE `$db[prefix]config` SET `debag` = '$debag' WHERE `id`='1'"))
   {
echo 'Настройки успешно сохранены!<br />
<a href="config.php?">Далее&gt;&gt;&gt;</a><br />';
   }else{echo 'Ошибка!<br />
<a href="config.php?mode=prices">&lt;&lt;&lt;Назад</a><br />';}
  }else{echo 'Код неверен!<br />
<a href="config.php?mode=prices">&lt;&lt;&lt;Назад</a><br />';}
 }
else
 {
echo '<form action="config.php?mode=debag&confirm=yes" method="POST">
<input name="in_script" type="hidden" value="1">
Обработка ошибок : <br />
<select size="1" name="debag">
  <option value="0"'.($config['debag'] == 0 ? ' selected="selected"' : null).'>Никаких ошибок</option>
  <option value="1"'.($config['debag'] == 1 ? ' selected="selected"' : null).'>Запись в файл</option>
  <option value="2"'.($config['debag'] == 2 ? ' selected="selected"' : null).'>Вывод в браузер</option>
</select><br />
Секретный код : <br />
<input name="secret_code" type="password"><br />
<input type="submit" value="Сохранить" />
</form>
';
 }

break;

}

##########################
echo '<hr/>';

if($_query_string != '')echo '...<a href="config.php?">Настройки</a><br />';
echo '..<a href="/admin/index.php?">Админ панель</a><br />';
echo '.<a href="/menu/index.php?">Кабинет</a><br />';



require '../inc/foot.php';

################################################
# 0KHQutGA0LjQv9GCINC90LUg0L/QsNCx0LvQuNC6IQ== #
#   0KHRgtCw0LLRgNC+0L/QvtC70YwsIDIwMDkg0LMu   #
################################################

?>