-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathblog.php
48 lines (40 loc) · 1.67 KB
/
blog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}
include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/customurlhandler.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/request.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
// get the configuration data
$config =& Config::getConfig();
// in order to maintain compatibility with previous version, and the alternative
// format of search-engine friendly urls
if( $config->getValue( "request_format_mode" ) == SEARCH_ENGINE_FRIENDLY_MODE ) {
lt_include( PLOG_CLASS_PATH."error.php" );
die();
}
$server = HttpVars::getServer();
$requestParser = new CustomUrlHandler();
$error = $requestParser->process($server["REQUEST_URI"]);
$vars = $requestParser->getVars();
$params = $requestParser->getParams();
$includeFile = $requestParser->getIncludeFile();
// Hack to force an error page in defaultaction
if(!$error){
$vars["userId"] = "userId";
$params["userId"] = "INVALID";
}
//
// fill in the request with the parameters we need
//
$vars["op"] = "op";
foreach( $vars as $key => $value ) {
if( is_array( $params ) && array_key_exists( $key, $params ) && $params["$key"] != "" )
HttpVars::setRequestValue( $vars["$key"], $params["$key"] );
}
// and transfer execution to the main script
lt_include( PLOG_CLASS_PATH.$includeFile );
?>