template_dir = sitePath .'templates'; $smarty->compile_dir = sitePath .'templates_c'; @ini_set("url_rewriter.tags",""); //init zone //end init zone $obj_array=array( "index", "news", ); $smarty->assign("main_menu",displayChildren(0,0));//main menu require_once "class/news.class.php"; news::show(); /* if(isset($_SESSION["user"]["auth"])) { $smarty->assign("login_ok",1); $smarty->assign("user_info",login::getUserInfo()); if(null!=frmGet("try_logout")){ login::logout(); } }else{ if(null!=frmGet("try_login")){ $user=&new login(frmGet("username"),frmGet("password")); $smarty->assign("user_info",login::getUserInfo()); } } */ /* $sql="SELECT * from sections"; $grid=new dataGrid($sql,$config["db_db"]); $grid->showColumn("title"); print_r($grid->render()); */ $obj = isset($_REQUEST['obj'])?(in_array(@$_REQUEST['obj'],$obj_array)?$_REQUEST['obj']:"index"):"index"; $smarty->assign("obj",$obj); $action = isset($_REQUEST['action'])?$_REQUEST['action']:null; $smarty->assign("action",$action); if (null!=$obj){ $class_file_name = "$obj.class.php"; if(isFileInFolder($class_file_name,sitePath."class/")){ require_once sitePath."class/".$class_file_name; eval("\$obj = new $obj('$action');"); }else { $smarty->display("index" . templateExtension); } }else{ $smarty->display("error".templateExtension); } unset($user); unset($smarty); ?>