$langname){ if( !$f ) $html .= " | "; else $f = false; if($currlang !== $lang) $html .= "{$langname['caption']}"; else $html .= "{$langname['caption']}"; } return $html; } function nocache(){ header('Expires: Wed, 22 Jul 1998 12:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Pragma: no-cache'); header('Cache-Control: no-cache, no-store, must-revalidate'); header('Cache-Control: pre-check=0, post-check=0', false); } function isAppleDevice(){ $uagent = $_SERVER['HTTP_USER_AGENT']; } session_start(); error_reporting(3); $languages = array( 'default' => 'en', 'data'=>array( 'en' => array( 'caption' => 'eng', 'pages' => array( 'home', 'about-us', 'world-factor-show', 'judit-polgar-chessplayground', 'press', 'agency', 'contact' ) ), 'hu' => array( 'caption' => 'hun', 'pages' => array( 'fooldal', 'rolunk', 'world-factor-show', 'polgar-judit-sakkjatszotere', 'sajto', 'reklamugynokseg', 'kapcsolat' ) ) ) ); $langlist = &$languages['data']; if(isset($_GET['setlang'])){ $lng = $_GET['setlang']; if(isset($languages['data'][$lng])) // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// $bname = str_replace('.html','',basename($_SERVER['HTTP_REFERER'])); $slang = basename(strrchr(dirname($_SERVER['HTTP_REFERER']),'/')); if(!is_null($slang) && isset($languages['data'][$slang])){ $bname = !is_null($bname) ? $bname : ''; if(!is_null($bname)) redirect($lng . '/' . $languages['data'][$lng]['pages'][array_search($bname, $languages['data'][$slang]['pages'])] . '.html'); } redirect($lng . '/' . $languages['data'][$lng]['pages'][0] . '.html', $lng); //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! REFERER } $doctitle = ''; $action = @$_GET['action']; $layout = 'default'; $lang = @$_GET['lang']; $lngc = @$_COOKIE['lang']; if(!isset($languages['data'][$lang])) { if(!is_null($lngc) && isset($languages['data'][$lngc])) redirect($lngc . '/' . $languages['data'][$lngc]['pages'][0] . '.html'); redirect($languages['default'] . '/' . $languages['data'][$languages['default']]['pages'][0] . '.html', $languages['default']); } if(!preg_match('/[a-z0-9\-\_]/mis', $action) || !is_file("templates/$lang/$action.php")) { redirect($lang . '/' . $languages['data'][$lang]['pages'][0] . '.html'); } $titles=array( 'hukapcsolat' => 'Kapcsolat', 'encontact' => 'Contact', ); // ### Select Layout ### switch($lang . $action){ case "hurolunk": case "husajto": case "enabout-us": $layout = 'layout2'; break; case "hureklamugynokseg": case "enagency": $layout = 'layout3'; break; case "hukapcsolat": case "encontact": $layout = "layout2"; break; case "hupolgar-judit-sakkjatszotere": case "enjudit-polgar-chessplayground": case "huworld-factor-show": case "enworld-factor-show": $layout = "layout3"; } $layout .= '.php'; $active[$action] = ' class="active"'; if(is_file("actions/$action.php")) include "actions/$action.php"; //echo "action = " . $action . "
"; //echo "layout = " . $layout . "
"; header("Content-Type: text/html; charset=UTF-8"); include_once "layouts/$lang/$layout"; ?>