forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: Ludo on July 14, 2008, 07:17:57 pm

Title: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: Ludo on July 14, 2008, 07:17:57 pm
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)

FILES TO EDIT: 2

EXTRACT (only if Captcha Mod for comments is not installed)
attached zip file to your gallery root directory, as follows:

OPEN
register.php

FIND
Code: [Select]
require('include/init.inc.php');
AFTER, ADD
Code: [Select]
require('include/captcha.class.php');
FIND
Code: [Select]
        array('input', 'email', $lang_register_php['email'], 255),
AFTER, ADD
Code: [Select]
        array('input', 'confirm', $lang_register_php['confirm'], 5),
FIND
Code: [Select]
            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
Code: [Select]
            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" />&nbsp;<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
Code: [Select]
    $email = trim(get_post_var('email'));
AFTER, ADD
Code: [Select]
    $confirm = trim(get_post_var('confirm'));
FIND
Code: [Select]
    if ($error != '') return false;
BEFORE, ADD
Code: [Select]
    if (!PhpCaptcha::Validate($confirm)) $error .= '<li>' . $lang_register_php['captcha_error'];

OPEN
lang/english.php

FIND
Code: [Select]
);

$lang_register_confirm_email = <<<EOT

BEFORE, ADD
Code: [Select]
  'confirm' => 'Enter confirmation code', 
  'captcha_error' => 'Confirmation code not matching',


SAVE AND CLOSE ALL FILES
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: goku on September 28, 2008, 01:44:07 pm
hey im sorry but i didnt find  any fonts folder in my cpg folder
what shud i do
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: Ludo on September 28, 2008, 06:06:53 pm
It should be created extracting the attached zip file, if not create it manually...
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: goku on September 30, 2008, 12:48:14 pm
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.
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: Ludo on September 30, 2008, 03:42:20 pm
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)
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: VaporDesigns on January 07, 2009, 06:20:35 pm
Is this captcha or re-captcha?  ???
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: Heroe on January 16, 2009, 11:58:19 pm
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

 
Title: Re: [Mod] Captcha (Visual Confirmation) for new users registration
Post by: Nibbler on January 17, 2009, 02:46:30 am
Works fine in other languages. Looks like you broke your Bulgarian language file by editing it. Restore a clean copy.