Файл: mob-lave.ru/admin/system.php
Строк: 136
<?php
require_once '../core/set.php';
$set['title'] = 'Настройки системы';
require_once '../core/head.php';
user_access('system_edit',null,'/index.php?');
require_once '../core/panel.php';
echo '<div class="navig">'.$home. $z.'<a href="/admin/">В панель управления</a>'.$z. $set['title'].'</div>';
$sys = mysql_fetch_assoc(mysql_query("SELECT * FROM `system`"));
if(isset($_POST['submit'])){
if($_POST['description'] != NULL) $desc = check($_POST['description']);
else $desc = NULL;
if($_POST['keywords'] != NULL) $keywords = check($_POST['keywords']);
else $keywords = NULL;
if($_POST['obj'] != NULL) $obj = check($_POST['obj']);
else $obj = NULL;
if($_POST['name_site'] != NULL) $name_site = check($_POST['name_site']);
else $name_site = 'DarkCMS | Главная';
if($_POST['perfix'] != NULL) $perfix = check($_POST['perfix']);
else $perfix = 'test';
if($_POST['privet'] != NULL) $privet = check($_POST['privet']);
else $privet = NULL;
if($_POST['online'] > 0) $online = num($_POST['online']);
else $online = 0;
if($_POST['size_file'] > 0) $size_file = num($_POST['size_file'])*1024*1024;
else $size_file = 0;
if (!preg_match('#..#',$_POST['set_them']) && is_dir('../design/theme/'.$_POST['set_them'])){
$design = check($_POST['set_them']);
}
$invite = num($_POST['invite']);
if($_POST['perfix'] != NULL) $perfix = check($_POST['perfix']);
else $perfix = 'Dark';
mysql_query("RENAME TABLE `$system[perfix]_all_accesses` TO `".$perfix."_all_accesses`");
mysql_query("RENAME TABLE `$system[perfix]_ban` TO `".$perfix."_ban`");
mysql_query("RENAME TABLE `$system[perfix]_chat` TO `".$perfix."_chat`");
mysql_query("RENAME TABLE `$system[perfix]_colors_list` TO `".$perfix."_colors_list`");
mysql_query("RENAME TABLE `$system[perfix]_forum_komm` TO `".$perfix."_forum_komm`");
mysql_query("RENAME TABLE `$system[perfix]_forum_podrazd` TO `".$perfix."_forum_podrazd`");
mysql_query("RENAME TABLE `$system[perfix]_forum_razd` TO `".$perfix."_forum_razd`");
mysql_query("RENAME TABLE `$system[perfix]_forum_them` TO `".$perfix."_forum_them`");
mysql_query("RENAME TABLE `$system[perfix]_foto_alb` TO `".$perfix."_foto_alb`");
mysql_query("RENAME TABLE `$system[perfix]_foto_foto` TO `".$perfix."_foto_foto`");
mysql_query("RENAME TABLE `$system[perfix]_foto_komm` TO `".$perfix."_foto_komm`");
mysql_query("RENAME TABLE `$system[perfix]_frends` TO `".$perfix."_frends`");
mysql_query("RENAME TABLE `$system[perfix]_frends_new` TO `".$perfix."_frends_new`");
mysql_query("RENAME TABLE `$system[perfix]_info` TO `".$perfix."_info`");
mysql_query("RENAME TABLE `$system[perfix]_info_dir` TO `".$perfix."_info_dir`");
mysql_query("RENAME TABLE `$system[perfix]_ip` TO `".$perfix."_ip`");
mysql_query("RENAME TABLE `$system[perfix]_lenta` TO `".$perfix."_lenta`");
mysql_query("RENAME TABLE `$system[perfix]_jurnal` TO `".$perfix."_jurnal`");
mysql_query("RENAME TABLE `$system[perfix]_mail` TO `".$perfix."_mail`");
mysql_query("RENAME TABLE `$system[perfix]_obmen` TO `".$perfix."_obmen`");
mysql_query("RENAME TABLE `$system[perfix]_obmen_files` TO `".$perfix."_obmen_files`");
mysql_query("RENAME TABLE `$system[perfix]_otziv` TO `".$perfix."_otziv`");
mysql_query("RENAME TABLE `$system[perfix]_predupr` TO `".$perfix."_predupr`");
mysql_query("RENAME TABLE `$system[perfix]_smile` TO `".$perfix."_smile`");
mysql_query("RENAME TABLE `$system[perfix]_smile_dir` TO `".$perfix."_smile_dir`");
mysql_query("RENAME TABLE `$system[perfix]_stena` TO `".$perfix."_stena`");
mysql_query("RENAME TABLE `$system[perfix]_users` TO `".$perfix."_users`");
mysql_query("RENAME TABLE `$system[perfix]_users_konts` TO `".$perfix."_users_konts`");
mysql_query("RENAME TABLE `$system[perfix]_user_ank` TO `".$perfix."_user_ank`");
mysql_query("RENAME TABLE `$system[perfix]_user_group` TO `".$perfix."_user_group`");
mysql_query("RENAME TABLE `$system[perfix]_user_group_access` TO `".$perfix."_user_group_access`");
mysql_query("RENAME TABLE `$system[perfix]_user_files` TO `".$perfix."_user_files`");
mysql_query("RENAME TABLE `$system[perfix]_user_files_dir` TO `".$perfix."_user_files_dir`");
mysql_query("RENAME TABLE `$system[perfix]_user_files_komm` TO `".$perfix."_user_files_komm`");
mysql_query("UPDATE `system` SET `obj` = '$obj', `size_file` = '$size_file', `description` = '$desc', `keywords` = '$keywords', `name_site` = '$name_site', `online` = '$online', `invite` = '$invite', `design` = '$design', `perfix` = '$perfix', `privet` = '$privet'");
header('Location: /admin/system.php');
$_SESSION['msg'] = 'Настройки сохранены';
}
$size_file = $sys['size_file']/1024/1024;
echo '<form method="post"/>
Название сайта (max 250)<br/><input type="text" name="name_site" value="'.$sys['name_site'].'" maxlength="250"/><br/>
Перфикс таблиц (max 20)<br/><input type="text" name="perfix" value="'.$sys['perfix'].'" maxlength="20"/><br/>
Описание - description (max 250)<br/><textarea name="description">'.$sys['description'].'</textarea></br>
Ключевые слова - keywords (max 250)<br/><textarea name="keywords">'.$sys['keywords'].'</textarea></br>
Объявление (max 1000)<br/><textarea name="obj">'.$sys['obj'].'</textarea></br>
Сообщение после реги. Если поле пустое, сообщ не приходит<br/><textarea name="privet">'.$sys['privet'].'</textarea></br>
Время онлайна юзеров (сек)<br/><input type="text" name="online" value="'.$sys['online'].'"/><br/>
Мах размер файлов (MB)<br/><input type="text" name="size_file" value="'.$size_file.'"/><br/>
Регистрация по инвайтам<br/>
<input name="invite" type="radio" '.($sys['invite']==1?' checked="checked"':null).' value="1" />Да
<input name="invite" type="radio" '.($sys['invite']==0?' checked="checked"':null).' value="0" />Нет<br/>
Снег на сайт<br/>
<input name="sneg" type="radio" '.($sys['sneg']==1?' checked="checked"':null).' value="1" />Да
<input name="sneg" type="radio" '.($sys['sneg']==0?' checked="checked"':null).' value="0" />Нет<br/>';
echo "Дизайн сайта<br /><select name='set_them'>n";
$opendirthem = opendir('../design/theme');
while ($themes = readdir($opendirthem)){
if ($themes=='.' || $themes=='..' || !is_dir("../design/theme/$themes"))continue;
echo "<option value='$themes'".($system['design'] == $themes?" selected='selected'":null).">".trim(file_get_contents('../design/theme/'.$themes.'/them.name'))."</option>n";
}
closedir($opendirthem);
echo "</select>";
echo '<br/><input type="submit" name="submit" value="Сохранить"/>
</form>';
echo '<div class="navig">'.$home. $z.'<a href="/admin/">В панель управления</a>'.$z. $set['title'].'</div>';
require_once '../core/foot.php';
?>