Captcha (Visual Confirmation) for adding comments - Page 15 Captcha (Visual Confirmation) for adding comments - Page 15
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Captcha (Visual Confirmation) for adding comments

Started by Abbas Ali, March 25, 2006, 08:39:59 AM

Previous topic - Next topic

0 Members and 15 Guests are viewing this topic.

grafx77

Hello Abbas or Nibbler,

The captcha box is showing up for me, but if I enter the code in wrong, the comment is still accepted. Do you know what file I might be having a problem with?  ???

I am using version 1.4.8

My gallery is located here: http://largedogbreedz.com/gallery/


Tranz


Abbas Ali

If you had made the change in db_input.php then make sure that it was done at right place.
Chief Geek at Ranium Systems

grafx77

I really thought I made the appropriate change within the db_input.php file, but evidentally not.

I made the change and everything works now. Thank you for both your help!

;D

Naglfar

Thanks so much for the mod Abbas.. The spamming was starting to get pretty bad.


http://www.borkurart.com/gallery/



nigelt74

Hi Abbas

Firstly the mod works perfectly well I have had it running for a number of months now

the only issue I am having is that sometimes the letters overlap each other is there any way to prevent this?


Abbas Ali

Not sure but you can do some trial and error method.

Open captcha.php in editor and find this code


// create new image
$oPhpCaptcha = new PhpCaptcha($aFonts, 150, 30, 5, 20, false);


The four parameters in above code which can be useful in your case are...

150 - This is the width of captcha image
30 - Height of captcha image
5 - Number of characters to show in image
20 - Number of lines to show on image (these are the background lines which makes the captcha image difficult to read)

You can try either changing the width to a higher value or decreasing the number of characters to show. Do some tests and see which values fits the best to your need.
Chief Geek at Ranium Systems

nigelt74


angelik

hello,
i wirte in this topic because i have a problem with the confirmation code.
It doesn't appeared in the page.

http://photographie.awcreation.com/displayimage.php?album=lasthits&cat=124&pos=1

i try to download again the captcha files but no change.

If you can help me?

thanks
a+


ps: sorry for my english

Nibbler


angelik

Quote from: Nibbler on February 08, 2007, 02:12:11 PM
http://photographie.awcreation.com/plugins/captcha/captcha.php gives 'internal server error'. You'd need to ask your host why that is.

hello,
yes it's a mistake because the file existe in the folder
http://photographie.awcreation.com/plugins/captcha/

I will try to see what is the problem.

thanks
a+

broekh002

Thanks a lot!!!!, where can I find this module?

Rodney

Quote from: Abbas Ali on March 25, 2006, 08:39:59 AM
Recently i saw a lot of comment spamming on my personal gallery by bots. I thought why not implement the captcha for adding comments. I know that i can disallow Anonymous user to post comments to stop spamming but many of us don't want to do that since there are always genuine anonymous users who want to post comments.

Thanks to Edward Eliot for PhpCaptcha class which is used by this mod.

What will this mod do?

  • Will show an image with some text while adding comment
  • User will be required to enter the text exactly as shown in image in the text box provided
  • If the text entered by user doesn't matches with text shown on image then comment won't be added

The mod

Files modified

  • db_input.php
  • themes/yourtheme/theme.php
  • lang/english.php

New Files

  • captcha.php
  • include/captcha.class.php
  • fonts

First extract the attached zip file and place captcha.php and fonts directory in your coppermine root directory. Place captcha.class.php in include directory.

Then edit lang/english.php

Add

'captcha_error' => 'The confirmation code didn\'t matched',


just after

'non_exist_comment' => 'The selected comment does not exist', //cpg1.4


Add

'confirm' => 'Confirmation',


just after

'report_comment_title' => 'Report this comment to the administrator', //cpg1.4


##############

Edit themes/yourtheme/theme.php

Add

'{CONFIRM}' => $lang_display_comments['confirm'],


just after

'{COMMENT}' => $lang_display_comments['comment'],


Add

<tr>
  <td class="tableb_compact" colspan="2">
    {CONFIRM}
  </td>
  <td class="tableb_compact" colspan="2">
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
  </td>
</tr>


just after

<!-- END input_box_no_smilies -->
                                </td>
                                <td class="tableb_compact">
                                <input type="hidden" name="event" value="comment" />
                                <input type="hidden" name="pid" value="{PIC_ID}" />
                                <input type="submit" class="comment_button" name="submit" value="{OK}" />
                                </td></tr>


##################

Edit db_input.php

Add


        require("include/captcha.class.php");
        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
          cpg_die(ERROR, "Confirmation code didn't matched", __FILE__, __LINE__);
        }


just after


    case 'comment':
        if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);



That's it. Hope this helps some of you out there....


Abbas

P.S: I don't know whether this can be done using a plugin or not. If someone can come out with a plugin then it will be better.

Abbas Ali

Quote from: broekh002 on February 09, 2007, 04:28:48 PM
Thanks a lot!!!!, where can I find this module?

Rodney


Means? The zip file is attached to the first post and all the instructions are also given.
Chief Geek at Ranium Systems

angelik

Quote from: angelik on February 08, 2007, 04:35:59 PM
hello,
yes it's a mistake because the file existe in the folder
http://photographie.awcreation.com/plugins/captcha/

I will try to see what is the problem.

thanks
a+

hello,
the problem the permission of pluggin's folder .
it was 777, and to run correctly I do 755.

a+

skidpics

Would love to try the mod, as I am receive multiple spam comments..  Although I edited the required files, I cannot find any of the entries in my theme.php file..  Can some help on where to place the required code to make it work.  attached is my theme.php file, from the I-feel-dirty theme..

-- Skidpics

Joachim Müller

@skidpics and all who have issue applying this mod:

why don't you use the corresponding plugin instead? It's easier to implement for newbies.

skidpics

Thanks for the quick reply, but what plugin?  I have browsed the thread, but not found a link to any plugin, nor do I see it in the downloads section... 

-- Skidpics

jalmz

GUYS BE SURE YOU READ THE INTRUCTIONS CAREFULLY.

like this one..

First extract the attached zip file and place captcha.php and fonts directory in your coppermine root directory. Place captcha.class.php in include directory.

skidpics


Mohammad J

thank you Abbas for this great Capatcha!!!

I have been searching the Internet long time to find similar solution. I am going to try it right now and will give you my feedback soon....

well done!