summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/emotes/upload.php4
-rw-r--r--public/rules.php50
-rw-r--r--public/static/txt/RULES2
3 files changed, 54 insertions, 2 deletions
diff --git a/public/emotes/upload.php b/public/emotes/upload.php
index 96544fd..f890ec2 100644
--- a/public/emotes/upload.php
+++ b/public/emotes/upload.php
@@ -104,8 +104,8 @@ if ($_SERVER['REQUEST_METHOD'] != "POST") {
<textarea name="notes" id="form-notes"></textarea>
<div>
- <label for="tos" class="inline">Do you accept <a href="/rules">the rules</a>?<span
- style="color:red;">*</span></label>
+ <label for="tos" class="inline">Do you accept <a href="/rules.php" target="_BLANK">the
+ rules</a>?<span style="color:red;">*</span></label>
<input type="checkbox" name="tos" value="1" required>
</div>
diff --git a/public/rules.php b/public/rules.php
new file mode 100644
index 0000000..027b994
--- /dev/null
+++ b/public/rules.php
@@ -0,0 +1,50 @@
+<?php
+include_once "../src/config.php";
+include_once "../src/partials.php";
+include_once "../src/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 <?php echo 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 <?php echo 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> \ No newline at end of file
diff --git a/public/static/txt/RULES b/public/static/txt/RULES
new file mode 100644
index 0000000..0ec5b9e
--- /dev/null
+++ b/public/static/txt/RULES
@@ -0,0 +1,2 @@
+Hey, admin! Write your rules in /static/txt/RULES file.
+If you see this, VI VON \ No newline at end of file