assign("_config",$_config); //DB_DataObject::debugLevel(1); session_start(); ereg("^(/([^/]*))?(/([^/]*))?(/([^/]*))?",$_SERVER['PATH_INFO'],$path_info); $requestedPage = $path_info[2]!="" ? rawurldecode($path_info[2]): "home"; $action = $path_info[4]!="" ? rawurldecode($path_info[4]): "index"; $id = $path_info[6]!="" ? rawurldecode($path_info[6]): null; if(isset($overide) && $overide!=""){ #If we are including this from within another script. list($requestedPage,$action,$id)=$overide; } if(!ereg('^[a-z_0-9]+$',$requestedPage)){$requestedPage="none";} if(!ereg('^[a-z_0-9-]+$',$action)){$action="none";} if($requestedPage=="install"){require_admin();std_run_initial_sql();die();} if($requestedPage=="basic_images"){send_image_to_browser($action,$id);die();} $controller_file = "controllers/".$requestedPage.".php"; $t->setRender($requestedPage."_".$action); //Sets what should be diplayed by default $t->assign('action',$action); $t->assign('controller',$requestedPage); $t->assign('id',$id); if(!file_exists(FILEROOT.$controller_file)){die("Sorry, page not found");} require(FILEROOT.$controller_file); $t->doRender(); ?>