Location: PHPKode > projects > ZompLog > admin/themes.php
<?php
ob_start();
include_once("functions.php");
include('config.php');
include("session.php");
include("header.php");

$user = loadUser($_SESSION['login'],$link,$table_users);

if(!$_SESSION["loggedIn"] || !$user['admin']){
?>

You don't have enough privileges to view this page.
<?php
exit;
}
else
{


if($_POST['Submit']){

if(!$_POST['index'])
{
$messages[]="$lang_message029";
}



if(empty($messages)) {




$filename = "../themes/$settings[skin]/index.php";
$fp = fopen($filename, "w");
$stripped = stripslashes($_POST[index]);
$string = "$stripped";
$write = fputs($fp, $string);
fclose($fp);

$filename = "../themes/$settings[skin]/content.php";
$fp = fopen($filename, "w");
$stripped = stripslashes($_POST[content]);
$string = "$stripped";
$write = fputs($fp, $string);
fclose($fp);

	}
}
}

  

?>

<div id="submenu"><a href="changeclothes.php" class="sub"><?php echo "$lang_choose_theme"; ?></a> | <a href="settings_theme.php" class="sub"><?php echo "$lang_theme_options"; ?></a> | <a href="themes.php" class="sub"><?php echo "$lang_theme_html_editor"; ?></a></div>


<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><?php
if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
displayMessage($_GET[message]);
  }

else{
echo "$lang_message015";
}  
  
?>
</div></div>


<div id="main">

<form method="POST" name="editform" enctype="multipart/form-data">

	  <?php 

$filename = "../themes/$settings[skin]/index.php";
$fp = fopen($filename, "r");
$index = fread($fp, filesize($filename));
$index = htmlspecialchars($index);
fclose($fp);


$filename = "../themes/$settings[skin]/content.php";
$fp = fopen($filename, "r");
$content = fread($fp, filesize($filename));
$content = htmlspecialchars($content);
fclose($fp);




?>
	  
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
          <tr>
            <td width="100%" class="title"><a name="top" id="top"></a><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><h1><?php echo "$lang_edit_current_theme"; ?> <?php echo "$settings[skin]"; ?></h1></td>
              <td><input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="button" /></td>
            </tr>
			  <tr>
              <td colspan="2"> <?php echo "$lang_choose"; ?> <a href="changeclothes.php"><?php echo "$lang_another_theme"; ?></a></td>
            </tr>
          </table>
		 
		  </td>
          </tr>
          <tr>
            <td><fieldset id="titlediv">
      <legend><?php echo "$lang_help"; ?></legend>
	  <p><strong><?php echo "$lang_themes_help01"; ?></strong><br />
    <?php echo "$lang_themes_help02"; ?></p>
	  </fieldset>	  </td>
          </tr>
          <tr>
            <td><div class="text" onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><div align="right"><a href="#"><span class="showstate"></span><?php echo "$lang_help"; ?></a></div></div>
<div id="sc1" class="switchcontent">
<table width="100%" cellpadding="0" cellspacing="0" class="text" style='border: #CCCCCC solid; border-width: 5px 1px 1px 1px; padding: 5px 5px 5px 5px;'>
  <tr>
    <td>
      <p><strong><?php echo "$lang_themes_help03"; ?></strong><br />
        <?php echo "$lang_themes_help04"; ?><br />
        <br />
        <strong><?php echo "$lang_themes_help05"; ?><br />
        </strong><?php echo "$lang_themes_help06"; ?><br />
        <br />
        <strong><?php echo "$lang_themes_help07"; ?><br />
        </strong><?php echo "$lang_themes_help08"; ?><br />
        </p></td>
  </tr>
</table>
  </div> </td>
          </tr>
          <tr>
            <td class="title">&nbsp;</td>
          </tr>
          <tr>
            <td><fieldset id="titlediv">
      <legend><a name="content" id="content"></a><?php echo"$lang_contentphp"; ?></legend><table width="100%" border="0" cellpadding="0" cellspacing="0" class="text">
    
              <tr>
                <td colspan="2"><textarea name="content" cols="65" rows="25"><?php echo "$content"; ?></textarea></td>
              </tr>
              <tr>
                <td width="76%"><div align="left">
                    <?php 
			$filename = "../themes/$settings[skin]/content.php";
			if (is_writable("$filename")){
			echo "$lang_can_edit";
			}
			else
			{
			echo "$lang_cant_edit";
			}
			?>
                </div></td>
                <td width="24%"><div align="right"><a href="#top"><?php echo "$lang_top"; ?></a> | <a href="#bottom"><?php echo "$lang_bottom"; ?></a> </div></td>
              </tr>
            </table></fieldset></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><fieldset id="titlediv">
      <legend><a name="index" id="index"></a><?php echo"$lang_indexphp"; ?></legend><table width="100%" border="0" class="text">

              <tr>
                <td colspan="2"><textarea name="index" cols="65" rows="25"><?php echo "$index"; ?></textarea></td>
              </tr>
              <tr>
                <td width="76%"><div align="left">
                    <?php 
			$filename = "../themes/$settings[skin]/index.php";
			if (is_writable("$filename")){
			echo "$lang_can_edit";
			}
			else
			{
			echo "$lang_cant_edit";
			}
			?>
                </div></td>
                <td width="24%"><div align="right"><a href="#top"><?php echo "$lang_top"; ?></a> | <a href="#bottom"><?php echo "$lang_bottom"; ?></a></div></td>
              </tr>
            </table></fieldset></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><a name="bottom" id="bottom"></a>
            <input type="submit" name="Submit" value="<?php echo "$lang_submit"; ?>" id="submit" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table>
</form>
</div>
<?php
include ("footer.php");
?>
Return current item: ZompLog