ini_set("magic_quotes_gpc", "off"); if($_SERVER['REMOTE_ADDR'] == "84.24.36.140") { ini_set("display_errors", "on"); } else { ini_set("display_errors", "off"); } ini_set("default_charset", "UTF-8"); error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); date_default_timezone_set("Europe/Amsterdam"); //session_start(); $imageRoot = "/"; $serverRoot = $_SERVER["DOCUMENT_ROOT"].$imageRoot; if(substr(strtolower($_GET["page"]),-4) != ".jpg" && substr(strtolower($_GET["page"]),-4) != ".png"){ include $serverRoot.'includes/redirect.php'; } include $serverRoot.'includes/connect.php'; include $serverRoot.'includes/functions.php'; include $serverRoot.'includes/lib/swift_required.php'; //include $serverRoot.'includes/facebook.php'; $flagArray = array("nl" => "Nederlands", "en" => "English", "de" => "Deutsch"); if(isset($_GET["page"]) && $_GET["page"] != ""){ $path = explode("/", $_GET["page"]); if($path[count($path) - 1] == ""){ array_pop($path); } if(count($flagArray) > 1){ if(isset($flagArray[strtolower($path[0])])){ $lang = strtolower($path[0]); array_shift($path); } else { $lang = "nl"; show404(); } } else { $lang = "nl"; } if(substr(strtolower($path[count($path)-1]),-4) == ".jpg" || substr(strtolower($path[count($path)-1]),-4) == ".png"){ getImage($path); } $langArray = getLanguage($lang); if($path[0] == "card"){ include $serverRoot."includes/card.php"; die(); } if(count($path) == 0){ $pageArray = getPage("home"); $path = array("home"); } else { $pageArray = getPage($path[0]); if($pageArray == false){ show404(); } switch($pageArray["menu_file"]){ /* case "home.php": if (isset($path[1])){ $newsItem = getItemData("news","",array("label" => $path[1],"active"=>1),true); $pageArray["menu_file"] = "news.php"; if(!isSet($newsItem) || count($newsItem) == 0){ show404(); } } break; */ case "news.php": if(isSet($path[1]) && !is_numeric($path[1])){ $itemArray = getItemData("news","",array("active"=>1,"label" => $path[1]),true); if(!isSet($itemArray) || count($itemArray) == 0){ show404(); } else { $pageArray['doctitle'] = $itemArray['doctitle']; $pageArray['description'] = $itemArray['description']; $pageArray['keywords'] = $itemArray['keywords']; } } elseif($_SERVER['REMOTE_ADDR'] == "84.24.36.140") { //$pageArray['menu_file'] = "news_facebook.php"; } break; case "products.php": if(isSet($path[1]) && !is_numeric($path[1])){ $catArray = getItemData("category","",array("active"=>1,"label" => $path[1]),true); if(!isSet($catArray) || count($catArray) == 0){ show404(); } else { $pageArray['doctitle'] = $catArray['doctitle']; $pageArray['description'] = $catArray['description']; $pageArray['keywords'] = $catArray['keywords']; } } if(isSet($path[2]) && !is_numeric($path[2])){ $productArray = getItemData("product",$catArray['id'],array("active"=>1,"label" => $path[2]),true); if(!isSet($productArray) || count($productArray) == 0){ show404(); } else { $pageArray['doctitle'] = $productArray['doctitle']; $pageArray['description'] = $productArray['description']; $pageArray['keywords'] = $productArray['keywords']; } } break; case "default.php": if (isset($path[1])){ $pageArray = getPage($path[1]); if($pageArray == false){ show404(); } elseif($pageArray['menu_file'] == "vacatures.php") { if(isSet($path[2])){ if(isSet($path[3]) && $path[3] != "contact"){ show404(); } if(isSet($path[4]) && $path[4] != getSetting('thanksUrl')){ show404(); } $itemArray = getItemData("job","",array("active"=>1,"label" => $path[2]),true); if(!isSet($itemArray) || count($itemArray) == 0){ show404(); } else { $pageArray['doctitle'] = $itemArray['doctitle']; $pageArray['description'] = $itemArray['description']; $pageArray['keywords'] = $itemArray['keywords']; } } } } break; case "contact.php": case "enquete.php": if(isset($path[1]) && $path[1] != getSetting('thanksUrl')){ show404(); } break; default: if(count($path) > 1){ show404(); } } } $canonical = false; } else { $browserLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); switch ($browserLang){ case "de": case "en": $lang = $browserLang; break; default: $lang = "nl"; break; } $langArray = getLanguage($lang); $pageArray = getPage("home"); $path = array("home"); $canonical = true; } $companyEmail = getSetting('companyEmail'); $menuArray = getMenus(); ?>