$value)
{
if(SUBDOMAINS)
echo '';
else
echo '';
echo "\n";
}
}
function theme_page()
{
if(isset($_POST['editCss']) && $_POST['editCss'] == "Edit" && $_POST['cssId'] != -1)
{
$css = get_option('cssfile');
$csstitle = strip_string($css[$_POST['cssId']]['title']);
$cssstr = strip_string($css[$_POST['cssId']]['csscontent']);
}
if(isset($_POST['deleteCss']) && $_POST['deleteCss'] == "Delete" && $_POST['cssId'] != -1)
{
echo '
Delete '.delete_css_file().'!
';
}
if(isset($_POST['catch']) && $_POST['catch'] == "Catch")
{
$cssstr = download_css_file();
if(isset($cssstr))
{
$csstitle = explode("/",$_POST['cssfile']);
$csstitle = array_pop($csstitle);
}
}
if(isset($_POST['saveCss']) && $_POST['saveCss'] == "Save")
{
if($_POST['title'] != Null)
{
$csstitle = strip_string($_POST['title']);
}
else
{
echo '
You must give it a title!
';
$nosave = 1;
}
if($_POST['cssText']!= Null)
{
$cssstr = strip_string($_POST['cssText']);
}
else
{
echo '
You must have css content!
';
$nosave = 1;
}
if(!$nosave) {
save_css_file();
echo '';
}
}
?>
}
function download_css_file()
{
if(!isset($_POST['cssfile'])) return ;
$handle = fopen($_POST['cssfile'], "r");
$data = fread($handle, 1000000);
return $data;
}
function save_css_file()
{
$css = get_option('cssfile');
foreach($css as $key=>$value)
{
if($value['title'] == $_POST['title'])
{
$css[$key] = array("title"=>$_POST['title'],"csscontent"=>$_POST['cssText']);
$update = 1;
break;
}
}
if(!$update)
{
$css[] = array("title"=>$_POST['title'],"csscontent"=>$_POST['cssText']);
}
update_option('cssfile',$css);
}
function delete_css_file()
{
$css = get_option('cssfile');
$title = $css[$_POST['cssId']]['title'];
unset($css[$_POST['cssId']]);
update_option('cssfile',$css);
return $title;
}
function show_css_list()
{
$css = get_option('cssfile');
?>