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

Размер файла: 6.03Kb
<?php

Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);

extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);
extract($HTTP_SESSION_VARS);

session_name("SESID");
session_start();
require("../mysql.php");
include ("../config.php"); # Подключаем настройки сайта. (config.php)

if ($_GET[act]=="set")
{

 if ($_SESSION['login']==$nickadmina && md5($_SESSION['pass'])==$passadmina)
  {
  	  mysql_query("update `settings` set welcome='".$_POST[wwelcome]."', themes='".$_POST[wthemes]."',css='".$_POST[stylethemes]."',image='".$_POST[fon]."', show_time='".$_POST[wshow_time]."', show_date='".$_POST[wshow_date]."', mainlink='".$_POST[wmainlink]."', generacia='".$_POST[wgeneracia]."', counter='".$_POST[wcounter]."', nickadmina='".$_POST[wnickadmina]."', emailadmina='".$_POST[wemailadmina]."', sdvigclock='".$_POST[wsdvigclock]."', title='".$_POST[wtitle]."', textlogo='".$_POST[wtextlogo]."', copyright='".$_POST[wcopyright]."', homeurl='".$_POST[whome]."', rashstr='".$_POST[wras_pages]."', portal='".$_POST[wportal]."', gzip='".$_POST[wgzip]."', offmes='".$_POST[woffmes]."', kolnews='".$_POST[wkolnews]."' where id='1';");
  	  header ("location: set.php?set=1");

  } 
   else
  {
   include ("../themes/$themes.php"); 
   echo"<div>Неправильный ввод.</br><a href='index.php'>Назад</a></div>";
   include ("../foot.php");
  }

}

if ($_GET[act]=="")
{
include ("../themes/$themes.php"); //Вставляем скин сайта.

if ($_SESSION['login']==$nickadmina && md5($_SESSION['pass'])==$passadmina)
  {
if ($_GET[set]=="1")
{
echo"<div style='color: red'>Сайт настроен</div>";
}
echo"<div>Настройка системы.</div>";
echo"<div>Время на сервере: ".date("H.i(d/m/Y)")."";
echo"<form method='post' action='set.php?act=set'>";
    echo"<div class='b'>Общие настройки</div>";
# тема html или xhtml
echo"<div class='z'>Html/xhtml:<br/>
     <select name='wthemes' class='textbox'><option>";

echo $themes;

echo"</option>";

 $dir = opendir ("../themes"); 
   while ($file = readdir ($dir)) 
 {
    if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php")  && ($file != "css") && ($file != "$themes.php")  )
    { $file= str_replace(".php","",$file);
echo "<option>$file</option>";
 }}
 echo "</select></div>";
closedir ($dir);


# стиль
echo"<div class='z'>Стиль:<br/>
     <select name='stylethemes' class='textbox'><option>";

echo $css;

echo"</option>";

 $dir = opendir ("../themes/css"); 
   while ($file = readdir ($dir)) 
 {
    if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php")  && ($file != "$css.css")  )
    { $file= str_replace(".css","",$file);
echo "<option>$file</option>";
 }}
 echo "</select></div>";
closedir ($dir);

# Показывать добавление ссылки
echo"<div class='z'>Включить блок ДРУЗЬЯ:<br/>Да";
	if($mainlink=="1"){echo"<input name='wmainlink' type='radio' value='1' checked='checked'/>";} else {echo"<input name='wmainlink' type='radio' value='1'/>";}
	echo" &nbsp; &nbsp; ";
	if($mainlink=="0"){echo"<input name='wmainlink' type='radio' value='0' checked='checked'/>";} else {echo"<input name='wmainlink' type='radio' value='0'/>";}
	echo"Нет</div>";
		
		
# счетчик
echo"<div class='z'>Включить cчетчик:<br/>Да";
	if($counter=="1"){echo"<input name='wcounter' type='radio' value='1' checked='checked' />";} else {echo"<input name='wcounter' type='radio' value='1' />";} 	echo" &nbsp; &nbsp; ";
	if($counter=="0"){echo"<input name='wcounter' type='radio' value='0' checked='checked' />";} else {echo"<input name='wcounter' type='radio' value='0' />";}
	echo"Нет</div>";
	
# Включить gzip сжатие
echo"<div class='z'>Включить gzip сжатие:<br/>Да";
	if($gzip=="1"){echo"<input name='wgzip' type='radio' value='1' checked='checked'/>";} else {echo"<input name='wgzip' type='radio' value='1'>";} 	echo" &nbsp; &nbsp; ";
	if($gzip=="0"){echo"<input name='wgzip' type='radio' value='0' checked='checked'/>";} else {echo"<input name='wgzip' type='radio' value='0'/>";}
	echo"Нет</div>";

# Если on то, сайт открыт, если off, то сайт закрыт на реконструкцию
echo"<div class='z'>Включить сайт:<br/>Да";
	if($portal=="on"){echo"<input name='wportal' type='radio' value='on' checked='checked'/>";} else {echo"<input name='wportal' type='radio' value='on' />";} 	echo" &nbsp; &nbsp; ";
	if($portal=="off"){echo"<input name='wportal' type='radio' value='off' checked='checked' />";} else {echo"<input name='wportal' type='radio' value='off'/>";}
	echo"Нет</div>";

# Ник админа на сайте
echo"<div class='z'>Ник админа:<br/>
     <input name='wnickadmina' maxlength='50' value='$nickadmina'/></div>";
     	
# е-mail админа 
echo"<div class='z'>е-mail админа:<br/>
     <input name='wemailadmina' maxlength='50' value='$emailadmina'/></div>";	

# Заголовок страниц  
echo"<div class='z'>Заголовок страниц :<br/>
     <input name='wtitle' maxlength='100' value='$title'/></div>";

# Название
echo"<div class='z'>Название:<br/>
     <input name='wtextlogo' maxlength='200' value='$textlogo'/></div>";

# Копирайт
echo"<div class='z'>Ваш копирайт:<br/>
     <input name='wcopyright' maxlength='100' value='$copyright'/></div>";

# Главная сайта
echo"<div class='z'>Главная сайта без слэша в конце:<br/>
     <input name='whome' maxlength='100' value='$home'/></div>";
  

echo"<br/><input value='OK' name='do' type='submit'/></form>";
  	print"<a href='main.php'>В админку</a></div>";
  }
else
  {
    echo"<div>Неправильный ввод.<br> <a href='index.php'>Назад</a></div>";
  }
include ("../foot.php");
}
?>