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

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 1 Guest are viewing this topic.

paul1959

The problem is partly solved. My FTP Client probably does not like overwriting files. When i first deleted the theme.php on my webhost and uploaded it again the garbage on the screen disapeared.

What remains is the fact that i cannot see the Captcha image ( www.pdejong.com/coppermine/captcha.php ).

When comparing GD settings i see that GauGAU's Freetype linkage indicates: "with TTF library" while my settings says "with Freetype" (see attachment).
Could this be the cause of not displaying the Captcha image?

Thanks,


paul1959

Problem finally solved.

The problem of the not appearing Captcha image was caused by the Dutch language file. I noticed that other languages had no problems only the dutch language file. When i checked the file encoding the Dutch file used UTF-8 but others laguage files used ANSI.
Changing the Dutch file to ANSI encoding solved the problem and everything is working now!

Thanks...

Joachim Müller

huh? All cpg1.4.x language files are in utf-8 (except english, which is in iso8859-1). None of them are in ANSI.

paul1959

@Gaugau: You are right of course. I assumed this to soon because both English language files are in ANSI and did not look any further.

But the fact remains that i had to change encoding of the Dutch language file to ANSI before the Captcha image appeared.
To make it even stranger, with the default dutch language file in place the captcha image appeared but of course no confirmation text.
When i opened the Dutch language file and directly saved it again without changing anything the Captcha image disappeared when refreshing the page. I tried this several times everytime using the original Dutch file from the ZIP. I also switched character encoding in cpg config but this made no difference.
This all changed for the better when i changed the encoding to ANSI for the Dutch language file.
Strange isn't it???

Abbas Ali

I just tested captcha image in dutch, spanish, korean, french etc... languages and it came fine in all of them. I didn't modified anything in those lang files, they are standard cpg149 lang files.
Chief Geek at Ranium Systems

paul1959

If i use Notepad to edit the language file and save it again (keeping encoding at UTF-8) the Capcha image won't appear (red cross).
If i change the encoding to ANSI before saving everything works fine. Both apply even if nothing is changed in the file.
Using Wordpad to edit and save the file automatically saves it in ANSI encoding.

Of course my problem is solved now but this is interesting for others who encounter similar problems.

taothai

Hi !

I was trying to implement this captcha in cpg 1.4.9 but while following the instruction on implementing the second step requires editing of themes/yourtheme/theme.php but the file in question doesn't contain anything like the commands. Here is the theme I'm using themes/water_drop/theme.php it looks like this

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.9
  $Source$
  $Revision: 3125 $
  $Author: gaugau $
  $Date: 2006-06-16 08:48:03 +0200 (Fr, 16 Jun 2006) $
**********************************************/

define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='<img src="themes/water_drop/images/orange_carret.gif" width="8" height="8" border="0" alt="" />';

?>


May I copy themes/sample/theme.php to my current theme and replace the themes/water_drop/theme.php with the sample file? It seems to be there....

taothai

I copied the sample theme.php and applied everything. I worked perfectly.

Thanks alot for sharing this spam blocker....


Nibbler

Please read the thread before you post, this has already been asked and answered. Copying the entire sample theme is not a good idea.

http://forum.coppermine-gallery.net/index.php?topic=29564.msg153364#msg153364

teejnut

I've followed the instructions and double-checked everything, but the mod doesn't seem to be working right. It doesn't matter if I put in the right confirmation or not, you are still able to comment. Please see the link below for my site and the attached theme.php file that is in my water drop theme folder. Thanks for the help!  :)

http://www.teejnut.com/gallery/index.php


heemkringduffel

Hello, Thanks for the mod!
Is it possible to remove the lines in the backgrounds picture?
I saw in captcha.class.php at line 33 the numbers of lines, but it doesn't change in the resultate:

         $iNumLines = 0, // number of noise lines to draw

Nibbler

Modify the 20 in captcha.php

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

heemkringduffel

Thanks, it works!
www.heemkring.be/foto
Now I search in the phpcode that the OK bottom is after the image. And that the text in the left size is grouping (each link at a new line).

Greatz, Frank.

Abbas Ali

You have added


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

</tr>


at a wrong place in your theme file. Reread the instructions carefully.
Chief Geek at Ranium Systems

teejnut

Quote from: Abbas Ali on September 15, 2006, 01:58:36 PM
You have added


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

</tr>


at a wrong place in your theme file. Reread the instructions carefully.

i have it in the wrong place? i've tried rereading the instructions, and still have no luck... hmm..


teejnut

Quote from: teejnut on September 16, 2006, 08:49:55 AM
i double-checked the db_input.php file and the edits are there...

nevermind... i had the edits wrong in the db_input.php file. i did the edits after the comment update instead of the comment section. sorry! great mod! thanks for the help!

peter2

Hi!

I followed the instructions for implementation, but instead of letters in confirmation picture, there are just lines...
What did I do wrong  ???
Please help

http://petersfoto.s5.net/displayimage.php?pos=-607

Abbas Ali

Did you uploaded the fonts folder? Make sure that there are two .ttf files in that folder and that they are not partially uploaded.

Also check whether you have FreeType support in your PHP via phpinfo.
Chief Geek at Ranium Systems