diff --git a/imgboard.php b/imgboard.php index 8a63280..1ecf2a2 100644 --- a/imgboard.php +++ b/imgboard.php @@ -74,6 +74,14 @@ if (isset($_POST["message"]) || isset($_POST["file"])) { clearExpiredBans(); } } + + $modpost = false; + if (isset($_POST['modpost'])) { + list($loggedin, $isadmin) = manageCheckLogIn(); + if ($loggedin) { + $modpost = true; + } + } $parent = "0"; if (isset($_POST["parent"])) { @@ -108,9 +116,19 @@ if (isset($_POST["message"]) || isset($_POST["file"])) { $post['name'] = cleanString(substr($post['name'], 0, 75)); $post['email'] = cleanString(str_replace('"', '"', substr($_POST["email"], 0, 75))); $post['subject'] = cleanString(substr($_POST["subject"], 0, 75)); - $post['message'] = str_replace("\n", "
", colorQuote(cleanString(rtrim($_POST["message"])))); + if ($modpost) { + if ($isadmin) { + $modposttext = ' ## Admin'; + } else { + $modposttext = ' ## Mod'; + } + $post['message'] = $_POST["message"]; + } else { + $modposttext = ''; + $post['message'] = str_replace("\n", "
", colorQuote(cleanString(rtrim($_POST["message"])))); + } if ($_POST['password'] != '') { $post['password'] = md5(md5($_POST['password'])); } else { $post['password'] = ''; } - $post['nameblock'] = nameBlock($post['name'], $post['tripcode'], $post['email'], time()); + $post['nameblock'] = nameBlock($post['name'], $post['tripcode'], $post['email'], time(), $modposttext); if (isset($_FILES['file'])) { if ($_FILES['file']['name'] != "") { @@ -324,6 +342,9 @@ if (isset($_POST["message"]) || isset($_POST["file"])) { $onload = manageOnLoad('moderate'); $text .= manageModeratePostForm(); } + } elseif (isset($_GET["modpost"])) { + $onload = manageOnLoad('modpost'); + $text .= manageModpostForm(); } elseif (isset($_GET["logout"])) { $_SESSION['tinyib'] = ''; session_destroy(); diff --git a/inc/functions.php b/inc/functions.php index 1da5ae1..4978e63 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -105,7 +105,7 @@ function nameAndTripcode($name) { return array($name, ""); } -function nameBlock($name, $tripcode, $email, $timestamp) { +function nameBlock($name, $tripcode, $email, $timestamp, $modposttext) { $output = ''; if ($name == "" && $tripcode == "") { @@ -124,7 +124,7 @@ function nameBlock($name, $tripcode, $email, $timestamp) { $output = '' . $output . ''; } - return $output . ' ' . date('y/m/d(D)H:i:s', $timestamp); + return $output . $modposttext . ' ' . date('y/m/d(D)H:i:s', $timestamp); } function writePage($filename, $contents) { diff --git a/inc/html.php b/inc/html.php index b7c4c95..2cd25eb 100644 --- a/inc/html.php +++ b/inc/html.php @@ -323,7 +323,7 @@ function adminBar() { if (!$loggedin) { return '[Return]'; } $text = '['; $text .= ($isadmin) ? 'Bans] [' : ''; - $text .= 'Moderate Post] ['; + $text .= 'Moderate Post] [Mod Post] ['; $text .= ($isadmin) ? 'Rebuild All] [' : ''; $text .= 'Log Out] [Return]'; return $text; @@ -356,6 +356,8 @@ function manageOnLoad($page) { return ' onload="document.tinyib.password.focus();"'; case 'moderate': return ' onload="document.tinyib.moderate.focus();"'; + case 'modpost': + return ' onload="document.tinyib.message.focus();"'; case 'bans': return ' onload="document.tinyib.ip.focus();"'; } @@ -418,6 +420,82 @@ function manageModeratePostForm() { EOF; } +function manageModpostForm() { + return << +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Thread No. + +  (0 for new thread) +
+ Name + + +
+ E-mail + + +
+ Subject + + + +
+ Message + + +
+ File + + +
+ Password + +  (for post and file deletion) +
+
+ +
+ All text entered in the "Message" field will be posted AS-IS with absolutely no formatting applied.
This means for all line-breaks you must enter the text "<br>". +
+
+EOF; +} + function manageModeratePost($post) { global $isadmin; $ban = banByIP($post['ip']);