Support preventing creation of new threads and/or replies

Resolves #132.
This commit is contained in:
Trevor Slocum 2021-01-28 15:24:35 -08:00
parent d36f250e8c
commit 92921b5b60
3 changed files with 17 additions and 0 deletions

View File

@ -237,6 +237,15 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name'])
}
$post = newPost(setParent());
if (!$loggedin) {
if ($post['parent'] == TINYIB_NEWTHREAD && TINYIB_DISALLOWTHREADS != '') {
fancyDie(TINYIB_DISALLOWTHREADS);
} else if ($post['parent'] != TINYIB_NEWTHREAD && TINYIB_DISALLOWREPLIES != '') {
fancyDie(TINYIB_DISALLOWREPLIES);
}
}
$hide_fields = $post['parent'] == TINYIB_NEWTHREAD ? $tinyib_hidefieldsop : $tinyib_hidefields;
if ($post['parent'] != TINYIB_NEWTHREAD && !$loggedin) {

View File

@ -58,6 +58,12 @@ if (!defined('TINYIB_REPORT')) {
if (!defined('TINYIB_REQMOD')) {
define('TINYIB_REQMOD', '');
}
if (!defined('TINYIB_DISALLOWTHREADS')) {
define('TINYIB_DISALLOWTHREADS', '');
}
if (!defined('TINYIB_DISALLOWREPLIES')) {
define('TINYIB_DISALLOWREPLIES', '');
}
if (!defined('TINYIB_ALWAYSNOKO')) {
define('TINYIB_ALWAYSNOKO', false);
}

View File

@ -27,6 +27,8 @@ define('TINYIB_CAPTCHA', ''); // Reduce spam by requiring users to pass
define('TINYIB_MANAGECAPTCHA', ''); // Improve security by requiring users to pass a CAPTCHA when logging in to the management panel: simple / recaptcha ['' to disable]
define('TINYIB_REPORT', false); // Allow users to report posts
define('TINYIB_REQMOD', ''); // Require moderation before displaying posts: files / all ['' to disable]
define('TINYIB_DISALLOWTHREADS', ''); // When set, users attempting to post a new thread are shown this message instead ['' to disable]
define('TINYIB_DISALLOWREPLIES', ''); // When set, users attempting to post a reply are shown this message instead ['' to disable]
// Board appearance
define('TINYIB_INDEX', 'index.html'); // Index file