View file shcms/settings.php

File size: 2.99Kb
<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Настройки
=============================================
Official website: http://shcms.ru
=============================================
*/
define('SHCMS', true);
include_once'../system/inc/basic_settings.php';
registrat();
$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$user_id"));

$shcmsengine['title'] = Lang::get('Пользовательские настройки');
include_once'../template/head.php';
     if($_POST['submit']) {
	  $submit =$_POST['submit'];
	  }

     if(isset($submit)) {
	 
     if($_POST['poc_email']){
	   $poc_email =$_POST['poc_email'];
	   }
     if($_POST['poc_icq']) {
	   $poc_icq =$_POST['poc_icq'];
	   }
     if($_POST['time_dv']) {
	  $time_dv =$_POST['time_dv'];
	  }
     if($_POST['wap_themes']) {
	  $wap_themes = $_POST['wap_themes'];
	  }
     if($_POST['web_themes']) {
	  $web_themes = $_POST['web_themes'];
	  }
     if($_POST['newsletter']) {
	  $newsletter = $_POST['newsletter'];
	  }
	  
$user['poc_email'] = (isset ($poc_email) && $poc_email);
$user['poc_icq'] = (isset ($poc_icq) && $poc_icq);
$user['poc_wmid'] = (isset ($poc_wmid) && $poc_wmid);
$user['time_dv'] = (isset ($time_dv) && $time_dv);
$user['newsletter'] = (isset ($newsletter) && $newsletter);

	
 mysql_query("UPDATE `users` SET `time_dv`='$time_dv',`poc_email` ='$poc_email',`poc_icq` = '$poc_icq', `poc_wmid` = '$poc_wmid',`newsletter` = '$newsletter' WHERE `id`='$user_id'");

messag(Lang::get('Настройки сохранены'));
header("Refresh: 1; url=settings.php");
}

  echo '<form action="?'.$conservation.'" method="post">';
echo '<div class="maintitle mainrazd">'.Lang::get('Настройка Темы').'</div><div class="maintext">';
echo '<div class="posts"><img src="../template/icon/themes.png">&nbsp; <a href="them.php">'.Lang::get('Сменить тему').'</a></div>';
echo '</div>';
echo '<div class="maintitle mainrazd">'.Lang::get('Настройка Анкеты').'</div><div class="maintext">';
echo Lang::get('Показывать E-mail').'<input class="styled"  name="poc_email" type="checkbox" value="1" ' .($user['poc_email']?'checked="checked"':'') . ' /><hr />';
echo Lang::get('Показывать ICQ').'<input class="styled"  name="poc_icq" type="checkbox" value="1" ' .($user['poc_icq']?'checked="checked"':'') . ' /><hr />';
echo '</div>';
echo '<div class="maintitle mainrazd">'.Lang::get('Дополнительные').'</div><div class="maintext">';
echo Lang::get('Подписаться на рассылку от Администратора').'<input class="styled"  name="newsletter" type="checkbox" value="1" '.($user['newsletter']?'checked="checked"':'') . ' />';
echo '</div>';
echo '<input type="submit" name="submit" value="'.Lang::get('Отправить').'">';
echo '</form>';




include_once'../template/foot.php';
?>