Jump to:

10845 Posts in 2513 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » ReCaptcha and Page Comments

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1748 Views
  • HansR
    Avatar
    Community Member
    140 Posts

    ReCaptcha and Page Comments Link to this post

    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

  • ulysses
    Avatar
    Community Member
    57 Posts

    Re: ReCaptcha and Page Comments Link to this post

    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: http://doc.silverstripe.org/doku.php?id=modules:recaptcha

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

    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: http://recaptcha.net/api/getkey

    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: http://ev.ulysses.co.nz/guest-book/ 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.

    1748 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.