Location: PHPKode > projects > php Blogger > admin/index.php
<?php
###############################
# index.php       version 1.1.#
###############################
include ('header.php');
?>
<div id="headermenu">Configuration</div>
<?php
if(isset($_POST['submit'])) {
	$sitedisabled = $_POST['sitedisabled'];
	$rewritemod = $_POST['rewritemod'];
	$sitetitle = $_POST['sitetitle'];
	$language = $_POST['language'];
	$themes = $_POST['themes'];
	$sitepath = $_POST['sitepath'];
	$sitemail = $_POST['sitemail'];
	if(get_magic_quotes_gpc()) {
		$sitedisabled = stripslashes($sitedisabled);
		$rewritemod = stripslashes($rewritemod);
		$sitetitle = stripslashes($sitetitle);
		$language = stripslashes($language);
		$themes = stripslashes($themes);
		$sitepath = stripslashes($sitepath);
		$sitemail = stripslashes($sitemail);
	}
	$sitedisabled = mysql_real_escape_string($sitedisabled);
	$rewritemod = mysql_real_escape_string($rewritemod);
	$sitetitle = mysql_real_escape_string($sitetitle);
	$language = mysql_real_escape_string($language);
	$themes = mysql_real_escape_string($themes);
	$sitepath = mysql_real_escape_string($sitepath);
	$sitemail = mysql_real_escape_string($sitemail);
	$name = array($sitedisabled,$rewritemod,$sitetitle,$language,$themes,$sitepath,
		$sitemail);
	foreach($name as $name) {
		if(strlen($name) < 1) {
			echo "<center>Field must be at least 1 characters long: <a href=\"javascript:history.go(-1)\">Go Back</a></center>";
			die();
		}
	}
$arecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$sitedisabled' WHERE optionid = 9");
$brecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$rewritemod' WHERE optionid = 10");
$crecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$sitetitle' WHERE optionid = 1");
$drecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$language' WHERE optionid = 5");
$erecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$themes' WHERE optionid = 7");
$frecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$sitepath' WHERE optionid = 4");
$grecordSet = &$conn->Execute("UPDATE abcoption SET valueopt = '$sitemail' WHERE optionid = 8");
$conn->Close();	
	echo "<div id ='information'>&nbsp;Successfully. ";
    ?>
<a href="index.php">Back to Configuration</a></div>
<?php
} else {
$dSet = &$conn->Execute('SELECT * FROM users where active = 3');
$count = $dSet->RecordCount();
if ($count > 0){
echo "<a href=\"user.php\">Members Waiting For Approval <span id=\"info\">[$count]</span></a><br /><br />";
}
if(!$dSet)
print $conn->ErrorMsg();
else
while(!$dSet->EOF) {
$dSet->MoveNext();
}
?>
<form method="post" action="index.php">
Enable Maintenance Mode<br />
<?php if($sitedisabled == 1) { ?>
<select style="background:#FFF6C1;" id="incc" name="sitedisabled">
<option value='1'>- Website is in maintenance mode</option>
<option style="background:#ffffff;" value='1'>---- Maintenance mode</option>
<option style="background:#ffffff;" value='2'>------ Production mode</option>
</select>
<?php } ?>
<?php if($sitedisabled == 2) { ?>
<select style="background:#EEFFE3;" id="incc" name="sitedisabled">
<option value='2'>-- Website in production mode</option>
<option style="background:#ffffff;" value='1'>---- Maintenance mode</option>
<option style="background:#ffffff;" value='2'>------ Production mode</option>
</select>
<?php } ?>
<br /><br />
Friendly URLs<br />
Requirements: Apache web server with the mod_rewrite module installed.<br />
<?php if($rewritemod == 1) { ?>
<select style="background:#EEFFE3;" id="incc" name="rewritemod">
<option value='1'>-- Friendly URLs Enabled</option>
<option style="background:#ffffff;" value='1'>---- Yes</option>
<option style="background:#ffffff;" value='2'>------ No</option>
</select>                               
<?php } ?>
<?php if($rewritemod == 2) { ?>
<select style="background:#FFF6C1;" id="incc" name="rewritemod">
<option value='2'>-- Friendly URLs Disabled</option>
<option style="background:#ffffff;" value='1'>---- Yes</option>
<option style="background:#ffffff;" value='2'>------ No</option>
</select>
<?php } ?>
<br /><br />
WebSite Name<br />
<input id="incc" type="text" name="sitetitle" value="<?php echo $sitetitle; ?>" size="35" />
<br /><br />
Language<br />
<input id="incc" name="language" value="<?php echo $language; ?>" />
<br /><br />
Template<br />
<input id="incc" type="text" name="themes" value="<?php echo $themes; ?>" />
<br /><br />
URL (http://www.example.com or http://www.example.com/folder)
<br /><input id="incc" type="text" name="sitepath" value="<?php echo $sitepath; ?>" size="35" />
<br /><br />
System Email<br />
<input id="incc" type="text" name="sitemail" value="<?php echo $sitemail; ?>" size="35" />
<br /><br />
<input type="submit" class="topicbuton" name="submit" value="Submit" /><br /><br />
</form>
<?php
$conn->Close();
}
?>
</div>
</div>
</div>
<?php include ('footer.php'); ?>
Return current item: php Blogger