The Capthca module works great with the Comments module, except from when I select to use reCaptcha instead of the one of the other options. As reCaptcha uses it's own input field, the captcha is never validated. How can I modify the template (or the source code) to let reCaptcha do the validation?
Using reCaptcha with Comments module [SOLVED]
Using reCaptcha with Comments module [SOLVED]
Hi!
The Capthca module works great with the Comments module, except from when I select to use reCaptcha instead of the one of the other options. As reCaptcha uses it's own input field, the captcha is never validated. How can I modify the template (or the source code) to let reCaptcha do the validation?

The Capthca module works great with the Comments module, except from when I select to use reCaptcha instead of the one of the other options. As reCaptcha uses it's own input field, the captcha is never validated. How can I modify the template (or the source code) to let reCaptcha do the validation?
Last edited by jervi on Fri Oct 09, 2009 3:04 pm, edited 1 time in total.
SOLVED: Re: Using reCaptcha with Comments module
In the modules/comments
action.default.php line 107 find:
change to:
then in the comments template in the admin area:
Find this:
and remove the first table return with redundant code in it (it's ONLY redundant *if* the reCaptcha is used)
Because you're using reCaptcha, you'd remove the instructions to enter the code "entercodetxt" (in the lang file) and the input field "inputentercode"
Next, to style the reCaptcha you can do this:
Put this in the head of your template between the literal tags
Then add this to your css and change as you like.
action.default.php line 107 find:
Code: Select all
if (TRUE == empty($params['captcha_phrase']) || ! $captcha->CheckCaptcha($params['captcha_phrase'])) {
Code: Select all
if (FALSE == empty($params['captcha_phrase']) || ! $captcha->CheckCaptcha($params['captcha_phrase'])) {
then in the comments template in the admin area:
Find this:
Code: Select all
{if $spamprotect}
<tr>
<td>{$entercodetxt}:</td>
<td>{$inputentercode}</td>
</tr>
{/if}Because you're using reCaptcha, you'd remove the instructions to enter the code "entercodetxt" (in the lang file) and the input field "inputentercode"
Next, to style the reCaptcha you can do this:
Put this in the head of your template between the literal tags
Code: Select all
<__script__ type="text/javascript">
var RecaptchaOptions = {
theme : 'clean'
};
</__script>
Code: Select all
/* Recaptcha Styles */
.recaptchatable .recaptcha_image_cell, #recaptcha_table {
background-color:transparent !important; /* reCaptcha widget background color*/
}
#recaptcha_table {
border-color: #fff !important; /* reCaptcha widget border color*/
}
#recaptcha_response_field {
border-color: #333 !important; /* Text input field border color*/
background-color:#fff !important; /* Text input field background color*/
}
#recaptcha_table img {
border:0px!important; /* stop spam read books removing border from this image*/
}
Re: Using reCaptcha with Comments module [SOLVED]
Thanx for this solution, works like a charm 

