Audio Captcha in Dolphin 6

lancashiredates posted 15th of April 2010 in Community Voice. 2 comments.

This can also be easily integrated with Dolphin 7 Look Here

For Dolphin 6 You can swap the current Captcha for a third party one with Captcha Refresh and Audio.

I have done this with Securimage from http://www.phpcaptcha.org/

You can set it to play audio via flash or by clicking an image that plays a wav file.

I used Securimage V 2.0.1 for this tutorial.

Step 1.

Upload Securimage files to a folder called /captcha/ in your main dolphin directory.

Step 2. Set Cookie for D6

Edit /captcha/securimage.php

Find: around line 1000

function generateCode($len)

{

$code = '';

for($i = 1, $cslen = strlen($this->charset); $i <= $len; ++$i) {

$code .= $this->charset{rand(0, $cslen - 1)};

}

return $code;

}

Replace with:

function generateCode($len)

{

$code = '';

for($i = 1, $cslen = strlen($this->charset); $i <= $len; ++$i) {

$code .= $this->charset{rand(0, $cslen - 1)};

}

$hashtext = md5($code);

setcookie('strSec', $hashtext, 0, '/');

return $code;

}

Step 3. Show Captcha Code in D6 Join Form

Edit /templates/base/scripts/BxBaseFormView.php

Find: around line 367

case 'Captcha':

$sCode =

'<img src="' . $site['url'] . 'simg/simg.php" class="form_captcha" /><br /><br />

<input type="text" class="input_text" maxlength="6" name="Captcha" />';

break;

Replace with:

case 'Captcha':

$mtime= md5(time());

$sCode =

'<p> <img id="siimage" align="left" style="padding-right: 5px; border: 0" src="' . $site['url'] . 'captcha/securimage_show.php?sid=' . $mtime . '" />

</p><p style="clear:both">&nbsp;

</p>

<p>Click to hear code:

<a style="border-style: none" href="' . $site['url'] . 'captcha/securimage_play.php" title="Audible Version of CAPTCHA"><img src="' . $site['url'] . 'captcha/images/audio_icon.gif" alt="Audio Version" style="border:none" alt="this.blur()" /></a>

</p>

<p>&nbsp;</p>

<p>Click to swap image:

<!-- pass a session id to the query string of the script to prevent ie caching -->

<a tabindex="-1" style="border-style: none" href="#" title="Refresh Image" alt="document.getElementById(\'siimage\').src = \'' . $site['url'] . 'captcha/securimage_show.php?sid=\' + Math.random(); return false"><img src="' . $site['url'] . 'captcha/images/refresh.gif" alt="Reload Image" border="0" alt="this.blur()" style="vertical-align:middle" /></a>

</p>       <br />

<input type="text" class="input_text" maxlength="6" name="Captcha" />';

break;

Step 4. stop the old Captcha from overwriting the Cookie

Edit /simg/simg.php

Remove or Comment these lines: around line 36


$hashtext = md5($textstr);
setcookie('strSec', $hashtext, 0, '/');

Thats it

This was done on Dolphin V6.1.6 it should also work on 6.1.4 and 6.1.5

Check it out here Lancashire Dating

Dave

 
Comments
·Oldest
·Top
Please login to post a comment.
jtadeo
Thanks for taking the time to contribute this. Maybe someone will do a Dolphin 7 version.
lancashiredates
Your wish is my Command

http://www.boonex.com/unity/blog/entry/Captcha_with_Audio_for_Dolphin_7

Regards
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
PET:0.049627065658569