summaryrefslogtreecommitdiff
path: root/viewthread.php
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-04-12 09:56:22 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-04-12 09:56:22 -0600
commit424622fbdbe7065cb5b93b39d6cfc5ba0a31775e (patch)
tree4c436c21340618453e751e05ddf5ef7c0ed524fc /viewthread.php
parent10280968b8b45fe130bc50e2ede4ce3cabfe1e58 (diff)
Begin post moderation, add delete feature
Diffstat (limited to 'viewthread.php')
-rw-r--r--viewthread.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/viewthread.php b/viewthread.php
index 64750a5..e1961fc 100644
--- a/viewthread.php
+++ b/viewthread.php
@@ -31,6 +31,32 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
created by <b><?= $current->author->name; ?></b>
in <b><?= $current->category->name; ?></b>
<abbr title="<?= date('M d, Y g:ia', strtotime($current->date_created));?>">3 days ago</abbr>
+<?php
+include_once 'model/User.php';
+
+if (isset($_SESSION['signed_in'])) {
+ $user = new User();
+ $user->get_by_id($_SESSION['user_id'], $dbc);
+
+ if ($user->level > 0) {
+ echo '
+ <form action="moderate.php" method="post">
+ <p>
+ <b>Moderator Options</b>
+ <input type="number" name="id" value="' . $current->id . '">
+ <input type="checkbox" id="delete" name="delete">
+ <label for="delete">Delete thread</label>
+ <input type="checkbox" id="lock" name="lock">
+ <label for="lock">Locked</label>
+ <input type="checkbox" id="pin" name="pin">
+ <label for="pin">Pinned</label>
+ <input type="submit" value="Update thread">
+ </p>
+ </form>
+ ';
+ }
+}
+?>
<hr>
<?php
$posts = $current->get_posts($dbc);