The instructions for ASK A QUESTION would be the same as TELL A FRIEND, as it was cloned from that.
In catalog/ask_a_question.php
Find this:
require('includes/application_top.php');
Insert this AFTER:
// start modification for reCaptcha
require_once('includes/classes/recaptchalib.php');
require_once('includes/recaptchakeys.php');
// end modification for reCaptcha
Find this:
if ($error == false) {
$email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
$email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], STORE_NAME) . "\n\n";
Insert this BEFORE:
// start modification for reCaptcha
// the response from reCAPTCHA
$resp = null;
// was there a reCAPTCHA response?
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
$error = true;
$messageStack->add('friend', ENTRY_SECURITY_CHECK_ERROR . " (reCAPTCHA output: " . $resp->error . ")");
}
// end modification for reCaptcha
Find this:
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
<td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
Insert this BEFORE:
<!-- start modification for reCaptcha -->
<tr>
<td class="main"><?php echo ENTRY_SECURITY_CHECK; ?></td>
</tr>
<tr>
<script>
var RecaptchaOptions = {
theme : 'white',
tabindex : 3
};
</script>
<td class="main"><?php echo recaptcha_get_html($publickey); ?></td>
</tr>
<!-- end modification for reCaptcha -->
**********
* Step 6 *
**********
In catalog/includes/languages/xxxxxxx/ask_a_question.php
Find the ENDING:
?>
Insert this BEFORE:
define('ENTRY_SECURITY_CHECK', 'Security Code:');
define('ENTRY_SECURITY_CHECK_ERROR', 'The Security Code was not entered correctly.');
========
** END **
========
Remember to backup first.
'Rexx