-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (29 loc) · 878 Bytes
/
index.php
File metadata and controls
29 lines (29 loc) · 878 Bytes
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
<?php
session_start();
include 'qn_config/conf.php';
$linkPre = explode("/", $sub);
$path = $_SERVER['REQUEST_URI'];
$path1 = explode("?", $path);
$path = ltrim($path1[0], '/'); // Trim leading slash(es)
$elem = explode('/', $path);
if(count($linkPre) > 0)
{
for ($i=count($linkPre); $i > 0 ; $i--) {
if($sub == "")
break;
array_shift($elem);
}
}
$path = join("/", $elem);
//$elements = explode('/', $path); // Split path on slashes
if(strlen($path) == 0) { // No path elements means home
$path = $GLOBALS['root'] . '/' . 'qn_frontend/Home.php';
}
else
$path = $GLOBALS['root'] . '/' . 'qn_frontend/' . $path . '.php';
$pageTitle = end($elem)!=""?end($elem):"Home";
if (!file_exists($path)) {
header("Location: " . $GLOBALS['host'] . '/404');
}
include 'qn_themes/'. $currTheme.'/base.php' ;
?>