RECAPTCHA for submit

Register an Account
Closed Thread
 
Thread Tools Display Modes
  #11 (permalink)  
Old 01-18-2008, 08:06 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
With 9.9 - the reCAPTCHA is built in by default, also comes options to use Whitehat CAPTCHA, default Pligg CAPTCHA or simple Math equations for your users to solve.
  #12 (permalink)  
Old 01-18-2008, 10:46 AM
xiesi's Avatar
Constant Pligger
Pligg Version: 9.95
Pligg Template: yget + diy
 
Join Date: Jun 2007
Posts: 223
Send a message via MSN to xiesi
I want have CAPTCHA for submit comments.
  #13 (permalink)  
Old 01-18-2008, 10:52 AM
New Pligger
 
Join Date: Sep 2006
Posts: 3
Good...that's exactly what i needed......
  #14 (permalink)  
Old 01-18-2008, 11:33 AM
xiesi's Avatar
Constant Pligger
Pligg Version: 9.95
Pligg Template: yget + diy
 
Join Date: Jun 2007
Posts: 223
Send a message via MSN to xiesi
I really want have a captcha mod for submit comments.anyone can help?
  #15 (permalink)  
Old 02-10-2008, 03:50 PM
Casual Pligger
Pligg Version: 1.1.2
Pligg Template: Wistie
 
Join Date: Feb 2008
Location: USA
Posts: 89
Hi,
Thanks for putting the solution online but I have a question..I am using the recaptcha already for my registration process. Can I use the same for submitting the news? If so, should I use the same solution you provided?
Thanks in advance.

Quote:
Originally Posted by fhelik View Post
Ok these are the steps to get the Recaptcha in the submission page, so every user has to fill the captcha in order to continue with the submission. /

You will end up with something like this: (check the attachment)

(Before start you will need a Recaptcha keys, to get them go to recaptcha register and get the key, also download the recaptchalib.php from the same site and save it in your pligg base folder)

(Before we start make sure the User Registration Captcha is "true" under the admin, configuration, Captcha)

Step 1: open submit_step_2.tpl

Look for this:


HTML Code:
 <input type="submit" value="{#PLIGG_Visual_Submit2_Continue#}" class="submit" />		
		<input type="hidden" name="url" id="url" value="{$submit_url}" />
		<input type="hidden" name="phase" value="2" />
		<input type="hidden" name="randkey" value="{$randkey}" />
		<input type="hidden" name="id" value="{$submit_id}" />
Right before that insert this( remember to change YOURPUBLICKEY for yours):

Code:
         {php} 		
			require_once('recaptchalib.php');
			$publickey = "YOURPUBLICKEY"; // you got this from the signup page
			echo recaptcha_get_html($publickey);
		{/php}
Now open submit.php

look for this:

PHP Code:
check_actions('do_submit1');
    
$main_smarty->display($the_template '/pligg.tpl');
}

// submit step 2 
right after insert this (remember to change YOUR PUBLIC AND SECRET):

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
            
$main_smarty->assign('register_error_text'"badcode");
            
$main_smarty->display($the_template '/register_error.tpl');
            return;
        }
        
// fin capthca 
a little below look for this:

PHP Code:
}

// submit step 3 
and replace it with this: ( I just added one more } )

PHP Code:
}}

// submit step 3 
Before start make backup of these 2 files, in case you make a mistake.
I made this from a code I found there in pligg, plus the resources of Recaptcha.net and recaptcha group.

I hope this helps, and work, please leave a comment after installation.

I don't know what people are doing wrong, but for those here are the files. remember to do the backup of the 3 files before replace. NOTE i am using yget template on indipop.net

check the attachment for the files.

ok I hope it works for you guys. please post here if success
  #16 (permalink)  
Old 02-13-2008, 05:49 PM
Constant Pligger
Pligg Version: 9.9
Pligg Template: yget mod
 
Join Date: Oct 2007
Posts: 162
edit: i'm sorry it was a misunderstood

Last edited by lacasuela; 02-13-2008 at 06:48 PM.
  #17 (permalink)  
Old 05-24-2008, 12:58 AM
Casual Pligger
 
Join Date: Apr 2008
Posts: 41
Quote:
Originally Posted by dollars5 View Post
With 9.9 - the reCAPTCHA is built in by default, also comes options to use Whitehat CAPTCHA, default Pligg CAPTCHA or simple Math equations for your users to solve.
I can only see this on registration. How can I enable it on news submission?
  #18 (permalink)  
Old 06-27-2008, 08:58 AM
gameradam
Guest
 
Posts: n/a
How do I add this for news submissions so that when submitting news you'll have to enter in a RECAPTCHA code.
  #19 (permalink)  
Old 06-28-2008, 10:44 PM
gameradam
Guest
 
Posts: n/a
Anyone?
Come on, this would really help fight spam.
  #20 (permalink)  
Old 06-28-2008, 10:58 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 gameradam View Post
Anyone?
Come on, this would really help fight spam.
I suggest you read the entire thread... The solution has already been posted.
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