Location: PHPKode > projects > chillyCMS > chillyCMS/modules/visitorcounter/backend.php
<?php
defined('DOIT') or die('Restricted access');

$editform .= "<br /><br />";
//read settings from database
$modsettings=explode(",",$modsettings);
$displayname=$modsettings[0];
$numberofdigits=$modsettings[1];
$digitstyle=$modsettings[2];

//display modulename?
$editform .= "<p>$mod_visitorcounter[lbl_displayname]</p><select size='1' name='displayname'>";
if ($displayname==1) {
	$editform .= "<option value='1' selected='selected'>$l_gen[lbl_yes]</option>";
	$editform .= "<option value='0'>$l_gen[lbl_no]</option>";
} else {
	$editform .= "<option value='1'>$l_gen[lbl_yes]</option>";
	$editform .= "<option value='0' selected='selected'>$l_gen[lbl_no]</option>";
}
$editform .= "</select><br /><br />";
//number of digits
$editform .= "<p>$mod_visitorcounter[lbl_digitnum]</p><select size='1' name='numberofdigits'>";
for ($i=3;$i<9;$i++) {
	if ($numberofdigits==$i) {
		$editform .= "<option value='$i' selected='selected'>$i</option>";
	} else {
		$editform .= "<option value='$i'>$i</option>";
	}
}
$editform .= "</select><br /><br />";
//style
$allowedext=array("jpg","jpeg","png","gif");
$styles=array("textonly"=>"textonly");
$handle = opendir(PATH."/modules/visitorcounter/images");
if ($handle) {
	while (false !== ($file = readdir($handle))) {
		if ($file != "." && $file != ".." && !is_dir($file)) {
			$fileending = explode(".",$file);
			$fileending = array_pop($fileending);
			if (in_array($fileending,$allowedext)) {
				$displayfile = substr($file, 0, -4);
				$styles[$displayfile] = $file;
			}
		}	
	}
}
if (empty($styles)) {
	$editform .= "<input type='hidden' name='digitstyle' value='textonly'>";
} else {
	asort($styles);
	$editform .= "<p>$mod_visitorcounter[lbl_style]</p><select size='1' name='digitstyle'>";
	foreach ($styles as $s=>$ds) {
		if ($digitstyle==$ds) {
			$editform .= "<option value='$ds' selected='selected'>$s</option>";
		} else {
			$editform .= "<option value='$ds'>$s</option>";
		}
	}
	$editform .= "</select><br /><br />";
}

//since the data is to be saved in an array, the order is important!
$specialsettings="displayname,numberofdigits,digitstyle";
?>
Return current item: chillyCMS