Вход Регистрация
Файл: pages/settings/themes.php
Строк: 38
<?
only_reg
();
$set['title']='Мои настройки';
require_once (
"../../core/cuctema/head.php");
title();
aut();

if (isset(
$_POST['save'])){
if (isset(
$_POST['set_them']) && preg_match('#^([A-z0-9-_()]+)$#ui'$_POST['set_them']) && is_dir(H.'/core/themes/'.$_POST['set_them']))
{
$user['set_them']=$_POST['set_them'];
mysql_query("UPDATE `user` SET `set_them` = '$user[set_them]' WHERE `id` = '$user[id]' LIMIT 1");
}
elseif (isset(
$_POST['set_them2']) && preg_match('#^([A-z0-9-_()]+)$#ui'$_POST['set_them2']) && is_dir(H.'/core/themes/'.$_POST['set_them2']))
{
$user['set_them2']=$_POST['set_them2'];
mysql_query("UPDATE `user` SET `set_them2` = '$user[set_them2]' WHERE `id` = '$user[id]' LIMIT 1");
}
else 
$err='Ошибка применения темы';
if (!isset(
$err))msg('Изменения успешно приняты');
}
err();
echo 
"<form method='post' action='?themes'>n";
echo 
"<div class='main123'>";
echo 
"<font color='red'>Тема (".($webbrowser?'WEB':'WAP')."):</font><br />n<select name='set_them".($webbrowser?'2':null)."'>n";
$opendirthem=opendir(H.'/core/themes');
while (
$themes=readdir($opendirthem)){
// пропускаем корневые папки и файлы
if ($themes=='.' || $themes=='..' || !is_dir(H."/core/themes/$themes"))continue;
// пропускаем темы для определенных браузеров
if (file_exists(H."/core/themes/$themes/.only_for_".($webbrowser?'wap':'web')))continue;

echo 
"<option value='$themes'".($user['set_them'.($webbrowser?'2':null)]==$themes?" selected='selected'":null).">".trim(file_get_contents(H.'/core/themes/'.$themes.'/them.name'))."</option>n";
}
closedir($opendirthem);
echo 
"</select><br />n";
echo 
"</div>n";

echo 
"<div class='menu123'>";
echo 
"<input type='submit' name='save' value='Сохранить' />n";
echo 
"</div>n";
echo 
"</form>n";
require_once (
"../../core/cuctema/foot.php");
?>
Онлайн: 0
Реклама