Replace mathematical captcha with words (Technics)

by Paul @, Thursday, June 26, 2008, 19:29 (5776 days ago)

I'm trying to follow the CAPTCHA customization; replace the numbers with words to try and elude the spambots a bit more.

The instructions say to input the following line in the "template":

{$captcha.number_1 | replace:"1":"one" | replace:"2":"two" | replace...}

(Added spaces to post this topic.)

Can someone tell me where exactly I need to put this? I've tried template.html, lang/english.php, captcha/captcha.php without success. Thanks in advance!

locked
5130 views
Avatar

Replace mathematical captcha with words

by Alex ⌂, Thursday, June 26, 2008, 20:04 (5776 days ago) @ Paul

Hi Paul,

search for this line in templates/default/subtemplates/posting.tpl.inc:

<label for="captcha_code">{#captcha_expl_math#} {$captcha.number_1} + {$captcha.number_2} = </label><input id="captcha_code" type="text" name="captcha_code" value="" size="5" maxlength="5" /></p>

and replace it by

<label for="captcha_code">{#captcha_expl_math#} {$captcha.number_1|replace:"1":"one"|replace... ... ... ...} + {$captcha.number_2|replace:"1":"one"|replace... ... ... ...} = </label><input id="captcha_code" type="text" name="captcha_code" value="" size="5" maxlength="5" /></p>

Alex

locked
5048 views

Replace mathematical captcha with words

by Paul, Friday, June 27, 2008, 05:54 (5776 days ago) @ Alex

Hi Alex,

Thanks for the reply! However I only have a template.html file in the root folder, not the subfolder or .inc file that you mention. I forgot to say that I'm running version 1.7, maybe that's why?

The closest thing I could find to your instructions are

$number[0] = rand(1,10);
$number[1] = rand(0,10);
$number[2] = $number[0] + $number[1];

in captcha/captcha.php. The "labels" are also placed, I think, in lang/english.php as $lang['captcha_...'] entries... I still don't see how/where to enter your replacements..

locked
4981 views

Replace mathematical captcha with words

by Paul, Friday, June 27, 2008, 08:57 (5776 days ago) @ Paul

I just realized there's a separate forum for v1.x. Sorry for the mistake!

locked
5032 views

RSS Feed of thread