Location: PHPKode > projects > infoboard > infoboard/_req/savesetting.php
<?
session_start();
include("../data/connect.php");
include("../data/_uconfig.php");
include("../_class/lang.php");
include("../_class/lang_".$iscon["getlang"].".php");

include("../_class/_func.php");
include("../_class/class.global.php");

$infoboard = new global_infoboard();
$infoboard->checksess();
$infoboard->adminsess();

if(isset($_POST["showtopic"])) $showtopic = $_POST["showtopic"]; else $showtopic = 20;
if(isset($_POST["righttopic"])) $righttopic = $_POST["righttopic"]; else $righttopic = 5;
if(isset($_POST["numright"])) $numright = $_POST["numright"]; else $numright = 0;
if(isset($_POST["showreply"])) $showreply = $_POST["showreply"]; else $showreply = 5;
if(isset($_POST["imghot"])) $imghot = $_POST["imghot"]; else $imghot = 0;
if(isset($_POST["imgcool"])) $imgcool = $_POST["imgcool"]; else $imgcool = 0;

if(isset($_POST["showfont"])) $showfont = $_POST["showfont"]; else $showfont = 0;
if(isset($_POST["showInsertImage"])) $showInsertImage = $_POST["showInsertImage"]; else $showInsertImage = 0;
if(isset($_POST["showtable"])) $showtable = $_POST["showtable"]; else $showtable = 0;
if(isset($_POST["showcode"])) $showcode = $_POST["showcode"]; else $showcode = 0;


$print ="<?\n";
$print.="\$iscon[\"website\"] = \"".htmlspecialchars(stripslashes($_POST["website"]))."\";\n";
$print.="\$iscon[\"mailmaster\"] = \"".htmlspecialchars(stripslashes($_POST["mailmaster"]))."\";\n";
$print.="\$iscon[\"copyright\"] = \"".htmlspecialchars(stripslashes($_POST["copyright"]))."\";\n";
$print.="\$iscon[\"title\"] = \"".htmlspecialchars(stripslashes($_POST["title"]))."\";\n";
$print.="\$iscon[\"fullpath\"] = \"".htmlspecialchars(stripslashes($_POST["fullpath"]))."\";\n";
$print.="\$iscon[\"keywords\"] = \"".htmlspecialchars(stripslashes($_POST["keywords"]))."\";\n";
$print.="\$iscon[\"description\"] = \"".htmlspecialchars(stripslashes($_POST["description"]))."\";\n";
$print.="\$iscon[\"target\"] = \"".$_POST["target"]."\";\n";
$print.="\$iscon[\"maxsize\"] = ".$_POST["maxsize"].";\n";
$print.="\$iscon[\"fileext\"] = array(\"".eregi_replace(",", Chr(34).", ".Chr(34), $_POST['fileext'])."\");\n";
$print.="\$iscon[\"badword\"] = array(\"".eregi_replace(",", Chr(34).", ".Chr(34), $_POST['badword'])."\");\n";
$print.="\$iscon[\"keepregister\"] = array(\"".eregi_replace(",", Chr(34).", ".Chr(34), $_POST['keepregister'])."\");\n";
$print.="\$iscon[\"showtopic\"] = ".$showtopic.";\n";
$print.="\$iscon[\"righttopic\"] = ".$righttopic.";\n";
$print.="\$iscon[\"numright\"] = ".$numright.";\n";
$print.="\$iscon[\"showreply\"] = ".$showreply.";\n";
$print.="\$iscon[\"imgnew\"] = ".$_POST["imgnew"].";\n";
$print.="\$iscon[\"imghot\"] = ".$imghot.";\n";
$print.="\$iscon[\"imgcool\"] = ".$imgcool.";\n";

$separate = $_POST["separate"];
if($_POST["urlmod"] == 1) {
	 $print.="\$iscon[\"urlmod\"] = 1;\n";
	 $print.="\$iscon[\"_s\"] = \"".$separate."\";\n";
	 if($separate == "/"){
		  $print.="\$iscon[\"friendly\"] = ".$_POST["friendly"].";\n";
	 }else{
		  $print.="\$iscon[\"friendly\"] = false;\n";
	 }
}else{
	 $print.="\$iscon[\"urlmod\"] = 0;\n";
	 $print.="\$iscon[\"_s\"] = \".\";\n";
	 $separate = ".";
	 $print.="\$iscon[\"friendly\"] = false;\n";
}

$print.="\$iscon[\"showlevel\"] = ".$_POST["showlevel"].";\n";
$print.="\$iscon[\"boardinfo\"] = ".$_POST["boardinfo"].";\n";
$print.="\$iscon[\"showfont\"] = ".$showfont.";\n";
$print.="\$iscon[\"showInsertImage\"] = ".$showInsertImage.";\n";
$print.="\$iscon[\"showtable\"] = ".$showtable.";\n";
$print.="\$iscon[\"showcode\"] = ".$showcode.";\n";
$print.="\$iscon[\"lockuser\"] = ".$_POST["lockuser"].";\n";
$print.="\$iscon[\"stamppic\"] = ".$_POST["stamppic"].";\n";
$print.="\$iscon[\"textstamp\"] = \"".htmlspecialchars(stripslashes($_POST["textstamp"]))."\";\n";
$print.="\$iscon[\"showip\"] = ".$_POST["showip"].";\n";
$print.="\$iscon[\"showlang\"] = ".$_POST["showlang"].";\n";
$print.="\$iscon[\"getlang\"] = \"".$_POST["getlang"]."\";\n";
$print.="\$iscon[\"useronline\"] = ".$_POST["useronline"].";\n";
$print.="?>\n";

	     $path = "../data/_uconfig.php";
		 if(is_writable($path)){
			   $fp=fopen($path,"w");
			   fwrite($fp ,$print);  
			   fclose($fp);
			   if($_POST["urlmod"] == 1) {
				    if($separate == "/"){
						 refurl($iscon["lang"][105], "../infoboard/config".$separate."1");
					}else{
						 refurl($iscon["lang"][105], "../infoboard/config".$separate."1.html");
					}
			   }else{
				    refurl($iscon["lang"][105], "../?infoboard=config".$separate."1");

			   }
		 }

?>
Return current item: infoboard