summaryrefslogtreecommitdiff
path: root/rules.php
blob: 84e2b252e6d3a4e615e11e7b68aaaf753fec3d37 (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
44
45
46
47
48
49
50
<?php
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/config.php";
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/partials.php";
include_once "{$_SERVER['DOCUMENT_ROOT']}/lib/accounts.php";

authorize_user();

$contents = "";

$path = sprintf("%s/%s/txt/RULES", $_SERVER["DOCUMENT_ROOT"], INSTANCE_STATIC_FOLDER);

if (is_file($path)) {
    $contents = file_get_contents($path);
    $contents = explode("\n", $contents);
}
?>

<html>

<head>
    <title>The Rules of <?= CONFIG['instance']['name'] ?></title>
    <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/static/style.css">
</head>

<body>
    <div class="container">
        <div class="wrapper">
            <?php html_navigation_bar() ?>
            <div class="content row">
                <div class="sidebar" style="min-width: 300px;"></div>
                <div class="content">
                    <h1>The Rules of <?= CONFIG['instance']['name'] ?></h1>
                    <ol>
                        <?php
                        foreach ($contents as $line) {
                            echo "<li>$line</li>";
                        }
                        if (empty($contents)) {
                            echo "<i>No rules!</i>";
                        }
                        ?>
                    </ol>
                </div>
            </div>
        </div>
    </div>
</body>

</html>