diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-10 18:23:30 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-10 18:23:30 +0500 |
| commit | f7506dd67c1e376eb41c7b5c6e05d8a6fefa96ee (patch) | |
| tree | 7d8da74f4c2ad2e86edcc9f0b7f28b412950b749 | |
| parent | 0891b1fb605a0244a3f034ebdd528b4b57fa35f2 (diff) | |
feat: terms of service page
| -rw-r--r-- | emotes/upload.php | 5 | ||||
| -rw-r--r-- | index.php | 2 | ||||
| -rw-r--r-- | static/txt/RULES | 2 | ||||
| -rw-r--r-- | static/txt/TOS.txt | 1 | ||||
| -rw-r--r-- | tos.php (renamed from rules.php) | 22 |
5 files changed, 13 insertions, 19 deletions
diff --git a/emotes/upload.php b/emotes/upload.php index 58836d6..3c43b48 100644 --- a/emotes/upload.php +++ b/emotes/upload.php @@ -136,9 +136,8 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") { </table> <div> - <label for="tos" class="inline">Do you accept <a href="/rules.php" - target="_BLANK">the - rules</a>?<span style="color:red;">*</span></label> + <label for="tos" class="inline">Do you accept <a href="/tos.php" + target="_BLANK">TOS</a>?<span style="color:red;">*</span></label> <input type="checkbox" name="tos" value="1" required> </div> @@ -88,6 +88,8 @@ authorize_user(); echo ')</a>'; } ?> + + - <a href="/tos.php">Terms of Service</a> </p> </div> </div> diff --git a/static/txt/RULES b/static/txt/RULES deleted file mode 100644 index 0ec5b9e..0000000 --- a/static/txt/RULES +++ /dev/null @@ -1,2 +0,0 @@ -Hey, admin! Write your rules in /static/txt/RULES file. -If you see this, VI VON
\ No newline at end of file diff --git a/static/txt/TOS.txt b/static/txt/TOS.txt new file mode 100644 index 0000000..2bd0e7a --- /dev/null +++ b/static/txt/TOS.txt @@ -0,0 +1 @@ +<i>Please edit /static/txt/TOS.txt</i>
\ No newline at end of file @@ -7,18 +7,21 @@ authorize_user(); $contents = ""; -$path = sprintf("%s/%s/txt/RULES", $_SERVER["DOCUMENT_ROOT"], INSTANCE_STATIC_FOLDER); +$path = "{$_SERVER['DOCUMENT_ROOT']}/static/txt/TOS.txt"; + +$contents = "<p>No rules!</p>"; +$last_updated = "Never"; if (is_file($path)) { $contents = file_get_contents($path); - $contents = explode("\n", $contents); + $last_updated = date("F d, Y", filemtime($path)); } ?> <html> <head> - <title>The Rules of <?= CONFIG['instance']['name'] ?></title> + <title>Terms of Service - <?= CONFIG['instance']['name'] ?></title> <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon"> <link rel="stylesheet" href="/static/style.css"> </head> @@ -30,17 +33,8 @@ if (is_file($path)) { <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> + <h1>Terms of Service (Last updated: <?= $last_updated ?>)</h1> + <?= $contents ?> </div> </div> </div> |
