File size: 1.23Kb
Выберите тему!
<?php
Defined('ADMIN_S_S') or die ('Доступ запрещен!!!');
echo
'<span class="ramka">
Редактировать тему сайта.
</span><br />';
$s_tema = trim(file_get_contents($cms.'cgf/tema.txt'));
if ($_POST['s_tema'] != '')
{
if (is_file($cms.'dis/'.$_POST['s_tema'].'/tema.html'))
$save_tem = trim($_POST['s_tema']);
else
$save_tem = $cms_theme_UP;
$fp = fopen ($cms.'cgf/tema.txt', "w+");
fwrite ($fp, trim($save_tem));
fclose ($fp);
echo '
<span class="ramka">
Успешно!
</span>
<META HTTP-EQUIV="Refresh" CONTENT="1;">
';
}
else
{
?>
<br />
<form name="" action="" method="post">
<?php
echo '<select size="1" name="s_tema">';
$dir = opendir ("dis");
while ($file = readdir ($dir))
{ if (( $file != ".") && ($file != "..") && ($file != "price.txt"))
{
if ($file == $s_tema)
echo '<option selected value="'.$file.'">'.$file.'</option>';
else
echo '<option value="'.$file.'">'.$file.'</option>';
}
}
closedir ($dir);
echo '</select><br />';
?>
<input class="knopka" type="submit" value="Сохранить">
</form>
<?php
}
?>