Esempio n. 1
0
#              where this script is used.               #
#                                                       #
#    See readme.htm for further copyright information   #
#########################################################

include '../inc/functions.inc.php';
checklogin();
adminonlyaccess($_SESSION['loginlevel']);

drawheader('Edit Layout');
print'<table width="90%" border="0" cellspacing="1" cellpadding="0" align="center" class="rahmen">
	  	<tr class="tr3" valign="top">
    		<td colspan="3"><b>Hier kannst du das Layout der Ausgabeseite anpassen.</b>';

if ($_GET['go'] == 'save') {
	$_POST['content'] = unspecialchars($_POST['content']);
	
	$fp = fopen($_GET['file'],"w+");
	fputs($fp,$_POST['content']);
	fclose($fp);
	print '<br /><br /><b>Erfolgreich gespeichert</b>';
  }

print'</td></tr><tr class="tr1">';

  // Zeigt die Tabelle mit dem Textfield an
	print'<td valign="top"><form method="post" action="'.$_SERVER['PHP_SELF'].'?go=save&file='.$_GET['file'].'">
  				<div align="center">
					<textarea name="content" wrap="off" cols="70" rows="63">';
						$ef = $_GET['file'];
						$fp = fopen($ef,"r");
Esempio n. 2
0
}
#########################################
#########################################
#     Editierten Comment speichern      #
#########################################
if ($_GET['go'] == 'savecomment') {
    $zeile = file($cf);
    $zeilen = sizeof($zeile);
    for ($i = 0; $i < $zeilen; $i++) {
        $eintrag = explode('§', $zeile[$i]);
        if ($eintrag[0] == $_POST['nr']) {
            $eintrag[2] = unspecialchars($_POST['comment']);
            $eintrag[2] = cleantext($_POST['comment']);
            $eintrag[3] = unspecialchars($_POST['author']);
            $eintrag[3] = cleantext($_POST['author']);
            $eintrag[4] = unspecialchars($_POST['email']);
            $eintrag[4] = cleantext($_POST['email']);
        }
        $zeile[$i] = implode($eintrag, "§");
    }
    $fp = fopen($cf, "w+");
    flock($fp, 2);
    for ($i = 0; $i < $zeilen; $i++) {
        fwrite($fp, $zeile[$i]);
    }
    flock($fp, 3);
    fclose($fp);
    echo 'Comment gespeichert!';
}
#########################################
#########################################