<?php
require("config.php");

if(is_mobile()){
	$urls = explode("?", $_SERVER['REQUEST_URI']);
	if(count($urls) == 2){
		header("location:wap.php?".$urls[1]);
	}else{
		if(is_array($_GET)){
			$url_param = "?";
			foreach($_GET as $k=>$v){                        
				$url_param .= $k."=".$v."&";
				if(current($_GET) === end($_GET)){}
			}
			header("location:/wap.php".$url_param);
		}else{
			header("location:wap.php");
		}
	}
}

//require("custom_ctrl.php");

$spConfig['controller_path'] = APP_PATH.'/modules/'.basename(__FILE__,".php");
$tpl_dir = "default";
$spConfig['view']['config']['template_dir'] = APP_PATH.'/template/'.$tpl_dir; 


require(SP_PATH."/SpeedPHP.php");
import(APP_PATH.'/modules/default/bsController.php');
spRun();