$v) { unset($process[$key][$k]); if (is_array($v)) { $process[$key][stripslashes($k)] = $v; $process[] = &$process[$key][stripslashes($k)]; } else { $process[$key][stripslashes($k)] = stripslashes($v); } } } unset($process); } define("INCLUDE_PATH",dirname(__FILE__)); define("TEMPLATE_PATH",INCLUDE_PATH.DIRECTORY_SEPARATOR."templates"); require_once(INCLUDE_PATH.DIRECTORY_SEPARATOR."ver3_config.php"); function __autoload($class_name) { $filename=INCLUDE_PATH.DIRECTORY_SEPARATOR.$class_name.".class.php"; if (!file_exists($filename)) return false; include $filename; } $route_string=$_GET["route"]; $route_array=explode("/",$route_string); $routes=array( array( "path"=>"/", "class"=>"text", "act"=>"home", "vars"=>array(), ), array( "path"=>"captcha", "class"=>"captcha", "act"=>"img", "vars"=>array(), ), array( "path"=>"franchise", "class"=>"text", "act"=>"franchise", "vars"=>array(), ), array( "path"=>"geo/change/city", "class"=>"geo", "act"=>"changeCity", "vars"=>array(), ), array( "path"=>"reader/books", "class"=>"reader", "act"=>"books", "vars"=>array(), ), array( "path"=>"reader/delete", "class"=>"reader", "act"=>"delete", "vars"=>array("id"=>$route_array[2]), ), array( "path"=>"reader/favorite", "class"=>"reader", "act"=>"favorite", "vars"=>array("id"=>$route_array[2],"f"=>$route_array[3]), ), array( "path"=>"reader/mark", "class"=>"reader", "act"=>"mark", "vars"=>array("id"=>$route_array[2],"m"=>$route_array[3]), ), array( "path"=>"reader/list/book", "class"=>"reader", "act"=>"book", "vars"=>array("id"=>$route_array[3]), ), array( "path"=>"reader/list", "class"=>"reader", "act"=>"list", "vars"=>array(), ), array( "path"=>"reader/add", "class"=>"reader", "act"=>"edit", "vars"=>array("act"=>"add"), ), array( "path"=>"reader/edit", "class"=>"reader", "act"=>"edit", "vars"=>array("act"=>"edit","id"=>$route_array[2]), ), array( "path"=>"reader/send", "class"=>"reader", "act"=>"send", "vars"=>array(), ), array( "path"=>"reader", "class"=>"reader", "act"=>"swf", "vars"=>array(), ), array( "path"=>"restore/check", "class"=>"restore", "act"=>"check", "vars"=>array(), ), array( "path"=>"restore/success", "class"=>"restore", "act"=>"success", "vars"=>array(), ), array( "path"=>"restore", "class"=>"restore", "act"=>"form", "vars"=>array(), ), array( "path"=>"activation2/check1", "class"=>"activation2", "act"=>"check1", "vars"=>array(), ), array( "path"=>"activation2/check2", "class"=>"activation2", "act"=>"check2", "vars"=>array(), ), array( "path"=>"activation2/success", "class"=>"activation2", "act"=>"success", "vars"=>array(), ), array( "path"=>"activation2/step2", "class"=>"activation2", "act"=>"step2", "vars"=>array(), ), array( "path"=>"activation2", "class"=>"activation2", "act"=>"form", "vars"=>array(), ), array( "path"=>"activation/ajax", "class"=>"activation", "act"=>"ajax", "vars"=>array(), ), array( "path"=>"activation/success", "class"=>"activation", "act"=>"success", "vars"=>array(), ), array( "path"=>"activation", "class"=>"activation", "act"=>"form", "vars"=>array(), ), array( "path"=>"about/how", "class"=>"about", "act"=>"how", "vars"=>array(), ), array( "path"=>"about/pay", "class"=>"about", "act"=>"pay", "vars"=>array(), ), array( "path"=>"about/why", "class"=>"about", "act"=>"why", "vars"=>array(), ), array( "path"=>"about/author", "class"=>"about", "act"=>"author", "vars"=>array(), ), array( "path"=>"tv/get", "class"=>"tv", "act"=>"getData", "vars"=>array(), ), array( "path"=>"tv", "class"=>"tv", "act"=>"tv", "vars"=>array(), ), array( "path"=>"comments/get", "class"=>"comments", "act"=>"get", "vars"=>array("start"=>$route_array[2]), ), array( "path"=>"comments", "class"=>"comments", "act"=>"list", "vars"=>array(), ), array( "path"=>"list", "class"=>"lessons", "act"=>"list", "vars"=>array(), ), array( "path"=>"lessons", "class"=>"lessons", "act"=>"list", "vars"=>array(), ), array( "path"=>"explain/download", "class"=>"explain", "act"=>"download", "vars"=>array("lesson_number"=>$route_array[2]), ), array( "path"=>"explain/upload", "class"=>"explain", "act"=>"upload", "vars"=>array("lesson_number"=>$route_array[2]), ), array( "path"=>"explain", "class"=>"explain", "act"=>"explain", "vars"=>array("lesson_number"=>$route_array[1]), ), array( "path"=>"questions/get", "class"=>"questions", "act"=>"get", "vars"=>array("start"=>$route_array[2]), ), array( "path"=>"questions", "class"=>"questions", "act"=>"list", "vars"=>array(), ), array( "path"=>"about", "class"=>"about", "act"=>"about", "vars"=>array(), ), array( "path"=>"contact/send", "class"=>"contact", "act"=>"send", "vars"=>array("franchise"=>$route_array[2]), ), array( "path"=>"contact", "class"=>"contact", "act"=>"contact", "vars"=>array("message"=>$route_array[1]), ), array( "path"=>"oauth/vk", "class"=>"oauth", "act"=>"vk", "vars"=>array(), ), array( "path"=>"oauth/fb", "class"=>"oauth", "act"=>"fb", "vars"=>array(), ), array( "path"=>"oauth/ml", "class"=>"oauth", "act"=>"ml", "vars"=>array(), ), array( "path"=>"autologin", "class"=>"sitepage", "act"=>"autologin", "vars"=>array("uid"=>$route_array[1],"code"=>$route_array[2]), ), array( "path"=>"logincheck", "class"=>"logout", "act"=>"checkDouble", "vars"=>array(), ), array( "path"=>"login", "class"=>"sitepage", "act"=>"login", "vars"=>array(), ), array( "path"=>"logout_double_page", "class"=>"logout", "act"=>"logoutDoublePage", "vars"=>array(), ), array( "path"=>"logout_double", "class"=>"logout", "act"=>"logoutDouble", "vars"=>array(), ), array( "path"=>"logout", "class"=>"logout", "act"=>"logout", "vars"=>array(), ), array( "path"=>"pay/freekassa/status.php", "class"=>"pay", "act"=>"freekassa", "vars"=>array(), ), array( "path"=>"pay/get", "class"=>"pay", "act"=>"get", "vars"=>array(), ), array( "path"=>"stats/stat", "class"=>"stats", "act"=>"stat", "vars"=>array("id"=>$route_array[2]), ), array( "path"=>"stats", "class"=>"stats", "act"=>"list", "vars"=>array(), ), array( "path"=>"games", "class"=>"games", "act"=>"list", "vars"=>array("cat_id"=>$route_array[1]), ), array( "path"=>"radio", "class"=>"radio", "act"=>"radio", "vars"=>array(), ), array( "path"=>"chat/update/img", "class"=>"chat", "act"=>"img", "vars"=>array(), ), array( "path"=>"chat/update/title", "class"=>"chat", "act"=>"title", "vars"=>array(), ), array( "path"=>"chat/ajax/get", "class"=>"chat", "act"=>"get", "vars"=>array(), ), array( "path"=>"chat/ajax/send", "class"=>"chat", "act"=>"send", "vars"=>array(), ), array( "path"=>"chat/ajax/delete", "class"=>"chat", "act"=>"delete", "vars"=>array("id"=>$route_array[3]), ), array( "path"=>"chat", "class"=>"chat", "act"=>"chat", "vars"=>array(), ), array( "path"=>"profile/edit", "class"=>"profile", "act"=>"edit", "vars"=>array(), ), array( "path"=>"profile", "class"=>"profile", "act"=>"profile", "vars"=>array("message"=>$route_array[1]), ), array( "path"=>"lesson/update", "class"=>"lesson", "act"=>"update", "vars"=>array(), ), array( "path"=>"getting.php", "class"=>"lesson", "act"=>"get", "vars"=>array("ls"=>$_GET["ls"]), ), array( "path"=>"stat.php", "class"=>"lesson", "act"=>"stat", "vars"=>array(), ), ); function find_route($routes,$path) { foreach ($routes as $route) { if (strlen($path) >= strlen($route["path"]) && $route["path"]==substr($path,0,strlen($route["path"]))) { return $route; } } return $routes[0]; } $route=find_route($routes,$route_string); require_once(INCLUDE_PATH."/ver3_".$route["class"].".class.php"); header('Content-type: text/html; charset=windows-1251'); $class_name="ver3_".$route["class"]; $class_action=$route["act"]."Action"; $page=new $class_name($route["vars"]); $page->$class_action(); $page->show();