Location: PHPKode > projects > HuMo-gen > admin/include/settings_admin.php
<?php
// *** Safety line ***
if (!defined('ADMIN_PAGE')){ exit; }

echo '<h1 align=center>'.$language["setting_name"].'</h1>';

print '<p align=center>';

	//ALS MAGIC QUOTES AAN STAAN, DIT ONGEDAAN MAKEN:
	if (isset($_POST['optie_wijzig'])){
		function stripslashes_array($data) {
			if (is_array($data)){
				foreach ($data as $key => $value){
					$data[$key] = stripslashes_array($value);
				}
				return $data;
			}else{
				return stripslashes($data);
			}
		}
		if (get_magic_quotes_gpc()==1) {
			$_POST = stripslashes_array($_POST);
		}

	// *** Instellingen ***
	// Dit item moet aan het begin i.v.m. gewijzigde instellingen.
		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["default_skin"])."' WHERE setting_variabele='default_skin'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["default_language"])."' WHERE setting_variabele='default_language'") or die(mysql_error());
		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["default_language_admin"])."' WHERE setting_variabele='default_language_admin'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["database_naam"])."' WHERE setting_variabele='database_naam'") or die(mysql_error());
		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["homepage"])."' WHERE setting_variabele='homepage'") or die(mysql_error());
		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["homepage_omschrijving"])."' WHERE setting_variabele='homepage_omschrijving'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["rss_link"])."' WHERE setting_variabele='rss_link'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".$_POST["zoekmachine"]."' WHERE setting_variabele='zoekmachine'") or die(mysql_error());
		$result = mysql_query("UPDATE humo_settings SET setting_value='".$_POST["optierobots"]."' WHERE setting_variabele='optierobots'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["parenteel_generaties"])."' WHERE setting_variabele='parenteel_generaties'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["personen_weergeven"])."' WHERE setting_variabele='personen_weergeven'") or die(mysql_error());

		$result = mysql_query("UPDATE humo_settings SET setting_value='".addslashes($_POST["url_rewrite"])."' WHERE setting_variabele='url_rewrite'") or die(mysql_error());
	}

	//Variabelen hier inlezen, anders zie je de wijzigingen niet.
	include("../include/settings_global.php"); //Variabelen

	// ========== DO THIS HERE - LATER IT CREATES VALIDATION PROBLEMS
	$arr_count=0; $arr_count_admin=0;
	$map=opendir('../languages/');
	while (false!==($file = readdir($map))) {
		if (strlen($file)<5 AND $file!='.' AND $file!='..'){
			// *** Get language name ***
			include("../languages/".$file."/language_data.php");
			$langs[$arr_count][0]=$language["name"];
			$langs[$arr_count][1]=$file;
			$arr_count++;
			if (file_exists('../languages/'.$file.'/language_admin.php')){
				$langs_admin[$arr_count_admin][0]=$language["name"];
				$langs_admin[$arr_count_admin][1]=$file;
				$arr_count_admin++;
			}
		}
	}
	closedir($map);
	//==============

	print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?instellingen=1">';
	echo '<input type="hidden" name="page" value="'.$page.'">';
	echo '<table class="humo standaard" border="1">';
	//echo '<table border="1" width="100%">';

	echo '<tr class="tabel_kop"><th>'.$language["setting_option"].'</th><th>'.$language["setting_setting"].'</th></tr>';

	print '<tr bgcolor="green"><th><font color="white">'.$language["setting_general"].'</font></th><th><input type="Submit" name="optie_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	echo '<tr><td>'.$language["setting_lang_skin"].'</td><td><select size="1" name="default_skin">';
		print '<option value="">Standard</option>';

		$map=opendir('../styles/');
		while (false!==($file = readdir($map))) {
			if (substr($file,-4,4)=='.css') {
				$theme_map[]=$file;
			}
		}
		closedir($map);

		for ($i=0; $i<count($theme_map); $i++){
			$theme=$theme_map[$i];
			$theme=str_replace(".css","", $theme);
			$select=''; if ($humo_option['default_skin']==$theme){ $select=' SELECTED'; }
			print '<option value="'.$theme.'"'.$select.'>'.$theme.'</option>';
		}
	echo "</select>";
	echo '</td></tr>';

	echo '<tr><td>'.$language["setting_lang_humo"].'</td><td><select size="1" name="default_language">';

		if($langs) {
			for($i=0; $i<count($langs); $i++) {
				$select=''; if ($humo_option['default_language']==$langs[$i][1]){ $select=' SELECTED'; }
				print '<option value="'.$langs[$i][1].'"'.$select.'>'.$langs[$i][0].'</option>';
			}
		}

	echo "</select>";
	echo '</td></tr>';

	echo '<tr><td>'.$language["setting_lang_admin"].'</td><td><select size="1" name="default_language_admin">';

		if($langs_admin) {
			for($i=0; $i<count($langs_admin); $i++) {
				$select=''; if ($humo_option['default_language_admin']==$langs_admin[$i][1]){ $select=' SELECTED'; }
				print '<option value="'.$langs_admin[$i][1].'"'.$select.'>'.$langs_admin[$i][0].'</option>';
			}
		}

	echo "</select>";
	echo '</td></tr>';

	echo '<tr><td>'.$language["setting_stopsearchengines"].'</td><td><select size="1" name="zoekmachine">';
	if ($humo_option["zoekmachine"]=='j'){
		print '<option value="j" SELECTED>'.$language["admin_yes"].'</option>';
		print '<option value="n">'.$language["admin_no"].'</option>';
	}
	else{
		print '<option value="n" SELECTED>'.$language["admin_no"].'</option>';
		print '<option value="j">'.$language["admin_yes"].'</option>';
	}
	echo "</select><br>";

	print "<textarea cols=80 rows=1 name=\"optierobots\" style='height: 20px;'>".htmlentities($humo_option["optierobots"],ENT_NOQUOTES)."</TEXTAREA></td></tr>";

	echo '<tr><td valign="top">url_rewrite<br>'.$language["setting_url_rewrite"].'</td><td><select size="1" name="url_rewrite">';
	if ($humo_option["url_rewrite"]=='j'){
		print '<option value="j" SELECTED>'.$language["admin_yes"].'</option>';
		print '<option value="n">'.$language["admin_no"].'</option>';
	}
	else{
		print '<option value="n" SELECTED>'.$language["admin_no"].'</option>';
		print '<option value="j">'.$language["admin_yes"].'</option>';
	}
	echo '</select> <b>'.$language["setting_url_rewrite2"].'</b><br>';
	echo 'URL&nbsp;&nbsp;: http://www.website.nl/humo-php/gezin.php?id=F12<br>';
	echo $language["setting_url_rewrite3"].' http://www.website.nl/humo-php/gezin/F12/<br>';
	echo '</td></tr>';

	print '<tr bgcolor=green><th><font color=white>'.$language["setting_mainmenu"].'</font></th><th><input type="Submit" name="optie_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><td>'.$language["setting_websitename"].'</td>';
	print '<td><input type="text" name="database_naam" value="'.$humo_option["database_naam"].'" size="40"></td></tr>';

	print '<tr><td>'.$language["setting_homepagelink"].'<br>'.$language["setting_linkdescription"].'</td>';
	print '<td><input type="text" name="homepage" value="'.$humo_option["homepage"].'" size="40"> '.$language["setting_link"].'<br>';
	print '<input type="text" name="homepage_omschrijving" value="'.$humo_option["homepage_omschrijving"].'" size="40"></td>';
	print "</tr>";

	// *** Verjaardagen RSS ***
	echo '<tr><td>'.$language["setting_linkbirth_rss"].'</td><td>';

	print '<input type="text" name="rss_link" value="'.$humo_option["rss_link"].'" size="40"> '.$language["setting_link"].'<br>';
	print '<i>'.$language["setting_linkbirth_rss2"].'</i>';

	// *** FAMILY ***
	print '<tr bgcolor=green><th><font color=white>'.$language["setting_familyscreen"].'</font></th><th><input type="Submit" name="optie_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	print '<tr><td style="white-space:nowrap;">'.$language["setting_generations_nr"].'</td>';
	print '<td><textarea cols=3 rows=1 name="parenteel_generaties" style="height: 20px;">'.$humo_option["parenteel_generaties"].'</TEXTAREA> '.$language["setting_generations_nr2"].'</td>';
	print "</tr>";

	print '<tr><td style="white-space:nowrap;">'.$language["setting_search_pers"].'</td>';
	print '<td><textarea cols=3 rows=1 name="personen_weergeven" style="height: 20px;">'.$humo_option["personen_weergeven"].'</TEXTAREA> '.$language["setting_search_pers2"].'</td>';
	print '</tr>';

	print '<tr bgcolor=green><th><font color=white>'.$language["setting_keepallchanges"].'</font></th><th><input type="Submit" name="optie_wijzig" value="'.$language["admin_change"].'"></th></tr>';

	echo '</table>';
	print '</form>';
?>
Return current item: HuMo-gen