diff --git a/imgboard.php b/imgboard.php index 99bab4f..3110541 100644 --- a/imgboard.php +++ b/imgboard.php @@ -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) { diff --git a/inc/defines.php b/inc/defines.php index bbe4645..a177cff 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -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); } diff --git a/settings.default.php b/settings.default.php index 9a0bdec..ce9591e 100644 --- a/settings.default.php +++ b/settings.default.php @@ -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