Location: PHPKode > projects > ZompLog > plugins/captcha/admin_old.php
<?php
ob_start();

include_once("../../admin/functions.php");
include("../../admin/config.php");
include("../../admin/session.php");
include("../../admin/header.php");



$user = loadUser($_SESSION['login'],$link,$table_users);


if($_POST["Submit"]){
	$sql="UPDATE `ragersweb_captcha` SET `value` = '".$_POST["fontColor"]."' WHERE `setting` ='fontColor';";
	$result=mysql_query($sql, $link) or die("Died inserting data into db.  Error returned if any: ".mysql_error());
	
	$sql="UPDATE `ragersweb_captcha` SET `value` = '".$_POST["bgColor"]."' WHERE `setting` ='bgColor';";
	$result=mysql_query($sql, $link) or die("Died inserting data into db.  Error returned if any: ".mysql_error());
	
	$sql="UPDATE `ragersweb_captcha` SET `value` = '".$_POST["font"]."' WHERE `setting` ='font';";
	$result=mysql_query($sql, $link) or die("Died inserting data into db.  Error returned if any: ".mysql_error());
	
	$sql="UPDATE `ragersweb_captcha` SET `value` = '".$_POST["description"]."' WHERE `setting` ='headline';";
	$result=mysql_query($sql, $link) or die("Died inserting data into db.  Error returned if any: ".mysql_error());
	
	$sql="UPDATE `ragersweb_captcha` SET `value` = '".$_POST["message"]."' WHERE `setting` ='bug';";
	$result=mysql_query($sql, $link) or die("Died inserting data into db.  Error returned if any: ".mysql_error());
		
	header("Location: admin.php?message=updated plugin!");
	ob_end_flush();		
		
	
}


$query = "SELECT * FROM $prefix" . "_emoticons WHERE id = 1";
$result = mysql_query($query,$link);
$icons = mysql_fetch_array($result);
$iconset = $icons[iconset];

?>

<div id="submenu"><a href="../../admin/plugins.php" class="sub">plugins</a></div>


<div id="side">
<div class="title">&nbsp;</div>
<div class="box"><?php
if(!empty($messages)){
	displayErrors($messages);
}

elseif($_GET[message] && empty($messages)){
  	displayMessage($_GET[message]);
}

else{
  	echo "Configure the Captcha plugin.";
}  
  
?>
</div></div>


<div id="main">
<h1>Captcha</h1>
<br />
<?php 
$sql="SELECT * FROM $prefix" . "_captcha WHERE setting LIKE 'bgColor'";
$query=mysql_query($sql);
$bgColor=mysql_fetch_assoc($query);

$sql="SELECT * FROM $prefix" . "_captcha WHERE setting LIKE 'fontColor'";
$query=mysql_query($sql);
$fontColor=mysql_fetch_assoc($query);

$sql="SELECT * FROM $prefix" . "_captcha WHERE setting LIKE 'font'";
$query=mysql_query($sql);
$dbfont=mysql_fetch_assoc($query);

$sql="SELECT * FROM $prefix" . "_captcha WHERE setting LIKE 'bug'";
$query=mysql_query($sql);
$bug=mysql_fetch_assoc($query);

$sql="SELECT * FROM $prefix" . "_captcha WHERE setting LIKE 'headline'";
$query=mysql_query($sql);
$headline=mysql_fetch_assoc($query);

//Getting Fonts

$dir = opendir("./fonts"); 
	while ($file = readdir($dir)) {

			if (!is_dir($file) && $file !="." && $file !=".." ){
						
			$filetype=explode(".",$file);
			$filetype=$filetype[count($filetype)-1];
				
				if (strtolower($filetype)=="ttf" ){
						$fontlist[]=$file;	
				}
			} 			
	}				
	 
closedir($dir);

?>

<form action="admin.php" method="POST">
  <fieldset id="titlediv">
	<legend>Settings</legend>
	FontColory<br>
	<input type="text" value="<?php echo $fontColor["value"] ?>" size="20" name="fontColor" id="fontColor" ><br>
	BackgroundColor<br>
	<input type="text" value="<?php echo $bgColor["value"] ?>" size="20" name="bgColor" id="bgColor" ><br>
	Font<br>
	 <select name="font" id="font">
    	<?php 
    	foreach ($fontlist as $dirfont){
	 		if ($dbfont["value"]==$dirfont){$selected="selected='selected'";}
	 		else{$selected="";}
    		echo "<option value='".$dirfont."' ".$selected.">".$dirfont."</option>"; 
    	} 
    	?>
  	</select><br>
	Captcha Description (over the picture)<br> 
	<input type="text" value="<?php echo $headline["value"] ?>" size="100" name="description" id="description" ><br>
	Alarm Message<br> 
	<input type="text" value="<?php echo $bug["value"] ?>" size="100" name="message" id="message" ><br>
	</fieldset>
	
	<br />

    <input type="submit" name="Submit" value="Submit" />
</form>
<br />
<br />

</div>
<?php
include("../../admin/footer.php");
?>
Return current item: ZompLog