If anyone is using the "CAPTCHA using TTF & GD" mod and wanted to add that CAPTCHA mod to the forms created from this mod here's down and dirty what I did:
In the form you created located in "includes/templates/YOUR_TEMPLATE/templates" find this:
Code:
</fieldset>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>
Paste the following just above this
Code:
<?php
// BOF Captcha
if(is_object($captcha) && (!$_SESSION['customer_id'])) {
?>
<br class="clearBoth" />
<?php echo $captcha->img(); ?>
<?php echo $captcha->redraw_button(BUTTON_IMAGE_CAPTCHA_REDRAW, BUTTON_IMAGE_CAPTCHA_REDRAW_ALT); ?>
<br class="clearBoth" />
<label for="captcha"><?php echo TITLE_CAPTCHA; ?></label>
<?php echo $captcha->input_field('captcha', 'id="captcha"') . ' <span class="alert">' . TEXT_CAPTCHA . '</span>'; ?>
<br class="clearBoth" />
<?php
}
// BOF Captcha
?>
In your header_php.php located in "includes/modules/pages/YOUR_FORM" find this:
Code:
require(DIR_WS_MODULES . 'require_languages.php');
$breadcrumb->add(NAVBAR_TITLE);
Just below this add:
Code:
// BOF Captcha
if(CAPTCHA_CONTACT_US != 'false') {
require(DIR_WS_CLASSES . 'captcha.php');
$captcha = new captcha();
}
// EOF Captcha
Then find this:
Code:
if ($error == false) {
// grab some customer info if logged in
if(isset($_SESSION['customer_id'])) {
And just above it paste this:
Code:
// BOF Captcha Validation
if (is_object($captcha) && !$captcha->validateCaptchaCode()) {
$error = true;
$messageStack->add('customer_questionnaire', ERROR_CAPTCHA);
}
// EOF Captcha Validation
I think this covers everything I did.. (Hopefully I didn't overlook anything) So far my testing shows this works just perfectly..
Here's the source I used: http://www.zen-cart.com/forum/showpo...&postcount=284
This post shows how to add the CAPTCHA to the Returns Authorization form, but it was pretty to adapt the instructions here to work with this form.. Hopefully someone else will find it useful too..