From 16e2e39bddb8f59e5032e6fa49145ea9a2db6a32 Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:16:08 -0800 Subject: [PATCH 01/23] Update README.md --- README.md | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5b3401a5..dd27e7c1 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,28 @@ -infinity -======================================================== -About ------------- -infinity is a fork of vichan, with the difference that infinity is geared towards allowing users to create their own boards. A running instance is at [8ch.net](https://8ch.net/) +This fork adds a new board option to infinity: -Most things (other than installation) that apply to upstream vichan also apply to infinity. See their readme for a detailed FAQ: https://github.com/vichan-devel/vichan/blob/master/README.md +The requirement to solve a captcha in order to create a thread, but not in order to post a reply. -If you are not interested in letting your users make their own boards, install vichan instead of infinity. +Here's a quick rundown of where code edits have been made: -Because I cannot be bothered to maintain `install.php`, the install process is as such: +ALL CODE EDITS FOR NEW THREAD CAPTCHA ARE MARKED WITH THE COMMENT "New thread captcha" +ONE ADITIONAL EDIT TO SETTINGS.HTML MARKED WITH: + +The $config setting for new thread captcha is $config[new_thread_capt] -``` -mysql -uroot infinity < install.sql -echo 'infinity' > .installed -``` +templates/mod/settings.html +Option for new captcha thread creation has been added to the settings template. +"Enable CAPTCHA" also clarified with better description. -Here's my install script as of 11/14/2014 for the 8chan servers which run Ubuntu 14.04: +inc/8chan-mod-pages.php +Two lines of code added to 8chan-mod-pages.php -``` -apt-get install graphicsmagick gifsicle php5-fpm mysql-client php5-mysql php5-cli php-pear php5-apcu; add-apt-repository ppa:jon-severinsson/ffmpeg; add-apt-repository ppa:nginx/stable; apt-get update; apt-get install nginx ffmpeg; pear install Net_DNS2 -``` +inc/config.php +Line added, makes new thread captcha default to off. -Have fun! +/templates/post_form.html +Several lines added. Makes the verification box show up in the new thread form +when $config[new_thread_capt] is enabled. + +/post.php +Added two new conditions to if statement. From f79c87b2e00fd7af1e18c73dfad8f0da422f440f Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:18:05 -0800 Subject: [PATCH 02/23] Update post.php --- post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index bb690b85..84736567 100644 --- a/post.php +++ b/post.php @@ -236,7 +236,9 @@ elseif (isset($_POST['post'])) { } // Same, but now with our custom captcha provider - if ($config['captcha']['enabled']) { + //if ($config['captcha']['enabled']) { + //New thread captcha + if (($config['captcha']['enabled']) || (($post['op']) && ($config['new_thread_capt'])) ) { $resp = file_get_contents($config['captcha']['provider_check'] . "?" . http_build_query([ 'mode' => 'check', 'text' => $_POST['captcha_text'], From 107a91f8ccf1ca7b2251ffc959d42ad3f805c200 Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:20:54 -0800 Subject: [PATCH 03/23] Update post_form.html --- templates/post_form.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/post_form.html b/templates/post_form.html index 1b01b93b..940f33f0 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -89,6 +89,20 @@ + + {% elseif config.new_thread_capt %} + + {% if id %} + {% else %} + + + {% trans %}Verification{% endtrans %} + + + + + + {% endif %} {% endif %} {% if config.user_flag %} From 89e2677a1ea2c48158ab82ade2bf5eb5dd71ef67 Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:23:50 -0800 Subject: [PATCH 04/23] Update config.php --- inc/config.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/config.php b/inc/config.php index 64a57297..84f41362 100644 --- a/inc/config.php +++ b/inc/config.php @@ -445,6 +445,11 @@ * ==================== */ + //New thread captcha + //Require solving a captcha to post a thread. + //Default off. + $config['new_thread_capt'] = false; + // Do you need a body for your reply posts? $config['force_body'] = false; // Do you need a body for new threads? From 86cd7b81f954a697ec72d5471d029fb33399bb5c Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:25:55 -0800 Subject: [PATCH 05/23] Update 8chan-mod-pages.php --- inc/8chan-mod-pages.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index b87a97ae..a6f76d44 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -408,6 +408,8 @@ FLAGS; $user_flags = isset($_POST['user_flags']) ? "if (file_exists('$b/flags.php')) { include 'flags.php'; }\n" : ''; $captcha = isset($_POST['captcha']) ? 'true' : 'false'; $force_subject_op = isset($_POST['force_subject_op']) ? 'true' : 'false'; + /*New thread captcha*/ + $new_thread_capt = isset($_POST['new_thread_capt']) ? 'true' : 'false'; @@ -502,6 +504,8 @@ OEKAKI; \$config['default_stylesheet'] = array('Custom', \$config['stylesheets']['Custom']); \$config['captcha']['enabled'] = $captcha; \$config['force_subject_op'] = $force_subject_op; +/*New thread captcha*/ +\$config['new_thread_capt'] = $new_thread_capt; \$config['hour_max_threads'] = $hour_max_threads; $code_tags $katex $oekaki $replace $multiimage $allow_flash $allow_pdf $user_flags if (\$config['disable_images']) From aa3885ddf2c2f8f072cba33510cf3a2f8b6f937a Mon Sep 17 00:00:00 2001 From: blahblah666 Date: Wed, 28 Jan 2015 23:31:50 -0800 Subject: [PATCH 06/23] Update settings.html --- templates/mod/settings.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/mod/settings.html b/templates/mod/settings.html index ce68ec41..47eb365b 100644 --- a/templates/mod/settings.html +++ b/templates/mod/settings.html @@ -45,7 +45,10 @@ {% trans %}Enable dice rolling{% endtrans %} {% trans %}Don't allow users to repost images{% endtrans %} {% trans %}Allow a poster to delete his own posts{% endtrans %} - {% trans %}Enable CAPTCHA{% endtrans %}
This is not ReCAPTCHA, it is custom to 8chan + + {% trans %}Enable CAPTCHA{% endtrans %}
Users must solve a CAPTCHA in order to post.
This is not ReCAPTCHA, it is custom to 8chan.
+ + {% trans %}Enable CAPTCHA for thread creation only{% endtrans %}
Users must solve a CAPTCHA in order to create new threads,
but do not have to solve a CAPTCHA in order to post replies.
{% trans %}Language{% endtrans %}
{% trans %}To contribute translations, register at Transifex{% endtrans %}