template_dir = './templates'; $smarty->compile_dir = './smarty/templates_c'; $smarty->cache_dir = './smarty/cache'; $smarty->config_dir = './smarty/configs'; $smarty->plugins_dir[] = './smarty/plugins'; $smarty->trusted_dir = array('./includes', './templates'); $smarty->security = true; $smarty->cache_lifetime = 7200; $smarty->force_compile = true; $smarty->compile_check = false; $smarty->use_sub_dirs = true; $smarty->caching = false; session_name("IOANNATINOSID"); session_start(); date_default_timezone_set("Europe/Athens"); if(isset($_GET['locale'])) { if($_GET['locale']=="el") { $_SESSION['locale'] = "1"; $smarty->assign('LANGUAGE', "el"); setlocale(LC_ALL, 'el_GR.utf8'); } elseif($_GET['locale']=="en") { $_SESSION['locale'] = "2"; $smarty->assign('LANGUAGE', "en"); setlocale(LC_ALL, 'en_US'); } elseif($_GET['locale']=="it") { $_SESSION['locale'] = "3"; $smarty->assign('LANGUAGE', "it"); setlocale(LC_ALL, 'it_IT.utf8'); } elseif($_GET['locale']=="es") { $_SESSION['locale'] = "4"; $smarty->assign('LANGUAGE', "es"); setlocale(LC_ALL, 'es_AR.utf8'); } else { $_SESSION['locale'] = "1"; $smarty->assign('LANGUAGE', "el"); setlocale(LC_ALL, 'el_GR.utf8'); } if(isset($_SERVER['HTTP_REFERER'])) { if(strpos($_SERVER['HTTP_REFERER'], 'http://www.ioannatinos.gr/')===0 || strpos($_SERVER['HTTP_REFERER'], 'https://www.ioannatinos.gr/')===0 || strpos($_SERVER['HTTP_REFERER'], 'https://localhost/~giannis/ioannatinos')===0) { header("Location: ".$_SERVER['HTTP_REFERER']); exit(); } header("Location: http://www.ioannatinos.gr/"); exit(); } } elseif(isset($_SESSION['locale'])) { if($_SESSION['locale']=="1") { setlocale(LC_ALL, 'el_GR.utf8'); $smarty->assign('LANGUAGE', "el"); } elseif($_SESSION['locale']=="2") { setlocale(LC_ALL, 'en_US'); $smarty->assign('LANGUAGE', "en"); } elseif($_SESSION['locale']=="3") { setlocale(LC_ALL, 'it_IT.utf8'); $smarty->assign('LANGUAGE', "it"); } elseif($_SESSION['locale']=="4") { setlocale(LC_ALL, 'es_AR.utf8'); $smarty->assign('LANGUAGE', "es"); } else { $_SESSION['locale'] = "1"; setlocale(LC_ALL, 'el_GR.utf8'); $smarty->assign('LANGUAGE', "el"); } } else { $_SESSION['locale'] = "1"; setlocale(LC_ALL, 'el_GR.utf8'); $smarty->assign('LANGUAGE', "el"); } bindtextdomain("weblabs", "./locale"); textdomain("weblabs"); $_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'homepage'; switch($_action) { case "villa": $templateoverride = "2.html"; $smarty->assign('BUTTON2', "current"); break; case "studios": $templateoverride = "3.html"; $smarty->assign('BUTTON3', "current"); break; case "gallery": $templateoverride = "4.html"; $smarty->assign('BUTTON4', "current"); break; case "contact": $templateoverride = "5.html"; $smarty->assign('BUTTON5', "current"); break; default: $templateoverride = "1.html"; $smarty->assign('BUTTON1', "current"); break; } if(isset($templateoverride)) $smarty->assign_by_ref('SMARTYTEMPLATE', $templateoverride); else $smarty->assign('SMARTYTEMPLATE', "1.html"); $smarty->display('0.html'); ?>