From 97a22e57c1ef3c3e41ed5666255c1e941df21f3e Mon Sep 17 00:00:00 2001 From: czaks Date: Sat, 20 Jul 2013 22:47:26 -0400 Subject: Remove imgcaptcha, this code is unused in any of our forks and needs work to get here back. Revert "Merge branch 'imgcaptcha' of https://github.com/asiekierka/Tinyboard" This reverts commit 49afb685c8e658c0f36b8171e176363538eb9419, reversing changes made to 2451a0f29c08e23ff36ef113082c112224f7e576. Conflicts: js/imgcaptcha.js --- templates/post_form.html | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index 07b53a9f..0ea2b999 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -67,21 +67,6 @@ {% endif %} - {% if config.imgcaptcha %} - - - {% trans %}Verification{% endtrans %} - {{ antibot.html() }} - - - -
- {{ config.imgcaptcha_question }}
- Odswiez - {{ antibot.html() }} - - - {% endif %} {% trans %}File{% endtrans %} -- cgit v1.3 From 889945f50cd0c2cd1b8f39d7b380133196a93a74 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 30 Jul 2013 23:36:46 -0400 Subject: Hide "flags" section in posting form if user doesn't have permission to do anything special --- templates/post_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index aa051f5f..a112e2ab 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -85,7 +85,7 @@ {% endif %} - {% if mod %} + {% if mod and ((not id and post.mod|hasPermission(config.mod.sticky, board.uri)) or (not id and post.mod|hasPermission(config.mod.lock, board.uri)) or post.mod|hasPermission(config.mod.rawhtml, board.uri)) %} {% trans %}Flags{% endtrans %} -- cgit v1.3 From 90b82b1a0635d78d536bc92decbdc273d8f7e323 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 31 Jul 2013 02:38:40 -0400 Subject: Disable autocomplete --- templates/post_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index a112e2ab..03b9961f 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -1,4 +1,4 @@ -
+ {{ antibot.html() }} {% if id %}{% endif %} {{ antibot.html() }} -- cgit v1.3 From b7d884ef45c271a0081a61b396cddb9aaf9a55ef Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 16 Jul 2013 13:18:55 -0400 Subject: recaptcha: fix for https --- templates/post_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index 03b9961f..599ae754 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -59,7 +59,7 @@ {{ antibot.html() }} - + {{ antibot.html() }} -- cgit v1.3 From dc84ccc6a8e0b6fd3fc626eb1f321e4cf2d05511 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 1 Aug 2013 23:31:35 -0400 Subject: Revert "Disable autocomplete": this breaks access to post text after an error, at least in Firefox This reverts commit 90b82b1a0635d78d536bc92decbdc273d8f7e323. --- templates/post_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index 9ccd7be3..391f0657 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -1,4 +1,4 @@ - + {{ antibot.html() }} {% if id %}{% endif %} {{ antibot.html() }} -- cgit v1.3 From 5710575d1dc9fbd39bd90f9e5f4f9e33ef3f5a73 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 1 Aug 2013 23:31:35 -0400 Subject: Revert "Disable autocomplete": this breaks access to post text after an error, at least in Firefox This reverts commit 90b82b1a0635d78d536bc92decbdc273d8f7e323. --- templates/post_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/post_form.html') diff --git a/templates/post_form.html b/templates/post_form.html index 599ae754..31fe88c6 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -1,4 +1,4 @@ - + {{ antibot.html() }} {% if id %}{% endif %} {{ antibot.html() }} -- cgit v1.3 From a3fbff225927469e68efc7ab31977736f34c7480 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 3 Aug 2013 17:42:34 -0400 Subject: Update $config['try_smarter']. Should be working now. --- inc/config.php | 3 ++- inc/functions.php | 13 ++++++++++--- post.php | 9 ++++++--- templates/post_form.html | 3 +++ 4 files changed, 21 insertions(+), 7 deletions(-) (limited to 'templates/post_form.html') diff --git a/inc/config.php b/inc/config.php index 120f3865..15af9661 100644 --- a/inc/config.php +++ b/inc/config.php @@ -262,7 +262,8 @@ 'recaptcha_challenge_field', 'recaptcha_response_field', 'spoiler', - 'quick-reply' + 'quick-reply', + 'page' ); // Enable reCaptcha to make spam even harder. Rarely necessary. diff --git a/inc/functions.php b/inc/functions.php index b6862444..309546ef 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -841,11 +841,14 @@ function post(array $post) { } function bumpThread($id) { - global $board; + global $config, $board, $build_pages; if (event('bump', $id)) return true; + if ($config['try_smarter']) + $build_pages[] = thread_find_page($id); + $query = prepare(sprintf("UPDATE ``posts_%s`` SET `bump` = :time WHERE `id` = :id AND `thread` IS NULL", $board['uri'])); $query->bindValue(':time', time(), PDO::PARAM_INT); $query->bindValue(':id', $id, PDO::PARAM_INT); @@ -1274,7 +1277,8 @@ function buildIndex() { global $board, $config, $build_pages; $pages = getPages(); - $antibot = create_antibot($board['uri']); + if (!$config['try_smarter']) + $antibot = create_antibot($board['uri']); for ($page = 1; $page <= $config['max_pages']; $page++) { $filename = $board['dir'] . ($page == 1 ? $config['file_index'] : sprintf($config['file_page'], $page)); @@ -1285,8 +1289,11 @@ function buildIndex() { if (!$content) break; + if ($config['try_smarter']) { + $antibot = create_antibot($board['uri'], 0 - $page); + $content['current_page'] = $page; + } $antibot->reset(); - $content['pages'] = $pages; $content['pages'][$page-1]['selected'] = true; $content['btn'] = getPageButtons($content['pages']); diff --git a/post.php b/post.php index 103894db..65e85bcc 100644 --- a/post.php +++ b/post.php @@ -216,7 +216,7 @@ if (isset($_POST['delete'])) { } if (!$post['mod']) { - $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : null)); + $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); if ($post['antispam_hash'] === true) error($config['error']['spam']); } @@ -594,12 +594,15 @@ if (isset($_POST['delete'])) { } } - buildThread($post['op'] ? $id : $post['thread']); - if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies']+1 < $config['reply_limit'])) { bumpThread($post['thread']); } + buildThread($post['op'] ? $id : $post['thread']); + + if ($config['try_smarter'] && $post['op']) + $build_pages = range(1, $config['max_pages']); + if ($post['op']) clean(); diff --git a/templates/post_form.html b/templates/post_form.html index 31fe88c6..4d7a37b7 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -4,6 +4,9 @@ {{ antibot.html() }} {{ antibot.html() }} +{% if current_page %} + +{% endif %} {% if mod %}{% endif %} {% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %} -- cgit v1.3