mikestaps's if you trying to get it to display a messagestack error for example "Please check the the reCAPTCHA form." then you probably have to add a
PHP Code:
$messageStack->add('WHATEVER-PAGE-NAME', GOOGLE_RECAPTCHA_CHECK_ERROR);
to the:
class.google_recaptcha.php file at the bottom for that page. My file is different since I'm not using what is available for download. I added the 2.0 reCAPTCHA myself before it was available for download by David so my implantation is slightly different. Below is how I did it so you can get an idea:
PHP Code:
// Zencart stuff
class google_recaptcha extends base {
function __construct() {
$this->attach($this, array('NOTIFY_CONTACT_US_CAPTCHA_CHECK', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK', 'NOTIFY_TRACKING_CAPTCHA_CHECK'));
}
function update(&$class, $eventID, $paramsArray = array()) {
global $messageStack, $error, $secret;
$event_array = array('NOTIFY_CONTACT_US_CAPTCHA_CHECK' => 'contact', 'NOTIFY_CREATE_ACCOUNT_CAPTCHA_CHECK' => 'create_account', 'NOTIFY_TRACKING_CAPTCHA_CHECK' => 'tracking');
// reCAPTCHA response?
if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
$messageStack->add('contact', GOOGLE_RECAPTCHA_CHECK_ERROR);
$messageStack->add('create_account', GOOGLE_RECAPTCHA_CHECK_ERROR);
$messageStack->add('tracking', GOOGLE_RECAPTCHA_CHECK_ERROR);
$error = true;
}
return $error;
}
}