Re: Support Thread for Google reCAPTCHA
Hi David
Thanks it works fine now. I thing it had to do with latency of my ISP. One other thing. How do I get it to work on my SSL pages? Currently a warning flashes up, when you go to the contact us or create an account page that not all items are secure? Is there something I should have done with Google?
Thanks in advance.
Dono
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
dochsa
Hi David
Thanks it works fine now. I thing it had to do with latency of my ISP. One other thing. How do I get it to work on my SSL pages? Currently a warning flashes up, when you go to the contact us or create an account page that not all items are secure? Is there something I should have done with Google?
Thanks in advance.
Dono
See the reply I gave earlier about SSL.
Quote:
Originally Posted by
David Allen
The solution is simple - in the Contact-us template file change the line (step 4 in instalation, step 6 for create account)
Code:
<?php echo recaptcha_get_html($publickey, $resp->error); ?>
to this
Code:
<?php echo recaptcha_get_html($publickey, $resp->error, true); ?>
The extra 'true' tells it to use SSL and should solve the problem.
In the next version I'll get it to pick up the HTTPS automatically
Regards
David
Re: Support Thread for Google reCAPTCHA
Hi!
I`d like to include this mod to an EZ-page on which customers can send me their suggestions.I get spam messages so I MUST include some captcha script to this page.Any ideas how could this be done?
Re: Support Thread for Google reCAPTCHA
It shouldn't be too hard :) - you just need to add the line
Code:
<?php echo recaptcha_get_html($publickey, $resp->error); ?>
into the suggestion form - this shows the CAPTCHA to your customers. Then in the code which sends the email, add in the check for a correct response
Code:
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// set the error code so that we can display it
$messageStack->add('your-EZ-page', $resp->error);
$error = true;
}
Hope this helps
Regards
David
Re: Support Thread for Google reCAPTCHA
It showes error); ?> on the suggestions page and then shows the form, but no captcha is loaded
Re: Support Thread for Google reCAPTCHA
looks like your php tags are out of synch.
You will also need the recaptchalib.php file in the extra functions folder.
Re: Support Thread for Google reCAPTCHA
1 Attachment(s)
Re: Support Thread for Google reCAPTCHA
David,
For v1.5.1 and newer (since some captcha-related notifier hooks were added to v1.5.1), you can drop the changes your v1.1 plugin makes to the /includes/modules/ files and simply add the attached notifier support files to accomplish the same results.
Makes integration a lot simpler that way because there's fewer files to edit (esp since some of those files are often edited by other plugins), and simpler to update in the future too.
I might also suggest that using zen_get_ip_address() instead of $_SERVER['REMOTE_ADDR'] might provide more accurate results especially if the visitor is behind some sort of proxy or forwarder, or the store's hosting company is using some sort of proxying or caching engine that incorrectly passes the store's IP instead of the visitor's IP.
Re: Support Thread for Google reCAPTCHA
Quote:
Originally Posted by
DrByte
David,
For v1.5.1 and newer (since some captcha-related notifier hooks were added to v1.5.1), you can drop the changes your v1.1 plugin makes to the /includes/modules/ files and simply add the attached notifier support files to accomplish the same results.
Makes integration a lot simpler that way because there's fewer files to edit (esp since some of those files are often edited by other plugins), and simpler to update in the future too.
Thanks for that. I've just d/loaded today's new 1.51 and see the added notifier hooks. Brilliant. It will, as you say, make things a lot simpler.
In order not to have to maintain 2 versions (pre-1.51 and 1.51+) going forward, I'm thinking that I should make the pre-1.51 version also use the observer class. A quick question if I may. Am I correct in that all I would need (apart from the check on $error) to add to those header_php.php files would be the line
Code:
$zco_notifier->notify('NOTIFY_CONTACT_US_CAPTCHA_CHECK');
I like the sugestion of using zen_get_ip_address(). I'll add that to the observer class.
Many thanks
David
Re: Support Thread for Google reCAPTCHA
The only requirements you'd need to backport would be the changes that added the notifier points to those modules files.