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(isSet($_GET['preview'])){ $_SESSION['preview'] = true; } if(substr(strtolower($_GET["page"]),-4) != ".jpg" && substr(strtolower($_GET["page"]),-4) != ".png"){ include $serverRoot.'includes/redirect.php'; } if($_SERVER['HTTP_HOST'] == "werkenbij.mkgilze.nl" || $_SERVER['HTTP_HOST'] == "werkenbij.machineskennes.nl" || $_SERVER['HTTP_HOST'] == "werkenbij.machineskennes.com" || $_SERVER['HTTP_HOST'] == "careers.mkgilze.nl" || $_SERVER['HTTP_HOST'] == "careers.machineskennes.nl" || $_SERVER['HTTP_HOST'] == "careers.machineskennes.com"){ header("HTTP/1.1 301 Moved Permanently"); header("location: //www.machineskennes.com/nl/mk-gilze/vacatures"); die(); } 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", "fr" => "Français", "es" => "Espanol", "ru" => "Русский", "ar" => "Türkçe", "po" => "Polski", "gr" => "ελληνικά", "au" => "Australia",); if(isSet($_SESSION['preview'])){ $flagArray['ab'] = "Arabisch"; } if(isset($_GET["page"]) && $_GET["page"] != ""){ $path = explode("/", $_GET["page"]); if($path[count($path) - 1] == ""){ array_pop($path); } if(count($path) == 1 && $path[0] == "code"){ include $serverRoot."code.php"; die(); } 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": case "opendag.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": case "fr": case "pl": case "gr": case "es": case "tr": case "ru": $lang = $browserLang; break; default: $lang = "nl"; break; } $langArray = getLanguage($lang); $pageArray = getPage("home"); $path = array("home"); $canonical = true; } $companyEmail = getSetting('companyEmail'); $menuArray = getMenus(); $mapID = 4060; switch($lang){ case "de": $extraLogo = getItem(4051); $mapID = 4059; $extraLogo2 = getItem(4403); $mapID2 = 4402; break; case "fr": $extraLogo = getItem(4050); $mapID = 4058; break; case "po": $extraLogo = getItem(4049); $mapID = 4057; break; case "ar": $extraLogo = getItem(4048); $mapID = 4056; break; case "en": $extraLogo = getItem(4047); $mapID = 4055; break; case "ru": $extraLogo = getItem(4046); $mapID = 4054; break; case "es": $extraLogo = getItem(4045); $mapID = 4053; break; case "gr": $extraLogo = getItem(4044); $mapID = 4052; break; case "au": $extraLogo = getItem(4258); $mapID = 4259; break; } ?>