diff options
Diffstat (limited to 'app.php')
-rw-r--r-- | app.php | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -18,6 +18,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { header("Location: /?error=" . $lang["app"]["file"]) and die(); } } elseif ($toplevel === "") { + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; } else { if ($toplevel === "-") { @@ -25,12 +26,14 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { $toplevel = explode("/", $pagename)[0]; if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } else { header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($pagename)) and die(); } } else if ($toplevel === "api") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } } else if ($toplevel === "cloudburst" || $toplevel === "raindrops") { @@ -50,6 +53,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { die(); } + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { @@ -63,9 +67,11 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"]; if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops)) && $toplevel !== "unknown") { + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { global $toplevel; + $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/includes/short.inc"; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/short.inc"; } } |