Location: PHPKode > projects > NodbForum > 0.1 Alfa/admined.php
<?php 
#############################################################################################
#																																														#
#																					NodbForum																					#
#																																														#
#					NodbForum is based on EasyForum developed by Host-Tings.		 											#
#					This program is distributed under the GPL license. Please read this for 					#
#					obtain more information.																													#
#																																														#
#		NodbForum is created, maintained and Copyright Guillermo Espert Carrasquer (el-eles)		#
#																																														#
#############################################################################################

include "global.php";
include "incl/pss.inc";
include "incl/head.inc";

if(!isset($topic))
{
	redirect("admin.php?f=$f");
}
else
{
	$file = "$data/$topic";
	file_allowed($topic);
} 

$fs = open_file($file);
$fs = explode("\n",$fs);

if(isset($line) && isset($subject) && isset($post))
{
	$line = (int)$line;
	$subject = str_replace(':|:','',$subject);
	$post = str_replace(':|:','',$post);
	$post = str_replace("\r",'',$post);
	$post = str_replace("\n",'<br />',$post);
	$subject = stripslashes($subject);
	$post = stripslashes($post);
	$row = explode(":|:",$fs[$line]);
	$row[1] = $subject;
	$row[3] = $post;
	$fs[$line] = implode(':|:',$row);
	$fs = implode("\n",$fs);
	save_file($file,$fs);
	die("<script type=\"text/javascript\">a='adminsh.php?f=$f&topic=$topic';window.location=a;</script></head></body><body></body></html>");
}
?>
</head>
<body>
<?php

for($i = 0; $i < count($fs); $i++)
{
	$row = explode(":|:",$fs[$i]);
	echo '<form action="admined.php" method="post">'."\n";
	echo '<input type="hidden" name="f" value="'.$f.'" />'."\n";
	echo '<input type="hidden" name="topic" value="'.$topic.'" />'."\n";
	echo '<input type="hidden" name="line" value="'.$i.'" />'."\n";
	echo '<input type="text" style="position:relative;width:60%" name="subject" value="'.$row[1].'" /><br />'."\n";
	$msg = str_replace('<br />',"\r\n",$row[3]);
	echo '<textarea cols="20" rows="8" name="post" style="position:relative;width:60%">'.$msg.'</textarea>'."\n";
	echo '<br /><input type="submit" value="Save" />'."\n";
	echo '</form><br />'."\n";
}
?>
</body>
</html>
Return current item: NodbForum