RECAPTCHA for submit

Register an Account
Closed Thread
 
Thread Tools Display Modes
  #21 (permalink)  
Old 07-17-2008, 06:16 PM
New Pligger
 
Join Date: Aug 2007
Posts: 1
Thanks ruptan for all the work that was done on this. After reviewing your post and the attached files, I noticed an error in the post that was not in the attached files. I also modified the behavior so that when a user enters an invalid Captcha, the user will return to the same page with the error message from recaptcha.

First, I am using Pligg 9.9.0

Step 1: Open submit_step_2.tpl:

Find :
PHP Code:
<input type="submit" value="{#PLIGG_Visual_Submit2_Continue#}" class="submit" /> 
BEFORE THIS PLACE:
PHP Code:
            <?php 
                
require_once(captcha_captchas_path '/reCaptcha/libs/recaptchalib.php');
                
$publickey get_misc_data('reCaptcha_pubkey'); // you got this from the signup page
                
echo recaptcha_get_html($publickey);
            
?>
(this code was found in modules->captcha->captchas->recaptcha->captcha.tpl)
Step 2: Open Submit.php (this is where the typo is on ruptan's post).

Find:

PHP Code:
// submit step 2

function do_submit2() {
    global 
$db$main_smarty$dblang$the_template$linkres$current_user
AFTER THIS PASTE:
PHP Code:
//captcha
if(enable_captcha == 'true') {
            
        require_once(
'recaptchalib.php');        
        
// Get a key from http://recaptcha.net/api/getkey
        
$publickey "YOURPUBLICKEY";
        
$privatekey "YOURPRIVATE";
        
        
# the response from reCAPTCHA
        
$resp null;
        
# the error code from reCAPTCHA, if any
        
$error null;
        
        
# was there a reCAPTCHA response?
        
if ($_POST["recaptcha_response_field"]) {
                
$resp recaptcha_check_answer ($privatekey,
                                                
$_SERVER["REMOTE_ADDR"],
                                                
$_POST["recaptcha_challenge_field"],
                                                
$_POST["recaptcha_response_field"]);
                
                if (
$resp->is_valid) {
                        echo 
"Succesfully verified that you are human.";
                } else {
                        
# set the error code so that we can display it
                        
$error $resp->error;

                }
        }    
            
        if (!
$resp->is_valid) { // if incorrect captcha code was entered
              
echo $error;
            
do_submit1();
            return;
        }
        
// fin capthca 
Step 3:

In Submit.php,

FIND:

PHP Code:
}

// submit step 3 
REPLACE WITH:
PHP Code:
} }

// submit step 3 
In Summary: The code listed on the site for submit.php incorrectly places new captcha code in such a way that the function do_submit2() never gets created. However, the code listed in the attachment is correct. If you don't look at that code, you will not get this to work. I also changed the behavior so that if it is a human who typed wrong, they can refill the submit page.

Thanks again for even figuring this stuff out, I hope that this post clarifies some of the issues you may encounter getting this to work.

Kudos also goes to ednet, who had a similar post. His showed me the typo I pointed out...

http://forums.pligg.com/pligg-mods/8...recaptcha.html

If you'd like to see an example: www.TotalExperience.com
  #22 (permalink)  
Old 07-18-2008, 09:59 AM
Constant Pligger
 
Join Date: May 2007
Posts: 143
Great! finally a working Recapcha mod for pligg 0.9.9
Thanks

Watch Tv Episode Online - Watch your favorites Tv Shows.
  #23 (permalink)  
Old 10-02-2008, 01:43 AM
New Pligger
 
Join Date: Jul 2008
Posts: 18
Looks good on the site but when you press submit it goes to a blank page, help?!
  #24 (permalink)  
Old 10-22-2008, 12:38 PM
New Pligger
 
Join Date: Sep 2007
Posts: 19
Quote:
Originally Posted by iamneat1 View Post
Looks good on the site but when you press submit it goes to a blank page, help?!
yes same this happens here
please help
  #25 (permalink)  
Old 10-23-2008, 06:38 AM
Casual Pligger
 
Join Date: Mar 2008
Posts: 30
How can solve tshi problem?

"Fatal error: Call to undefined function do_submit2() in /var/www/vhosts/mysite.com/httpdocs/submit.php on line 65"

Where is the problem?

thanks a lot
  #26 (permalink)  
Old 10-23-2008, 11:28 AM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Quote:
Originally Posted by nuki View Post
How can solve tshi problem?

"Fatal error: Call to undefined function do_submit2() in /var/www/vhosts/mysite.com/httpdocs/submit.php on line 65"

Where is the problem?

thanks a lot
What version of Pligg are you using?
  #27 (permalink)  
Old 10-23-2008, 11:47 AM
New Pligger
 
Join Date: Sep 2007
Posts: 19
i tried all but i am facing blank page after submission i dont know what to do i am using 9.9
latest
please help me
  #28 (permalink)  
Old 10-23-2008, 12:11 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Quote:
Originally Posted by whomi View Post
i tried all but i am facing blank page after submission i dont know what to do i am using 9.9
latest
please help me
9.9 is not the latest. 9.9.5 is.
Pligg Beta 9.9.5 comes with recaptcha already included.
Just go to admin and click on captcha and set it up from there.
  #29 (permalink)  
Old 10-23-2008, 12:59 PM
New Pligger
 
Join Date: Sep 2007
Posts: 19
hi i am talking about recaptcha from submisison of story
is it includec in 9.9.5 if yes then how to set that
  #30 (permalink)  
Old 10-23-2008, 01:32 PM
chuckroast's Avatar
Pligg Developer/Coder/Designer
Pligg Version: SVN
Pligg Template: Social Pro Kit
 
Join Date: Jun 2006
Posts: 5,448
Quote:
Originally Posted by whomi View Post
hi i am talking about recaptcha from submisison of story
is it includec in 9.9.5 if yes then how to set that
in Pligg Beta 9.9.5 go to Admin, then click on Captcha. Enable the Recaptcha module, Then click Configure and enter the keys.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[mod request] (re)captcha for ajax contact form? Rodney Questions and Comments 7 02-18-2011 11:02 AM
Pligg 1.0 Recaptcha on Step2 msmanikandan Questions and Comments 1 07-14-2009 11:53 AM
RecaptchA CONFIGURED reklama Questions and Comments 4 11-15-2008 03:26 PM
[Mod] Dodging SPAM with recaptcha ednet Questions and Comments 22 08-09-2008 03:48 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development