From 884802259ba698d9bed60fe9f21ae23c06e5b486 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Mon, 27 Oct 2014 17:06:52 -0700 Subject: [PATCH] Add TINYIB_NOFILEOK for file-less new threads --- 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 d1db637..c8448d0 100644 --- a/imgboard.php +++ b/imgboard.php @@ -228,7 +228,7 @@ if (isset($_POST['message']) || isset($_POST['file'])) { } if ($post['file'] == '') { // No file uploaded - if ($post['parent'] == TINYIB_NEWTHREAD && (TINYIB_PIC || TINYIB_SWF || TINYIB_WEBM)) { + if ($post['parent'] == TINYIB_NEWTHREAD && (TINYIB_PIC || TINYIB_SWF || TINYIB_WEBM) && !TINYIB_NOFILEOK) { fancyDie("A file is required to start a thread."); } if (str_replace('
', '', $post['message']) == "") { diff --git a/inc/defines.php b/inc/defines.php index 2e5ae54..339bcc8 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -27,6 +27,9 @@ if (!defined('TINYIB_SWF')) { if (!defined('TINYIB_WEBM')) { define('TINYIB_WEBM', false); } +if (!defined('TINYIB_NOFILEOK')) { + define('TINYIB_NOFILEOK', false); +} if (!defined('TINYIB_REQMOD')) { define('TINYIB_REQMOD', 'disable'); } diff --git a/settings.default.php b/settings.default.php index 8658043..cb99527 100644 --- a/settings.default.php +++ b/settings.default.php @@ -35,6 +35,7 @@ define('TINYIB_WEBM', false); // Enable .weba and .webm audio/video file // File control define('TINYIB_MAXKB', 2048); // Maximum file size in kilobytes [0 to disable] define('TINYIB_MAXKBDESC', "2 MB"); // Human-readable representation of the maximum file size +define('TINYIB_NOFILEOK', false); // Allow the creation of new threads without uploading a file // Thumbnail size - new thread define('TINYIB_MAXWOP', 250); // Width