From e72d0adbcd7e69928a1ef380c7a841c160284c68 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 2 Jan 2023 20:29:01 +0100 Subject: Update --- app.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app.php') diff --git a/app.php b/app.php index d4ed154..7bfbe29 100644 --- a/app.php +++ b/app.php @@ -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"; } } -- cgit