Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

ReCaptcha and Page Comments


Reply


2 Posts   1870 Views

Avatar
HansR

Community Member, 140 Posts

7 January 2009 at 7:35pm

I have had to disable Akismet on my site because it simply doesn't work at the moment (after 60 seconds I get an execution time exceeded error message). MathSpamProtection is enabled for now. However, it would be pretty easy to write a script that could parse the equation and enter the solution. It's probably only a matter of time before some spammers do this, and render it useless.

There is a ReCaptcha module, but has anyone connected it to the general page comment? For that matter, the documentation of this module is prety slim.

Hans

Avatar
ulysses

Community Member, 57 Posts

2 February 2010 at 4:26pm

Edited: 02/02/2010 4:27pm

I have implemented ReCaptcha and works OK using SS 2.3.3. You need to install both ReCaptcha and SpamProtection modules together. Then run the /dev/build parameters in the URL and you will have the "Spam Protection drop down field for UserForms and if you turn on page comments, it will display the ReCaptcha image as well.

Please note that you have to register for a ReCaptcha key at their site, so that you can get a public and private key assigned to you, which you have to incorporate into your _config.php in the 'mysite' folder. See instructions at: [url]http://doc.silverstripe.org/doku.php?id=modules:recaptcha[/url]

You also need to add a line of code inthe _config.php file in the 'mysite' folder. See instructions at: [url]http://doc.silverstripe.org/doku.php?id=modules:spamprotection[/url]

This is my code in my _config.php:

// Spam Protection Setup - 'recaptcha' & 'spamprotection' modules
SpamProtectorManager::set_spam_protector("RecaptchaProtector");
RecaptchaField::$public_api_key = '<publickey>';
RecaptchaField::$private_api_key = '<privatekey>';

Copy and paste it into your _config.php and replace the items <publickey> & <privatekey> with your keys generated from the ReCaptcha site. To register and get your key for ReCaptcha, go to: [url]http://recaptcha.net/api/getkey[/url]

I have implemented this using 'olivesunset' & 'blackcandy' themes and they work fine. However, on my 'highground' theme, the ReCaptcha image block is a bit screwed up. i.e. too many line spaces in between the ReCaptcha code. See: [url]http://ev.ulysses.co.nz/guest-book/[/url] I think it has something to do with the line height of the CSS for this theme. I am still to find a solution for it.