Results 1 to 4 of 4

Thread: How to add Captcha to ad creation page in Classipress?

  1. #1
    Thread Starter
    Amateur tothenines's Avatar
    Join Date
    Sep 2011
    Location
    Mexico
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question How to add Captcha to ad creation page in Classipress?

    Have made a few customizations to my Classipress install to make it easier for users. One change is that I no longer require users to register and log in to post an ad. Because I am not requiring the login, I want to place a Captcha on the ad creation page to prevent excessive spam from being sent in. How can I do this?

    I tried adding the following (found here http://forums.appthemes.com/recaptch...age-ads-15208/ in this tutorial to add captcha to the sidebar form) to the step-functions.php file but it gave me a parse error:

    PHP Code:
    <?php
     
    // call the lib..
        
    require_once (TEMPLATEPATH '/includes/lib/recaptchalib.php');
        
    $resp null;
        
    $error null;
     
    // Get a key from http://recaptcha.net/api/getkey
    $publickey "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    $privatekey "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
     
     
    # was there a reCAPTCHA response?
    if ($_POST["submit"]) {
     
        
    $response recaptcha_check_answer($privatekey,
            
    $_SERVER["REMOTE_ADDR"],
            
    $_POST["recaptcha_challenge_field"],
            
    $_POST["recaptcha_response_field"]);
     
            if (
    $response->is_valid) {
                    
    cp_contact_ad_owner_email($post->ID);
            
    $msg '<p class="green center"><strong>' __('Your message has been sent!''appthemes') . '</p>';
            } else {
     
                    
    # set the error code so that we can display it
            
    $msg '<p class="red center"><strong>' __('The anti-spam reCaptcha answer was incorrect!' 'appthemes') . '</p>';
     
             }
    }
     
    ?>
    Any help would be so much appreciated !!! Thank you so much

  2. #2
    Veteran ajamm's Avatar
    Join Date
    Nov 2011
    Location
    New Zealand
    Posts
    309
    Thanks
    26
    Thanked 32 Times in 29 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Veteran bleem's Avatar
    Join Date
    Feb 2012
    Posts
    1,572
    Thanks
    104
    Thanked 205 Times in 180 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Junior Member timkoch's Avatar
    Join Date
    May 2011
    Location
    South Africa
    Posts
    41
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Add ReCaptcha to classipress ad creation page

    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Vantage: New Listing Creation Results in Blank Page
    By saltspring in forum Report Vantage Bugs (Legacy)
    Replies: 3
    Last Post: July 21st, 2012, 08:19 AM
  2. How to add recaptcha or any captcha in category selection page
    By navjottomer in forum ClassiPress General Discussion
    Replies: 7
    Last Post: April 12th, 2011, 11:13 AM
  3. [SOLVED] Using Fixed Ad model but Ad creation page shows Per-Category Price
    By johare in forum Help Using ClassiPress
    Replies: 1
    Last Post: December 10th, 2010, 06:51 PM