Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: reCaptcha Integration

  1. #1
    Thread Starter
    Junior Member
    Not a Verified Customer
    bili.ph's Avatar
    Join Date
    Apr 2009
    Location
    Philippines
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reCaptcha Integration

    I just tried integrating reCaptcha to replace the original capcha anti-spam field. I got the original directions here:
    http://wiki.recaptcha.net/index.php/...rate_reCAPTCHA

    1. Download the reCaptcha.php here http://recaptcha.net/plugins/php/ and place it in the classipress folder

    2. Signup for reCaptcha here http://recaptcha.net/api/getkey and take note of the private and public keys

    3. In postform.php look for div class capcha and comment-out the code within this div.

    4. Paste the following lines - take note to change the public and private keys to the ones reCaptcha gave after signing up:

    <?php require_once('recaptchalib.php');
    define('PUBLIC_KEY', '6LcTCgAAAAAAgOdATOWSL66jRLL6ioPibkgMp');
    define('PRIVATE_KEY', '6LtYPgAAAAAAbodQWSLAP66jR997ioPibkgMp');
    echo recaptcha_get_html( PUBLIC_KEY ); ?>
    5. In form_process.php after "<?php" paste the following lines:

    require_once('recaptchalib.php');
    define('PUBLIC_KEY', '6LcTCgAAAAAAgOdATOWSL66jRLL6ioPibkgMp');
    define('PRIVATE_KEY', '6LtYPgAAAAAAbodQWSLAP66jR997ioPibkgMp');
    $response = recaptcha_check_answer(
    PRIVATE_KEY, $_SERVER['REMOTE_ADDR'],
    $_POST['recaptcha_challenge_field'],
    $_POST['recaptcha_response_field']
    );
    6. Look for the if-statement that validates the spam field and comment it out

    insert a new ifelse statement:
    if ( $response->is_valid ) {}
    else { $err .= __('The reCaptcha spam field is incorrect') . "
    "; }
    That's it! Let me know if this works or if you have suggestions in optimising the code

  2. #2
    Founder dcowgill's Avatar
    Join Date
    Mar 2009
    Location
    San Francisco, CA
    Posts
    1,939
    Thanks
    66
    Thanked 135 Times in 99 Posts

    Re: reCaptcha Integration

    This is great. Thanks for sharing!

  3. #3
    Thread Starter
    Junior Member
    Not a Verified Customer
    bili.ph's Avatar
    Join Date
    Apr 2009
    Location
    Philippines
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reCaptcha Integration

    no problem David

    by the way, you can also change the theme and the default colors of the reCaptcha widget. Here's the link:
    http://wiki.recaptcha.net/index.php/Theme

  4. #4
    reyvax's Avatar
    Join Date
    Apr 2009
    Location
    France
    Posts
    66
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: reCaptcha Integration

    Juste share a good capcha for comment: http://mollom.com/

    plugin for wp : http://wordpress.org/extend/plugins/wp-mollom/

  5. #5
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: reCaptcha Integration

    It doesn't work for me.

    I've installed recaptcha and it works as a wordpress plugin for registration and comments with classipress

    however, i can't make it work for the post new classified in classipress

    in my offline website on localhost, everything works fine

    when I upload my files (post-form.php and functions.php, plus the recaptchalib.php) to the server it breaks up the page - anything after <?php require_once('recaptchalib.php'); in post-form.php ... is not loaded

    I guess I have some server issue - what it can be? after the require_once fails there's no php error message from the server to help understand what's wrong

    recaptchalib.php is placed in the correct folder (same as classipress).... on localhost works, on remote server doesn't

    so I'm convinced the issue is on the server...

    anyone can help?
    thanks!

  6. #6
    Veteran taylerj's Avatar
    Join Date
    Apr 2009
    Location
    Las Vegas, NV
    Posts
    380
    Thanks
    1
    Thanked 8 Times in 6 Posts

    Re: reCaptcha Integration

    Moved this topic to tutorials, thanks for the share.
    Eric is best known in the forum for his in depth tutorials. He started in design 4 years ago and then discovered WordPress and has been coding and hacking themes and plugins ever since. He's quite helpful if you have any questions for him in the forum. Eric also makes his own WordPress themes and plugins and provides ClassiPress consulting on the side. David Cowgill - (Owner of Classipress)

  7. #7
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: reCaptcha Integration

    anyone can help with my issue please?

    if I try to follow the tutorial presented here or the one at official recaptcha pages

    either the page stops working after the beginning of the php require once string or the site fails to load entirely

    could be some setting on my server perhaps?

  8. #8
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: reCaptcha Integration

    oh wait... perhaps the problem is that I already have recaptcha as a wordpress plugin

    it might not be working on the post classified form because of that - but I want to keep recaptcha also for the user registration!

  9. #9
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: reCaptcha Integration

    yes! that was the issue... but now the problem becomes... how to make the recaptcha appear on both user registration and post new classified classipress form?

  10. #10
    Junior Member
    Not a Verified Customer
    Il Gatto's Avatar
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: reCaptcha Integration

    I solved temporally by adding manually the ReCaptcha for the post form (since on my website anyone can post a form) and added the SICaptcha plugin for the registration form.... not 100% elegant but effective

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Ebay Integration
    By jyormark in forum ClassiPress General Discussion
    Replies: 6
    Last Post: June 15th, 2011, 09:40 PM
  2. Are there plans for Authorize.net integration?
    By reddit in forum ClassiPress General Discussion
    Replies: 2
    Last Post: April 7th, 2011, 06:31 PM