1 theanimation Jun 10, 2012 05:39
3 theanimation Jun 22, 2012 15:52
Are you talking about the plugin listed [url=http://plugins.b2evolution.net/index.php/2009/03/02/turing_test_221]here[/url]? The link to that plugin has been broken since early 2010.
If there's another one, let me know. Thanks.
4 deljr Jul 01, 2012 16:04
I have implemented a Turing test for b2evolution 2.4.2 by adapting the information that is available here for version 4.1.4:
http://forums.b2evolution.net/viewtopic.php?t=24516
First of all, make a backup of these two files just in case anything goes wrong:
\skins\_item_comment_form.inc.php
\htsrv\comment_post.php
Now we are going to adjust the content in \skins\_item_comment_form.inc.php. Find the line that reads
global $comment_cookies, $comment_allow_msgform;
Just after it add a line that reads
global $comment_antispam;
Find the line that reads
$comment_author = $Comment->author;
Just before it add a line that reads
$comment_antispam = '';
(Note that that is two apostrophes in a row, not a double quotation mark.)
Find the line that reads
$Form->text( 'o', $comment_author_url, 40, T_('Website'), '<br />'.T_('Your URL will be displayed.'), 100, 'bComment' );
Just after it (but before the closing brace) add a line that reads
$Form->text( 't', $comment_antispam, 40, 'Type letter Q', '<br />You may have to type the letter again if you preview your comment.', 100, 'bComment' );
Now we are going to adjust the content in \htsrv\comment_post.php. Find the line that reads
$url = param( 'o', 'string' );
After it add a line that reads
$antispam = param( 't', 'string' );
Find the lines that read
if( empty($email) )
{
$Messages->add( T_('Please fill in your email.'), 'error' );
}
After them (but before the following brace) add
if( strcasecmp($antispam, 'q') != 0 )
{
$Messages->add( 'You must type the letter Q in the appropriate box.', 'error' );
}
Seems to work perfectly. If anybody else success with this approach, please let me know.
5 loobyloo Apr 05, 2013 12:43
I've tried implementing this but where is the "appropriate box"? If I try to submit a comment it send me to an error page as describe in your last instruction, but when I go back to the page there's nowhere in which to type Q.
That is,
$Form->text( 't', $comment_antispam, 40, 'Type letter Q', '<br />You may have to type the letter again if you preview your comment.', 100, 'bComment' );
doesn't seem to make any difference.
6 deljr Dec 07, 2013 20:27
Looby,
The box appears right after the Website line and before the Comment text line. I attach a picture.
Don.
7 deljr Dec 08, 2013 17:09
This last week some spambot found one of my b2e blogs and started sending me tons of spam via the "contact" link. I decided to implement a basic Turing text just like I had done for my comment function. I'm not a trained coder, so I had a lot of trepidation. Turned out to be pretty easy. I want to put together a Turing test for the "contact" portion of the blog so that I stop receiving spam. I started with the info up above (thanks, theanimation!)
Here was my adjusted procedure.
The two files that seem to be the major ones for processing that are:
/skins/_msgform.disp.php
/htsrv/message_send.php
Back up both of those before making any changes, just in case.
Here's what I did.
Now we are going to adjust the content in /skins/_msgform.disp.php. Find the line that reads
global $cookie_name, $cookie_email;
Just after it add a line that reads
global $contact_antispam;
Find the line that reads
$email_author = '';
Just after it add a line that reads
$contact_antispam = '';
Find the line that reads
$Form->textarea( 'h', '', 15, T_('Message'), T_('Plain text only.'), 40, 'bComment' );
Just after it add a line that reads
$Form->text( 't', $contact_antispam, 40, 'Type letter Q', '<br />You may have to type the letter again if you preview your comment.', 100, 'bComment' );
Now we are going to adjust the content in /htsrv/message_send.php. Find the line that reads
$message = param( 'h', 'html', '' );
After it add a line that reads
$antispam = param( 't', 'string' );
Find the lines that read
if( empty( $message ) )
{ // message should not be empty!
$Messages->add( T_('Please do not send empty messages.'), 'error' );
}
elseif( $antispam_on_message_form && antispam_check( $message ) )
{ // a blacklisted keyword ha sbeen found in the message:
$Messages->add( T_('The supplied message is invalid / appears to be spam.'), 'error' );
}
After them (but before the following brace) add
if( strcasecmp($antispam, 'q') != 0 )
{
$Messages->add( 'You must type the letter Q in the appropriate box.', 'error' );
}
Seems to work perfectly. If anybody else has success with this approach, please let me know.
Thank you for sharing the code.
There is already a Turing test plugin. You may need to edit it a bit since it was made for b2evo v2.
See here http://b2evolution.net/downloads/extend.html