From 5adfff925b144161c840f63ebb271c11c3c0c883 Mon Sep 17 00:00:00 2001
From: Savetheinternet
Date: Mon, 13 Dec 2010 02:44:43 +1100
Subject: [PATCH] Post moderation controls
---
inc/config.php | 23 ++++++++++++++++++++++-
inc/display.php | 33 +++++++++++++++++++++++++++++++--
2 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/inc/config.php b/inc/config.php
index 2d2dddf6..e3080316 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -143,8 +143,29 @@
define('MOD_MOD', 1, true);
define('MOD_ADMIN', 2, true);
- // What level of administration you need to view IP addresses
+ // Permissions
+ // What level of administration you need to:
+
+ // View IP addresses
define('MOD_SHOW_IP', MOD_MOD, true);
+ // Delete a post
+ define('MOD_DELETE', MOD_JANITOR, true);
+ // Ban a user for a post
+ define('MOD_BAN', MOD_MOD, true);
+ // Ban and delete (one click; instant)
+ define('MOD_BANDELETE', MOD_BAN, true);
+ // Delete file (and keep post)
+ define('MOD_DELETEFILE', MOD_JANITOR, true);
+ // Delete all posts by IP
+ define('MOD_DELETEBYIP', MOD_BAN, true);
+
+ // Mod links (full HTML)
+ // Correspond to above permission directives
+ define('MOD_LINK_DELETE', '[D]', true);
+ define('MOD_LINK_BAN', '[B]', true);
+ define('MOD_LINK_BANDELETE', '[B&D]', true);
+ define('MOD_LINK_DELETEFILE', '[F]', true);
+ define('MOD_LINK_DELETEBYIP', '[D+]', true);
// A small file in the main directory indicating that the script has been ran and the board(s) have been generated.
// This keeps the script from querying the database and causing strain when not needed.
diff --git a/inc/display.php b/inc/display.php
index a5bb1c70..b8a58e2b 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -119,9 +119,38 @@
$built .= ', ' . $fraction;
}
// Filename
- $built .= ', ' . $this->filename . ')
' .
+ $built .= ', ' . $this->filename . ')' .
+
// Thumbnail
- '';
+ '';
+ }
+
+ if($mod) {
+ // Mod controls (on posts)
+ $built .= '';
+
+ // Delete
+ if($mod['type'] >= MOD_DELETE)
+ $built .= ' ' . MOD_LINK_DELETE . '';
+
+ // Delete all posts by IP
+ if($mod['type'] >= MOD_DELETEBYIP)
+ $built .= ' ' . MOD_LINK_DELETEBYIP . '';
+
+ // Ban
+ if($mod['type'] >= MOD_BAN)
+ $built .= ' ' . MOD_LINK_BAN . '';
+
+ // Ban & Delete
+ if($mod['type'] >= MOD_BANDELETE)
+ $built .= ' ' . MOD_LINK_BANDELETE . '';
+
+ // Delete file (keep post)
+ if($mod['type'] >= MOD_DELETEFILE)
+ $built .= ' ' . MOD_LINK_DELETEFILE . '';
+
+
+ $built .= '
';
}
// Body