template_dir = 'views'; $smarty->compile_dir = 'cache/compiled'; $smarty->auto_literal = true; //Global Vars $baseUrl = str_replace("/index.php","", $_SERVER['PHP_SELF']); $smarty->assign("baseUrl", $baseUrl); $smarty->assign("assetsDir", $baseUrl.'/assets'); $smarty->assign("configs", $configs); //Routes $uri = (string) isset($_GET['url']) ? $_GET['url'] : ''; $url = explode("/", $uri); $key = $url[0] ? $url[0] : 'home'; $action = $url[1] ? $url[1] : 'index'; $smarty->assign("key", $key); //Allowed Image Sizes; $allowedSizes= array('300x300', '140x140','60x60', '80x80', '1000x1000', '825x525'); $langs = $bd->table('el_languages')->get(); for($i=0; $iconfigLoad('lang/'.$langinfo[$_SESSION['lan_id']].'/base.txt'); if($key=='img'){ include('views/'.$key.'/controller.php'); } elseif(file_exists('./views/'.$key.'/controller.php')){ if(file_exists('./lang/'.$langinfo[$lan_id].'/'.$key.'.txt')){ $smarty->configLoad('lang/'.$langinfo[$lan_id].'/'.$key.'.txt'); } include('views/'.$key.'/controller.php'); } elseif($key == 'idioma'){ $_SESSION['lan_id'] = $action; header("Location: /"); } else{ include('views/contents/controller.php'); }