From 62f2797f4e11f7ed135d886861ea480f88a63a59 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Tue, 18 Aug 2020 18:37:25 -0700 Subject: [PATCH] Support custom capcodes Based on changes submitted as !55. --- imgboard.php | 2 +- inc/defines.php | 3 +++ settings.default.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/imgboard.php b/imgboard.php index aa1ff2d..5cb953f 100644 --- a/imgboard.php +++ b/imgboard.php @@ -138,7 +138,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) $post['message'] = $_POST['message']; if ($rawpost) { // Treat message as raw HTML - $rawposttext = ($isadmin) ? ' ## Admin' : ' ## Mod'; + $rawposttext = ($isadmin) ? ' ## ' . $tinyib_capcodes[0][0] . '' : ' ## ' . $tinyib_capcodes[1][0] . ''; } else { if (TINYIB_WORDBREAK > 0) { $post['message'] = preg_replace('/([^\s]{' . TINYIB_WORDBREAK . '})(?=[^\s])/', '$1' . TINYIB_WORDBREAK_IDENTIFIER, $post['message']); diff --git a/inc/defines.php b/inc/defines.php index b9864f8..13501cd 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -94,3 +94,6 @@ if (!isset($tinyib_embeds)) { $tinyib_embeds['YouTube'] = 'https://www.youtube.com/oembed?url=TINYIBEMBED&format=json'; } } +if (!isset($tinyib_capcodes)) { + $tinyib_capcodes = array(array('Admin', 'red'), array('Mod', 'purple')); +} diff --git a/settings.default.php b/settings.default.php index 267d471..a076327 100644 --- a/settings.default.php +++ b/settings.default.php @@ -34,6 +34,7 @@ define('TINYIB_CATALOG', true); // Generate catalog page define('TINYIB_JSON', true); // Generate JSON files $tinyib_hidefieldsop = array(); // Fields to hide when creating a new thread - e.g. array('name', 'email', 'subject', 'message', 'file', 'embed', 'password') $tinyib_hidefields = array(); // Fields to hide when replying +$tinyib_capcodes = array(array('Admin', 'red'), array('Mod', 'purple')); // Administrator and moderator capcode label and color // Post control define('TINYIB_DELAY', 30); // Delay (in seconds) between posts from the same IP address to help control flooding [0 to disable]