News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Try my new CAPTCHA circle test

Started by akyhne, December 02, 2008, 10:51:21 AM

Previous topic - Next topic

lax.slash

LMAO @ the "Spammers Wanted!"


Hopefully you get the kinks worked out soon. Very innovative idea!

Sorry to hear about your eye. Get well soon!

Akyhne

I think I found the solution on what way to do the change of text. I will just do as SMF does and load another image with the explaining text on it.

lax.slash



Akyhne

Thanks. But I have to finnish the code first. Still long way to go.

Akyhne

I'm close to have a beta 1 ready for people to try. Should I create a mod in the mod section or just attach it here?

lax.slash

It's 1000% up to you. :) If you upload it to the mods section, then SMF will check it for security, and stuff like that. You'll also have a topic for support and everything created for you, which, IMO makes it a lot easier for the mod author to give help. You're also able to see how many people download it. If you upload it here though, it is faster, and it's online right away, as opposed to waiting one or two days for them to approve it.

Akyhne

I'm not that big a programmer and I have no knowledge of SMF's coding guidelines etc. So I don't know if I will even make a mod out of this.
Therefore I think I will upload the file here - perhaps later tonight.

Akyhne

Ok. here we go. Use it at own risc. I have tried it on several forums, but with no other packages or themes installed. Please repport back with issues.


Cavecost Captcha v1.0 beta
By Akyhne




Cavecost
CAptcha VErification Confirmation Of Shapes and Text


Compatibility
For SMF 1.1.7

Introduction
This mod enhances the captcha test by adding an extended captcha verification with fake letters in the verification image, that the registrant should not provide in the captcha verification field. To tell the registrant which letters are fake, a shape is put above each letter. Another captcha image is added to tell the shape of the fake letters.

The extended captcha is not interfering with PM center, although the shapes are still shown there!

REQUIRED: A manual edit is REQUIRED for ALL themes (other than SMF Core Default) which have a custom Register.template.php
If you don't do perform the edit, nobody will be able to register using those themes.

Manual edit of Register.template.php:
Replace the function "refreshImages"
function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("', $context['verificiation_image_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);

// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);';

if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;';
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";';
echo '
}';


with


function refreshImages()
{
// Make sure we are using a new rand code.
var new_url = new String("', $context['verificiation_image_href'], '");
var new_url2 = new String("', $context['verificiation_shape_href'], '");
new_url = new_url.substr(0, new_url.indexOf("rand=") + 5);
new_url2 = new_url2.substr(0, new_url.indexOf("rand=") + 5);

// Quick and dirty way of converting decimal to hex
var hexstr = "0123456789abcdef";
for(var i=0; i < 32; i++)
new_url = new_url + hexstr.substr(Math.floor(Math.random() * 16), 1);
new_url2 = new_url2 + hexstr.substr(Math.floor(Math.random() * 16), 1);';

if ($context['use_graphic_library'])
echo '
document.getElementById("verificiation_image").src = new_url;
document.getElementById("verificiation_shape").src = new_url2;';
else
echo '
document.getElementById("verificiation_image_1").src = new_url + ";letter=1";
document.getElementById("verificiation_image_2").src = new_url + ";letter=2";
document.getElementById("verificiation_image_3").src = new_url + ";letter=3";
document.getElementById("verificiation_image_4").src = new_url + ";letter=4";
document.getElementById("verificiation_image_5").src = new_url + ";letter=5";';
echo '
}';


Insert after

if ($context['visual_verification'])
{
echo '
<tr valign="top">
<td width="40%" valign="top">
<b>', $txt['visual_verification_label'], ':</b>
<div class="smalltext">', $txt['visual_verification_description'], '</div>


.. this code:

<div style="display:', $modSettings['disable_visual_verification'] == 5 ? 'block': 'none','">', $txt['visual_verification_description_special1'], '<br />
<img src="', $context['verificiation_shape_href'], '" alt="" id="verificiation_shape" /><br />
', $txt['visual_verification_description_special2'], '</div>



Insert after:


<option value="4" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 4 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_high'], '</option>



.. this code:


<option value="5" ', !empty($modSettings['disable_visual_verification']) && $modSettings['disable_visual_verification'] == 5 ? 'selected="selected"' : '', '>', $txt['admin_setting_image_verification_special1'], '</option>



Features
o Adds another option of an extended captcha test

Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version. Do NOT activate this mod while people are registering. They will not be able to verify the captcha due to already created sessions. If you are trying the captcha verification right after activating the mod, you will perhaps not be able to. Simply close your browser and open it again to kill existing sessions (a F5 keystroke won't do!).

Simply install the package to install on the SMF Default Core Theme ONLY.

A Manual edit will be required for ALL themes (other than SMF Default Core Theme) which have a custom Register.template.php
If you don't perform the manual edit, nobody will be able to register using those themes.

Unistallation
Just uninstall the mod as usual from the package center. Be sure to visit the registration -> Settings and change the captcha level to whatever level you wish. If you don't do this, the captcha level will change to lowest level!!

Changelog
1.0 beta 1 - 08th December 2008
o First beta

Akyhne

By the way... it works with the "Are you human" but not with "Recaptcha"

lax.slash


lax.slash

1) No problem with installation!

2) It told me to leave out letters with a character that wasn't even being shown.


This happens every time I refresh it.

Akyhne

You didn't read the readme ;)

You have to close the browser and open it again to delete the old sessions. Then it generates new cookie sessions

lax.slash

Oh.

* lax.slash smacks himself on the forehead

Akyhne

When everything else fail... read the manual ;)

lax.slash

Works like a charm! :) No errors I can see.

Akyhne

What mods and themes have you installed in the forum?

lax.slash

Just a mod I made that I uploaded today to SMF. It just modifies the "News:" text for random news items. I only have themes packaged with SMF by default as of now.

M-DVD

Good idea. Simple and Effective.

The spammers will have most difficult.  :D

Akyhne

Oh, I'm not done yet. It will be even more hard in a future version ;)

Advertisement: