Файл: panel/settings_sys.php
Строк: 159
<?
include_once '../sys/includes/start.php';
include_once '../sys/includes/compress.php';
include_once '../sys/includes/sess.php';
include_once '../sys/includes/home.php';
include_once '../sys/includes/settings.php';
$temp_set=$set;
include_once '../sys/includes/db_connect.php';
include_once '../sys/includes/ipua.php';
include_once '../sys/includes/fnc.php';
include_once '../sys/includes/adm_check.php';
include_once '../sys/includes/user.php';
user_access('adm_set_sys',null,'index.php?'.SID);
adm_check();
$set['title']='Настройки системы';
include_once '../sys/includes/header.php';
title();
auter();
if (isset($_POST['save']))
{
$temp_set['title']=esc(stripcslashes(htmlspecialchars($_POST['title'])),1);
$temp_set['mail_backup']=esc($_POST['mail_backup']);
$temp_set['p_str']=intval($_POST['p_str']);
mysql_query("ALTER TABLE `user` CHANGE `set_p_str` `set_p_str` INT( 11 ) DEFAULT '$temp_set[p_str]'");
if (!preg_match('#..#',$_POST['set_them']) && is_dir(H.'s-klub/thems/'.$_POST['set_them']))
{
$temp_set['set_them']=$_POST['set_them'];
mysql_query("ALTER TABLE `user` CHANGE `set_them` `set_them` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '$temp_set[set_them]'");
}
if (!preg_match('#..#',$_POST['set_them2']) && is_dir(H.'s-klub/thems/'.$_POST['set_them2']))
{
$temp_set['set_them2']=$_POST['set_them2'];
mysql_query("ALTER TABLE `user` CHANGE `set_them2` `set_them2` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '$temp_set[set_them2]'");
}
if ($_POST['set_show_icon']==2 || $_POST['set_show_icon']==1 || $_POST['set_show_icon']==0)
{
$temp_set['set_show_icon']=intval($_POST['set_show_icon']);
mysql_query("ALTER TABLE `user` CHANGE `set_show_icon` `set_show_icon` SET( '0', '1', '2' ) DEFAULT '$temp_set[set_show_icon]'");
}
if ($_POST['show_err_php']==1 || $_POST['show_err_php']==0)
{
$temp_set['show_err_php']=intval($_POST['show_err_php']);
}
if ($_POST['set_show_forum_nw']==1 || $_POST['set_show_forum_nw']==0)
{
$temp_set['set_show_forum_nw']=intval($_POST['set_show_forum_nw']);
}
if (isset($_POST['antidos']) && $_POST['antidos']==1)
{
$temp_set['antidos']=1;
}else{
$temp_set['antidos']=0;
}
if (isset($_POST['antimat']) && $_POST['antimat']==1)
{
$temp_set['antimat']=1;
}else{
$temp_set['antimat']=0;
}
$temp_set['meta_keywords']=esc(stripcslashes(htmlspecialchars($_POST['meta_keywords'])),1);
$temp_set['meta_description']=esc(stripcslashes(htmlspecialchars($_POST['meta_description'])),1);
if (save_settings($temp_set))
{
admin_log('Настройки','Система','Изменение системных настроек');
msg('Настройки успешно приняты');
}else{
$err='Нет прав для изменения файла настроек!';
}
}
err();
echo "<form method='post' action='?'>";
echo "<div class='forum_tema'>";
echo "<b>Название сайта:</b><br />";
echo "<input name='title' value='".$temp_set['title']."' type='text' /><br />";
echo "<b> на страницу:</b><br />";
echo "<input name='p_str' value='".$temp_set['p_str']."' type='text' /><br />";
echo "<b>Иконки:</b><br />";
echo "<select name='set_show_icon'>";
if ($temp_set['set_show_icon']==2)
{
$sel=' selected="selected"';
}else{
$sel=NULL;
}
echo "<option value='2'$sel>Большие</option>";
if ($temp_set['set_show_icon']==1)
{
$sel=' selected="selected"';
}else{
$sel=NULL;
}
echo "<option value='1'$sel>Маленькие</option>";
if ($temp_set['set_show_icon']==0)
{
$sel=' selected="selected"';
}else{
$sel=NULL;
}
echo "<option value='0'$sel>Скрывать</option>";
echo "</select><br />";
echo "<b>Темы форума на главной:</b><br />";
echo "<select name='set_show_forum_nw'>";
echo "<option value='0'".($temp_set['set_show_forum_nw']==0?" selected='selected'":null).">Скрывать</option>";
echo "<option value='1'".($temp_set['set_show_forum_nw']==1?" selected='selected'":null).">Показывать</option>";
echo "</select><br />";
echo "<b>Тема (WAP):</b><br />";
echo "<select name='set_them'>";
$opendirthem=opendir(H.'s-klub/thems');
while ($themes=readdir($opendirthem))
{
if ($themes=='.' || $themes=='..' || !is_dir(H."s-klub/thems/$themes"))
{
continue;
}
if (file_exists(H."s-klub/thems/$themes/.only_for_web"))
{
continue;
}
echo "<option value='$themes'".($temp_set['set_them']==$themes?" selected='selected'":null).">".trim(file_get_contents(H.'s-klub/thems/'.$themes.'/them.name'))."</option>";
}
closedir($opendirthem);
echo "</select><br />";
echo "<b>Тема (WEB):</b><br />";
echo "<select name='set_them2'>";
$opendirthem=opendir(H.'s-klub/thems');
while ($themes=readdir($opendirthem))
{
if ($themes=='.' || $themes=='..' || !is_dir(H."s-klub/thems/$themes"))
{
continue;
}
if (file_exists(H."s-klub/thems/$themes/.only_for_wap"))
{
continue;
}
echo "<option value='$themes'".($temp_set['set_them2']==$themes?" selected='selected'":null).">".trim(file_get_contents(H.'s-klub/thems/'.$themes.'/them.name'))."</option>";
}
closedir($opendirthem);
echo "</select><br />";
echo "<b>Ключевые слова (META):</b><br />";
echo "<textarea name='meta_keywords'>".$temp_set['meta_keywords']."</textarea><br />";
echo "<b>Описание (META):</b><br />";
echo "<textarea name='meta_description'>".$temp_set['meta_description']."</textarea><br />";
echo "<label><input type='checkbox'".($temp_set['antidos']?" checked='checked'":null)." name='antidos' value='1' /> <b>Анти-Dos*</b></label><br />";
echo "<label><input type='checkbox'".($temp_set['antimat']?" checked='checked'":null)." name='antimat' value='1' /> <b>Анти-Мат</b></label><br />";
echo "<b>Ошибки интерпретатора:</b><br />";
echo "<select name='show_err_php'>";
echo "<option value='0'".($temp_set['show_err_php']==0?" selected='selected'":null).">Скрывать</option>";
echo "<option value='1'".($temp_set['show_err_php']==1?" selected='selected'":null).">Показывать администрации</option>";
echo "</select><br />";
echo "<b>E-mail для BackUp:</b><br />";
echo "<input type='text' name='mail_backup' value='".$temp_set['mail_backup']."' /><br />";
echo "<br />";
echo "<b>* Анти-Dos - защита от частых запросов с одного IP-адреса!</b><br />";
echo "<input value='Изменить' name='save' type='submit' />";
echo "</div>";
echo "</form>";
if (user_access('adm_panel_show'))
{
echo "<a href='/panel/'><div class='foot'>";
echo "<img src='/s-klub/img/left.png'> В админку";
echo "</div></a>";
}
include_once '../sys/includes/footer.php';
?>