For those, like me, who can't get Captcha Plugin (http://forum.coppermine-gallery.net/index.php/topic,36319.0.html) working, I've "extended" Abbas Ali Captcha Mod for comments (http://forum.coppermine-gallery.net/index.php/topic,29564.0.html) to registration page, in order to prevent automatic registrations by spambots and alike.
This mod will present new users trying to register an additional required field to enter the confirmation code shown aside in the captcha image: no matching confirmation code = registration not allowed, quite simple :-)
DEMO: http://vanrokken.altervista.org/register.php
NEW FILES: 4 (
only if Captcha Mod for comments is not installed)
- captcha.php
- include/captcha.class.php
- fonts/acidic.ttf
- fonts/hurryup.ttf
FILES TO EDIT: 2
- register.php
- lang/english.php
EXTRACT (
only if Captcha Mod for comments is not installed)
attached zip file to your gallery root directory, as follows:
- captcha.php => / (root directory)
- captcha.class.php => /include
- acidic.ttf => /fonts
- hurryup.ttf => /fonts
OPEN
register.phpFIND
require('include/init.inc.php');
AFTER, ADD
require('include/captcha.class.php');
FIND
array('input', 'email', $lang_register_php['email'], 255),
AFTER, ADD
array('input', 'confirm', $lang_register_php['confirm'], 5),
FIND
if ($element[2]) echo <<<EOT
<tr>
<td width="40%" class="tableb" height="25">
{$element[2]}
</td>
<td width="60%" class="tableb" valign="top">
<input type="text" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="$value" class="textinput" />
</td>
</tr>
EOT;
REPLACE WITH
if ($element[2]) {
echo <<<EOT
<tr>
<td width="40%" class="tableb" height="25">
{$element[2]}
</td>
<td width="60%" class="tableb" valign="top">
EOT;
if ($element[1] == "confirm") {
echo '<input type="text" style="width: 40%" name="'.$element[1].'" maxlength="'.$element[3].'" value="'.$value.'" class="textinput" /> <img src="captcha.php" align="middle">';
} else {
echo '<input type="text" style="width: 100%" name="'.$element[1].'" maxlength="'.$element[3].'" value="'.$value.'" class="textinput" />';
}
echo <<<EOT
</td>
</tr>
EOT;
}
FIND
$email = trim(get_post_var('email'));
AFTER, ADD
$confirm = trim(get_post_var('confirm'));
FIND
if ($error != '') return false;
BEFORE, ADD
if (!PhpCaptcha::Validate($confirm)) $error .= '<li>' . $lang_register_php['captcha_error'];
OPEN
lang/english.phpFIND
);
$lang_register_confirm_email = <<<EOT
BEFORE, ADD
'confirm' => 'Enter confirmation code',
'captcha_error' => 'Confirmation code not matching',
SAVE AND CLOSE ALL FILES
hey im sorry but i didnt find any fonts folder in my cpg folder
what shud i do
It should be created extracting the attached zip file, if not create it manually...
hey z i have installed the mod like u said but my captcha image dont show up and im really depressed man i can't get ppl to join my gallery :( please help.
For any issue not related to registration page in particular, refer to "main" Captcha Mod thread (http://forum.coppermine-gallery.net/index.php/topic,29564.0.html)
Is this captcha or re-captcha? ???
i having problems with this mod
captcha don't appear ???
i double check the files and the edits all is fine
my gallery link
http://abroadbg.com
Works fine in other languages. Looks like you broke your Bulgarian language file by editing it. Restore a clean copy.