1) { $_APPREQ['uri'] = array_shift($temp_arr); $temp_arr = explode('&', array_shift($temp_arr) ); foreach ($temp_arr as $queryvariable) { list($key, $value) = explode('=', $queryvariable); $_APPREQ['query_string'][] = array( 'key' => $key, 'value' => $value ); } } // ajax handling if (isset($_GET['ajax']) && $_GET['ajax'] == 'true') { // this is implied with a uri starting with '/ajax', the GET is set in .htaccess // I know this is hacky, but let's just start with this and polish it later $_APPREQ['ajax'] = true; $_APPREQ['uri'] = substr($_APPREQ['uri'], 5); unset($_GET['ajax']); } else { $_APPREQ['ajax'] = false; } // build the rest of the request uri $temp_arr = explode('/', $_APPREQ['uri']); if ($_APPREQ['uri'] == '/') $_APPREQ['page'] = '/'; else $_APPREQ['page'] = $temp_arr[1]; array_shift($temp_arr); array_shift($temp_arr); if (count($temp_arr) == 0 || $temp_arr[0] == "") $_APPREQ['subpage'] = NULL; else $_APPREQ['subpage'] = $temp_arr; // xhtml is default output $_APPREQ['format'] = (isset($_CONF['defaults']['format'])) ? $_CONF['defaults']['format'] : 'xhtml'; // Turn off magic quoting ini_set('magic_quotes_gpc', 0); ini_set('magic_quotes_runtime', 0); // Do include's that would not otherwise get pulled in require_once SITE_LIB . '/autoload.php'; require_once SITE_LIB . '/debug.php'; ?>