include ("config.php");
include ("functions.php");
include ("themes/$theme/theme.php");
function read_signews($news){
include ("header.php");
global $theme;
$fd=file("misc/$news");
$title=explode("|",$fd[0]);
echo "
";
OpenTableTitle(" ".$title[0]);
echo " ";
for($j=1; $j ";
else if(stristr($fd[$j],"%%%")){
echo "
";
}
else
echo $fd[$j];
}
CloseTableTitle();
echo " |
";
}
switch($_POST['mod']){
case "delpubnews":
$mypass=stripslashes(htmlspecialchars($_POST['pass']));
$myfile=stripslashes(htmlspecialchars($_POST['file']));
if ($password == $mypass) {
unlink('misc/'.$myfile);
}
?>
break;
case "pubnews":
$mypass=stripslashes(htmlspecialchars($_POST['pass']));
$myfile=stripslashes(htmlspecialchars($_POST['file']));
if ($password == $mypass) {
copy('misc/'.$myfile,'news/'.str_replace("news_","",$myfile));
unlink('misc/'.$myfile);
generate_RSS();
}
?>
break;
case "readsignews":
$mypass=stripslashes(htmlspecialchars($_POST['pass']));
if ($password == $mypass) {
$handle = opendir('misc/'.$section);
while ($file = readdir($handle)) {
if (stristr($file, "news_")) {
read_signews($file);
echo "
";
print "
";
}
}
closedir($handle);
print "Indietro";
}
else
print "Password errata
Indietro";
break;
case "news":
$mypass=stripslashes(htmlspecialchars($_POST['pass']));
$myhead=stripslashes($_POST['head']);
$mybody=stripslashes($_POST['body']);
$mytitle=stripslashes(htmlspecialchars($_POST['title']));
$myicon=stripslashes(htmlspecialchars($_POST['icon']));
$myhead=str_replace("\n","
",$myhead);
$mybody=str_replace("\n","
",$mybody);
if($password==$mypass){
$fp=fopen("news/".time().".php","w");
fwrite($fp,"$mytitle|$myicon|0\n$myhead\n§§§\n$mybody\n%%%");
fclose($fp);
generate_RSS();
}?>
break;
case "motd":
$mypass=$_POST['pass'];
$mybody=stripslashes($_POST['body']);
#$mybody=str_replace("\n","
",$mybody);
if($password==$mypass){
$fp=fopen("misc/motd.php","w");
fwrite($fp,"$mybody");
fclose($fp);
}?>
break;
case "comment":
$myname=stripslashes(htmlspecialchars($_POST['name']));
$mybody=stripslashes(htmlspecialchars($_POST['body']));
$mybody=str_replace("\n","
",$mybody);
$fp=fopen("news/".$_POST['id'].".php","a");
fwrite($fp,"\n###\n$myname\n$mybody");
fclose($fp);
?>
break;
case "prev":
include "header.php";
$myhead=stripslashes($_POST['head']);
$mybody=stripslashes($_POST['body']);
$mytitle=stripslashes(htmlspecialchars($_POST['title']));
$myicon=stripslashes(htmlspecialchars($_POST['icon']));
$myhead=str_replace("\n","
",$myhead);
$mybody=str_replace("\n","
",$mybody);
echo "";
OpenTableTitle(" ".$mytitle);
echo "|
";
echo $myhead;
echo " |  | ";
CloseTableTitle();
echo "
|
";
OpenTableTitle(" ".$mytitle);
echo "
";
echo $myhead;
echo "
";
echo $mybody;
echo " |  | ";
CloseTableTitle();
echo " |
<<Torna Indietro
";
include "footer.php";
break;
case "signews":
$myhead=stripslashes($_POST['head']);
$myname=stripslashes($_POST['mionome']);
$mybody=stripslashes($_POST['body']);
$mytitle=stripslashes(htmlspecialchars($_POST['title']));
$myicon=stripslashes(htmlspecialchars($_POST['icon']));
$myhead=str_replace("\n","
",$myhead);
$mybody=str_replace("\n","
",$mybody);
$fp=fopen("misc/news_".time().".php","w");
fwrite($fp,"$mytitle|$myicon|0\n$myname ha scritto:
$myhead\n§§§\n$mybody\n%%%");
fclose($fp);
?>
break;
}
?>