<?php
$id = $HTTP_GET_VARS["site"];
$keyword = ( !empty($HTTP_GET_VARS['keyword']) ) ? $HTTP_GET_VARS['keyword'] : "";
$kid = $HTTP_GET_VARS["kid"];
$cat = "";
$lang = "";
$files = array("disclaimer" => "disclaimer.php",
"contact" => "contact.php",
"links" => "links.php",
"404" => "../errors/404.php",
"home" => "home.php",
"rememberit" => "projects/rememberit.php",
"tools" => "tools.php",
"internetsurfer" => "projects/internetsurfer.php",
"codelib" => "projects/codelib.php",
"counter" => "counter.php",
"impressum" => "contact.php"
);
# functions
function getFileName() {
global $cat;
global $lang;
global $files;
global $id;
if (strpos($id, "tut_") === 0) { #tutorials
$rsite = "tutorials.php";
$lang = substr($id, strpos($id, "_")+1, strlen($id));
#----------------------------------------------
} elseif (strpos($id, "inf_") === 0) { # tipps
$rsite = "info.php";
$cat = substr($id, strpos($id, "_")+1, strlen($id));
#----------------------------------------------
} elseif ($id == "") { # others
$rsite = "home.php";
#----------------------------------------------
} elseif ($id == "tipp_tp") { # tipps
$lang = "
tp";
$rsite = "tipps.php";
} elseif ($id == "tipp_delphi") {
$lang = "delphi";
$rsite = "tipps.php";
#----------------------------------------------
} elseif (($id == "lexikon") && ($keyword == "") && ($kid == "")) { # encyclopedia
$rsite = "lexikon/index.php";
} elseif (($id == "lexikon") && ($keyword != "") && ($kid == "")) {
$rsite = "lexikon/search_result.php";
} elseif (($id == "lexikon") && ($keyword == "") && ($kid != "")) {
$rsite = "lexikon/show_entry.php";
#----------------------------------------------
} else { # list
$rsite = $files[$id];
}
return $rsite;
}
?>
<?php
$s = getFileName();
if ($s == "") { $s = "../errors/404.php"; }
include("sites/".$s);
?>