diff options
Diffstat (limited to 'app.php')
-rw-r--r-- | app.php | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,9 +1,6 @@ <?php -if (!isset($_COOKIE["PEH2_LANGUAGE"])) { - $_COOKIE["PEH2_LANGUAGE"] = "en"; - setcookie("PEH2_LANGUAGE", "en", time() + (86400 * 365), "/"); -} +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/language.inc"; global $lang; global $pages; if (str_ends_with($_GET['_'], "/")) { $pagename = substr($_GET['_'], 0, strlen($_GET['_']) - 1); @@ -18,7 +15,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/" . $toplevel . "/" . $filename)) { header("Location: /assets/" . $toplevel . "/" . $filename) and die(); } else { - header("Location: /?error=File not found") and die(); + header("Location: /?error=" . $lang["app"]["file"]) and die(); } } elseif ($toplevel === "") { require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; @@ -30,7 +27,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } else { - header("Location: /?error=Page not found: " . strip_tags($pagename)) and die(); + header("Location: /?error=" . $lang["app"]["page"] . " " . strip_tags($pagename)) and die(); } } else if ($toplevel === "api") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { |