ReCaptcha

Discussion in 'TemplateCodes' started by seymourjames, Oct 20, 2009.

  1. seymourjames All Hands On Deck

    Just a quick post to say many of the users of templatecodes are using Recpatcha for spam control. However the standard red color is pretty dominating and some might say awful.

    To give the ReCaptcha a neutral set of colors which are much more befitting you just need to uncomment this piece of code by moving it up above the */

    <?php
    /*
    <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>


    The code sits right at the top of the file in modules/recpatcha/libs/recaptchalib.php . Further styling can also be carried out if necessary:

    How to change reCAPTCHA colors - reCAPTCHA Wiki
  2. mirway7 New Member

    it does not work with me ;)

  3. seymourjames All Hands On Deck

    Try it on a live server rather than locally and have you signed up with them???
  4. mirway7 New Member

    yes of course. The module works fine online, but not with your code ;)
  5. seymourjames All Hands On Deck

    How to change reCAPTCHA colors - reCAPTCHA Wiki .

    This is where the code comes from. It works fro me and a few of my customers. You must be doing something wrong (you have taken it out of the commenting haven't you). If you are using xampp then you are not on a live server but a local server setup!!! you cannot get the same behaviour.

    It even gives you this change in the actual module download (recaptcha/libs/recaptchalib.php). so if it is wrong then the wiki is wrong, the code supplied by recpatcha is wrong as well.

    <?php
    /* To make it clear <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>

    * This is a PHP library that handles calling reCAPTCHA.
    * - Documentation and latest version
    * PHP CAPTCHA Library for reCAPTCHA
    * - Get a reCAPTCHA API Key
    * http://recaptcha.net/api/getkey
    * - Discussion group
    * reCAPTCHA | Google Groups
    *
    * Copyright (c) 2007 reCAPTCHA -- reCAPTCHA: Stop Spam, Read Books
    * AUTHORS:
    * Mike Crawford
    * Ben Maurer
  6. mirway7 New Member

    now I dont have error message but the theme does not change any more
  7. seymourjames All Hands On Deck

    You give no details and cannot be helped. Try to give details or what is the point in asking. And once again. If you are not on a live server, it may not work. Who knows what you are doing, what version of 68C you have , a screenshot or a link, etc.
  8. freeze2 Super Moderator

    For some reason, this code doesn't show up in my recaptchalib.php file. I downloaded Eric's module from:

    68 Classifieds reCaptcha Module ? Eric Barnes

    According to the wiki...I should be able to add the code...would this go in the recaptchalib.php file? And if so, where in the file?

    Thanks!
  9. seymourjames All Hands On Deck

    OK I see now it is not included in Eric's download but it is part of the Wiki and standard download from ReCaptcha.

    Correct. Put it at the top. like this for example

    <?php
    <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>

    /* bla bla

    */
  10. freeze2 Super Moderator

    Thanks...will give it a try :)
  11. freeze2 Super Moderator

    Gave it a try and got the following error:

    PHP Parse error: syntax error, unexpected '<' in /mywebsite/modules/recaptcha/libs/recaptchalib.php on line 2

    Any other thoughts?
  12. freeze2 Super Moderator

    Ok...was playing around and got 1 step closer:

    I added the following to the very top of the recaptchalib.php file:

    HTML:
    <script type="text/javascript">
    	var RecaptchaOptions = {
    	theme : 'white'
    	};
    </script>
    This enabled me to change to any of the reCaptcha themes. The only problem now is that once the message is sent it adds that code to the top of the email confirmation page and screws up my css which in turn throws my site out of wack.
  13. seymourjames All Hands On Deck

    Add the code I gave to the top of the recaptchalib.php that Eric gives in his module.

    <?php
    /* To make it clear <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>

    I see no reason if you have done that why it would do any of these things unless you have made changes elsewhere in your system. It worked for me the last time I tired it and id it for a customer. Not sure there is anything more I can add.
  14. freeze2 Super Moderator

    Yea...not sure why, but I always get that parse error when I do that:

    PHP Parse error: syntax error, unexpected '<' in /mywebsite/modules/recaptcha/libs/recaptchalib.php on line 2

    The only thing I have done to the plugin is add my keys as per instructions...oh well, red template it is...:cool:
  15. seymourjames All Hands On Deck

    Sorry I see a comment tag in the code - should be as I originally put

    <?php
    <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>
  16. freeze2 Super Moderator

    Yup...had caught that.

    Gave it another try and still get the error...
  17. seymourjames All Hands On Deck

    Works for me. Not sure why you are getting that error.
  18. freeze2 Super Moderator

    ...one of those unexplainables...

    Not sure if you tried it on your demo site...would be interesting to see if it works normally there as well.
  19. teggen Customer

    Getting the same error..

    I am runing a modified version of Fluid, and getting the same error as well.

    Could it be because of the note found on reCAPTCHAwiki?

  20. seymourjames All Hands On Deck

    I see the issue. The script needs to come before the <?php


    Just tested and it works fine

    <script>
    var RecaptchaOptions = {
    theme : 'clean'
    };
    </script>



    <?php

    /*
    * This is a PHP library that handles calling reCAPTCHA.
    * - Documentation and latest version
    * PHP CAPTCHA Library for reCAPTCHA
    * - Get a reCAPTCHA API Key
    * http://recaptcha.net/api/getkey
    * - Discussion group
    * reCAPTCHA | Google Groups
    *
    * Copyright (c) 2007 reCAPTCHA -- reCAPTCHA: Stop Spam, Read Books
    * AUTHORS:
    * Mike Crawford
    * Ben Maurer
    *
    * Permission is hereby granted, free of charge, to any person obtaining a copy
    * of this software and associated documentation files (the "Software"), to deal
    * in the Software without restriction, including without limitation the rights
    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    * copies of the Software, and to permit persons to whom the Software is
    * furnished to do so, subject to the following conditions:
    *
    * The above copyright notice and this permission notice shall be included in
    * all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    * THE SOFTWARE.
    */

    /**
    * The reCAPTCHA server URL's
    */
    define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
    define("RECAPTCHA_AP

    etc

Share This Page