summaryrefslogtreecommitdiff
path: root/public/404.php
diff options
context:
space:
mode:
Diffstat (limited to 'public/404.php')
-rw-r--r--public/404.php34
1 files changed, 24 insertions, 10 deletions
diff --git a/public/404.php b/public/404.php
index 8d36c12..58aa7db 100644
--- a/public/404.php
+++ b/public/404.php
@@ -1,26 +1,40 @@
<?php
-include "../src/config.php";
-http_response_code(404);
+include_once "../src/config.php";
+include_once "../src/utils.php";
+include_once "../src/partials.php";
+include_once "../src/accounts.php";
+
+authorize_user();
+
+$status = intval($_GET["error_status"] ?? "404");
+http_response_code($status);
+
+$reason = str_safe($_GET["error_reason"] ?? "Not found", 200);
+
?>
<html>
<head>
- <title>Not found - <?php echo INSTANCE_NAME ?></title>
+ <title>(Error) <?php echo sprintf("%s - %s", $reason, INSTANCE_NAME) ?></title>
<link rel="stylesheet" href="/static/style.css">
<link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
</head>
<body>
<div class="container">
- <div class="wrapper center">
- <section class="box center big-gap" style="display: flex;flex-direction:column; padding: 16px;">
- <h1 style="color: red;">404 Not Found</h1>
+ <div class="wrapper">
+ <?php html_navigation_bar() ?>
+ <section class="content">
+ <h1 style="color: red;"><?php echo $reason ?></h1>
+ <a href="/">[ Back to home ]</a>
+ </section>
+
+ <section style="position: absolute; right: 6px; bottom: 6px;">
<img src="/static/img/404/<?php
$files = scandir("static/img/404");
- $count = count($files) - 2;
- echo random_int(1, $count);
- ?>.webp">
- <a href=" /">Back to home</a>
+ array_splice($files, 0, 2);
+ echo $files[random_int(0, count($files) - 1)];
+ ?>" alt=""></img>
</section>
</div>
</div>