define("INCLUDE", "on"); $lng = "ru"; if(isset($_COOKIE['lng']) && $_COOKIE['lng'] == "ru") $lng = "ru"; if(isset($_COOKIE['lng']) && $_COOKIE['lng'] == "en") $lng = "en"; if(isset($_GET['lng']) && $_GET['lng'] == "ru") { setcookie("lng", "ru", time()+3600 * 24 * 30); $lng = "ru"; } elseif(isset($_GET['lng']) && $_GET['lng'] == "en") { setcookie("lng", "en", time()+3600 * 24 * 30); $lng = "en"; } require_once('inc/config.php'); require_once('inc/const.php'); require_once('inc/lib.php'); require_once ('libs/Smarty.class.php'); $smarty = new Smarty; $smarty->template_dir = "templates/"; $smarty->compile_dir = "templates_c/"; $smarty->config_dir = "configs/"; $content = array(); $data_array = array(); $mod = (isset($_GET['mod'])) ? delete_slashes($_GET['mod']) : ''; $id = (isset($_GET['id'])) ? delete_slashes($_GET['id']) : 1; include("inc/lastnews.inc.php"); switch($mod) { case 'pages': include("inc/page.php"); break; case 'news': include("inc/news.php"); break; default: include("inc/page.php"); } $content['lng'] = $lng; if ($mod!='news') { $id=(int)$id; $p_id = get_p_id($id); if ($p_id==0){$p_id = get_p_id_from_pages($id);} } else {$id=4;$p_id=4;} $data = array(); $data = get_all_top_menu($lng); $content['top_menu'] = $data; $data = array(); $data = get_all_side_menu($lng,$p_id); $content['side_menu'] = $data; $data = array(); $data = get_config_data($lng,$p_id); $content['config'] = $data; $content['mod'] = $mod; //print_r($content); $smarty->assign('title', $title); $smarty->assign('keywords', $keywords); $smarty->assign('description', $description); $smarty->assign('main_part_tpl', $main_part_tpl); $smarty->assign('content', $content); $smarty->assign('p_id', $p_id); if (($id==1)){ $smarty->display("main.tpl");} else {$smarty->display("other.tpl");} ?>