File size: 3.84Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Системные настройки
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
$shcmsengine['title'] = 'SHCMS Engine Системные настройки.';
include_once'../template/head.php';
registrat();
$adminka ->admin();
$resting == false;
$user4 = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$user_id'"));
if($user4['team'] < 6)
{
echo 'Ошибка';
header('Refresh: 1; url=/index.php?'.$conservation.'&');
include_once'../template/foot.php';
exit();
}
include_once'secu.php';
$loa = mysql_query("SELECT * FROM `settings_shcms`");
$load_shcms = mysql_fetch_array($loa);
if($_POST['sub_save'])
{$sub_save = $_POST['sub_save'];}
if(isset($sub_save))
{
if($_POST['name'])
{$name = $_POST['name'];}
if($_POST['keywords'])
{$keywords = $_POST['keywords'];}
if($_POST['description'])
{$description = $_POST['description'];}
if($_POST['trans'])
{$trans = $_POST['trans'];}
if($_POST['close_site'])
{$close_site = $_POST['close_site'];}
if($_POST['close_text'])
{$close_text = $_POST['close_text'];}
$load_shcms['title'] = isset($name) ? (substr($name,0,40)):'';
$load_shcms['keywords'] = isset($keywords) ? (substr($keywords,0,255)):'';
$load_shcms['description'] = isset($description) ? (substr($description,0,2000)):'';
$load_shcms['trans'] = (isset ($trans) && $trans);
$load_shcms['close_site'] = (isset ($close_site) && $close_site);
$load_shcms['close_text'] = (isset ($close_text) && $close_text);
$ok_mysq = mysql_query("UPDATE `settings_shcms` SET `description`='$description',`keywords`='$keywords',`title`='$name',`trans`='$trans',`close_site` = '$close_site',`close_text`='$close_text'");
if($ok_mysq == true)
{
echo '<div class="actshcms">Изминение успешно сохранены</div>';
header("Refresh: 1; url=?");
include_once'../template/foot.php';
exit();
}
else
{
echo '<div class="errors">Настройки не сохранены</div>';
header("Refresh: 1; url=?");
include_once'../template/foot.php';
exit();
}
}
echo '<form method="post" action="?">';
echo 'Заголовок гл. страницы:<br/><input type="text" name="name" value="'.$load_shcms['title'].'"><br/>';
echo 'Домашняя страница сайта:<br/><input type="text" value="http://'.$_SERVER['HTTP_HOST'].'"><br/>';
echo 'Описание (Description) сайта:<br/><textarea name="description" >'.$load_shcms['description'].'</textarea><br/>';
echo 'Ключевые слова (Keywords) для сайта:<br/><textarea name="keywords" >'.$load_shcms['keywords'].'</textarea><br/>';
echo "Закрытия сайта:<br />\n<select name='close_site'>\n";
echo '<option value="0"' . ($load_shcms['close_site'] == 0? ' selected="selected">' : '>') .'Открыть</option>';
echo '<option value="1"' . ($load_shcms['close_site'] == 1? ' selected="selected">' : '>') .'Закрыть</option>';
echo '</select><br/>';
echo 'Причина закрытия:<br/><textarea name="close_text" >'.$load_shcms['close_text'].'</textarea><br/>';
echo "Транслит:<br />\n<select name='trans'>\n";
echo '<option value="0"' . ($load_shcms['trans'] == 0? ' selected="selected">' : '>') .'Выключить</option>';
echo '<option value="1"' . ($load_shcms['trans'] == 1? ' selected="selected">' : '>') .'Включить</option>';
echo '</select><br/>';
echo '<input type="submit" name="sub_save" value="Сохранить"></form>';
include_once'../template/foot.php';
?>