summaryrefslogtreecommitdiff
path: root/404.php
blob: cd7e12e2bd7824ec828e3539dcbf72a9f1c5232d (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
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>(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">
            <?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(INSTANCE_STATIC_FOLDER . "/img/404");
                array_splice($files, 0, 2);
                echo $files[random_int(0, count($files) - 1)];
                ?>" alt=""></img>
            </section>
        </div>
    </div>
</body>

</html>