template_dir = PATH_TPL; $tpl->compile_dir = PATH_TPL.'cache/'; // Post engine $posts = new Posts(); // Getting structure //$path = new Path('/kz'); if (LANG_SITE=='/') $path = new Path(); else $path = new Path(LANG_SITE); $_page = $path->getPage(); if($_page["id"]) $_cont = $path->getCont($_page["id"]); $ln = $path->a_path; array_shift($ln); if ($ln) $tpl->assign("lng_uri",implode('/',$ln).'/'); // Prepare template varibles // uri if(count($path->a_path)>1) { foreach($path->a_path as $k=>$v){ $i = $k-1; $str = "uri".$i; if($k > 0) $tpl->assign($str, $v); } } else $tpl->assign("uri0", ""); // page info $title_page = @$_cont["title"]; if (LANG_SITE_SH!='') $title_page = @$_cont["title_".LANG_SITE_SH]; $_page_tpl = array( "id" => @$_page["id"], "pid" => @$_page["pid"], "title" => $title_page, "keywords" => @$_cont["keywords"], "description" => @$_cont["description"], "content" => @$_cont["content"], "name" => @$_page["name"], "sys_name" => @$_page["sys_name"], ); // Check page access if(isset($_page["access"]) && is_array($_page["access"]) && !in_array($_SESSION["user"]["gid"], $_page["access"])) $_page_tpl["content"] = $tpl->fetch("system/page-auth.tpl"); $tpl->assign("_backuri", base64_encode($_SERVER["REQUEST_URI"])); $tpl->assign("_page", $_page_tpl); $tpl->assign("_user", $_SESSION["user"]); $_bread_crumps = $path->b_path ; $tpl->assign("_bread_crumps", $_bread_crumps ); $tpl->assign("_bread_crumps_count", count( $_bread_crumps ) ); // Additions functions include_once(PATH_FNS."user.functions.php"); $tpl->assign("ArrayVote",GetVoteInfo()); $tpl->assign("_sitemap",load_sitemap($path->a_path)); $tpl->assign("_today",date("d.m.Y")); $tpl->assign("menu",showmenu('main')); // Load blocks //$last_uri = $path->a_path[count($path->a_path)-1]; $pid = isset( $_page['id'] ) ? $_page['id'] : 0 ; // $bl = new Block(); $bl->loadBlocks($_page['tid'], $pid ); $tpl->assign("_css_list", base64_encode(implode(',',$css_list)) ); // Display print page if(__get("print") && __get("print") == 1) $tpl->display("print.tpl"); // Display template else $tpl->display($_page["tpl"]); exit; ?>