forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Comments => Topic started by: Abbas Ali on March 25, 2006, 08:39:59 am

Title: Captcha (Visual Confirmation) for adding comments
Post by: 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?

The mod

Files modified

New Files

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
Code: [Select]
'captcha_error' => 'The confirmation code didn\'t matched',

just after
Code: [Select]
'non_exist_comment' => 'The selected comment does not exist', //cpg1.4

Add
Code: [Select]
'confirm' => 'Confirmation',

just after
Code: [Select]
'report_comment_title' => 'Report this comment to the administrator', //cpg1.4

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

Edit themes/yourtheme/theme.php

Add
Code: [Select]
'{CONFIRM}' => $lang_display_comments['confirm'],

just after
Code: [Select]
'{COMMENT}' => $lang_display_comments['comment'],

Add
Code: [Select]
<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
Code: [Select]
<!-- 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

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

just after

Code: [Select]
    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.



[edit GauGau 2007-04-05]
This wonderful mod has been turned into a plugin that you should try out as well: coppermine-gallery.net > Support > cpg1.4.x Support > cpg1.4 plugins > cpg1.4 plugin contributions >Captcha (Visual Confirmation) for adding comments (http://forum.coppermine-gallery.net/index.php?topic=36319.0)
[/edit]
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on June 02, 2006, 03:05:26 pm
Thanks, Abbas! Very useful mod.  :-* I had to disable comments due to the crazy spamming. Let's see how it goes now. :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Dr Preacox on June 02, 2006, 04:21:36 pm
Hmm do you have a demo? I know how it would look in my head, but on CPG I havn't the foggiest ... either way its a good mod, I might install it
Title: Registration form captcha?
Post by: majay on June 02, 2006, 06:20:58 pm
Hi,

I just discovered Abbas' mod to add a security code to comments, and I have been trying to find a way to apply it to the user registration form. I'm simply experimenting, to see if it could work.
Here is the mod: http://forum.coppermine-gallery.net/index.php?topic=29564.0 (http://forum.coppermine-gallery.net/index.php?topic=29564.0)

First, I added the captcha_error and the confirm bits from the language file under lang_register_php instead of lang_display_xxx.

So far, by adding the <tr> code in register.php, I have managed to make the Captcha appear fine on my registration page in several ways (under the Submit button, under both "required_info" and "optional_info" labels, under the password field), but no matter where I put it, the registration process does not take it into account. Ie if the verifiaction code doesn't match the image, CPG won't detect the error and the registration will go through anyway. 

I tried to insert the following code between the "password_verification" and "email" rows, just to see what would happen:

Code: [Select]
EOT;
break;
<tr>
  <td class="tableb_compact" colspan="2">
    {$lang_register_php['confirm']}
<br>
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
  </td>
</tr>

But that caused an error, as it is obviously incomplete and I assume that changes should be made within the $form_data = array( bit and perhaps the function check_user_info(&$error) bit.

I don't know enough about PHP to know what I should change/add, so I was wondering if anybody might have an idea of what should be done? Or if you think that what I'm trying to achieve is too complicated and requires real knowledge of PHP, please let me know.

Thank you!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on June 03, 2006, 01:50:47 am
This thread deals with a particular mod, please don't clutter it by asking for an entirely different mod.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on June 03, 2006, 07:28:50 am
Hmm do you have a demo? I know how it would look in my head, but on CPG I havn't the foggiest ... either way its a good mod, I might install it

This is how it looks http://www.abbasali.net/photos/displayimage.php?pid=70

@Morgane: Start a new thread for discussing captcha on registration page.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Dr Preacox on June 03, 2006, 01:43:57 pm
Thanxs Abbas, nice mod, may I suggest changing the TAB index so you can tab to submit after you enter the confirmation code, and also moving the submit button after the Captcha Image?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on June 03, 2006, 01:50:37 pm
Sure why not... you can modify the code to whatever your needs be.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Dr Preacox on June 04, 2006, 06:10:03 am
Oh I guess I could do that  :D

I'll modify this post once im done :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mqcarpenter on June 21, 2006, 05:13:14 am
I do not want to sound like a total newb moron, but I just upgraded to 1.4.8 and the upgrade instructions basically have the theme.php blank. The content referenced here is not in that file. In fact, here is my theme.php content:

Code: [Select]
<?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.8
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/
define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_HAS_NAVBAR_GRAPHICS'1);
define('THEME_HAS_FILM_STRIP_GRAPHIC'1);
// HTML template for template sys_menu spacer
$template_sys_menu_spacer ="|";
?>


This is per the instructions. I am trying to do a deep search to find where the theme.php code you mention is so I can implement this. Is it in another theme file? TIA
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on June 21, 2006, 07:16:44 am
If the section in question doesn't exist in your custom theme, copy the corresponding section from themes/sample/theme.php into themes/yourtheme/theme.php and then modify as suggested. In your case, paste
Code: [Select]
// Displays comments for a specific picture
function theme_html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
    global $template_image_comments, $template_add_your_comment, $lang_display_comments;

    $html = '';

//report to moderator buttons
    if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
        template_extract_block($template_image_comments, 'report_comment_button');
    }

    if (!$CONFIG['enable_smilies']) {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_smilies');
        template_extract_block($template_add_your_comment, 'input_box_smilies');
    } else {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_no_smilies');
        template_extract_block($template_add_your_comment, 'input_box_no_smilies');
    }

    $tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');

    if ($CONFIG['comments_sort_descending'] == 1) {
        $comment_sort_order = 'DESC';
    } else {
        $comment_sort_order = 'ASC';
    }
    $result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

    while ($row = mysql_fetch_array($result)) {
        $user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';

        if ($CONFIG['enable_smilies']) {
            $comment_body = process_smilies(make_clickable($row['msg_body']));
            $smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');
        } else {
            $comment_body = make_clickable($row['msg_body']);
            $smilies = '';
        }

        $ip = $row['msg_hdr_ip'];
        if ($row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            $ip .= ' [' . $row['msg_raw_ip'] . ']';
        }

        $params = array('{EDIT}' => &$comment_edit_box,
            '{BUTTONS}' => &$comment_buttons,
            '{IPINFO}' => &$comment_ipinfo
            );

        $template = template_eval($template_image_comments, $params);

        $params = array('{MSG_AUTHOR}' => $row['msg_author'],
            '{MSG_ID}' => $row['msg_id'],
            '{PID}' => $row['pid'],
            '{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
            '{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
            '{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
            '{MSG_BODY}' => bb_decode($comment_body),
            '{MSG_BODY_RAW}' => $row['msg_body'],
            '{OK}' => &$lang_display_comments['OK'],
            '{SMILIES}' => $smilies,
            '{IP}' => $ip,
            '{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
            '{WIDTH}' => $CONFIG['picture_table_width']
            );

        $html .= template_eval($template, $params);
    }

    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (USER_ID) {
            $user_name_input = '<tr><td><input type="hidden" name="msg_author" value="' . USER_NAME . '" /></td>';
            template_extract_block($template_add_your_comment, 'user_name_input', $user_name_input);
            $user_name = '';
        } else {
            $user_name = isset($USER['name']) ? '"' . strtr($USER['name'], $HTML_SUBST) . '"' : $lang_display_comments['your_name'] . '" onclick="javascript:this.value=\'\';';
        }

        $params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
            // Modified Name and comment field
            '{NAME}' => $lang_display_comments['name'],
            '{COMMENT}' => $lang_display_comments['comment'],
            '{PIC_ID}' => $pid,
            '{USER_NAME}' => $user_name,
            '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            '{OK}' => $lang_display_comments['OK'],
            '{SMILIES}' => '',
            '{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if ($CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();

        $html .= template_eval($template_add_your_comment, $params);
    }

    return $html;
}
into themes/yourtheme/theme.php into a new line before
Code: [Select]
?>
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Prisoner_24601 on July 13, 2006, 11:02:05 pm
Code: [Select]
<!-- 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>

Doesn't exist, except in themes/sample/theme.php, even after adding the section GauGau mentions above (at least, using the default themes provided in CPG 1.4.8).

I tried renaming the "sample" theme to "testing_theme" to get it to show up in my list -- making no other changes -- and I got "Fatal Error" when I tried to use that theme (and I had to replace it with a theme.php from a theme I knew worked to get rid of the error).  I also tried not including the code Abbas Ali mentions to include after the code I quoted above and I got "Fatal Error".
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on July 14, 2006, 08:31:05 am
Do not use the sample theme for anything else but copying parts from it into your custom theme.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 14, 2006, 08:34:12 am
Don't use sample theme directly...

First copy the theme_html_comments function from sample theme to your theme as suggested by GauGau.

Then copy (from sample theme to your theme)

Code: [Select]
$template_add_your_comment = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
        </tr>
        <tr>
                <td colspan="3">
                <form method="post" name="post" action="db_input.php">
                        <table width="100%" cellpadding="0px" cellspacing="0px">

<!-- BEGIN user_name_input -->
                                <tr><td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT} </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />                                        <!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
<!-- 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>
                        </table>
                </form>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
</table>
<!-- END smilies -->

EOT;

and make necessary changes to this code.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Prisoner_24601 on July 14, 2006, 10:09:58 pm
I did so.  I refreshed my browser and got a completely blank screen.  No errors, just a blank, white page.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on July 14, 2006, 10:15:36 pm
You probably pasted it incorrectly and have your server set to hide error messages. Attach a copy of your theme.php to your next post.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scotty588 on July 15, 2006, 11:25:56 am
Ok I am also confused about this. This is what my theme.php looks like.
Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly 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.1
  $Source:
  $Revision: 1.10 $
  $Author:
  $Date: 2005/04/30 07:13:16 $
**********************************************/

define('THEME_HAS_RATING_GRAPHICS'1);
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 ='::';

?>

If you could just tell me exactly what I need to paste into mine that would make it 10x easier for me. I tried reading through these posts and I looked at the sample.php and it confuses me because I have no idea what needs to be put into my theme.php Thank you for making this I am having very bad spam problems!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mammut on July 15, 2006, 04:08:35 pm
Ehmmm... Were do I download the file?    :-[
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on July 15, 2006, 04:11:27 pm
It's attached to the first post, as stated.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on July 16, 2006, 04:11:19 am
Works great! I love it very much so (just deleted 1000+ spam comments on my site today), and came to coppermine looking for something like this. Thanks so much.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scotty588 on July 16, 2006, 05:57:38 am
Can someone help me with mine. I am still confused about the theme.php file. I am on msn and aim right now if thats easier. Thanks.

Also is there a way to mass delete comment spam?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: antisa33 on July 17, 2006, 02:59:02 am
Hello
Thanks for the mod, i have done all that you say in my cpg148 but i cant see the numbers, i see a cross, why ?
Thanks
Isa
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 17, 2006, 07:25:41 am
@scotty588: I am attaching the modified theme file. Replace it with your theme.php file. (Remove the .txt extension from attached file)

@antisa33: Did you copied captcha.php, captcha.class.php and fonts directory properly? Also a link to your site might help.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Gail on July 18, 2006, 12:02:06 am
Hi,

I started having problems with spammers and comments last week; I turned off the ability to add comments and then searched this forum for solutions. Thank you so much for this mod - i uploaded/edited my files this afternoon and everything seems to be working. I have since enabled comments again.  :)

Thanks to the development team for all of your work.

Gail
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scotty588 on July 18, 2006, 12:23:32 am
Thanks Abbas I did what you said and it doesn't seem to show up at all. I have enabled guest comments so you can see. Hopefully I won't get mass spammed.
http://scottyk87.dmservers.com
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 18, 2006, 07:03:26 am
Can't say what's happening.. are you sure that you replaced themes/blackbirch/theme.php with the file i gave?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: antisa33 on July 18, 2006, 02:40:20 pm
@abbas ali : try http://www.mandala-colorier.com/coloriage-2-3.html (http://www.mandala-colorier.com/coloriage-2-3.html)
I see a cross on IE and nothinbg in firefox.
I copy all the files correctly, and i have done all your modifications
Thanks a lot for all  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on July 18, 2006, 09:37:42 pm
Split 'new topic' to http://forum.coppermine-gallery.net/index.php?topic=33997
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scotty588 on July 19, 2006, 02:56:56 am
Abbas: I replaced the theme.php with the one you attached and took off the .txt extention. I overode it and it still does not show up. If you contact me on aim or msn I would be happy to set you up with a temp ftp account to look for the problem if you willing.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 19, 2006, 07:04:04 am
@antisa33: I tried the url http://www.mandala-colorier.com/coloriage-2-3.html and the image is shown. Also captcha is working fine..Did you resolved it?

@scotty588: Send me a PM with the ftp details.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: bobby131313 on July 26, 2006, 09:21:25 pm


Beautiful Mod!

Worked perfectly first shot. Thank you!

One stupid little thing though, just grammer...

"Confirmation code didn't matched" in db_input.php probably should be...

"Confirmation code does not match"

I feel silly even mentioning it, but I'm kind of anal and you might be too.  ;D

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 27, 2006, 07:24:12 am
Because i am not a native english speaker ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jaydj on July 29, 2006, 03:06:11 am
Thanks ! You're a xavior !  Now I don't have to delete hundreds of spam messages a day. :)
I just want to clarify that if I should use another theme, I should edit the themes/mytheme/theme.php file right ?
If I don't then will my comment area break or will the confirmation code just be absent from the form ?

Thanks again !
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 29, 2006, 07:07:09 am
Yes you should edit theme/yourtheme/theme.php. If that block of code is not present in your theme then you should copy it from sample theme to your theme.

If you don't edit the other theme then confirmation image will be absent from comment area. But since in db_input.php we are checking whether user has specified correct confirmation code or not..it won't work. So in short every theme you use should have that confirmation code.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: antisa33 on August 06, 2006, 02:12:41 am
Abbas, when your tried my mod on my website, have you clic on ok ?
I always have this message error :
Confirmation code didn't matched 
Can you try to add a comment ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 06, 2006, 05:12:13 am
I was able to add comment on your website. Check http://www.kidsandcolors.com/colorina_colors-1355.html and you will see a comment 'Nice horse' added by me. Make sure that 5 letters are coming in the image. If not then reupload the fonts directory. Also make sure that the image reads different letters every time you refresh a page. If not then that means the image is coming from your cache and is not the correct image.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on August 08, 2006, 09:01:19 am
@Abbas & devs: should this go into the devel branch as an option? While I'm doing the comment approval clean-up, I could implement it as well.
Things that need checking before doing so:
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 08, 2006, 09:29:20 am
Yes this could be a config option. As far as license is concerned, the class has been released under Free BSD license. I don't know about the fonts but those came along with the class. Should I ask author about the fonts?

Here (http://www.ejeliot.com/pages/php-captcha) is the website of the author. Do get the latest class if this goes in devel.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on August 08, 2006, 09:56:54 am
If the above considerations could be addressed, I think this would be a great addition to the core code. We really need to deter this infestation/plague upon the internet as much as possible.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: maxaxax on August 14, 2006, 01:16:18 am
great job Abbas, merci beaucoup !  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: IamDeirdre on August 14, 2006, 04:51:35 pm
Thank you for this, it was just what I needed!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Fudgemaster on August 20, 2006, 01:43:03 pm
Is there a possibility to have the captcha for non registered users and the registered users would be able to comment after loggin in without it ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 21, 2006, 07:26:04 am
Yes, but this will require some code changes. If you know your way around then you are welcome to make the changes, else i will do it whenever i get some free time.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Marine on August 21, 2006, 09:11:07 pm
Hello,

I don't understand everything  :-[
I have done the change for all the files except for the theme.php because I have an syntaxe error when I add my change on my gallery.
I'm currently using Water_drop 1.4.8, I have edited the Sample theme.php to paste since line2210 // Displays comments for a specific picture
but I don't see where I have to stop and where is <--end smilies-->  ?

Can someone help me ?  ;D
Sorry for my English

Thanks  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 22, 2006, 08:46:40 am
Read this thread from starting.

http://forum.coppermine-gallery.net/index.php?topic=29564.msg158255#msg158255
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: pigpen on August 22, 2006, 02:23:35 pm
This is exactly what I needed. Thank you very much.
Hope this will be included in one of the forthcoming releases.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on August 22, 2006, 02:27:12 pm
It will be in 1.5.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: tobiasth on August 23, 2006, 09:40:53 pm
works great, many thx!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: spikeweb on August 25, 2006, 06:04:16 pm
Thanks to all of you as reading all posts got my gallery working fine with the captcha !
BUT
I use a franch lang file and get {CONFIRM} instead of Confirmation on the comment page. I changed the /lang/french.php file to reflect the change as mentionned for english.php but no success.
If anyone can help  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 25, 2006, 10:04:21 pm
Congratulation ;) your code is very good in the sites that is found

I have a proble i don´t cant put it in my web, i have a problem, don´t know what punt intro file captcha.php and captcha.class.php please help me ???
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 26, 2006, 07:43:03 am
@spikeweb: Make sure you added the following line at correct place as described in my first post

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

Please read the instructions for theme.php again from my first post.

@diane: If i understood you correctly you want to know where to upload captcha.php and captcha.class.php. Well captcha.php should be uploaded to the coppermine root folder i.e. where you have index.php of coppermine and captcha.class.php should be uploaded to "include" directory which is within your coppermine root folder.

Also please do not send PM unless asked for (diane sent me a PM).
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: spikeweb on August 26, 2006, 10:14:11 am
Thanks for the note. That was it, I apologize for not having checked everything twice  :-[
Anyway, it works so fine now  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Pascal YAP on August 26, 2006, 10:27:41 am
Morning Abbas,

Your Captcha MOD is in our French Board (http://forum.coppermine-gallery.net/index.php?topic=35415.msg166282#msg166282)  ;D
Thanx

PYAP
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kromega on August 26, 2006, 04:33:18 pm
It will be in 1.5.
good ! is it worth to do all the modif ? or is the 1.5 coming soon ?


thanks

fabien
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on August 26, 2006, 11:18:54 pm
1.5 isn't coming soon.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: lac on August 27, 2006, 07:08:44 am
Hello,

This modification is work with Coppermine Photo Gallery 1.3.5?
Or only for 1.4.x?

Thank you,

Regards,
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 27, 2006, 09:22:49 am
This mod will only work for cpg1.4.x.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: lac on August 27, 2006, 12:47:25 pm
Hello,

I update version 1.4.8.

I want to use this modification...

I have a question:
- Where I put the "captcha lines" in .php files?
(in the end, or begin, or where?)

Please help me,

Thank you,

Regards,

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 28, 2006, 07:24:41 am
Which lines are you talking about? The attached files should be placed as it is.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 28, 2006, 08:17:10 pm
1.5 isn't coming soon.

Thank you for your help but we continue whith problems, i don´t know were i can get this files     
    * captcha.php
    * include/captcha.class.php
    * fonts

Some one can send me or tell me were i can download or what i cad writte on these files, there are a library´s or not

Please help me
Please please
 :'(
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on August 28, 2006, 08:22:42 pm
They are in the file attached to the first post. Download and extract it.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 28, 2006, 08:25:30 pm
1.5 isn't coming soon.
TranzNDance

hello as these I am diane, please excuseme my ingles is not very good
I like much as you block the unloading of iamgenes if xs do not write msg favor you could send to me the code I already have I cosay of like avoiding the Spam in the commentaries

It´s very important Thank you
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: lac on August 28, 2006, 08:57:27 pm
Which lines are you talking about? The attached files should be placed as it is.

Files modified

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

Where I put this codes in the .php files? (Edit db_input.php and theme.php, etc...)

I don't know.

Thank you,

Regards,
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 29, 2006, 12:49:33 am
They are in the file attached to the first post. Download and extract it.

you are the best thank you very much these code is very good
:) :) :) :) :) :) :) :) :) :) :) :)

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 29, 2006, 07:09:04 am
Where I put this codes in the .php files? (Edit db_input.php and theme.php, etc...)

Instructions are given in my first post as to where to copy those lines of code in the files. Please read it carefully.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 29, 2006, 04:22:46 pm


Thanks, Abbas! I had to disable comments .  ;) congratulation for these code.

Now I like to block pictures to download if the user dont´t writte a comment if you have the code plese help me, i like make any thingink like to the pague of  http://takethu.com/ these is the pague of TranzNDance

TranzNDance please help me I need make these please please please and thanks for your help.

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on August 29, 2006, 05:30:52 pm
Now I like to block pictures to download if the user dont´t writte a comment if you have the code plese help me, i like make any thingink like to the pague of  http://takethu.com/ these is the pague of TranzNDance
This request is not related to the mod in this thread. You will need to search for such a mod though I am unsure if it exists. If you can't find it, please create another thread.

Additionally, my site is not using such a mod so I don't know why you pointed out my site with regards to it. I am flattered that you like my gallery enough to want to emulate it. :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 29, 2006, 05:56:21 pm
Thanks TranzNDance really I lilke your site, but my english bad I think that you don´t understand you have in your site what I need.

in your site the link is inactive if the user dont´t writte the comment, and when writte the comment the user can make clic en the picture and see bic, this is what I need please help me  please please please please  :'(


Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on August 29, 2006, 06:34:04 pm
If I understand you correctly...

Actually, it's a coincidence that clicking on an image would open the big one and another time it doesn't. Not all my intermediate images are big enough to have the larger size. Looking at the pages where you left comments in my gallery, I can see where you came to the conclusion you did. However, regardless of whether a comment is left, this is how the images are:

Not linked/no big picture:
http://takethu.com/displayimage.php?pos=-396

Linked with big picture:
http://takethu.com/displayimage.php?pos=-608
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: diane on August 30, 2006, 05:33:28 pm
Thanks TranzNDance i need find tha codo to make this, if you know some one to know something obout it please tell me.

Thanks ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on August 30, 2006, 06:21:42 pm
Abbas,

Thanks for a mod to help with the comment spam problem. Can you, or some kind soul, help with my issue. I think I followed all the instructions carefully, however the captcha image doesn't show up, and i can comment without entering anything.

Here's a link to a picture: http://www.derpishi.com/gallery/displayimage.php?album=43&pos=3

Thanks in advance!!,
Mark
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kromega on August 31, 2006, 01:30:52 am
Guys,
Thanks for that mod, very usefull... at least when it will work 100% fine.
First thing, the behaviour is not similar depending on the language chosen !!! that seems really weird, as the theme doesn't change, right ??? any idea ???

e.g. in english, I've the captcha.php picture
http://www.fabski.com/images/displayimage.php?album=lastup&cat=0&pos=8&lang=english (http://www.fabski.com/images/displayimage.php?album=lastup&cat=0&pos=8&lang=english)
but not in french, no picture !!!
http://www.fabski.com/images/displayimage.php?album=lastup&cat=0&pos=8&lang=french (http://www.fabski.com/images/displayimage.php?album=lastup&cat=0&pos=8&lang=french)

second, with explorer, I've a redcross (image not found) but with Firefox, I've the image (at least in all languages but french) !

thanks for your help.

fabien
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 31, 2006, 08:41:17 am
@mvyvoda: Did you modified captcha.php file? When http://www.derpishi.com/gallery/captcha.php is opened, it should show an image. But in your case the page comes blank. Also do you have error messages turned off on your server?

@kromega: Try to open http://www.fabski.com/images/captcha.php and you will see the error message. The image is drawn by sending headers to browser. If some characters gets outputted before headers are sent then that kind of error message is thrown. So i suspect that something is getting outputted in your french.php file. Make sure that you don't have a blank line before <?php and after ?> tags in your lang/french.php file.

Also the captcha image comes fine for me in IE.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kromega on August 31, 2006, 04:01:20 pm
@kromega: Try to open http://www.fabski.com/images/captcha.php and you will see the error message. The image is drawn by sending headers to browser. If some characters gets outputted before headers are sent then that kind of error message is thrown. So i suspect that something is getting outputted in your french.php file. Make sure that you don't have a blank line before <?php and after ?> tags in your lang/french.php file.
my browser display just the text below, same as URL. no extra lines in my lang file.
http://www.fabski.com/images/captcha.php

Also the captcha image comes fine for me in IE.
really ??? anyone else could try please...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on August 31, 2006, 04:30:12 pm
I see the image in english and french in FF and IE.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on August 31, 2006, 05:12:18 pm
@mvyvoda: Did you modified captcha.php file? When http://www.derpishi.com/gallery/captcha.php is opened, it should show an image. But in your case the page comes blank. Also do you have error messages turned off on your server?

Abbas..., admittedly I am quite new to all this. Can you please advise what specific question I should tell my ISP in order to get error messages turned on. I am not sure if they are turned off, but that seems logical.

Thanks for all of your help! It is greatly appreciated.

Cheers,
Mark
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on August 31, 2006, 05:34:03 pm
oh... and no, i didn't edit the captcha.php file.

thanks,
-m
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kromega on August 31, 2006, 07:09:48 pm
I see the image in english and french in FF and IE.
I've changed a bit the theme.inc.php and now I can see them all.
Thanks for your support.

Fabien
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Pascal YAP on August 31, 2006, 10:22:08 pm
Kromega,

Touch Theme.in.php is not recommended at all by the Dev Team ! But it's a general rule.
Now, if you know what you do, why not !
Touch your Theme.inc.php is an other possibilty because you do not read carrefully you Theme.php  ;)

PYAP
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kromega on August 31, 2006, 10:42:48 pm
Kromega,

Touch Theme.in.php is met recommended at all by the Dev Team ! But it's a general rule.
Now, if you know what you do, why not !
Touch your Theme.inc.php is an other possibilty because you do not read carrefully you Theme.php  ;)
I use Mac_ox_x theme and couldn't find out the place where to add the new one in the theme.php... but it appears in the theme.inc.php and so I modified that one... seems to work except when modifying subsequently the french.php file... (french2 in the pull-down menu)... any idea why ? french2.php file attached in the french post about captcha...

Doesn't mean I know precisely what I do :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: tyio on September 01, 2006, 04:38:09 pm
for those who style have some problem, edit theme.inc.php


add :


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


after

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




then add

Quote
<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>


after (style of your website depending ;))

Quote
<!-- END input_box_no_smilies -->




and do the others change ^^
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on September 02, 2006, 04:24:01 am
In my gallery, the confirmation image does not show up anymore. I don't know what happened to it. Example:

http://www.britneyres.com/displayimage.php?album=1935&pos=1
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on September 02, 2006, 04:37:45 am
also, when I go to http://www.britneyres.com/captcha.php it says:

Quote
Fatal error: Call to undefined function: imageftbbox() in /home/britneyr/public_html/include/captcha.class.php on line 115
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 02, 2006, 07:29:34 am
@gymnastdude182: Was the image beign shown previously? If yes, then it means that your webhost changed something in php setup and freetype2 is no longer supported on your server.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on September 02, 2006, 08:58:25 am
@gymnastdude182: Was the image beign shown previously? If yes, then it means that your webhost changed something in php setup and freetype2 is no longer supported on your server.
He told me he did not edit any of that   :( what happened? Is it because I input a 404 error page? I removed that and it still does not work. That's the only thing I can think of that I edited.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Gizmo on September 02, 2006, 06:30:29 pm
Well, it finally happened to me. I started getting porn spam on my youths sports gallery - http://www.bullseyephotos.com/sports/index.php (http://www.bullseyephotos.com/sports/index.php). Good thing that I have email notification set up for everything that happens on that site otherwise some young person or parent might have seen it and I would have been clobbered. I was able to install this mod in 5 minutes following Abbas' instructions in the initial post in my gallery which is heavily modded without any issues. Excellent work and many thanks Abbas!  ;D

Cheers,

Gizmo
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on September 02, 2006, 09:18:42 pm
@mvyvoda: Did you modified captcha.php file? When http://www.derpishi.com/gallery/captcha.php is opened, it should show an image. But in your case the page comes blank. Also do you have error messages turned off on your server?

here's the error message i now see on http://www.derpishi.com/gallery/captcha.php (http://www.derpishi.com/gallery/captcha.php):
Quote
Fatal error: Call to undefined function imageftbbox() in /home/vyvodamr/public_html/gallery/include/captcha.class.php on line 115

my ISP doesn't know what's up with this. could it be something with the captcha.class.php code? any suggestions are more than welcome and I appreciate the time and energy of your help!!! currently, i've turned off commenting for unregistered users. please advise if you need me to turn it back on.

thanks a lot!,
mark
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on September 02, 2006, 09:55:32 pm
It means you don't have freetype support on your server.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Bonato on September 03, 2006, 07:07:07 am
Well, well... I find this mod very interesting and useful, but I was not able to do the modifications and get this thing to work. I'm very illiterate regarding code. I will have to find another solution to avoid those freaking spammers.

But thank you Abbas Ali, anyway.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: musikalg on September 04, 2006, 02:24:44 am
Wonderful hack! Just a minor comment, if you're using another language than english it might be a good idea to use:

Code: [Select]
require("include/captcha.class.php");
        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
          cpg_die(ERROR, $lang_errors['captcha_error'], __FILE__, __LINE__);
        }

instead of

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

in db_input.php

/Jimmy
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: musikalg on September 04, 2006, 02:50:02 am
I made a small modification so users who are logged in don't need to confirm, while anonymous users has to.
I haven't tested how secure this is, but it seems to work. My modification for theme.php is written for the Project VII-theme, you have to adjust it for your own theme. The trick is to write two versions of $template_add_your_comment, one for users who are logged in and one for those who aren't.

I just write the modifications necessary after you have done Abbas Alis modifications.

In db_input.php:

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

write

Code: [Select]
if (!USER_ID) {require("include/captcha.class.php");
        if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
          cpg_die(ERROR, $lang_errors['captcha_error'], __FILE__, __LINE__);
        } }

In theme.php, instead of

Code: [Select]
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
                                                        <<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>
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;

paste
Code: [Select]
if (!USER_ID) {
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
                                                        <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>
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;
}
else
{
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
                                                       
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;
}

This seems like a bit unnecessary complicated, but I couldn't get it working in any other way.

/Jimmy
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on September 04, 2006, 10:27:27 am
It means you don't have freetype support on your server.
my host says we do. what now  ??? how can I fix this?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on September 04, 2006, 08:28:46 pm
Check phpinfo, look for the GD section, see if freetype is actually there. Should look similar to http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#VersionGD
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on September 04, 2006, 10:32:24 pm
freetype is now installed and i can see the captcha image!!!!!! thanks for all the help. I am still having a problem however. It seems as though the confirmation image doesn't work properly because I can comment w/o typing the captcha image.

did i do something in correct w/ modding the code?

thanks for the help. i do appreciate it!
-m
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on September 04, 2006, 10:50:15 pm
for those who style have some problem, edit theme.inc.php
Don't do as tyio suggested. You must never edit include/themes.inc.php - under no circumstances.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on September 05, 2006, 01:03:56 am
I am still having a problem however. It seems as though the confirmation image doesn't work properly because I can comment w/o typing the captcha image.

did i do something in correct w/ modding the code?

Did you not edit db_input.php? That's the part that tests for whether the confirmation code is correct.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mvyvoda on September 05, 2006, 01:40:18 am
Did you not edit db_input.php? That's the part that tests for whether the confirmation code is correct.

ah yes... i made a mistake there.

thanks again everyone. it works perfectly now!,
-m
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Fudgemaster on September 05, 2006, 04:15:39 am
Niiiice.

Just edited the files to make it work.
Didn't have freetype2 in my webhotel but after contacting my provider they gave me a newer server with more phun stuff to play around.

Thank you for the mod Abbas :)

(offcourse, I had to get the first pr0n spam comments to my gallery to get this done (g*ay links to a BMW picture ;) )
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: davidcross100 on September 06, 2006, 11:53:21 am
Sorry for such a basic question but I'm new to all this PHP stuff. I;ve just taken over a website that is being bombarded with spam. Am going to try this out but falling down at the 1st hurdle - where can I find my 'Coppermine Root Directory?'

I've searched in all the folders of the website but can't find it! Again, sorry for the basic question but is it really obvious where it is?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: davidcross100 on September 06, 2006, 12:05:53 pm
Sorry everyone - I've just found it all. But I think I will have to upgrade the gallery I have as I think it is a bit out of date - some of the code mentioned doesn't exist in my coding.

However, is it right that when I download the file it only has 4 files and nothing about fonts that was mentioned in the original post?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on September 06, 2006, 12:30:52 pm
File contains

./fonts/hurryup.ttf
./fonts/acidic.ttf
./captcha.class.php
./captcha.php

.ttf are the font files and they should be in the fonts directory.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on September 07, 2006, 02:48:40 am
Check phpinfo, look for the GD section, see if freetype is actually there. Should look similar to http://coppermine-gallery.net/demo/cpg14x/docs/faq.htm#VersionGD
It does not display freetype anywhere on that page I made. I can PM you the link so you can check it out. I don't want to post it openly on the forum  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on September 07, 2006, 04:03:10 am
Haven't asked to be sent a PM. Both board rules as well as my signature say you mustn't. There goes your karma...
The phpinfo section you sent me by PM clearly shows that you don't have freetype support (see the screenshot I took from your phpinfo page). Bottom line: you can't use the captcha mod unless you have your webhost enable freetype for you. Don't ask here how to enable it - we can't help you with this. Only your webhost can. If you're self-hosted, then you just discovered one of the reasons why we don't recommend self-hosting.

Joachim

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Fotomaf on September 07, 2006, 11:18:07 pm
Abbas Tnahk you very mactch for your incredible work!
works so fine now!!
:D

Regards from Spain
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: green4gfx on September 08, 2006, 12:07:42 pm
ok i have make all like the poeple say ...

- Files Uploaded
- Files like in 1st post edit ... (i have used the user postet version without the Language mod.)

cpg version 1.4.9

i think i have the right GD version and Option ... [look in attach]

http://gallerie.green4gfx.de/displayimage.php?album=11&pos=0
it will don't be showed ... but its there, cause u can post a comment (Confirmation code didn't matched)

HELP pls ...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 08, 2006, 12:17:22 pm
You didn't edited the theme properly. Follow the instruction carefully to edit themes/yourtheme/theme.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: green4gfx on September 08, 2006, 12:28:28 pm
You didn't edited the theme properly. Follow the instruction carefully to edit themes/yourtheme/theme.php

??? i make all what there stay ... or i have something overwrite ...
My Theme.php --> http://404.green4gfx.de/theme.php.txt
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 08, 2006, 12:46:40 pm
The theme file seems to be fine. Is that file located at themes/green/theme.php ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: green4gfx on September 08, 2006, 01:05:02 pm
The theme file seems to be fine. Is that file located at themes/green/theme.php ?

yes it is ...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 08, 2006, 01:14:15 pm
Strange...the confirm box should be shown. It is not even coming in the html source.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: green4gfx on September 08, 2006, 01:45:56 pm
Strange...the confirm box should be shown. It is not even coming in the html source.
ok i have find the failure ... it was the Multiline comment Plugin ...
it must overwrite the Table ... i must find out the failure there ... cause i want it multi line'd ^^

ok it was my failure - NICE SCRIPT, BIG THX ;D
i hope that now is that Spam past ^^
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: bl4ckdragon on September 08, 2006, 09:55:41 pm
@Abbas Ali : thank you very much for your add-on
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: bsvee on September 10, 2006, 07:37:10 pm
@Abbas Ali.

Thank you for the mod, it's works great!  ;D I was suddenly getting spammed like crazy and had to turn off comments. The eyeball theme didn't fit into your original mod instructions but thank you for following up with the instructions for themes.inc.php. It would be nice if this could be released prior to 1.5, however. I think that the bots are cranked up on CPG sites right now.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Bonato on September 11, 2006, 01:57:10 am
I did everything I should, but it didn't work. It's a shame.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mikek on September 12, 2006, 12:39:05 pm
Installed the mod, but I'm always getting the "confirmation code does not match" error, even when the code is input correctly...

see: http://photoblog.escapenet.info

What am I missing?

Cheers, Mike
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mikek on September 12, 2006, 12:45:01 pm
Installed the mod, but I'm always getting the "confirmation code does not match" error, even when the code is input correctly...

see: http://photoblog.escapenet.info

What am I missing?

Found the error: my session.save_path was not set correctly in php.ini

Thanks for a great mod!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 12, 2006, 05:15:21 pm
Hi Abbas,

Thanks for this great mod.
I tried about everything to get this working but so far no luck.
All files doublechecked and modified ok, although i edited the Dutch language file.

Please look at a picture in my gallery and see what a mess it's making.
http://www.pdejong.com/coppermine/displayimage.php?album=6&pos=3

Could it be a problem with the language or with some of the themes? I also tried RainyDay but the same mess appears.

Also have my theme.php attached.

Some other info:
CPG 1.4.9
Theme PowerbookG4
Language Dutch
PHP 4.4.1
GD Support  enabled 
GD Version  bundled (2.0.28 compatible) 
FreeType Support  enabled 
FreeType Linkage  with freetype 
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: slimex on September 12, 2006, 07:17:56 pm
@antisa33: I tried the url http://www.mandala-colorier.com/coloriage-2-3.html and the image is shown. Also captcha is working fine..Did you resolved it?
Hi
This is really fine mod but im trying to get this work over 2 days now. I read the topics twice maybe more and i solve the GD trouble i Think only Gif suport didnt show on my PHP info. I get scrathes but i cant see the fonts or numbers could >>Antisa33 tell how he solve the problem or som one else ?
I wont give a link to the web page becouse there are nudety.
And sorry my bad english
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: slimex on September 12, 2006, 10:47:05 pm
 Hi again ;D I did resolve the fonts problem its ok now
I updatet my PHP it (and GD2librarry) was to old  ::)
An Thanks again for this hack  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 13, 2006, 07:08:23 am
@paul1959: I used your theme.php on my local setup and it worked fine. Please make sure that you have uploaded the theme.php properly.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 13, 2006, 04:06:29 pm
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,

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 13, 2006, 06:41:04 pm
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...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on September 13, 2006, 06:43:27 pm
huh? All cpg1.4.x language files are in utf-8 (except english, which is in iso8859-1). None of them are in ANSI.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 13, 2006, 08:07:18 pm
@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???
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 14, 2006, 07:11:59 am
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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 14, 2006, 08:28:14 am
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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: taothai on September 14, 2006, 01:26:13 pm
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

Code: [Select]
<?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....
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: taothai on September 14, 2006, 01:40:28 pm
I copied the sample theme.php and applied everything. I worked perfectly.

Thanks alot for sharing this spam blocker....

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on September 14, 2006, 01:42:14 pm
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: teejnut on September 14, 2006, 11:29:03 pm
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on September 15, 2006, 04:23:30 am
@teejnut: http://forum.coppermine-gallery.net/index.php?topic=29564.msg168316#msg168316
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: heemkringduffel on September 15, 2006, 12:53:04 pm
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on September 15, 2006, 01:09:09 pm
Modify the 20 in captcha.php

Code: [Select]
$oPhpCaptcha = new PhpCaptcha($aFonts, 150, 30, 5, 20, false);
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: heemkringduffel on September 15, 2006, 01:24:29 pm
Thanks, it works!
www.heemkring.be/foto (http://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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 15, 2006, 01:58:36 pm
You have added

Code: [Select]
<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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: teejnut on September 16, 2006, 08:49:12 am
You have added

Code: [Select]
<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..
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: teejnut on September 16, 2006, 08:49:55 am
@teejnut: http://forum.coppermine-gallery.net/index.php?topic=29564.msg168316#msg168316

i double-checked the db_input.php file and the edits are there...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: teejnut on September 16, 2006, 08:52:51 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!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: peter2 on September 16, 2006, 08:35:31 pm
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 (http://petersfoto.s5.net/displayimage.php?pos=-607)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 17, 2006, 05:28:40 am
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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: peter2 on September 17, 2006, 08:30:06 am

Tnx Abbas for answer.

I checked fonts folder, and it is OK.

Php info:

GD Support   enabled
GD Version    bundled (2.0.12 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
GIF Read Support    enabled
JPG Support    enabled
PNG Support    enabled
WBMP Support    enabled
XBM Support    enabled

Any other ideas  ???
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 17, 2006, 09:23:48 am
Remove the font files and reupload fresh ones.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: peter2 on September 17, 2006, 10:20:11 am
I reupload fonts folder.

It contains files:
09-17-06  10:11AM               126492 acidic.ttf
09-17-06  10:11AM                24048 hurryup.ttf

Still not working...

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on September 17, 2006, 10:27:43 am
try this:
http://forum.coppermine-gallery.net/index.php?topic=36319.0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: peter2 on September 17, 2006, 11:08:32 am
try this:
http://forum.coppermine-gallery.net/index.php?topic=36319.0

I tryed, but it does not help ... :(
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: atnika on September 18, 2006, 08:12:43 am
I personally was unable to make Ali's captcha mod working on my website, so I made another captcha mod for myself

http://forum.coppermine-gallery.net/index.php?topic=36339.0 (http://forum.coppermine-gallery.net/index.php?topic=36339.0)

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 20, 2006, 10:49:14 pm
OK, 1st, thanx for this mod.

I tried to install it, but all I got is a beautifull red cross instead of the code...

Any idea of what may be wrong?

A link: http://presquile.crozon.free.fr/coppermine/displayimage.php?album=topn&cat=0&pos=4
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 21, 2006, 01:43:18 pm
It works fine with english as lang http://presquile.crozon.free.fr/coppermine/displayimage.php?album=topn&cat=0&pos=4&lang=english

That means some blank line is getting outputted in your lang/french.php file.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 21, 2006, 03:27:12 pm
OK, I was wondering why the error message was in english... That should be the same reason. I'll chek the file...

Thanx a lot, Abbas...  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 21, 2006, 03:38:20 pm
OK, I modified the french.php file as told in the very 1st message but it doesn't work. The red cross and english error message again...  ???
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 21, 2006, 03:45:41 pm
It works ok, now.

Thanx again!  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 21, 2006, 03:50:54 pm
Grrr I didn't find how to edit my message...

In fact it doesn't work in french. I don't understand why...  ???
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 22, 2006, 08:54:53 am
Remove the following line from captcha.php file and see whether it works or not.

Code: [Select]
require("include/init.inc.php");
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: paul1959 on September 22, 2006, 09:28:12 am
Grrr I didn't find how to edit my message...

In fact it doesn't work in french. I don't understand why...  ???

Hi Loic,

I had the same problem using the Dutch lang file. Try to save your lang file with Ansi encoding. Seems strange but it worked for me!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 22, 2006, 09:29:35 am
Thanx Abbas, it works!  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Loïc on September 22, 2006, 09:33:18 am
Hi Loic,

I had the same problem using the Dutch lang file. Try to save your lang file with Ansi encoding. Seems strange but it worked for me!

I did what Abbas said and it works now. But your tips sounds good too since it definitly looks like a character bug (see the discussion about that bug in the french forum if you can read french)...

Anyway, thanx for your tip!  :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Pascal YAP on September 22, 2006, 11:03:54 am
Abbas,
Good Day
Quote
Remove the following line from captcha.php file and see whether it works or not.
Code: [Select]
require("include/init.inc.php");
bzzzzz Too Strong  ???
Nice idea  ;D

PYAP
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 22, 2006, 11:39:37 am
I thought why not remove the root cause (i.e. lang file). If init.inc.php is not included then lang file is also not included on captcha.php. This won't hamper the captcha in any way.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: peter2 on September 26, 2006, 08:54:04 pm

I finally solved the problem... I hope..  :)

I had to add last parameter to functions imagefttext and imageftbbox (in captcha.class.php), because it is not optional in PHP Version 4.3.2

So, I changed file captcha.class.php

from:
Code: [Select]
$aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $this->sCode[$i]);
To:
Code: [Select]
$aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $this->sCode[$i],array());
from:
Code: [Select]
imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i]);
to:
Code: [Select]
imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i],array());
from:
Code: [Select]
imagefttext($this->oImage, $iFontSize, $iOffsetAngle, $iX + $iRandOffsetX, $iY + $iRandOffsetY, $iShadowColour, $sCurrentFont, $this->sCode[$i]);
to
Code: [Select]
imagefttext($this->oImage, $iFontSize, $iOffsetAngle, $iX + $iRandOffsetX, $iY + $iRandOffsetY, $iShadowColour, $sCurrentFont, $this->sCode[$i],array());
I hope this is OK  :-\

Tnx

http://petersfoto.s5.net/ (http://petersfoto.s5.net/)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: wfs on October 11, 2006, 04:11:29 am
Hello Abbas,

thank you for the great mod for adding comments.

I did exactly according to your instructions.

the mod worked perfectly - thank you !

but I encountered a problem somewhere else - the tabs at the bottom of the page now spans across the entire page instead of the usual small squares located at the right hand corner.

I'd like the tabs like they were previously before I added the mod.

did I do something wrong?

pse help.

thanks so much.

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on October 11, 2006, 05:06:20 am
I doubt that your pagination issue is related to using this mod, but rather the bug discussed here: "thumbnail page navigation - no image counter (http://forum.coppermine-gallery.net/index.php?topic=35701.0)" :-\
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on October 11, 2006, 07:11:51 am
GauGau is right, this mod requires only comments template to be modified. So no chance of tabs getting distorted because of it.

Another possibility is that you might have made some mistake while modifying the theme file. If the thread referred by GauGau does not solve your issue then try re-applying the mod from scratch. I hope you have the backups of the modified files.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: wfs on October 11, 2006, 08:41:04 am
Thank you so much, GauGau and Abbas.
I applied the extra % as discussed in the thread referred to by GauGau.
Problem resolved !!!

Thank you guys AGAIN !!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: wirewolf on October 15, 2006, 09:34:14 pm
Abbas. great mod! Do you know if anyone has applied this mod to ecards?
John
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on October 16, 2006, 07:07:34 am
afaik No.
Title: SPLIT & MOVED: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on October 19, 2006, 08:06:46 am
Split unrelated threat to cpg1.4 themes/skins/templates (http://forum.coppermine-gallery.net/index.php?board=51).

http://forum.coppermine-gallery.net/index.php?topic=37490.0 (http://forum.coppermine-gallery.net/index.php?topic=37490.0)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sosha on October 19, 2006, 08:31:03 pm
fantastic stuff, worked perfectly first time, cheers
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on October 21, 2006, 01:06:15 pm
Hi,

I have made the modifications as described here, but the picture with the code is not vissible
Can you tell me what to do ?

Regards

Cees

http://www.ceesjoore.nl/coppermine/index.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 22, 2006, 01:49:17 am
I run the classic vertical filmstrip theme, but since that did not contain the pieces of code that needed changing
i used the sample theme.php and edited it accordingly. I edited db_input.php and english.php and dutch.php
I upload the captcha.php to the root of the album along with the fonts dir. Uploaded captcha.class.php to the include folder.

When i now click on a picture i do get a extra box saying Confirmation but there are no images beside it.
When i go the captcha.php file directly i get this error:
Code: [Select]
Cannot redeclare class phpcaptcha in /home/fototest/public_html/include/captcha.class.php on line 14
I read this post from front to back and again from back to front but found no clue. Can someone point me in the right direction ?

Thanks
Hein
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on October 22, 2006, 07:27:08 am
Post a link to your gallery would be helpful (turn on debug)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dke on October 22, 2006, 12:07:08 pm
ive added everything as in this thread, i get everything up and running, but it dosnt matter if i actually put anything into confirmation code or not, or what i put into confirmation code. Comments still work for everyone even if you type the wrong confirmation code, what might i have missed? Using mac_ox_x theme
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on October 22, 2006, 12:13:20 pm
ive added everything as in this thread, i get everything up and running, but it dosnt matter if i actually put anything into confirmation code or not, or what i put into confirmation code. Comments still work for everyone even if you type the wrong confirmation code, what might i have missed? Using mac_ox_x theme
Are you sure you edited db_input.php as instructed?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dke on October 22, 2006, 12:29:27 pm
Youre right,

i searched for if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

and added the code directly after it, but there were 2 cases of "if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);" the second one was the right one :) thanks!

Lovely mod but looks really bad in my theme, anyone have any ideas on how to make it look good with mac_ox_x theme, this is how it looks now: http://dkeserver.mine.nu/displayimage.php?pos=-148968

big thanks to Abbas Ali for this lovely mod, i hate that bot spam!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on October 22, 2006, 05:33:33 pm
Hi,

I have made the modifications as described here, but the picture with the code is not vissible
Can you tell me what to do ?

Regards

Cees

http://www.ceesjoore.nl/coppermine/index.php

Tried everything no result yet ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on October 22, 2006, 05:48:08 pm
If you view the file directly, there is no image: http://www.ceesjoore.nl/coppermine/captcha.php

If it worked, you would see the confirmation image. I don't know if it would help, but in Config enable debug mode and see if you get a helpful error message.

If you want help, help the helpers by making it easier on them. I saw your post yesterday but disregarded it since it meant I would have to look around your site for an example. Next time, try to post a more direct url to save everybody's time.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on October 22, 2006, 06:39:24 pm
If you view the file directly, there is no image: http://www.ceesjoore.nl/coppermine/captcha.php

If it worked, you would see the confirmation image. I don't know if it would help, but in Config enable debug mode and see if you get a helpful error message.

If you want help, help the helpers by making it easier on them. I saw your post yesterday but disregarded it since it meant I would have to look around your site for an example. Next time, try to post a more direct url to save everybody's time.

It never worked, it is not working on any of the pictures so my site is filled with examples.
So here is a link to 1 picture http://www.ceesjoore.nl/coppermine/displayimage.php?album=32&pos=11

All i get is a red cross by the confirmation code.
I have put on the debugging mode on for everybody to see, But all the code it is generating is not making any sense to me.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on October 22, 2006, 06:57:49 pm
Login as an admin and check if GD with Freetype is enabled under debug output
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on October 22, 2006, 08:55:11 pm
Login as an admin and check if GD with Freetype is enabled under debug output

@Sami,
When i check PHPINFO.php i see this:
 GD Support  enabled 
GD Version  bundled (2.0.28 compatible) 
FreeType Support  enabled 
FreeType Linkage  with TTF library 
FreeType Version  1.3 

I have put debug output on and this is what i see right now /include/themes.inc.php
Notice line 2196: Undefined index: uid
Notice line 2280: Undefined variable: report_tgt
Notice line 1899: Undefined index: uid
/themes/hardwired/theme.php
Notice line 312: Undefined index: confirm

Is that what you asked ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 25, 2006, 11:04:30 am
Post a link to your gallery would be helpful (turn on debug)

Stupid of me. Thanks ;)

Link is fototest.scouting.nl (http://fototest.scouting.nl)

I still get
Code: [Select]
Fatal error: Cannot redeclare class phpcaptcha in /home/fototest/public_html/include/captcha.class.php on line 14when i call captcha.php directly. I added the sample theme.php and copy/pasted the needed blocks of code into the theme.php of my classic vertical filmstrip theme.php. Also edited db_input.php correctly and edited both english.php and dutch.php. It now displays a confirmation text box below the picture, but no captcha image. If i now try to add comment and click ok i also get the above error message.

The Debug message:
Code: [Select]
USER:
------------------
Array
(
    [ID] => 3507a8f716313a02bc913f96ef5a91bd
    [am] => 1
    [lang] => dutch
    [liv] => Array
        (
            [0] => 12
            [1] => 11
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 3
    [user_name] => skildery
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg149_filetypes; (0s)
    [1] => select * from cpg149_plugins order by priority asc; (0s)
    [2] => delete from `fototest`.cpg149_sessions where time<1161763315 and remember=0; (0s)
    [3] => delete from `fototest`.cpg149_sessions where time<1160557315; (0s)
    [4] => select user_id from `fototest`.cpg149_sessions where session_id=md5("d63c83078b683a3e6b526b8b4400eaa2b8a101053b889122d0f118067ff35962"); (0s)
    [5] => select user_id as id, user_password as password from `fototest`.cpg149_users where user_id=3 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `fototest`.cpg149_users AS u INNER JOIN `fototest`.cpg149_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='3' (0s)
    [7] => SELECT user_group_list FROM `fototest`.cpg149_users AS u WHERE user_id='3' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg149_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg149_usergroups WHERE group_id= 1 (0s)
    [10] => update `fototest`.cpg149_sessions set time='1161766915' where session_id=md5('d63c83078b683a3e6b526b8b4400eaa2b8a101053b889122d0f118067ff35962'); (0s)
    [11] => SELECT user_favpics FROM cpg149_favpics WHERE user_id = 3 (0s)
    [12] => SHOW TABLES LIKE 'cpg149_cms_config' (0s)
    [13] => SELECT * FROM cpg149_cms_config (0s)
    [14] => SELECT * FROM cpg149_final_extract_config (0s)
    [15] => SELECT * FROM cpg149_mark_users WHERE user_id = 3 (0s)
    [16] => SELECT * FROM cpg149_mark_config (0s)
    [17] => SELECT title,keyword from cpg149_albums WHERE aid='3' (0s)
    [18] => SELECT COUNT(*) from cpg149_pictures WHERE ((aid='3'  ) )   (0s)
    [19] => SELECT * from cpg149_pictures WHERE ((aid='3'  ) )   ORDER BY filename ASC  LIMIT 1 ,1 (0s)
    [20] => SELECT * FROM cpg149_mark_users WHERE user_id = 3 (0s)
    [21] => SELECT pid FROM cpg149_mark_watermark WHERE pid = 12 (0s)
    [22] => DELETE FROM cpg149_banned WHERE expiry < '2006-10-25 10:01:55' (0s)
    [23] => SELECT * FROM cpg149_banned WHERE (ip_addr='81.69.50.110' OR ip_addr='81.69.50.110' OR user_id=3) AND brute_force=0 (0s)
    [24] => SELECT title,keyword from cpg149_albums WHERE aid='3' (0s)
    [25] => SELECT COUNT(*) from cpg149_pictures WHERE ((aid='3'  ) )   (0s)
    [26] => SELECT * from cpg149_pictures WHERE ((aid='3'  ) )   ORDER BY filename ASC  LIMIT 1 ,1 (0s)
    [27] => SELECT title, comments, votes, category, aid FROM cpg149_albums WHERE aid='3' LIMIT 1 (0s)
    [28] => SELECT name, parent FROM cpg149_categories WHERE cid = '7' (0s)
    [29] => SELECT cid, name, parent FROM cpg149_categories WHERE cid = '4' (0s)
    [30] => SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM cpg149_comments WHERE pid='12' ORDER BY msg_id ASC (0s)
    [31] => SELECT COUNT(*) FROM cpg149_pictures WHERE approved = 'NO' (0s)
    [32] => SELECT title,keyword from cpg149_albums WHERE aid='3' (0s)
    [33] => SELECT COUNT(*) from cpg149_pictures WHERE ((aid='3'  ) )   (0s)
    [34] => SELECT pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, title, caption,hits,owner_id,owner_name from cpg149_pictures WHERE ((aid='3'  ) )   ORDER BY filename ASC  LIMIT 0 ,10 (0s)
    [35] => SELECT count(*) from cpg149_comments where pid=11 and msg_id!=0 (0s)
    [36] => SELECT count(*) from cpg149_comments where pid=12 and msg_id!=0 (0s)
    [37] => SELECT * FROM cpg149_cms WHERE conid='12' AND type='2' ORDER BY cpos (0s)
)

==========================
GET :
------------------
Array
(
    [album] => 3
    [pos] => 1
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 4.3.10-16 - OK
------------------
mySQL version: 4.1.11-Debian_4sarge7-log
------------------
Coppermine version: 1.4.9(stable)
==========================
Module: GD
------------------
GD Version: 2.0 or higher
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support: 1
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XBM Support:
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 4.0.24
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/run/mysqld/mysqld.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Compiled Version 1.2.2
Linked Version 1.2.2
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | On | Off
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | /usr/share/php | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | no value | no value
file_uploads | On | On
include_path | .:/usr/share/php:/usr/share/pear | .:/usr/share/php:/usr/share/pear
open_basedir | /home/fototest/public_html:/usr/share/php:/tmp | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.103 seconds - 38 queries in 0 seconds - Album set : ; Meta set: ;
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jenkinl1302 on October 25, 2006, 02:07:47 pm
I originally had the same problems as some on this board with the captcha image not showing up.  Something with GD.  Actually, it prevented me from using any gallery software until I figured it out.  GD wasn't available until I asked for it (in code).  On captcha.php, try adding
Code: [Select]
dl("gd.so"); immediately before
Code: [Select]
define("IN_COPPERMINE", true);
I'm not sure if there's a better way to do this, or if it will work for everyone, but it seemed to make things work for me.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 25, 2006, 02:27:42 pm
jenkinl1302 i tried it but it did not work. Thanks for the input though :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on October 25, 2006, 03:09:52 pm
I originally had the same problems as some on this board with the captcha image not showing up.  Something with GD.  Actually, it prevented me from using any gallery software until I figured it out.  GD wasn't available until I asked for it (in code).  On captcha.php, try adding
Code: [Select]
dl("gd.so"); immediately before
Code: [Select]
define("IN_COPPERMINE", true);
I'm not sure if there's a better way to do this, or if it will work for everyone, but it seemed to make things work for me.

jenkinl1302 i tried it but it did not work for me thanks anyway !
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on October 27, 2006, 11:28:46 am
Hein & ceesjoore: If both of you are happy to PM me your ftp details then i will look into it.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: niks_007 on October 29, 2006, 07:29:27 pm
Hi...
        Mr. Abbas I did what is written here followed all the instructions. but can not see any changes to my gallery the url is http://www.lakesparadise.com/wallpapers/index.php here hundreds of people post comments daily and since last few days i am reciving so many spams so i tried it here i am attaching all the files needed to be modified take a look and let me know what is the problem.

             i have added few more words to ban list but it replaced those words with (...) when a comment is posted how can i change it to some smile simbol like :lol: so instead of ban word a smile can be viewed.


waiting for reply.
Nishant
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on October 30, 2006, 06:31:20 am
@ceesjoore: Your server doesn't have one of the functions ( imageftbbox() )required by this mod. You need to ask your webhost for this. That function is generally present if freetype is enabled.

@Hein: Today when i tried to browser your site, it is giving 403 forbidden error. Please ask your webhost to sort this out so that i can look at captcha issue. ( http://fototest.scouting.nl/ is giving 403)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: niks_007 on October 30, 2006, 02:27:06 pm
Dear Mr. Abbas Ali,
                 I am very much fed up with spam and want to sort out the issue as soon as posible i know you are very busy but please take a look at my problem.

Hi...
        Mr. Abbas I did what is written here followed all the instructions. but can not see any changes to my gallery the url is http://www.lakesparadise.com/wallpapers/index.php here hundreds of people post comments daily and since last few days i am reciving so many spams so i tried it here i am attaching all the files needed to be modified take a look and let me know what is the problem.

             i have added few more words to ban list but it replaced those words with (...) when a comment is posted how can i change it to some smile simbol like :lol: so instead of ban word a smile can be viewed.


waiting for reply.
Nishant
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 30, 2006, 03:54:00 pm
Dear Mr. Abbas Ali,
                 I am very much fed up with spam and want to sort out the issue as soon as posible i know you are very busy but please take a look at my problem.


Patience is the keyword here. Do not expect that the people who develop Coppermine are online 24/7 on the look out for any new question. They do not get paid for helping those who need it. Be aware of that fact before you loose patience and start spamming the forum.

Your first question is concerining the implementation of the Captcha mod to your gallery. Enable debugging, it's in the config panel, and also provide a description of any error messages you get etc.. Or if you are in a hurry try one of the other anti-spam methods, use the search of the forum.

Your second question is about the swear list of Coppermine. I suggest you make a new ticket for that question. This is not the correct place to place that question.

Cheers
Hein
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on October 31, 2006, 05:58:30 am
@Hein: thanks for taking the time to explain to niks_007 how a support board works. Sadly, this has been done many times before, niks_007 has been told to behave many times. He/she doesn't (as his negative karma record clearly shows).

@niks_007: this is the ultimatively last warning, next step even for the slightest misbehaviour will be a permanent ban.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on October 31, 2006, 06:16:23 am
@Hein: The captcha image is coming fine now. There was a parse error in captcha.php which i rectified (http://fototest.scouting.nl/captcha.php ). Modify the theme file now to apply the mod.

@niks_007: Try removing the below mentioned code from captcha.php file

Code: [Select]
require("include/init.inc.php");
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 31, 2006, 10:46:11 am
Thanks Abbas for looking into this. I'll see what needs modifying in the theme.php file for displaying the Captcha image. Again, thanks for your time!

Kind regards,
Hein

Update 11:03
When i visit the captcha.php directly i get a red cross with IE and the line "http://fototest.scouting.nl/captcha.php" with Firefox. Is it a browser setting ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on October 31, 2006, 11:09:26 am
Do you have any internet security software like Norton internet security
if you have disable it and try again
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on October 31, 2006, 12:40:34 pm
Do you have any internet security software like Norton internet security
if you have disable it and try again

No i do not have that on my pc as it tends to slow everything down ;)
But if that would be a possible cause then wouldn't that mean all who use such a program have no picture showing up ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on October 31, 2006, 04:24:35 pm
Could help me out with this mod which I installed for a client?

I installed this mod on a client's gallery which is hosted with us and it did not show the visual confirmation box.
So I read the thread here and seen it needed GD Support to run.  I went into the server and recompiled PHP with GD Support. Checked the gallery and the visiual confirmation still does not show and in IE is the old red X broken symbol.
Then I rechecked and the PHP info is now showing the GD Support.

The gallery is at:
http://www.billyelliotthemusical.me.uk/gallery/displayimage.php?album=67&pos=1

As per the install description, I put the captcha.php and fonts folder in the root of the gallery, and then the captcha.class.php in includes folder of the gallery.

I had to mod the themes/eyeball/theme.php to get the code in of course. 

Is there anything I can check?  I do have full administration access to the server which this gallery is hosted on.

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on October 31, 2006, 04:50:52 pm
Enable display of errors in php - then you will be able to see what the error is at http://www.billyelliotthemusical.me.uk/gallery/captcha.php. You probably missed something when adding GD support like freetype.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: niks_007 on October 31, 2006, 05:55:04 pm
hi Hein...
        I have enabled the debugging mode for admin only but i am not getting any error at all and comments can be posted but no visual confirmation is required i have followed all the instructions which are needed to be followed. but if i edit the same comment it shows a text {CONFIRM} in the left side and a cross in the right (No Image) and when you press ok button to edit it it says "Confirmation code didn't matched" but only when we edit the comment else it does not show any thing. in the previous message i have attached all three files needed to be edited so one can get the idea what and where is the problem.

Hi...
        Mr. Abbas I did what is written here followed all the instructions. but can not see any changes to my gallery the url is http://www.lakesparadise.com/wallpapers/index.php here hundreds of people post comments daily and since last few days i am reciving so many spams so i tried it here i am attaching all the files needed to be modified take a look and let me know what is the problem.

waiting for reply.
Nishant

if any one can help me please do so.

Thanks
Nishant
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on October 31, 2006, 07:02:31 pm
Enable display of errors in php - then you will be able to see what the error is at http://www.billyelliotthemusical.me.uk/gallery/captcha.php. You probably missed something when adding GD support like freetype.

Yep you're correct...... Fixed now.... Thanks for the help!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on October 31, 2006, 07:13:51 pm
if any one can help me please do so.
Thanks
Nishant

It looks like you did not edit the themes/yours/theme.php correctly.

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on October 31, 2006, 08:03:52 pm
I think there is some confusion in adding this mod for the average user which does not know PHP or how it is coded.

So I'm going to post a clear how to:

I will do this in steps for everyone.

1) Check to make sure your host has GD Support with FreeType Support.  If not then this will not work for you.  You can check this by making a php page with phpinfo(); in it and uploading it to your site. Under gd you will see the above if it is installed on their server.

2) Now upload captcha.php and fonts directory in your coppermine root directory and then upload captcha.class.php in include directory.

3) Open lang/english.php
Find:
Code: [Select]
'non_exist_comment' => 'The selected comment does not exist', //cpg1.4
Just under that add:
Code: [Select]
'captcha_error' => 'The confirmation code didn\'t matched',
Find:
Code: [Select]
'report_comment_title' => 'Report this comment to the administrator', //cpg1.4
Just under that add:
Code: [Select]
'confirm' => 'Confirmation',
Save and close.

4) This is where is gets some what confusing.
We now want to open themes/yourtheme/theme.php (for an example we will do eyeball).

Now we want to also open themes/sample/theme.php

In themes/sample/theme.php Find & Copy:

Code: [Select]
function theme_html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
    global $template_image_comments, $template_add_your_comment, $lang_display_comments;

    $html = '';

    //report to moderator buttons
    if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
        template_extract_block($template_image_comments, 'report_comment_button');
    }

    if (!$CONFIG['enable_smilies']) {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_smilies');
        template_extract_block($template_add_your_comment, 'input_box_smilies');
    } else {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_no_smilies');
        template_extract_block($template_add_your_comment, 'input_box_no_smilies');
    }

    $tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');

    if ($CONFIG['comments_sort_descending'] == 1) {
        $comment_sort_order = 'DESC';
    } else {
        $comment_sort_order = 'ASC';
    }
    $result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

    while ($row = mysql_fetch_array($result)) {
        $user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';

        if ($CONFIG['enable_smilies']) {
            $comment_body = process_smilies(make_clickable($row['msg_body']));
            $smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');
        } else {
            $comment_body = make_clickable($row['msg_body']);
            $smilies = '';
        }

        $ip = $row['msg_hdr_ip'];
        if ($row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            $ip .= ' [' . $row['msg_raw_ip'] . ']';
        }

        $params = array('{EDIT}' => &$comment_edit_box,
            '{BUTTONS}' => &$comment_buttons,
            '{IPINFO}' => &$comment_ipinfo
            );

        $template = template_eval($template_image_comments, $params);

        $params = array('{MSG_AUTHOR}' => stripslashes($row['msg_author']),
            '{MSG_ID}' => $row['msg_id'],
            '{PID}' => $row['pid'],
            '{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
            '{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
            '{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
            '{MSG_BODY}' => bb_decode($comment_body),
            '{MSG_BODY_RAW}' => $row['msg_body'],
            '{OK}' => &$lang_display_comments['OK'],
            '{SMILIES}' => $smilies,
            '{IP}' => $ip,
            '{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
            '{WIDTH}' => $CONFIG['picture_table_width']
            );

        $html .= template_eval($template, $params);
    }

    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (USER_ID) {
            $user_name_input = '<tr><td><input type="hidden" name="msg_author" value="' . stripslashes(USER_NAME) . '" /></td>';
            template_extract_block($template_add_your_comment, 'user_name_input', $user_name_input);
            $user_name = '';
        } else {
            $user_name = isset($USER['name']) ? '"' . strtr($USER['name'], $HTML_SUBST) . '"' : $lang_display_comments['your_name'] . '" onclick="javascript:this.value=\'\';';
        }

        $params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
            // Modified Name and comment field
            '{NAME}' => $lang_display_comments['name'],
            '{COMMENT}' => $lang_display_comments['comment'],
'{CONFIRM}' => $lang_display_comments['confirm'],
            '{PIC_ID}' => $pid,
            '{USER_NAME}' => $user_name,
            '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            '{OK}' => $lang_display_comments['OK'],
            '{SMILIES}' => '',
            '{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if ($CONFIG['enable_smilies']){
                        $params['{SMILIES}'] = generate_smilies();
                } else {
                        template_extract_block($template_add_your_comment, 'smilies');
                }

        $html .= template_eval($template_add_your_comment, $params);
    }

    return $html;
}

Now we want to paste that copy in your theme (again in this case the eyeball theme) just above the PHP close ?>.

Now that is done go back to themes/sample/theme.php then
Find & Copy:

Code: [Select]
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;

Now we want to paste that copy in your theme (again in this case the eyeball theme) just above the PHP close ?> again.

5) Now we want to search your theme file (again in this caes eyeball) for:
Code: [Select]
<!-- END input_box_no_smilies -->
                                <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>

Just after that add:

Code: [Select]
<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>

Save and close.

6) Open db_input.php
Find:

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

Just after that add:

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

Save and Close.

Thats it..... You're done.....


I hope this helps out some people having problems.  I also hope this is not looked at as a double post to Abbas Ali first post, I just thought it would help some with how to add it to their theme as his post was not clear on that part.


Thanks for the great mod and the time it took!


Jake
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: darktea on October 31, 2006, 11:41:18 pm
This looks like a great mod especially as my site was hit for the first time by spammers today. 

I followed the initial instructions and seem to have got most of the way there as I have the confirmation box, but I do not see the image.  I have looked through the previous comments and there is a suggest this maybe because I don't have freetype support; I checked this and it is enabled http://www.darktea.co.uk/phpinfo.php

I have followed the instructions posted by jakejammin as a check and picked up one error (I had duplicated some code so had two confirmation boxes previously), but I guess there is still something which my non php code eyes don't see

Any suggestions you could make would be wonderful and I have enabled the debug info just in case it is helpful.  www.darktea.co.uk

Thank you
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on November 01, 2006, 12:15:04 am
http://www.darktea.co.uk/captcha.php - chmod as suggested.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: claude258 on November 01, 2006, 01:44:18 am
I dont know why but I just happen to see that my site has a red X instead of the confirmation code.
http://claudebriere.net/coppermine/displayimage.php?album=72&pos=2

It was working well before ???.

Can you help?

Thanks.
Claude
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: claude258 on November 01, 2006, 04:54:44 am
I dont know why but I just happen to see that my site has a red X instead of the confirmation code.
http://claudebriere.net/coppermine/displayimage.php?album=72&pos=2

It was working well before ???.

Can you help?

Thanks.
Claude

I switched to the plugin version and it is working. But when a wrong code is used it goes to a error page (white page with codes...)
http://claudebriere.net/coppermine/displayimage.php?pos=-1697
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 01, 2006, 06:01:26 am
For plugin version, address your issue on the respective thread i.e. the plugin version thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on November 01, 2006, 06:59:38 am
Any suggestions you could make would be wonderful and I have enabled the debug info just in case it is helpful.  www.darktea.co.uk

Thank you


We can not see your phpinfo page.  Make sure the GD Support has FreeType Support listed.  I found out today, just because you see GD Support installed does not mean that GD Support has FreeType installed.

Again it must say FreeType Support enabled.  If it does not ask your host provider if they have FreeType Support enabled on their servers.

Hope that helps ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 01, 2006, 07:08:30 am
@niks_007: Try removing the below mentioned code from captcha.php file

Code: [Select]
require("include/init.inc.php");

@Nishant: Did you do what i said?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ceesjoore on November 01, 2006, 08:12:59 am
@ceesjoore: Your server doesn't have one of the functions ( imageftbbox() )required by this mod. You need to ask your webhost for this. That function is generally present if freetype is enabled.


Abbas,
My hosting provider told me that they don't have that function, so there is no solution for my problem now.
But thanks for helping.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 01, 2006, 08:18:29 am
@ceesjoore: There are other captcha mods too (Mods: Comments (http://forum.coppermine-gallery.net/index.php?board=76.0)). Try one of those.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on November 01, 2006, 03:48:50 pm
I think there is some confusion in adding this mod for the average user which does not know PHP or how it is coded.

So I'm going to post a clear how to:

I will do this in steps for everyone.

...

Jake

Thanks Jake i will give this a try. Maybe i missed something in editing my files.

Cheers!
Hein
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: niks_007 on November 01, 2006, 03:52:20 pm
Hi...
       I am extreemly Thankfull to Mr. Abbas Ali and others who have helped me
       Yes It has started Working... realy thanks alot to all.

Thanks
Nishant
www.lakesparadise.com
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mrdummy on November 01, 2006, 07:10:16 pm
It works, but i have edited in themes.inc.php

After reading this topic, i checked sample theme.php version and there is indeed same code.
The problem that i use igames theme. The theme.php has no function and template input code inside.

I must copy both codes from /sample/theme.php.
First part is template part, found at row 813-867.
copy to theme/theme.php, then add the code what is written in the first topic post.
Code: [Select]
<!-- begin captcha mod -->
<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>
<!-- end captcha mod -->
behind code
Code: [Select]
<!-- END input_box_no_smilies -->
    <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>
The <!-- xxx --> are just for marking new mods.

Second part, function part, is found at row 2248-2356. Copy whole part to your theme/theme.php, below the code.
Add after
Code: [Select]
'{COMMENT}' => $lang_display_comments['comment'],the code
Code: [Select]
'{CONFIRM}' => $lang_display_comments['confirm'],
You may place both parts below own theme/theme.php without troubles.

The code for db_input.php is found by row 113: case 'comment':
The code for language file is found:
- by 'non_exist_comment' around row 101 (remove the comma because it's last string in array!)
(there are TWO 'non_exist_comment' codes, at row 90 and 101...... :( Forgot to remove it?)
- by 'report_comment_title' around row 1033 or 1034 after adding code, remove also comma.
You may copy same code in another language files and translate it in your language.

I use Dreamweaver to edit the php files without troubles. Even for Dutch language file.
Alle files are from version 1.4.10, but igames theme is perhaps added.
Actually, if you're good with php, you can also copy code from theme.inc.php because it's same code, but don't copy function_exist part, but only between {} in if function_exists code.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: mrdummy on November 01, 2006, 09:24:51 pm
There is more.
http://forum.coppermine-gallery.net/index.php?topic=29564.msg168167#msg168167 has good code to switch captcha off when user is logged in. Thanks.

But the template part is too much long (for just small difference). I have much shorter code for template part:
Code: [Select]
// HTML template for the form to add comments
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
EOT;
if (!USER_ID) {
$template_add_your_comment .= <<<EOT
<!-- begin captcha mod -->
<tr>
<td class="tableb_compact" colspan="2"></td>
  <td class="tableb_compact">
    {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>
<!-- end captcha mod -->
EOT;
}
$template_add_your_comment .= <<<EOT
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;

Look at the part
Code: [Select]
if (!USER_ID) {
$template_add_your_comment .= <<<EOT
<!-- begin captcha mod -->
<tr>
<td class="tableb_compact" colspan="2"></td>
  <td class="tableb_compact">
    {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>
<!-- end captcha mod -->
EOT;
}
and the trick with .= behind the string $template_add_your_comment does the work. This is much shorter and lesser same code repeats.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jakejammin on November 02, 2006, 04:49:18 pm
There is more.
http://forum.coppermine-gallery.net/index.php?topic=29564.msg168167#msg168167 has good code to switch captcha off when user is logged in. Thanks.

Why would you want to do that??? The phpBB forum found out that spam bots can now, not only Register but login and post spam all in one quick swoop..... The spam bots I'm sure can do that to coppermine as well.....
I would assume....
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: darktea on November 02, 2006, 06:04:48 pm
Thanks Nibbler for you quick and accurate response.  I feel quite embarrassed about, but because it is the first time I have changed the code I had assumed that was the problem and I guess I ignore the obvious.  It is all working perfectly now.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Quinttindew on November 06, 2006, 10:46:58 am
Fatal error: main() [function.require]: Failed opening required 'include/turing.class.php' (include_path='.:/usr/local/lib/php') in /home/admin/domains/movishon.com/public_html/platinum/album/include/init.inc.php on line 195

Hi
I get this Error by init.inc.php  , what can i do

faith fully

Q
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 06, 2006, 12:58:14 pm
This mod does not uses any file named turing.class.php Perhaps you posted on the wrong thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sosha on November 19, 2006, 07:37:55 pm
Hi, i successfully installed this mod to my gallery a few weeks back, but all of a sudden it has stopped working and doesn't show (or red x's) the captcha image. Ive just double checked all my files to make sure there's nothing missing or has been reset to default and i cant find anything wrong.
However my site is hosted with hosting-unlimited who are notorious on these boards it seems

the gallery is at http://www.tarannau.com/footballers/gallery/

any help appreciated
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on November 19, 2006, 08:59:46 pm
Hi, i successfully installed this mod to my gallery a few weeks back, but all of a sudden it has stopped working and doesn't show (or red x's) the captcha image. Ive just double checked all my files to make sure there's nothing missing or has been reset to default and i cant find anything wrong.
However my site is hosted with hosting-unlimited who are notorious on these boards it seems

the gallery is at http://www.tarannau.com/footballers/gallery/

any help appreciated

You might want to try this plugin http://forum.coppermine-gallery.net/index.php?topic=36319.0 (http://forum.coppermine-gallery.net/index.php?topic=36319.0). It's based on this mod and does not involved editing files yourself.

Cheers!
Hein
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sosha on November 20, 2006, 08:48:58 pm
Ok well I installed the plugin and it seemed to work but just like with the mod the captcha image red x'd out

Is there some sort of server mis-configuration that I can bitch to my hosts about?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on November 20, 2006, 09:52:19 pm
Ok well I installed the plugin and it seemed to work but just like with the mod the captcha image red x'd out

Is there some sort of server mis-configuration that I can bitch to my hosts about?

Search the whole thread of that plugin i mentioned. In there is the solution to your problem iirc.

Cheers!
Hein
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 21, 2006, 06:10:46 am
And for support on that plugin, please post your issue on that thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sosha on November 21, 2006, 02:05:06 pm
And for support on that plugin, please post your issue on that thread.
Well actually I posted here because the mod wasnt working, and Hein suggested the plugin which gave the exact same problem, of the captcha image red x'ing
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on November 21, 2006, 10:54:10 pm
Then do as suggested: if you have issues with the plugin, go to the plugin thread. If you have issues, post on the mod thread (this one). Abbas Ali reminded you not to cross-post... Do as he suggested instead of trying to justify what you did before.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 22, 2006, 06:08:03 am
The thing is that though the issue in both (mod and plugin) might be the same but the way to solve it will be different. So stick to one either mod or plugin and then post your issue on respective thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sosha on November 28, 2006, 01:53:01 pm
Well as you know I originally tried this mod and since you actually wrote it I guess if i had to choose which one to use then it would be this one. I only mentioned the fact that i get the same error with both mod and plugin because I thought that might helpyou 'diagnose'

Sorry if i was perceived to be cross-posting I was just trying to help you guys help me.

Anyway any help would be appreciated as my gallery is still getting spammed badly even with akismet and I know captcha would be perfect if only the damn thing worked :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on November 29, 2006, 07:16:42 am
@Sosha: It seems that you have removed the mod. Re-apply it and then we will debug it and try to solve your issue.

As a starting point just put the captcha.php, captcha.class.php and fonts directory in its place. Do not edit theme file and db_input.php for now. We will first see whether the image is getting created or not. Once the image starts getting created then you can edit theme file.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: plathw on November 30, 2006, 03:07:03 pm
I have added this hack to my gallery, and as has been mentioned earlier, everything works great except the fonts aren't showing up, just the input box and the image with lines.  Here is the site for you to look at:

http://photos.coker.com

I have added everything as I should, the fonts directory is on the server in the root directory right where it needs to be....I'm very confused on what could be happening.  We have a working captcha on http://blog.coker.com that uses a wordpress plugin, so I assume that the server supports everything needed for the hack.

Also note I changed the language file so that incorrectly entering the captcha says "comments are disabled" instead of giving an error saying you incorrectly entered the confirmation.

Any help is greatly appreciated!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on November 30, 2006, 05:07:42 pm
Do you have freetype?
Title: Configuring Captcha for the Fruity theme
Post by: SiamJai on December 03, 2006, 01:55:56 pm
Captcha works like a charm; success at first try - thank you so much for sharing this great mod, Abbas Ali! Spammers now have one less place to infest. :)

I guess the trickiest part of the configuration is to make changes in the theme.php file, since its settings vary from theme to theme. We at the Thaiwonders team (http://www.thaiwonders.com/art/gallery/index.php) use Fruity, and we would like to make the Captcha-config process easier for fellow Fruity-users.  GauGau has posted half of the code already in response to a specific question, but I think it will be useful to see the entire process as a whole.

Please note: this method was tested and found to work with the Fruity theme. It may or may not work with other themes. 

The following two sections of themes/sample/theme.php need to be copied to themes/fruity/theme.php

Code: [Select]
// Displays comments for a specific picture
function theme_html_comments($pid)
{
    global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
    global $template_image_comments, $template_add_your_comment, $lang_display_comments;

    $html = '';

    //report to moderator buttons
    if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
        template_extract_block($template_image_comments, 'report_comment_button');
    }

    if (!$CONFIG['enable_smilies']) {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_smilies');
        template_extract_block($template_add_your_comment, 'input_box_smilies');
    } else {
        $tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
        template_extract_block($template_image_comments, 'edit_box_no_smilies');
        template_extract_block($template_add_your_comment, 'input_box_no_smilies');
    }

    $tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
    $tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');

    if ($CONFIG['comments_sort_descending'] == 1) {
        $comment_sort_order = 'DESC';
    } else {
        $comment_sort_order = 'ASC';
    }
    $result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

    while ($row = mysql_fetch_array($result)) {
        $user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        $comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
        $comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
        $comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';

        if ($CONFIG['enable_smilies']) {
            $comment_body = process_smilies(make_clickable($row['msg_body']));
            $smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');
        } else {
            $comment_body = make_clickable($row['msg_body']);
            $smilies = '';
        }

        $ip = $row['msg_hdr_ip'];
        if ($row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            $ip .= ' [' . $row['msg_raw_ip'] . ']';
        }

        $params = array('{EDIT}' => &$comment_edit_box,
            '{BUTTONS}' => &$comment_buttons,
            '{IPINFO}' => &$comment_ipinfo
            );

        $template = template_eval($template_image_comments, $params);

        $params = array('{MSG_AUTHOR}' => stripslashes($row['msg_author']),
            '{MSG_ID}' => $row['msg_id'],
            '{PID}' => $row['pid'],
            '{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
            '{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
            '{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
            '{MSG_BODY}' => bb_decode($comment_body),
            '{MSG_BODY_RAW}' => $row['msg_body'],
            '{OK}' => &$lang_display_comments['OK'],
            '{SMILIES}' => $smilies,
            '{IP}' => $ip,
            '{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
            '{WIDTH}' => $CONFIG['picture_table_width']
            );

        $html .= template_eval($template, $params);
    }

    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (USER_ID) {
            $user_name_input = '<tr><td><input type="hidden" name="msg_author" value="' . stripslashes(USER_NAME) . '" /></td>';
            template_extract_block($template_add_your_comment, 'user_name_input', $user_name_input);
            $user_name = '';
        } else {
            $user_name = isset($USER['name']) ? '"' . strtr($USER['name'], $HTML_SUBST) . '"' : $lang_display_comments['your_name'] . '" onclick="javascript:this.value=\'\';';
        }

        $params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
            // Modified Name and comment field
            '{NAME}' => $lang_display_comments['name'],
            '{COMMENT}' => $lang_display_comments['comment'],
            '{PIC_ID}' => $pid,
            '{USER_NAME}' => $user_name,
            '{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            '{OK}' => $lang_display_comments['OK'],
            '{SMILIES}' => '',
            '{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if ($CONFIG['enable_smilies']){
                        $params['{SMILIES}'] = generate_smilies();
                } else {
                        template_extract_block($template_add_your_comment, 'smilies');
                }

        $html .= template_eval($template_add_your_comment, $params);
    }

    return $html;
}

Code: [Select]
// HTML template for the form to add comments
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;

NOTES:
Add these sections before the last ?> in the php file - and don't forget to modify your new themes/fruity/theme.php as described in the first post.

There might be other ways, or less info to copy, but this is a tried-and-true method for the Fruity theme. I hope this will make it a bit easier for fellow Fruity users, and takes care of a few config questions in advance. ;)

Thanks again,

SiamJai from the Thaiwonders Team
Title: long quotes
Post by: SiamJai on December 03, 2006, 02:11:27 pm
Could someone change my "quote" tags to "code" in the above post please? I'd do it myself if post editing were enabled... Sorry for the inconvenience. 
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 04, 2006, 05:49:36 am
Thanks Siam for sharing.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Gephri on December 13, 2006, 11:11:53 pm
Installed the mod - simple enough.  But neither the text box nor captcha shows to unregistered visitors.  It must be being blocked by another mod or my own coding.  Can you point me towards where to look to get this mod working?

thanks,

PS I did have to set up the last mod with a body onload tweak because my gallery couldn't pick up the mod as-is.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jeffreybr on December 13, 2006, 11:12:53 pm
Hi,

i'm having a problem installing this.
i have followed all steps, only this one gives me problems:

Edit themes/yourtheme/theme.php

Add

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

just after

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

Add

Code:
<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

Code:
<!-- 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>

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


i have tried this but i can't find the text like the description in my file.
i'm using rainy day as theme.

Could someone help me?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 14, 2006, 07:22:16 am
@Gephri: Please give the url to your site.

@jeffrybr: You will need to copy that section from themes/sample/theme.php to your theme.php. Read this thread carefully from the begining. You will see that the instructions to copy section from sample theme have been given.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jeffreybr on December 14, 2006, 09:03:05 am
Hi,

i have done that, but i have a problem.
the image for the confirmation code is not shown.

http://www.watisdeplanning.nl/fotoboek/
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Gephri on December 14, 2006, 06:23:49 pm
Hello Abbas Ali
URL to Gephri's site ishttp://www.superstarstudents.com/gallery/index.php (http://www.superstarstudents.com/gallery/index.php)

Thanks for taking a look at why unregistered users can't see the captcha and comment area.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 15, 2006, 06:18:59 am
@Gephri: You will need to allow unregistered users to put comments from groups manager page (in admin mode).
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Gephri on December 15, 2006, 10:10:33 pm
thanks  - sometimes we're just looking too deep !
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 19, 2006, 05:31:05 am
I need some help.
I followed all instructions carefully, went over them twice,
and thought everything was working great.
Except, the confirmation shows up, but even if I don't type in the code,
it adds the comment, whether I am logged in or out..
Its like its not reading it :S
Please help!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 19, 2006, 06:43:57 am
You probably didn't modified db_input.php file.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 19, 2006, 03:20:17 pm
I did modify it though.
This is what it looks like:  www.vanessa-anne.org/pictures
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: WebJorge on December 19, 2006, 09:27:38 pm
Hello,

I'm using the latest 1.4.10 version, and i'm having trouble finding the lines of codes that you say that I have to edit on the theme.php file. I'm talking about your instructions that say...

Add

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

just after

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


I can't find that anyware on the theme.php file. Any help would be gladly apreciated.

Thanks!

~Jorge~
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 20, 2006, 01:52:30 am
To WebJorge: read the posts before yours.. about page 2. It explains this.
I still need help for my problem, though.
Please help!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 20, 2006, 07:49:10 am
@etnies: The captcha image is coming fine. The only place which might not be properly edited is db_input.php (which checks the input code against the image code). Attach your db_input.php file with next post.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 20, 2006, 03:19:04 pm
Okay, thanks Abbas.
I attached my db_input to this post.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 21, 2006, 06:45:22 am
You had edited the file in the wrong place. I corrected it and the modified file is attached. Replace your exisisting db_input.php with this one and lets see whether it works or not.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 21, 2006, 05:02:53 pm
I replaced my dp_input.php with the one you gave me.
It didn't cause any errors until I tried to submit the comment, then it gave me this error:

Code: [Select]
Parse error: syntax error, unexpected $end in /home/vanne/public_html/pictures/db_input.php on line 839
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 22, 2006, 01:32:52 pm
Ok, try this file.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: etnies on December 22, 2006, 06:19:03 pm
YES! It works now Abbas, thank you very much for your time and patience :)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: squish on December 26, 2006, 05:03:01 am
Just wanted to say thanks for an excellent mod. After reading the original posts and the replies, I was able to get it successfully implemented on my site (http://www.karaterice.com/pictures/index.php). Hopefully, this'll be the end of my days deleting comment spam.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on December 30, 2006, 03:25:49 am
Some of the mod html caused html validation to fail.

I changed:
Code: [Select]
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
to:
Code: [Select]
    <input type="text" name="confirmCode" size="5" class="textinput" /> <img src="captcha.php" align="middle" alt="captcha image" />
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on December 30, 2006, 06:23:09 am
Thx Thu.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 06, 2007, 07:52:27 pm
Respectful Abbas Ali.
I have a pproblem that mode captcha vork with  gallery 1.4.8 with a stranges that it not worked with gallery 1.4.10: instead mode  there appear a picture with red cross. Both gallery place in one server.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: MadLine on January 06, 2007, 10:48:27 pm
Hello

I'm has Captcha Packs for German & English Coppermine 1.4.10

Upload files and lucky its.

http://www.flashtoflash.de/blog/?p=47 (http://www.flashtoflash.de/blog/?p=47)

THX and all Useres

sry for bad english  :-\
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 06, 2007, 11:37:48 pm
formerli it doesn't worked. It's a same formerli - red cross.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 07, 2007, 12:33:00 am
ULISS: Post a link to your site and a test account if required to post comments.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 07, 2007, 01:16:19 am
Thank's for the help and support, has understood!
Forgive for my bad Russian-English. :-\
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: flynge on January 12, 2007, 03:14:42 pm
Hi

Just an advice: Use the "plugin manager" to install it. Then it works fine  :D

I had a lot of trouble getting it right. I think it's the theme-modification which is hard to get right.

It's sad that we have to implement such plugins to get rid of spam - but on the other hand it's great, that people like Abbas Ali provide us with the tool to fight it. Thanks  ;D

Have a nice weekend
Finn
www.flfoto.dk
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 12, 2007, 03:35:39 pm
Help new the bug is not present letters in a picture

http://usiba105.valuehost.ru/gallery/displayimage.php?album=random&cat=0&pos=-1 (http://usiba105.valuehost.ru/gallery/displayimage.php?album=random&cat=0&pos=-1)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on January 12, 2007, 06:42:10 pm
Just an advice: Use the "plugin manager" to install it. Then it works fine  :D
The captcha plugin and the captcha mod are two different things. Please keep comments on the plugin version to the thread that discusses the plugin.

Help new the bug is not present letters in a picture
A "bug" is something that is wrong with the mod code. Yours may be an implementation error as well. You appear to require to be logged in before being able to post comments. Subsequently, you should post a non-admin test user account.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 12, 2007, 07:27:44 pm
strange that in local machine  mode are worked, but at hosting it doesn't worked.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 12, 2007, 07:57:26 pm
I have include function to authorize comments guest.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on January 13, 2007, 06:13:27 am
Maybe you didn't uploaded fonts directory properly.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 13, 2007, 01:38:43 pm
what meaning  properly uploaded? Both fonts place in file-fonts...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on January 13, 2007, 07:10:31 pm
I mean try re-uploading the font files. Also make sure that you have freetype support enabled in php.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ULISS on January 13, 2007, 08:07:08 pm
Abbas Ali, i try re-uploading many times...?
Code: [Select]
GD Support  enabled 
GD Version  2.0 or higher 
FreeType Support  enabled 
FreeType Linkage  with freetype 
T1Lib Support  enabled 
GIF Read Support  enabled 
GIF Create Support  enabled 
JPG Support  enabled 
PNG Support  enabled 
WBMP Support  enabled 
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 13, 2007, 09:32:55 pm
There is certainly something wrong with them. The acidic.ttf from your site is different to the acidic.ttf from the package. Make sure you are uploading them in binary mode, try a different FTP client.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: fifo on January 20, 2007, 02:38:43 pm
There is certainly something wrong with them. The acidic.ttf from your site is different to the acidic.ttf from the package. Make sure you are uploading them in binary mode, try a different FTP client.

I have the very same problem.. only the cross instead of font images :/  Did you guys find any solution about this problem ? Were the font files really corrupted ?

Could you some info please ?

Thank you
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: rdarsey on January 22, 2007, 01:15:43 am
I am having the same issue.  I get the image with the lines, but no text.  The protection is working, just the Confirmation code is not showing up in the image.  Any help would be greatly appreciated.  To see a sample of what I am having a problem with, please visit:

http://www.darseydesign.com/cpg/displayimage.php?album=random&cat=1&pos=-104

Thank you
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 22, 2007, 01:17:26 am
If anyone with this specific issue is happy to PM me FTP access to their gallery I can investigate.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Dezsike on January 22, 2007, 03:19:25 pm
Hi, i have the same problem. It can be a problem that my webserver running under Windows? Because most webservers running under Linux, so it probably not tested on Windows OS.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: yetti on January 23, 2007, 12:31:02 am
Hi,
im install captcha mod, but im problem. comments is available only for login user and no visible for anonym users? where is problem?
http://www.soudlh.sk/cpg1410/displayimage.php?album=2&pos=8
thanks for help
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 23, 2007, 01:02:21 am
Set permissions on the groups page. This is not related to the mod.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: rdarsey on January 24, 2007, 05:18:36 pm
Nibbler,

I have tried sending you a PM with the FTP info you requested, but it does not seem to work correctly.  When I click the submit button on the PM, I am returned to my message.

Did you receive a message from me?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 24, 2007, 05:49:14 pm
No, you can mail me using nibbler@coppermine-gallery.net though.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on January 25, 2007, 01:06:51 pm
I got your email. You don't have GD2 installed which is required for this mod.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: rdarsey on January 25, 2007, 04:01:27 pm
Thanks Nibbler.  I will look into adding it to the server.

Thanks again.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: yetti on January 25, 2007, 08:10:20 pm
To Nibbler: Thanks very much, I set permissions and everything is OK. Im lamer  :) Thanks again
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: pieterc on January 30, 2007, 09:13:58 am
Okay - I've worked through the 1st 6 pages of this thread and still can't solve my problem.
I've followed all the steps Abbas Ali and GauGau told us to do to install captcha.
Now I can see the Captcha when going to enter the comment, but even if you leave the Captcha word blank or enter it incorrectly Coppermine still add the comment.
This morning I had to clean out about 20 SPAM entries again.
I can attach or email anyone that want to see my theme.php and other relevant files to ensure it's correct. I have currently disabled comments on my gallery.
Any help please guys. Thanks Pieter
http://afrikakiwi.com/coppermine2
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on January 30, 2007, 10:31:28 am
Attach your db_input.php file only.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: pieterc on January 30, 2007, 11:34:36 am
Thanks mate, I found the problem - there are 2 entries in db_input.php with the wording :
if (!(USER_CAN_POST_COMMENTS)) cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);

I used the wrong one. I redone it - Working fine. Many Many Thanks for this and for responding so quickly.

Abbas 1 - SPAMMERS 0

Cheers - Pieter
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: grafx77 on January 30, 2007, 11:21:34 pm
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/

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on January 31, 2007, 05:09:20 am
Did you make the change in db_input.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on January 31, 2007, 06:14:27 am
If you had made the change in db_input.php then make sure that it was done at right place.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: grafx77 on January 31, 2007, 01:48:27 pm
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Naglfar on February 02, 2007, 11:57:19 pm
Thanks so much for the mod Abbas.. The spamming was starting to get pretty bad.


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


Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nigelt74 on February 04, 2007, 06:30:58 am
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?

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 05, 2007, 07:02:16 am
Not sure but you can do some trial and error method.

Open captcha.php in editor and find this code

Code: [Select]
// 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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nigelt74 on February 06, 2007, 06:44:10 am
Thanks for that Abbas
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: angelik on February 08, 2007, 11:37:07 am
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: 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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: angelik on February 08, 2007, 04:35:59 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+
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: broekh002 on February 09, 2007, 04:28:48 pm
Thanks a lot!!!!, where can I find this module?

Rodney

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
Code: [Select]
'captcha_error' => 'The confirmation code didn\'t matched',

just after
Code: [Select]
'non_exist_comment' => 'The selected comment does not exist', //cpg1.4

Add
Code: [Select]
'confirm' => 'Confirmation',

just after
Code: [Select]
'report_comment_title' => 'Report this comment to the administrator', //cpg1.4

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

Edit themes/yourtheme/theme.php

Add
Code: [Select]
'{CONFIRM}' => $lang_display_comments['confirm'],

just after
Code: [Select]
'{COMMENT}' => $lang_display_comments['comment'],

Add
Code: [Select]
<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
Code: [Select]
<!-- 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

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

just after

Code: [Select]
    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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 10, 2007, 06:03:37 am
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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: angelik on February 10, 2007, 09:07:31 am
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+
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: skidpics on February 15, 2007, 04:50:40 pm
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on February 16, 2007, 04:11:43 am
@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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: skidpics on February 16, 2007, 04:28:47 am
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
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jalmz on February 16, 2007, 07:19:14 am
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.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: skidpics on February 18, 2007, 04:22:59 pm
And here is the link to the plugin forum..  Thanks for pointing that out..

http://forum.coppermine-gallery.net/index.php?topic=36319.0 (http://forum.coppermine-gallery.net/index.php?topic=36319.0)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Mohammad J on February 26, 2007, 06:20:54 am
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!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Mohammad J on February 27, 2007, 07:46:20 am
I have tried the module and it worked perfectly!   

However, when I tried it with the arabic.php language, the JPEG photo creation for the code failed.

I have made many analysis and found that the problem happenned because my arabic.php file is saved in UTF-8 charachter set. I can not conver the character set to other formats because every thing in my website is designed to work that way.


to solve hte problem, I checked the code of captcha.php and commented the initialize code as below:

Code: [Select]

define("IN_COPPERMINE", true);
// require("include/init.inc.php");
require("include/captcha.class.php");



After this change, captch worked great with arabic.php although it is saved in UTF-8.


My question is:  is it really required to have teh above include file "require("include/init.inc.php");"  ?

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Mohammad J on February 27, 2007, 07:57:57 am
By the way:

Visitors will not see the attachement unless they register to the forum. I think you need to put a note about this.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 27, 2007, 10:26:55 am
My question is:  is it really required to have teh above include file "require("include/init.inc.php");"  ?

No, init.inc.php is not required for capthca.php The mod will work absolutely fine without that line.

Visitors will not see the attachement unless they register to the forum. I think you need to put a note about this.

This is the default behavior of SMF forum (the forum software which we use), and it is good in a way.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Mohammad J on February 27, 2007, 10:47:38 am
Thank you sooooo much Abbas for your feedback. Now, I feel more confident about the solution.


You will not belive how your solution saved my time...thank you again and GOOD BYE SPAMMERS!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on February 28, 2007, 11:24:08 pm
I have been getting a LOT of spam comments recently, even WITH the captcha add on (that works perfectly). How can I stop the bots?

www.britneyres.com
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on February 28, 2007, 11:30:06 pm
You didn't install the captcha mod properly. Try it yourself.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: kylestone on March 01, 2007, 01:34:49 am
I'm not able to see any words / letters inb the captcha box
http://muttmart.com/coppermine/displayimage.php?album=1&pos=12
any ideas?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 01, 2007, 01:39:39 am
Check you have freetype support by looking at your phpinfo page.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 01, 2007, 07:00:47 am
I have been getting a LOT of spam comments recently, even WITH the captcha add on (that works perfectly). How can I stop the bots?

Make sure you edited db_input.php properly.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Blindside on March 01, 2007, 09:18:25 pm
First: Thanks for the nice mod.

But I have a problem: I can't see a Captcha Box with the numbers and letters. There is a field to type them in, but no field where they should be displayed (in Firefox) and with the IE I see this ugly red cross for a not existing picture. What have I done wrong?

http://stare-away.de/pics/displayimage.php?album=22&pos=0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 01, 2007, 09:25:52 pm
There is something at the start of the image that is causing it to be corrupt. It looks like a few blank lines followed by ?>. Double check your modifications.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Blindside on March 01, 2007, 09:43:05 pm
Well, my theme.php was nearly empty, so i took the provided modified theme.php and copied the content into my theme.php. I am really a noob and honestly have no clue of php, maybe I've copied sth. I shouldn't? This is my theme.php:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly 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.3
  $Source: /cvsroot/coppermine/stable/themes/rainy_day/theme.php,v $
  $Revision: 1.14 $
  $Author: gaugau $
  $Date: 2005/11/28 07:43:00 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has had all redundant CORE items removed                           //
// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);

// HTML template for sys_menu
$template_sys_menu = <<<EOT
  <div class="topmenu">
          <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
  {BUTTONS}
                  </tr>
          </table>
  </div>
EOT;

// HTML template for template sys_menu buttons
$template_sys_menu_button = <<<EOT
<!-- BEGIN {BLOCK_ID} -->
  <td><img src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
  <td><img src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" alt="" /></td>
  <td style="background-image:url(themes/rainy_day/images/button1_r1_c2.gif)">
          <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a>
  </td>
  <td><img src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" alt="" /></td>
<!-- END {BLOCK_ID} -->
EOT;

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='::';

// Displays comments for a specific picture
function theme_html_comments($pid)
{
    global 
$CONFIG$USER$CURRENT_ALBUM_DATA$comment_date_fmt$HTML_SUBST;
    global 
$template_image_comments$template_add_your_comment$lang_display_comments;

    
$html '';

//report to moderator buttons
    
if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
        
template_extract_block($template_image_comments'report_comment_button');
    }

    if (!
$CONFIG['enable_smilies']) {
        
$tmpl_comment_edit_box template_extract_block($template_image_comments'edit_box_no_smilies''{EDIT}');
        
template_extract_block($template_image_comments'edit_box_smilies');
        
template_extract_block($template_add_your_comment'input_box_smilies');
    } else {
        
$tmpl_comment_edit_box template_extract_block($template_image_comments'edit_box_smilies''{EDIT}');
        
template_extract_block($template_image_comments'edit_box_no_smilies');
        
template_extract_block($template_add_your_comment'input_box_no_smilies');
    }

    
$tmpl_comments_buttons template_extract_block($template_image_comments'buttons''{BUTTONS}');
    
$tmpl_comments_ipinfo template_extract_block($template_image_comments'ipinfo''{IPINFO}');

    if (
$CONFIG['comments_sort_descending'] == 1) {
        
$comment_sort_order 'DESC';
    } else {
        
$comment_sort_order 'ASC';
    }
    
$result cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, 

msg_hdr_ip, pid FROM 
{$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

    while (
$row mysql_fetch_array($result)) {
        
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && 

USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        
$comment_buttons $user_can_edit $tmpl_comments_buttons '';
        
$comment_edit_box $user_can_edit $tmpl_comment_edit_box '';
        
$comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo '';

        if (
$CONFIG['enable_smilies']) {
            
$comment_body process_smilies(make_clickable($row['msg_body']));
            
$smilies generate_smilies("f{$row['msg_id']}"'msg_body');
        } else {
            
$comment_body make_clickable($row['msg_body']);
            
$smilies '';
        }

        
$ip $row['msg_hdr_ip'];
        if (
$row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            
$ip .= ' [' $row['msg_raw_ip'] . ']';
        }

        
$params = array('{EDIT}' => &$comment_edit_box,
            
'{BUTTONS}' => &$comment_buttons,
            
'{IPINFO}' => &$comment_ipinfo
            
);

        
$template template_eval($template_image_comments$params);

        
$params = array('{MSG_AUTHOR}' => $row['msg_author'],
            
'{MSG_ID}' => $row['msg_id'],
            
'{PID}' => $row['pid'],
            
'{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
            
'{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
            
'{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
            
'{MSG_BODY}' => bb_decode($comment_body),
            
'{MSG_BODY_RAW}' => $row['msg_body'],
            
'{OK}' => &$lang_display_comments['OK'],
            
'{SMILIES}' => $smilies,
            
'{IP}' => $ip,
            
'{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
            
'{WIDTH}' => $CONFIG['picture_table_width']
            );

        
$html .= template_eval($template$params);
    }

    if (
USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (
USER_ID) {
            
$user_name_input '<tr><td><input type="hidden" name="msg_author" value="' USER_NAME '" /></td>';
            
template_extract_block($template_add_your_comment'user_name_input'$user_name_input);
            
$user_name '';
        } else {
            
$user_name = isset($USER['name']) ? '"' strtr($USER['name'], $HTML_SUBST) . '"' $lang_display_comments['your_name'] . '" 

onclick="javascript:this.value=\'\';'
;
        }

        
$params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
            
// Modified Name and comment field
            
'{NAME}' => $lang_display_comments['name'],
            
'{COMMENT}' => $lang_display_comments['comment'],
            
'{CONFIRM}' => $lang_display_comments['confirm'],
            
'{PIC_ID}' => $pid,
            
'{USER_NAME}' => $user_name,
            
'{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            
'{OK}' => $lang_display_comments['OK'],
            
'{SMILIES}' => '',
            
'{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if (
$CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();

        
$html .= template_eval($template_add_your_comment$params);
    }

    return 
$html;
}

$template_add_your_comment = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
        </tr>
        <tr>
                <td colspan="3">
                <form method="post" name="post" action="db_input.php">
                        <table width="100%" cellpadding="0px" cellspacing="0px">

<!-- BEGIN user_name_input -->
                                <tr><td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT} </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" 

onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />                           

             <!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 

100%;" />
<!-- 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>
<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>
                        </table>
                </form>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
</table>
<!-- END smilies -->

EOT;
?>

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 01, 2007, 10:15:03 pm
It is a problem with the theme.php on your server. The code you have posted here is fine.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Blindside on March 01, 2007, 10:42:10 pm
Ok, a very stupid fault. After correcting the theme.php as you said (deleting empty lines) I've uploaded it into the wrong folder. Now everything works fine, thanks.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Stormqueen on March 04, 2007, 08:15:15 pm
Thanks! Fab. mod. Was going crazy with the spams on my galleries, so I've installed the mod. files today. Thusfar, no new spams!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: khusrau on March 05, 2007, 09:01:14 pm
Sorry, but I'm new at this and don't know PHP. I've managed to make the changes in the appropriate files, discovered that Freetype was required and got that installed and the confirmation code now appears; however, I always receive a "Confirmation code didn't match" message. I turned on Debug for Admin and I got the following notice but, since I don't know PHP, I don't know if it's important:

/include/captcha.class.php
    * Warning line 12: session_start() [function.session-start]: open(/tmp/sess_9478a4986b54d68858115a0c51153339, O_RDWR) failed: Permission denied (13)
    * Notice line 195: Undefined index: php_captcha

Now I'm not sure how to proceed. Any help would be appreciated.

The URL of my gallery is: http://www.optimists-alumni.org/photos and "test3" is the theme I'm trying to get running.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 05, 2007, 09:08:20 pm
You don't have permission to write to the directory used to store sessions. Contact your host for support.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: khusrau on March 06, 2007, 03:15:33 pm
The support folks at the hosting company wanted detailed information so that they could debug the code. I emailed them the information but they didn't follow all of the instructions. They changed to my test theme, saw that it changed and, instead of following the rest of the instructions and entering a comment, they stopped (if the theme worked, everything must work)! I'm frustrated. Is this change something I can do?

PHPINFO() displays "Session Support: enabled" and "session.save_path: /tmp". When I use FTP to look at my site, there is a "tmp" directory in the root, at the same level as "public_html", which actually contains the website. Coppermine exists in "photos", a folder within "public_html". Properties for "tmp" are 0700.

I'm the only volunteer in our organization who even knows a bit of HTML. I took over our organization's website when the old person left but, at this point, I'm way beyond my depth. If you can offer the specifics of what they need to do, I can pass that to them.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 06, 2007, 04:00:39 pm
What I said above should be enough. If they won't help you then you can specify your tmp as the session.save_path if you are allowed a custom php.ini or can use ini_set().
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 07, 2007, 06:24:10 am
They changed to my test theme, saw that it changed and, instead of following the rest of the instructions and entering a comment, they stopped (if the theme worked, everything must work)!

Theme has nothing to do with sessions.

This mod uses session to store information. Whenever sessions are used the data is stored in a temporary directory defined by session.save_path in php.ini In your case the directory is /tmp. Note that  /tmp is different from the tmp directory parallel to your public_html. On a shared webhosting you cannot change the permission of /tmp directory.

Since your webhost is not understanding the situation, show them a test file which demonstrates the real problem.

Create a filed named session.php and place it in your photos folder.

Code: [Select]
<?php
session_start
();
$_SESSION['test'] = 'This is a test';

print 
$_SESSION['test'];
?>


Give the url of this file to your webhost i.e. http://www.optimists-alumni.org/photos/session.php

If sessions work on your server then above code should output 'This is a test' in the browser. Else notices/warnings will be given.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: olti on March 08, 2007, 12:58:37 am
I'm geting this error:
Code: [Select]
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/gsh/public_html/themes/water_drop/theme.php on line 325
Here is my theme.php
Code: [Select]
<?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="" />';


  
// HTML template for template sys_menu buttons
    // {HREF_LNK}{HREF_TITLE}{HREF_TGT}{BLOCK_ID}{SPACER}
  //  addbutton($sys_menu_buttons,'{HOME_LNK}','{HOME_TITLE}','{HOME_TGT}','home',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{MY_GAL_LNK}','{MY_GAL_TITLE}','{MY_GAL_TGT}','my_gallery',$template_sys_menu_spacer);
    // addbutton($sys_menu_buttons,'{MEMBERLIST_LNK}','{MEMBERLIST_TITLE}','{MEMBERLIST_TGT}','allow_memberlist',$template_sys_menu_spacer);
    // addbutton($sys_menu_buttons,'{MY_PROF_LNK}','{MY_PROF_TITLE}','{MY_PROF_TGT}','my_profile',$template_sys_menu_spacer);
  //  addbutton($sys_menu_buttons,'{ADM_MODE_LNK}','{ADM_MODE_TITLE}','{ADM_MODE_TGT}','enter_admin_mode',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{USR_MODE_LNK}','{USR_MODE_TITLE}','{USR_MODE_TGT}','leave_admin_mode',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{UPL_PIC_LNK}','{UPL_PIC_TITLE}','{UPL_PIC_TGT}','upload_pic',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{REGISTER_LNK}','{REGISTER_TITLE}','{REGISTER_TGT}','register',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{FAQ_LNK}','{FAQ_TITLE}','{FAQ_TGT}','faq',$template_sys_menu_spacer);
   // addbutton($sys_menu_buttons,'{LOGIN_LNK}','{LOGIN_TITLE}','{LOGIN_TGT}','login','');
   // addbutton($sys_menu_buttons,'{LOGOUT_LNK}','{LOGOUT_TITLE}','{LOGOUT_TGT}','logout','');
    // Login and Logout don't have a spacer as only one is shown, and either would be the last option.

// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2" cellpadding="0" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                                <tr>
                                        <td align="center">
                                        </td>
                                </tr>

                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2" cellpadding="0" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0" cellspacing="0" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;
// Displays a picture
function theme_html_picture()
{
    global 
$CONFIG$CURRENT_PIC_DATA$CURRENT_ALBUM_DATA$USER;
    global 
$album$comment_date_fmt$template_display_media;
    global 
$lang_display_image_php$lang_picinfo;

    
$pid $CURRENT_PIC_DATA['pid'];
    
$pic_title '';

    if (!isset(
$USER['liv']) || !is_array($USER['liv'])) {
        
$USER['liv'] = array();
    }
    
// Add 1 to hit counter
    
if (!USER_IS_ADMIN && !in_array($pid$USER['liv']) && isset($_COOKIE[$CONFIG['cookie_name'] . '_data'])) {
        
add_hit($pid);
        if (
count($USER['liv']) > 4array_shift($USER['liv']);
        
array_push($USER['liv'], $pid);
    }

    if(
$CONFIG['thumb_use']=='ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width'] ){ // The wierd comparision is because only picture_width is stored
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']){
      
$condition true;
    }elseif(
$CONFIG['thumb_use']=='any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']){
      
$condition true;
    }else{
     
$condition false;
    }

    if (
$CURRENT_PIC_DATA['title'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['title'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['caption'] != '') {
        
$pic_title .= $CURRENT_PIC_DATA['caption'] . "\n";
    }
    if (
$CURRENT_PIC_DATA['keywords'] != '') {
        
$pic_title .= $lang_picinfo['Keywords'] . ": " $CURRENT_PIC_DATA['keywords'];
    }

    if (!
$CURRENT_PIC_DATA['title'] && !$CURRENT_PIC_DATA['caption']) {
        
template_extract_block($template_display_media'img_desc');
    } else {
        if (!
$CURRENT_PIC_DATA['title']) {
            
template_extract_block($template_display_media'title');
        }
        if (!
$CURRENT_PIC_DATA['caption']) {
            
template_extract_block($template_display_media'caption');
        }
    }

    
$CURRENT_PIC_DATA['menu'] = html_picture_menu(); //((USER_ADMIN_MODE && $CURRENT_ALBUM_DATA['category'] == FIRST_USER_CAT + USER_ID) || ($CONFIG['users_can_edit_pics'] && $CURRENT_PIC_DATA['owner_id'] == USER_ID && USER_ID != 0) || GALLERY_ADMIN_MODE) ? html_picture_menu($pid) : '';

    
if ($CONFIG['make_intermediate'] && $condition ) {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'normal');
    } else {
        
$picture_url get_pic_url($CURRENT_PIC_DATA'fullsize');
    }

    
$image_size compute_img_size($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight'], $CONFIG['picture_width']);

    
$pic_title '';
    
$mime_content cpg_get_type($CURRENT_PIC_DATA['filename']);


    if (
$mime_content['content']=='movie' || $mime_content['content']=='audio') {

        if (
$CURRENT_PIC_DATA['pwidth']==|| $CURRENT_PIC_DATA['pheight']==0) {
            
$CURRENT_PIC_DATA['pwidth']  = 320// Default width

            // Set default height; if file is a movie
            
if ($mime_content['content']=='movie') {
                
$CURRENT_PIC_DATA['pheight'] = 240// Default height
            
}
        }

        
$ctrl_offset['mov']=15;
        
$ctrl_offset['wmv']=45;
        
$ctrl_offset['swf']=0;
        
$ctrl_offset['rm']=0;
        
$ctrl_offset_default=45;
        
$ctrl_height = (isset($ctrl_offset[$mime_content['extension']]))?($ctrl_offset[$mime_content['extension']]):$ctrl_offset_default;
        
$image_size['whole']='width="'.$CURRENT_PIC_DATA['pwidth'].'" height="'.($CURRENT_PIC_DATA['pheight']+$ctrl_height).'"';
    }

    if (
$mime_content['content']=='image') {
        if (isset(
$image_size['reduced'])) {
        $picfull_url get_pic_url($CURRENT_PIC_DATA'fullsize');
        $pic_title $CURRENT_PIC_DATA['title'];
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$pic_title\">";
            
$pic_html .= "<img src=\"" $picture_url "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            
$pic_html .= "</a>\n";
        } else {
            
$pic_html "<img src=\"" $picture_url "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
    } elseif (
$mime_content['content']=='document') {
        
$pic_thumb_url get_pic_url($CURRENT_PIC_DATA,'thumb');
        
$pic_html "<a href=\"{$picture_url}\" target=\"_blank\" class=\"document_link\"><img src=\"".$pic_thumb_url."\" border=\"0\" class=\"image\" /></a>\n<br />";
    } else {
        
$autostart = ($CONFIG['media_autostart']) ? ('true'):('false');

        
$players['WMP'] = array('id' => 'MediaPlayer',
                                
'clsid' => 'classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ',
                                
'codebase' => 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ',
                                
'mime' => 'type="application/x-mplayer2" ',
                               );
        
$players['RMP'] = array('id' => 'RealPlayer',
                                
'clsid' => 'classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" ',
                                
'codebase' => '',
                                
'mime' => 'type="audio/x-pn-realaudio-plugin" '
                               
);
        
$players['QT']  = array('id' => 'QuickTime',
                                
'clsid' => 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" ',
                                
'codebase' => 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" ',
                                
'mime' => 'type="video/x-quicktime" '
                               
);
        
$players['SWF'] = array('id' => 'SWFlash',
                                
'clsid' => ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ',
                                
'codebase' => 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ',
                                
'mime' => 'type="application/x-shockwave-flash" '
                               
);
        
$players['UNK'] = array('id' => 'DefaultPlayer',
                                
'clsid' => '',
                                
'codebase' => '',
                                
'mime' => ''
                               
);

        if (isset(
$_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'])) {
            
$user_player $_COOKIE[$CONFIG['cookie_name'].'_'.$mime_content['extension'].'player'];
        } else {
            
$user_player $mime_content['player'];
        }

                
// There isn't a player selected or user wants client-side control
        
if (!$user_player) {
            
$user_player 'UNK';
        }

        
$player $players[$user_player];

        
$pic_html  '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
        
$pic_html .= "<param name=\"autostart\" value=\"$autostart\" /><param name=\"src\" value=\""$picture_url "\" />";
        
$pic_html .= '<embed '.$image_size['whole'].' src="'$picture_url '" autostart="'.$autostart.'" '.$player['mime'].'></embed>';
        
$pic_html .= "</object><br />\n";
    }

    
$CURRENT_PIC_DATA['html'] = $pic_html;
    
$CURRENT_PIC_DATA['header'] = '';
    
$CURRENT_PIC_DATA['footer'] = '';

    
$CURRENT_PIC_DATA CPGPluginAPI::filter('file_data',$CURRENT_PIC_DATA);

    
$params = array('{CELL_HEIGHT}' => '100',
        
'{IMAGE}' => $CURRENT_PIC_DATA['header'].$CURRENT_PIC_DATA['html'].$CURRENT_PIC_DATA['footer'],
        
'{ADMIN_MENU}' => $CURRENT_PIC_DATA['menu'],
        
'{TITLE}' => bb_decode($CURRENT_PIC_DATA['title']),
        
'{CAPTION}' => bb_decode($CURRENT_PIC_DATA['caption']),
        );

    return 
template_eval($template_display_media$params);
}

// HTML template for the form to add comments
$template_add_your_comment = <<<EOT
        <form method="post" name="post" action="db_input.php">
                <table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
                        <tr>
                                        <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
                        </tr>
                        <tr>
                <td colspan="1">
                        <table width="100%" cellpadding="0" cellspacing="0">

<!-- BEGIN user_name_input -->
                                                        <tr>
                                                                <td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                                                </td>
<!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <td class="tableb_compact">
                                {COMMENT}
                                                                </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
                                </td>
<!-- END input_box_no_smilies -->
                                <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>
<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>
                        </table>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
<!-- END smilies -->
                </table>
        </form>
EOT;

// Modified Name and comment field
            
'{NAME}' => $lang_display_comments['name'],
            
'{COMMENT}' => $lang_display_comments['comment'],
            
'{CONFIRM}' => $lang_display_comments['confirm'],
            
'{PIC_ID}' => $pid,
            
'{USER_NAME}' => $user_name,
            
'{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            
'{OK}' => $lang_display_comments['OK'],
            
'{SMILIES}' => '',
            
'{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if (
$CONFIG['enable_smilies']){
                        
$params['{SMILIES}'] = generate_smilies();
                } else {
                        
template_extract_block($template_add_your_comment'smilies');
                }

        
$html .= template_eval($template_add_your_comment$params);
    }

    return 
$html;
}

function 
theme_slideshow()
{
    global 
$CONFIG$lang_display_image_php$template_display_media;

    
pageheader($lang_display_image_php['slideshow']);

    include 
"include/slideshow.inc.php";

    
$start_slideshow '<script language="JavaScript" type="text/JavaScript">runSlideShow()</script>';
    
template_extract_block($template_display_media'img_desc'$start_slideshow);

    
$params = array('{CELL_HEIGHT}' => $CONFIG['picture_width'] + 100,
        
'{IMAGE}' => '<img src="' $start_img '" name="SlideShow" class="image" /><br />',
        
'{ADMIN_MENU}' => '',
        );

    
starttable();
    echo 
template_eval($template_display_media$params);
    
endtable();
    
starttable();
    echo <<<EOT
        <tr>
                <td align="center" class="navmenu" style="white-space: nowrap;">
                        <a href="javascript:endSlideShow()" class="navmenu">
{$lang_display_image_php['stop_slideshow']}</a>
                </td>
        </tr>

EOT;
    
endtable();
    
pagefooter();
}
?>


cheers.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 08, 2007, 07:24:22 am
You haven't modified theme.php properly. The code has been misplaced around line 325.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: olti on March 08, 2007, 10:13:18 am
Yes I can understand that i did any error there, but I can't find that line of error. Can you  help me? I have posted all the file here.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 08, 2007, 06:28:48 pm
Attach your original (unmodified) theme.php and modified theme.php here.

Note: Attach the files and please do not put the full code in the post itself.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scrapthatpaper on March 09, 2007, 12:23:21 pm
HI Every one! New here....

I am wondering if someone can help.. Reading through every thing and checking it all I am still having a problem... My confrimation line shows, but the image is a red x.. I contacted the server and I still have a RED X... I am unsure how to fix it... I use Coppermine 1.4.9

Can someone help?

Thanks
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 09, 2007, 12:36:09 pm
As a start post a link to your gallery. Also check that FreeType is enabled on your server.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: olti on March 09, 2007, 12:45:07 pm
Hey Ali, here is the original (unmodified) theme.php and above (in the post) is the modified one.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scrapthatpaper on March 09, 2007, 01:07:05 pm
Here is a link my gallery

log in test123
pass test123

You have to log in first

http://www.2jills.com/gallery/displayimage.php?album=lastup&cat=0&pos=0

I already checked and yes freetype is enabled on my server

I think my captcha.class.php has an error but I cant find what it is.. when I add another } at the end I get a bunch of stuff.. Unkown picture


This is what I Inserted from the captcha download

Quote
<?php
   /***************************************************************/
   /* PhpCaptcha                                                  */
   /* Copyright  2005 Edward Eliot - http://www.ejeliot.com/     */
   /* This class is Freeware, however please retain this          */
   /* copyright notice when using                                 */
   /* Last Updated: 26th November 2005                            */
   /***************************************************************/

   // start a PHP session - this class uses sessions to store the generated
   // code. Comment out if you are calling already from your application
   session_start();

   class PhpCaptcha {
      var $oImage;
      var $aFonts;
      var $iWidth;
      var $iHeight;
      var $iNumChars;
      var $iNumLines;
      var $iSpacing;
      var $bCharShadow;
      var $sOwnerText;
      var $aCharSet;
      var $sBackgroundImage;
      var $sCode;

      function PhpCaptcha(
         $aFonts, // array of TypeType fonts to use - specify full path
         $iWidth = 200, // width of image
         $iHeight = 50, // height of image
         $iNumChars = 5, // number of characters to draw
         $iNumLines = 70, // number of noise lines to draw
         $bCharShadow = false, // add shadow to generated characters to further obscure code
         $sOwnerText = '', // add owner text to bottom of CAPTCHA, usually your site address
         $aCharSet = array(), // array of characters to select from - if blank uses upper case A - Z
         $sBackgroundImage = '' // background image to use - if blank creates image with white background
      ) {
         // get parameters
         $this->aFonts = $aFonts;
         $this->iWidth = $iWidth;
         $this->iHeight = $iHeight;
         $this->iNumChars = $iNumChars;
         $this->iNumLines = $iNumLines;
         $this->bCharShadow = $bCharShadow;
         $this->sOwnerText = $sOwnerText;
         $this->aCharSet = $aCharSet;
         $this->sBackgroundImage = $sBackgroundImage;

         // calculate spacing between characters based on width of image
         $this->iSpacing = (int)($this->iWidth / $this->iNumChars);
      }

      function DrawLines() {
         for ($i = 0; $i < $this->iNumLines; $i++) {
            $iRandColour = rand(100, 250);
            $iLineColour = imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);
            imageline($this->oImage, rand(0, $this->iWidth), rand(0, $this->iHeight), rand(0, $this->iWidth), rand(0, $this->iHeight), $iLineColour);
         }
      }

      function DrawOwnerText() {
         $iBlack = imagecolorallocate($this->oImage, 0, 0, 0);
         $iOwnerTextHeight = imagefontheight(2);
         $iLineHeight = $this->iHeight - $iOwnerTextHeight - 4;

         imageline($this->oImage, 0, $iLineHeight, $this->iWidth, $iLineHeight, $iBlack);
         imagestring($this->oImage, 2, 3, $this->iHeight - $iOwnerTextHeight - 3, $this->sOwnerText, $iBlack);

         $this->iHeight = $this->iHeight - $iOwnerTextHeight - 5;
      }

      function GenerateCode() {
         // reset code
         $this->sCode = '';

         // loop through and generate the code letter by letter
         for ($i = 0; $i < $this->iNumChars; $i++) {
            if (count($this->aCharSet) > 0) {
               // select random character and add to code string
               $this->sCode .= $this->aCharSet[array_rand($this->aCharSet)];
            } else {
               // select random character and add to code string
               $this->sCode .= chr(rand(65, 90));
            }
         }

         // save code in session variable
         $_SESSION['php_captcha'] = md5(strtoupper($this->sCode));
      }

      function DrawCharacters() {
         // loop through and write out selected number of characters
         for ($i = 0; $i < strlen($this->sCode); $i++) {
            // select random font
            $sCurrentFont = $this->aFonts[array_rand($this->aFonts)];

            // select random greyscale colour
            $iRandColour = rand(0, 100);
            $iTextColour = imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);

            if ($this->bCharShadow) {
               // shadow colour
               $iRandColour = rand(0, 100);
               $iShadowColour = imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);
            }

            // select random font size
            $iFontSize = rand(16, 25);

            // select random angle
            $iAngle = rand(-30, 30);

            // get dimensions of character in selected font and text size
            $aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $this->sCode[$i]);

            // calculate character starting coordinates
            $iX = $this->iSpacing / 4 + $i * $this->iSpacing;
            $iCharHeight = $aCharDetails[2] - $aCharDetails[5];
            $iY = $this->iHeight / 2 + $iCharHeight / 4;

            // write text to image
            imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i]);

            if ($this->bCharShadow) {
               $iOffsetAngle = rand(-30, 30);

               $iRandOffsetX = rand(-5, 5);
               $iRandOffsetY = rand(-5, 5);

               imagefttext($this->oImage, $iFontSize, $iOffsetAngle, $iX + $iRandOffsetX, $iY + $iRandOffsetY, $iShadowColour, $sCurrentFont, $this->sCode[$i]);
            }
         }
      }

      function Create($sFilename = '') {
         // check for required gd functions
         if (!function_exists('imagecreate') || !function_exists('imagejpeg') || ($this->sBackgroundImage != '' && !function_exists('imagecreatetruecolor'))) {
            return false;
         }
         // get background image if specified and copy to CAPTCHA
         if ($this->sBackgroundImage != '') {
            // create new image
            $this->oImage = imagecreatetruecolor($this->iWidth, $this->iHeight);

            // create background image
            $oBackgroundImage = imagecreatefromjpeg($this->sBackgroundImage);

            // copy background image
            imagecopy($this->oImage, $oBackgroundImage, 0, 0, 0, 0, $this->iWidth, $this->iHeight);

            // free memory used to create background image
            imagedestroy($oBackgroundImage);
         } else {
            // create new image
            $this->oImage = imagecreate($this->iWidth, $this->iHeight);
         }

         // allocate white background colour
         imagecolorallocate($this->oImage, 255, 255, 255);

         // check for owner text
         if ($this->sOwnerText != '') {
            $this->DrawOwnerText();
         }

         // check for background image before drawing lines
         if ($this->sBackgroundImage == '') {
            $this->DrawLines();
         }

         $this->GenerateCode();
         $this->DrawCharacters();

         // write out image to file or browser
         if ($sFilename != '') {
            // write stream to file
            imagejpeg($this->oImage, $sFilename);
         } else {
            // tell browser that data is jpeg
            header('Content-type: image/jpeg');

            // write stream to browser
            imagejpeg($this->oImage);
         }

         // free memory used in creating image
         imagedestroy($this->oImage);

         return true;
      }

      // call this method statically
      function Validate($sUserCode) {
         if (md5(strtoupper($sUserCode)) == $_SESSION['php_captcha']) {
            // clear to prevent re-use
            $_SESSION['php_captcha'] = '';

            return true;
         }

         return false;
      }
?>




Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scrapthatpaper on March 09, 2007, 04:48:31 pm
Anyone?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scrapthatpaper on March 09, 2007, 07:14:58 pm
IF you try looking at the link I removed it... I have members who are wanting to leave comments etc... Will have to find another way
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 10, 2007, 08:19:44 am
Something strange on your server. The image headers are not getting outputted properly. Will need to debug.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: gymnastdude182 on March 12, 2007, 12:09:45 am
I put in the code exactly, and people can still add comments even if they don't enter a confirmation code. I have freetype, can't figure out the problem.

www.britneyres.com
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on March 12, 2007, 09:00:49 am
Seems like you haven't applied the hack properly. Review your code modifications extra-carefully.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 12, 2007, 12:54:01 pm
Specially review db_input.php.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: klunstenaar on March 12, 2007, 11:01:08 pm
Question:

My captcha on cpg works good...
Until i integrate it with something like Joomla! or SMF. If i put the right code than he still says : conformation didnt match.
Can someone help me out, or did i missed something and is it allready solved somewhere else in this long forum?

Klunstenaar
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 14, 2007, 08:13:58 am
I don't think that captcha has anything to do with bridging.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 14, 2007, 10:51:09 am
Might be interfering with the sessions used by the captcha.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: arnestad on March 14, 2007, 01:14:17 pm
Hi.
It seems to work great, but is it only registered users who can post comments? If I go into user mode I'm only able to see the comments already posted but not to post any myself.

Is this correct or can I enable something so that Guests are welcome to make comments as well?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 14, 2007, 01:18:36 pm
Is this correct or can I enable something so that Guests are welcome to make comments as well?

Read the docs and enable commenting for guests from groups manager page.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dage on March 14, 2007, 01:21:03 pm
Hello to everybody!

I'm new here too  :P...

I'm very pleased to have found a forum like that, it's really wonderfull!

Ouch, I forget to introduce me, sorry  :o
My name is Daniel, and i'm from Catalonia (Spain). I have a Coppermine Gallery hosted in www.enfoca2.com a spanish photographic forum. My gallery address is danielarenas.enofca2.com


I was very worried about spam and anoying bots, but you give me the solution...CAPTCHA (many thanks specially to Abbas Ali for this helpfull post and share his knowledge)

Ok, let's see...

I've done all Abbas Ali told about Captcha i've put the archives and folders, and modified english.php, theme.php and db_input.php.

When i tried to visit my gallery an unexpected error was found.

Code: [Select]
Parse error: parse error, unexpected T_DOUBLE_ARROW in /var/www/vhosts/danielarenas.enfoca2.com/httpdocs/themes/hardwired/theme.php on line 222
... Yes is an error in the theme.php language on line 222, like olti user's error. I know it means that there's a problem with a instruction on line 222, but... ¿what's an unexpected T_DOUBLE_ARROW error?

The only thing i've modified in the theme.php are the lines added. And i've added the lines at the bottom of the page, like that (i only put a very small piece of the theme.php modified, only where i've put the new lines). Notice that lines added are wrote in black in this post.

Code: [Select]
EOT;

// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
<!-- BEGIN admin_approval -->
                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
<!-- END admin_approval -->
                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
                                </tr><tr>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>
EOT;
[b]
'{CONFIRM}' => $lang_display_comments['confirm'],
'{COMMENT}' => $lang_display_comments['comment'],

<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>
<!-- 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>[/b]




?>

Perhaps i had to write this lines in another place of the theme.php? Perhaps not in the bottom but in the top?

Thank's to everybody for your help.

See you later  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dage on March 14, 2007, 01:23:25 pm
Sorry i've wrong typed my gallery address: danielarenas.enfoca2.com

Many thank's
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: arnestad on March 14, 2007, 01:52:55 pm
Read the docs and enable commenting for guests from groups manager page.

Thanks, works like a charm now!!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dage on March 14, 2007, 02:41:48 pm
Solutioned!  ::)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: klunstenaar on March 14, 2007, 03:23:39 pm
Dont wanna kick my problem abouth captcha with my bridge, but as i saw
Might be interfering with the sessions used by the captcha.
Is there a solution for, if this is the reason? Couse the captcha really works out good for the spam, and i wanna keep using it if it possible.
p.s. if u need more info abouth my sites or other info, no problem.

Kluns~
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on March 14, 2007, 06:16:39 pm
Try the same approach as here (http://forum.coppermine-gallery.net/index.php?topic=41649.msg197510#msg197510) but with session instead of cookie.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: klunstenaar on March 14, 2007, 07:00:20 pm
Thx for ur fast response nibbler!

I tryed the change like you said, but didnt work out.
Only gave me a session checkout error with logging-out. offcourse i could live with that if it fixed the captcha:)

Is there more i can try?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: arsalanj on March 15, 2007, 07:29:14 am
I followed all the steps described but I have a problem. The Captcha image is not displayed. The background randomly-placed lines are shown but not the actual alphabets on it. My server supports GD 2 and I'm using image generation on other parts of the site.

Please see what I am getting:

http://www.indo-pak.org/gallery/displayimage.php?album=random&cat=2&pos=-93

The following link will show that GD 2 is installed & is working because here I can see the image:

http://www.indo-pak.org/index.php?option=com_content&task=view&id=33&Itemid=40

Please tell me what might be the problem

Thanks
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 15, 2007, 11:50:58 am
@dage: Attach your theme.php here

@arsalanj: Make sure you have uploaded fonts folder properly. The fonts file in it should be uploaded in a binary mode.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: arsalanj on March 15, 2007, 09:30:17 pm
Thanks Abbas for your kind time. I have re-checked that the fonts folder has been uploaded successfully. The folder contains two fonts. You can verify them:

http://www.indo-pak.org/gallery/fonts/acidic.ttf
http://www.indo-pak.org/gallery/fonts/hurryup.ttf

(gallery folder is the folder where Coppermine gallery is installed).

Still, it is giving that problem  >:(

I hope that u have another clue about this problem.

Thanks
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 16, 2007, 08:19:03 am
Try uploading the fonts using a different ftp client. Not sure if that will solve the problem but you can try.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: _WHAT_ on March 16, 2007, 08:52:00 am
I don't have the sections in my theme.php when I search for them I don't find antything.

I have attached my theme.php I hope you can help me would love to use this mod I am beeing killed by the spam :(
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 16, 2007, 10:23:16 am
http://forum.coppermine-gallery.net/index.php?topic=29564.msg153387#msg153387
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: _WHAT_ on March 16, 2007, 10:37:57 am
That helped a little bit but the next part in theme.php with the <tr> and submit button is still not there....
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: dage on March 16, 2007, 01:11:12 pm
@dage: Attach your theme.php here

Thank's about your help Abbas Alí but i have solutioned the problem. It's fantastic to have people like you in this forum  :D
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 17, 2007, 09:19:56 am
@__WHAT__: you need to copy

Code: [Select]
// HTML template for the form to add comments
$template_add_your_comment = <<<EOT
.
.
.
.
EOT;

section.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: _WHAT_ on March 19, 2007, 08:02:46 am
I got it working now but there is a little flaw and I got some code showing on my page.

Code: [Select]
{CONFIRM} Is showing up at the control field.

My page http://www.theis.dk
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 20, 2007, 08:48:55 am
Make sure you did this...

Edit themes/yourtheme/theme.php

Add
Code: [Select]
'{CONFIRM}' => $lang_display_comments['confirm'],

just after
Code: [Select]
'{COMMENT}' => $lang_display_comments['comment'],
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: fals on March 22, 2007, 12:33:57 am
Thank you so much for this MOD.... No more viagra spamming !  ;D
http://www.fals.dk/Kattehjem/
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: fals on March 22, 2007, 01:27:16 am
Thank you so much for this MOD.... No more viagra spamming !  ;D
http://www.fals.dk/Kattehjem/

I modified the fonttype to a normal tahoma and removed the lines for better reading.... and changed background color to match my theme  8)

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.fals.dk%2Fimageupload%2Freg%2Fimages%2F7502comment.jpg&hash=812ae8685200788378826508a6186239)

Thanks again - this is so clever
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: skidpics on March 22, 2007, 08:24:35 am
I followed all the steps described but I have a problem. The Captcha image is not displayed. The background randomly-placed lines are shown but not the actual alphabets on it. My server supports GD 2 and I'm using image generation on other parts of the site.

Please see what I am getting:

http://www.indo-pak.org/gallery/displayimage.php?album=random&cat=2&pos=-93

The following link will show that GD 2 is installed & is working because here I can see the image:

http://www.indo-pak.org/index.php?option=com_content&task=view&id=33&Itemid=40

Please tell me what might be the problem

Thanks

Not sure if it makes  a difference, but upon checking the link of your 'confirmation image', it shows http://www.indo-pak.org/gallery/captcha.php, but mine on my site shows http://skidpics.com/plugins/captcha/captcha.php, directly coming from the plugins folder.. not the 'gallery' folder..  The plugins folder is the default install folder for plugins..

-- Skidpics

Warning:  Site contains lots of adult content..
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: zgorzelecinfo on March 22, 2007, 10:51:27 am
I;ve read all these posts and still have the known problem with red cross. First I thought it was the problem with the freefonts wich was not installed on my server, becaouse of the error line shown in direct link. So my ISP installed that module and so there's no text about the error, but the cross is still there, and direct link shows the empty blank page:

http://www.zgorzelec.info/foto/captcha.php

http://www.zgorzelec.info/foto/displayimage.php?album=81&pos=149

Can you help me please ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: zgorzelecinfo on March 22, 2007, 12:27:09 pm
EDIT: I've checked at php.net function imagefttext — Write text to the image using fonts using FreeType 2, so Freetype 2 is needed, but it seems to run only on PHP 5,

I have PHP 4 installed on my server and can't uprgade because of bigger system installed on it.

Is there any solution on this ?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 23, 2007, 07:18:10 am
Freetype can be installed on php4 too. Without freetype this mod won't work.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on March 23, 2007, 07:20:45 am
@skidpics: Are you using plugin or mod? It seems that you are using captcha plugin. If so then this is wrong thread. Ask your question on http://forum.coppermine-gallery.net/index.php?topic=36319.0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: michiel on March 31, 2007, 09:32:51 pm
Hi, I have just installed the mod, and something is wrong as I cannot enter my site (http://lorelei.dwaalgasten.nl/thumbnails.php?album=lastup&cat=0 (http://lorelei.dwaalgasten.nl/thumbnails.php?album=lastup&cat=0)) anymore, as I get the message: Parse error: parse error, unexpected $ in /www/htdocs/dwaalgas/frummel/themes/classic/theme.php on line 1185. I think I have taken all the steps you indicated. My theme.php file is attached. Could you tell me what I did wrong? Thanks!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: michiel on April 01, 2007, 03:58:20 pm
Update: I found a mistake in my theme file, so the "parse"  problem is solved. However, Captcha still does not function properly. If you add a comment, there is a box "confirmation"  added. However, the captcha image is not shown, so you don't know which confirmation code to enter. Logically, if you enter "OK", the error "Confirmation code didn't matched" is reporterd. I would certainly welcome your suggestions, as I get mad of the spam.... Thanks.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: michiel on April 01, 2007, 08:45:28 pm
Well, a thorough reading of this whole Captcha thread finally led to the conclusion that Captcha will not run on my site because my hosting company does not support imageftbbox. That's a pity, as Captcha seems a real good solution to spam.....
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: DiegoBretti on April 03, 2007, 09:34:47 pm
The system are cool. But didnt pass the W3 Validator :(
What can i do?
Thx.
Dieg0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on April 04, 2007, 09:00:25 am
Go through W3C validation output, fix the stuff it complains about in the source code of the captcha mod. For the benefit of others, you might post your improvements when done.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on April 04, 2007, 05:05:32 pm
I've posted my improvements for validation :)

http://forum.coppermine-gallery.net/index.php?topic=29564.msg188305#msg188305
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: DiegoBretti on April 05, 2007, 05:37:13 am
Some of the mod html caused html validation to fail.

I changed:
Code: [Select]
    <input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">
to:
Code: [Select]
    <input type="text" name="confirmCode" size="5" class="textinput" /> <img src="captcha.php" align="middle" alt="captcha image" />

I have another problem.

"Please, validate your XML document first!

Line 72

Column 71

The reference to entity "PHPSESSID" must end with the ';' delimiter."

and in code:

"Failed validation, 34 errors"

the problem is in "general entity "PHPSESSID" not defined and no default entity."
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: sthenley on April 06, 2007, 03:27:24 am
Quote
This modification is work with Coppermine Photo Gallery 1.3.5?
Or only for 1.4.x?

I have used mod in CPG 1.3.2. But code:
Code: [Select]
'{CONFIRM}' => $lang_display_comments['confirm'],
... Is in the file displayimage.php, not theme.php. The only diference.

Works great!  ;)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on April 06, 2007, 11:03:25 pm
Don't ask for other versions (http://forum.coppermine-gallery.net/index.php?topic=24540.0)

cpg1.3.x is outdated, goes completely unsupported and contains known bugs. Updating is mandatory (mustn't be discussed on this thread though). As suggested above: don't post cpg1.3.x-related stuff on a board/thread that is dedicated to cpg1.4.x.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: arkii on April 14, 2007, 08:15:12 am
Hi;

I install Captcha. Don't write confirmation code.

Please check : www.resimsel.com/captcha.php
http://www.resimsel.com/displayimage.php?album=18&pos=1

My server php info : www.resimsel.com/a.php

Help me please :(

I from Turkey. Sorry bad english.
Thank you.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on April 14, 2007, 12:21:59 pm
You do not have FreeType Support
ask your host for support
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: lamator on April 14, 2007, 05:56:35 pm
Please help

I have not found line: '{COMMENT}' => $lang_display_comments['comment'],

and : <!-- 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>

in my theme code, what's wrong ?

here I send a attach of my theme file "Rainy_day"

thanks for your help
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on April 15, 2007, 08:44:01 am
if you don't have it , copy it from themes/sample/theme.php to your theme and then make changes
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nerrick on April 19, 2007, 01:04:09 am
I have everything that is listed to get this mod to work. I have 2 slight problems. The verification image does not load and the pictures stopped loading as well. I have attached my theme.php for analysis.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on April 19, 2007, 02:35:08 pm
Post a link to your site.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nerrick on April 19, 2007, 06:03:53 pm
Post a link to your site.

http://www.nerrick.com/photos
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on April 25, 2007, 09:30:16 am
Remove

Code: [Select]
include('include/init.inc.php');

from captcha.php and see if it works.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nerrick on April 25, 2007, 08:39:10 pm
The line that you mentioned was not in the captcha.php file on my server. I did find the following line which i removed but I am sorry to say it did not fix the problem.

require("include/init.inc.php");

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on April 25, 2007, 08:45:37 pm
You have whitespace after the closing php tag in the theme.php. Remove it.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: nerrick on April 26, 2007, 07:10:55 am
Ok i removed the whitespace and the photos are loading again but the visual confirmation text still does not show up.

Any ideas? http://www.nerrick.com/photos/chaptcha.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on April 26, 2007, 07:16:27 am
http://www.nerrick.com/photos/captcha.php shows errors. I have come across similar errors on few occasions and no solution as yet. The problem is that function imageftbbox fails to open the font file.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: JustKia on April 27, 2007, 01:01:35 pm
Is it possible to have the captcha confimation only for unregistered users only?
for example allow registered users to post a comment freely, but unregistered users have to fill in the visual confirmation.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on April 27, 2007, 01:18:31 pm
Read through this thread from starting. I think someone has posted how to do that.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: superdave on April 27, 2007, 04:44:14 pm
hi abbas

i tried using this as a plugin, but got 'confirmation didn't match' errors constantly.

i want to try the mod, but i'm using ipodlounge theme and i can't figure out how to make the changes to the theme.php.

you said do this:

Code: [Select]
##############

Edit themes/yourtheme/theme.php

Add
Code:

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


just after
Code:

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


Add
Code:

<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
Code:

<!-- 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>


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

but there's nowhere to add the code. you said 'just after' the code, but the code's not there.

how can i add this code to my theme.php for ipodlounge?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Hein Traag on April 27, 2007, 04:47:34 pm
how can i add this code to my theme.php for ipodlounge?

Zip your theme.php and attach it to a post. We can then take a look at your file and see what's wrong.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: superdave on April 27, 2007, 04:53:18 pm
here ya go!!!!

:)

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: wordup on May 16, 2007, 12:36:17 am
http://gallery.silverbackcrew.com/captcha.php

i'm trying to troubleshoot this but I don't know where to start, could someone tell me why it's showing up blank? Thanks!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tranz on May 16, 2007, 03:49:20 am
http://gallery.silverbackcrew.com/captcha.php

i'm trying to troubleshoot this but I don't know where to start, could someone tell me why it's showing up blank? Thanks!
I got Server Not Found
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: XeoX on May 22, 2007, 03:33:05 pm
Hello!

I have the same problem with captcha - there is no confirmation code image on the page, though there should be. It worked about 3 weeks ago, but there was a server error and after that I have had problems with it. The address of my page is http://xeox.pri.ee/ and captcha.php is in http://xeox.pri.ee/plugins/captcha/captcha.php, but it's empty. What is the problem?

I'd apprichiate if you could help. If there is anything else you need, just ask.

Best wishes,
M
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: jerryleelewis on May 23, 2007, 11:14:46 pm
Hi Gyus i just change my Theme from Ocadia to Mesh Theme   here you can see http://www.friseurmaxheim.de/frisurengalerie/index.php (http://www.friseurmaxheim.de/frisurengalerie/index.php)

Captcha in Ocadia Theme works well , but in that Theme i cant get it to work need a little help from you

I attached the Theme.php

for you to have a look
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Jochus on May 27, 2007, 10:34:07 am
Thanks!

Works perfect on 1.4.10 and theme Hardwired. You can check it at http://album.jochus.be
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: agnes1983 on June 26, 2007, 04:33:30 pm
Thanks for this mod! :)
Now I never have to delete 200 spam comments every day. ;)

But I still have a question: where can I edit the width of the code-field?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on June 27, 2007, 07:40:22 am
But I still have a question: where can I edit the width of the code-field?

Its in the changes you made in theme file

Code: [Select]
<input type="text" name="confirmCode" size="5" class="textinput"> <img src="captcha.php" align="middle">

Change the size attribute to whatever you like.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ____Alma____ on July 07, 2007, 06:39:46 am
First I want to thank you for this great work that these doing, and second forgives my English I am using a translator.

I have the chapta installed, and can see it perfectly in the browser but in the commentaries the option does not appear, probably could help your me, and to say to me in what I have been wrong, I put the code of my theme that I believe that és here where the mistake is.

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2005 Coppermine Dev Team
  v1.1 originaly 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.3
  $Source: /cvsroot/coppermine/stable/themes/classic/theme.php,v $
  $Revision: 1.13 $
  $Author: donnoman $
  $Date: 2005/12/04 03:22:35 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);

// Added to display flim_strip
function theme_display_film_strip(&$thumb_list$nbThumb$album_name$aid$cat$pos$sort_options$mode 'thumb')
{
    global 
$CONFIG$THEME_DIR;
    global 
$template_film_strip$lang_film_strip;

    static 
$template '';
    static 
$thumb_cell '';
    static 
$empty_cell '';
    static 
$spacer '';

    if ((!
$template)) {
        
$template $template_film_strip;
        
$thumb_cell template_extract_block($template'thumb_cell');
        
$empty_cell template_extract_block($template'empty_cell');
    }

    
$cat_link is_numeric($aid) ? '' '&amp;cat=' $cat;

    
$thumbcols $CONFIG['thumbcols'];
    
$cell_width ceil(100 $CONFIG['max_film_strip_items']) . '%';

    
$i 0;
    
$thumb_strip '';
    foreach(
$thumb_list as $thumb) {
        
//modify $new_size for max dimension of thumbnails in filmstrip
        
$new_size 65;
        
preg_match('/(?<=width=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        
$srcWidth=$matches[0][0];
        
preg_match('/(?<=height=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        
$srcHeight=$matches[0][0];
        
$ratio max($srcWidth$srcHeight) / $new_size;
        
$ratio max($ratio1.0);
        
$destWidth = (int)($srcWidth $ratio);
        
$destHeight = (int)($srcHeight $ratio);
        
$thumb['image']=preg_replace('/width="[^"]*"/','width="'.$destWidth.'"',$thumb['image']);
        
$thumb['image']=preg_replace('/height="[^"]*"/','height="'.$destHeight.'"',$thumb['image']);
        
$i++;
        if (
$mode == 'thumb') {
            
$params = array('{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}",
                
'{THUMB}' => $thumb['image'],
                
'{CAPTION}' => $thumb['caption'],
                
'{ADMIN_MENU}' => ''
                
);
        } else {
            
$params = array('{CELL_WIDTH}' => $cell_width,
                
'{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                
'{THUMB}' => $thumb['image'],
                
'{CAPTION}' => '',
                
'{ADMIN_MENU}' => ''
                
);
        }
        
$thumb_strip .= template_eval($thumb_cell$params);
    }

    if (
defined('THEME_HAS_FILM_STRIP_GRAPHICS')) {
        
$tile1 $THEME_DIR 'images/tile1.gif';
        
$tile2 $THEME_DIR 'images/tile2.gif';
    } elseif (
defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        
$tile1=$tile2=$THEME_DIR 'images/tile.gif';
    } else {
        
$tile1=$tile2'images/tile.gif';
    }

    
$params = array('{THUMB_STRIP}' => $thumb_strip,
        
'{COLS}' => $i,
        
'{TILE1}' => $tile1,
        
'{TILE2}' => $tile2,
        );

    
ob_start();
    
starttable($CONFIG['picture_table_width']);
    echo 
template_eval($template$params);
    
endtable();
    
$film_strip ob_get_contents();
    
ob_end_clean();

    return 
$film_strip;
}
// Displays comments for a specific picture
function theme_html_comments($pid)
{
    global 
$CONFIG$USER$CURRENT_ALBUM_DATA$comment_date_fmt$HTML_SUBST;
    global 
$template_image_comments$template_add_your_comment$lang_display_comments;

    
$html '';

//report to moderator buttons
    
if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
        
template_extract_block($template_image_comments'report_comment_button');
    }

    if (!
$CONFIG['enable_smilies']) {
        
$tmpl_comment_edit_box template_extract_block($template_image_comments'edit_box_no_smilies''{EDIT}');
        
template_extract_block($template_image_comments'edit_box_smilies');
        
template_extract_block($template_add_your_comment'input_box_smilies');
    } else {
        
$tmpl_comment_edit_box template_extract_block($template_image_comments'edit_box_smilies''{EDIT}');
        
template_extract_block($template_image_comments'edit_box_no_smilies');
        
template_extract_block($template_add_your_comment'input_box_no_smilies');
    }

    
$tmpl_comments_buttons template_extract_block($template_image_comments'buttons''{BUTTONS}');
    
$tmpl_comments_ipinfo template_extract_block($template_image_comments'ipinfo''{IPINFO}');

    if (
$CONFIG['comments_sort_descending'] == 1) {
        
$comment_sort_order 'DESC';
    } else {
        
$comment_sort_order 'ASC';
    }
    
$result cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");

    while (
$row mysql_fetch_array($result)) {
        
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
        
$comment_buttons $user_can_edit $tmpl_comments_buttons '';
        
$comment_edit_box $user_can_edit $tmpl_comment_edit_box '';
        
$comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo '';

        if (
$CONFIG['enable_smilies']) {
            
$comment_body process_smilies(make_clickable($row['msg_body']));
            
$smilies generate_smilies("f{$row['msg_id']}"'msg_body');
        } else {
            
$comment_body make_clickable($row['msg_body']);
            
$smilies '';
        }

        
$ip $row['msg_hdr_ip'];
        if (
$row['msg_hdr_ip'] != $row['msg_raw_ip']) {
            
$ip .= ' [' $row['msg_raw_ip'] . ']';
        }

        
$params = array('{EDIT}' => &$comment_edit_box,
            
'{BUTTONS}' => &$comment_buttons,
            
'{IPINFO}' => &$comment_ipinfo
            
);

        
$template template_eval($template_image_comments$params);

        
$params = array('{MSG_AUTHOR}' => $row['msg_author'],
            
'{MSG_ID}' => $row['msg_id'],
            
'{PID}' => $row['pid'],
            
'{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
            
'{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
            
'{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
            
'{MSG_BODY}' => bb_decode($comment_body),
            
'{MSG_BODY_RAW}' => $row['msg_body'],
            
'{OK}' => &$lang_display_comments['OK'],
            
'{SMILIES}' => $smilies,
            
'{IP}' => $ip,
            
'{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
            
'{WIDTH}' => $CONFIG['picture_table_width']
            );

        
$html .= template_eval($template$params);
    }

    if (
USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
        if (
USER_ID) {
            
$user_name_input '<tr><td><input type="hidden" name="msg_author" value="' USER_NAME '" /></td>';
            
template_extract_block($template_add_your_comment'user_name_input'$user_name_input);
            
$user_name '';
        } else {
            
$user_name = isset($USER['name']) ? '"' strtr($USER['name'], $HTML_SUBST) . '"' $lang_display_comments['your_name'] . '" onclick="javascript:this.value=\'\';';
        }

        
$params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
            
// Modified Name and comment field
            
'{NAME}' => $lang_display_comments['name'],
'{CONFIRM}' => $lang_display_comments['confirm'],
            
'{COMMENT}' => $lang_display_comments['comment'],
            
'{PIC_ID}' => $pid,
            
'{USER_NAME}' => $user_name,
            
'{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
            
'{OK}' => $lang_display_comments['OK'],
            
'{SMILIES}' => '',
            
'{WIDTH}' => $CONFIG['picture_table_width'],
            );

        if (
$CONFIG['enable_smilies']) $params['{SMILIES}'] = generate_smilies();

        
$html .= template_eval($template_add_your_comment$params);
    }

    return 
$html;
}
$template_add_your_comment = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td width="100%" class="tableh2_compact"><b>{ADD_YOUR_COMMENT}</b></td>
        </tr>
        <tr>
                <td colspan="3">
                <form method="post" name="post" action="db_input.php">
                        <table width="100%" cellpadding="0px" cellspacing="0px">

<!-- BEGIN user_name_input -->
                                <tr><td class="tableb_compact">
                                        {NAME}
                                </td>
                                <td class="tableb_compact">
                                        <input type="text" class="textinput" name="msg_author" size="10" maxlength="20" value="{USER_NAME}" />
                                </td>
<!-- END user_name_input -->
<!-- BEGIN input_box_smilies -->
                                <td class="tableb_compact">
                                {COMMENT} </td>
                                <td width="100%" class="tableb_compact">
                                <input type="text" class="textinput" id="message" name="msg_body" onselect="storeCaret_post(this);" onclick="storeCaret_post(this);" onkeyup="storeCaret_post(this);" maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />                                        <!-- END input_box_smilies -->
<!-- BEGIN input_box_no_smilies -->
                                <input type="text" class="textinput" id="message" name="msg_body"  maxlength="{MAX_COM_LENGTH}" style="width: 100%;" />
<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>
<!-- 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>
                        </table>
                </form>
                </td>
        </tr>
<!-- BEGIN smilies -->
        <tr>
                <td width="100%" class="tableb_compact">
                        {SMILIES}
                </td>
        </tr>
</table>
<!-- END smilies -->

EOT;

?>


Again thank you very much for everything
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ____Alma____ on July 07, 2007, 06:42:21 am
Pardon forgot to put the page for if you want to see it your same.
Thank you

http://almaweb.es/Mi_album/index.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 07, 2007, 07:51:18 am
I can see the captcha image while adding comments. I also added a comment and it worked fine.

http://almaweb.es/Mi_album/displayimage.php?pos=-550

Did you solved the problem?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ____Alma____ on July 07, 2007, 01:48:25 pm
Ohhhh has been a failure mio, the captcha works perfectly, the image is that on having been given I from discharge to was not leaving for no site, not me ocurrión to enter as anonymous user...
You forgive for all the inconveniences.
Many people thank you very much for everything and also for this so necessary and interesting plugin.
Regards from Spain!!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: X-Korpio on July 24, 2007, 09:52:28 am
Greetings! Im using the newes CM gallery, and follow all the steps publish here, and apearantly it works but it dosnt show the numbers inside the image, I can see the field, and I when I press on OK its sayes the " Confirmation code didn't matched ", what did I did wrong?

http://www.klaudette.com/galeria/displayimage.php?album=7&pos=0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 24, 2007, 10:05:37 am
If you open http://www.klaudette.com/galeria/captcha.php, you will see the errors. Apparently there was a bug (http://bugs.php.net/bug.php?id=26309) in PHP documentation.

To remove those warnings -
Edit captcha.class.php and replace

Code: [Select]
$aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $this->sCode[$i]);

with

Code: [Select]
$aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $this->sCode[$i], array());

and replace

Code: [Select]
imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i]);

with

Code: [Select]
imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $this->sCode[$i], array());

That should do the trick.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: ComputerLady on August 04, 2007, 09:36:17 pm
I've been struggling with adding this MOD for a while now, since being told I can't use the plug-in version as my install is bridged with SMF.

The instructions at the head of this thread for installing this MOD seem incomplete. For example, the earliest instructions state:
Quote
Edit themes/yourtheme/theme.php

Add
Code:

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


just after
Code:

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


Add
Code:

<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
Code:

<!-- 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>

Yet, when I look at my themes/yourtheme/theme.php file (based on the Classic theme), I see only this:

Code: [Select]
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2007 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.12
  $Source$
  $Revision: 3636 $
  $Author: gaugau $
  $Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);

?>


No
Code: [Select]
'{COMMENT}' => $lang_display_comments['comment'], string that I can see, nor any

Code: [Select]
<!-- 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>

There also appears to be a LOT of changes to the original instructions provided in this thread, yet the instructions at the head of the thread have not been updated to reflect those changes. In short, I don't see how to modify my install to use this MOD at this time. Thanks for your time...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Nibbler on August 04, 2007, 10:39:39 pm
Use the plugin version then.

http://forum.coppermine-gallery.net/index.php?topic=36319.0
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on August 05, 2007, 06:02:35 am
@Nibbler
Sorry but she can't cause her gallery is bridged with SMF and plugin doesn't work with SMF and joomla bridge

@ComputerLady
If you can't find codes on your theme.php then you should copy them from themes/sample/theme.php
In your situation you should
- Copy & Paste $template_add_your_comment variable (starting by $template_add_your_comment = <<<EOT and ending by EOT;)
- Copy & paste theme_html_comments($pid) function
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: eka on August 14, 2007, 02:51:16 am
Hi,

I had earlier used Abbas' captcha codes to install this feature.
It worked very well.  Thank you guys !

I recently installed the Tagblitz plug-in.
I got an error - a box with a red cross in the place where the captcha code should appear.
See:  http://www.photograffs.com/displayimage.php?pos=-1509

can anybody help resolve this problem.
(I had earlier posted this problem under tagblitz topic.
I'm not trying to cross-post.  But I guess it is more appropriate under this topic).

I'm no good in php.
Anybody can help?

Thanks.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on August 14, 2007, 06:10:44 am
The problem is Tagblitz plug-in , it's injecting javascript to Captcha image and break it

can anybody help resolve this problem.
(I had earlier posted this problem under tagblitz topic.
I'm not trying to cross-post.  But I guess it is more appropriate under this topic).

Actually you did cross-post
For now you can disable tagblitz and wait for it to solve the problem
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: eka on August 14, 2007, 06:39:57 am
Thank you Sami.
I'll wait for the solution.  :)

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Sami on August 27, 2007, 10:01:12 am
Split and Moved unrelated reply (http://forum.coppermine-gallery.net/index.php?topic=46415.0) to this thread by nokc (http://forum.coppermine-gallery.net/index.php?action=profile;u=22228)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: JohnM-UK on September 03, 2007, 06:35:56 pm
Hi I tried to install this mod because even with a code users had to type (taken from a static image) I was still getting spam. Theres so much code to add in alot of files for this mod its difficult for someone without alot of php knowledge, and in some files where it says 'Add........ After........' Somethimes the code doesnt exist.
I then downloaded the 'plugin' by Sami and it said about using plugin manager to install it. Where do I find this or is it something I have to install to my gallery?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 04, 2007, 06:49:26 am
Ask captcha plugin related questions in the respective plugin thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: eka on September 05, 2007, 07:49:29 am
Hi,

I used Abbas Captcha for my site by amending the codes (before the plugin version came out).
I then upgraded my cpg to 1.4.12.
The captcha feature disappeared but the comment box was left intact.

Would it cause any problem now if I load the captcha plugin now?
Do I need to delete some lines in the code... before uploading the plug? and if so what lines....

Pse advice.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 05, 2007, 08:58:29 am
After upgrade did you preserved db_input.php and theme files from your previous version? I mean while upgrading did you overwrote all previously modified files? If yes then you can apply the plugin straightaway. But if you had preserved the old modified files then the captcha mod code should be removed from them before installing the plugin.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Jochus on September 09, 2007, 12:27:37 pm
Is it possible to use Captcha for the reporting of pictures to the admin? Because I receive several SPAM mails a day.

I tried captcha and it works perfect in combination with my comments, but not for my reports ...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 11, 2007, 09:54:31 am
Yes it is possible to use captcha anywhere we are getting the user input. Please start a separate thread for this though as this thread deals with captcha for comments only.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Jochus on September 11, 2007, 01:35:07 pm
Okay, thnx
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Master of Orion on November 06, 2007, 12:44:35 pm
Can you post the last version of Captcha
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: scottcrew on November 06, 2007, 01:49:38 pm
The latest version of CATPCHA is at:
http://forum.coppermine-gallery.net/index.php?topic=36319.0

HTH!
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on November 06, 2007, 02:47:15 pm
@ Master of Orion: stop cluttering this board by requesting "the most recent version" of mods. The most recent versions already exist in the mod threads. Don't be lazy, read the threads and you should be good. Mods don't need to get adapted to minor version updates (e.g. from cpg1.4.13 to cpg1.4.14), you just have to re-apply the mod after updating, that's all.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: chillivanilla on November 15, 2007, 02:07:58 pm
I've searched through the boards but can't find a definitive answer as to the whether Captcha code can be used when the SMF bridge is in place. I appreciate that the Captcha plugin can't be used but can the Capcha functionality be used when the mod is coded manually in this situation?

 
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on November 15, 2007, 07:14:05 pm
The captcha mod (the thread you've posted in) can not cope with bridging to SMF enabled because SMF's session will break the captcha session. The most recent version of the captcha plugin should be capable for use with SMF bridging. See Captcha (Visual Confirmation) for adding comments (http://forum.coppermine-gallery.net/index.php?topic=36319.0)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: hozyali on February 14, 2008, 11:39:21 pm
Hello,

I have this mod installed and was working fine on old versions, after upgrade to 1.4.16, it has stopped working. it shows the image but does not validate. even accepts as empty. Please advise.

Regards
Ali
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 15, 2008, 05:38:46 am
Make sure you have made changes in db_input.php properly.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: hozyali on February 15, 2008, 06:17:46 am
Make sure you have made changes in db_input.php properly.

Thank you Abbas Bhai...

Do you mean, I will have to redo the steps for db_input.php file?

Thanks for your help.

Regards
Huzaifa Ali
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 15, 2008, 01:49:23 pm
Do you mean, I will have to redo the steps for db_input.php file?

Yes.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: cgc0202 on February 15, 2008, 05:12:51 pm
Hi Abbas.

Thanks for the plugin. Using the theme.php you provided, and the the changes to the other files --the captcha  worked for the registration and login.  This is what I need most.

However, I am having problems with it in terms of its use in comments.  I tried it so many times and I get this error:


Fatal error: Cannot redeclare class phpcaptcha in /home/totinet/public_html/phi/gphi000/include/captcha.class.php on line 13

Here is a Demo page (http://likas-philippines.com/gphi000/index.php) using a fresh install of the version 1.4.16 -- also with its own problem. 

If possible, is there something that could be done so I do not have to use it for comments?  Only those who are logged in (thus also registered may comment.

Thanks.

Cornelio

P.S.
It seems to have compatibility issues also with other scripts, but I will place this as a separate respnse later.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: hozyali on February 15, 2008, 07:42:38 pm
Yes.

It worked, thanks a lot.

Huzaifa Ali
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on February 16, 2008, 06:14:13 am
@cgc020: There is a setting on admin groups manager page to turn comments off for guests. Perhaps you are looking for that. Also you said that you tried this plugin - This is not a plugin but a mod. There is a separate captcha plugin. Are you using that? Perhaps you should use that plugin as it does not requires and code changes.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: andye on February 18, 2008, 01:41:59 pm
I am also getting the error:

Fatal error: Cannot redeclare class phpcaptcha in /home/andyely/public_html/members/include/captcha.class.php on line 14

Any advice would be greatly received.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: rooty on February 27, 2008, 10:40:09 pm
Has anyone had any luck integrating Captcha into Foliage?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: rooty on February 28, 2008, 11:40:57 pm
Has anyone had any luck integrating Captcha into Foliage?

Errr....sorry, ignore that post; I had thought I was using the plugin, but in fact later realized that there is a plugin AND a mod, and I was using the mod. Plugin works beautifully with Foliage theme.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: skmdd on April 14, 2008, 07:47:40 am
Thanks for the nice mod. I got this working in first shot. (http://decoratingdesktop.com)
My site reports 500-600 spam comments. My site now is cleaner.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: aftab1003 on May 17, 2008, 12:47:11 pm
that freat, i have done in one shot tooo at http://www.picturerating.us/picture-gallery/index.php

but 1 thing i noticed, that with cookies, the commenter can edit or delete the own comment till the site cookie stay in his/her PC.
is it possible to stay away from visitors from their own comments?
if yes, then how we can do this.
thanks for your nice mod ;D
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on May 19, 2008, 06:32:41 am
This thread only deals with captcha mod. Your question is beyond the scope of this thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Ludo on May 20, 2008, 07:19:10 pm
It's been a hard time, but finally I've managed to get this mod working   8)

Just a suggestion: for the validation to work properly I had to move the line
Code: [Select]
require("include/captcha.class.php");at the beginning of db_input.php (just before the other requires): before, the confirmation code appeared but guests could post comments even without entering nothing (or a wrong code). I guess the session couldn't start, because of some PHP code already executed by the file.
As I noticed that other posters had to face this bug, maybe it can be useful to edit the installation instructions accordingly...
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Ludo on May 21, 2008, 10:08:57 am
I modded the mod  ;D to show confirmation code to guests only.
I don't know if this is the better way (any comment appreciated) but it works  ;D
(Edit: I just noticed a similar hack (http://forum.coppermine-gallery.net/index.php/topic,29564.msg168164.html#msg168164) previously posted: I think mine is lighter and more compliant with CPG code structure)

These edits require mod already in place.

OPEN
db_input.php

FIND (line 117)
Code: [Select]
if (!PhpCaptcha::Validate($_POST['confirmCode'])) {
REPLACE WITH
Code: [Select]
if (!(USER_ID) && !PhpCaptcha::Validate($_POST['confirmCode'])) {

OPEN
themes/your_theme/theme.php

FIND (in $template_add_your_comment)
Code: [Select]
                                <tr>                       
                                  <td class="tableb_compact" colspan="3">
                                    {CONFIRM}

BEFORE, ADD
Code: [Select]
<!-- BEGIN confirmation_code -->
FIND
Code: [Select]
                                    <input type="text" name="confirmCode" size="5" class="textinput" /> <img src="captcha.php" align="middle" alt="captcha code" />
                                  </td>
                                </tr>

AFTER, ADD
Code: [Select]
<!-- END confirmation_code -->
FIND (in function theme_html_comments)
Code: [Select]
            template_extract_block($template_add_your_comment, 'user_name_input', $user_name_input);
AFTER, ADD
Code: [Select]
            template_extract_block($template_add_your_comment, 'confirmation_code');

SAVE AND CLOSE ALL FILES           
Title: Re: Captcha (Visual Confirmation) locked me OUT!
Post by: RenesCopper on May 27, 2008, 10:14:07 pm
 ??? Using Captcha plugin locks me out of login to admin. can't see the captcha to login. using eyeball theme, black. and gallery is offline. don't know why it requires it for adminsitration.

What do I do? Delete Captcha files through my file manager/cPanel? Or just rename the folder and deal with it when I get in?

 :o

Title: Re: Captcha (Visual Confirmation) locked out: Solved
Post by: RenesCopper on May 28, 2008, 12:16:39 am
??? Using Captcha plugin locks me out of login to admin. can't see the captcha to login. using eyeball theme, black. and gallery is offline. don't know why it requires it for adminsitration.

What do I do? Delete Captcha files through my file manager/cPanel? Or just rename the folder and deal with it when I get in?
Found this:
Quote
Have an issue with plugin ? can't login to disable it ?
Manually disable captcha plugin:
=======================
- Use a mysql tool (e.g. phpmyadmin)
- Drop xxx_plugin_captcha table
- Open xxx_plugins table of gallery DB (xxx_ is your table prefix)
- Delete CAPTCHA row

So I tried that first. Figured out how to 'drop the xxx-plugin-captcha table', opened the xxx-plugins table, but there was no CAPTCHA row to delete. and that didn't solve the problem.

so went to my file manager/cPanel, and renamed the captcha folder. that worked! got into the admin backend. and deleted the captcha plugin. Now have two problems left.
Do I delete the Receive folder? was it created by the captcha plugin? and how do I restore the browse button? Should I run the update.php to get restored?
 :-\
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Ludo on May 28, 2008, 09:37:38 am
This topic is about Captcha mod, not plugin...  ::)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: RenesCopper on May 29, 2008, 11:52:54 pm
What's the difference? Mod vs plugin? I have perused these 22 pages and am still confused, as this topic started several years ago. and undoubtedly some of this is out-of-date.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Ludo on May 30, 2008, 08:46:25 am
The plugin topic is under Support > Plugins > Plugin contributions
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: englishgirls on June 29, 2008, 04:42:44 am
I have been using Captcha V3.0 for ages without any problems but now when I log in I get the error 'confirmation code didn't match'.  I followed the advise in a previous thread as follows:

"I was able to add comment on your website. Check http://www.kidsandcolors.com/colorina_colors-1355.html and you will see a comment 'Nice horse' added by me. Make sure that 5 letters are coming in the image. If not then reupload the fonts directory. Also make sure that the image reads different letters every time you refresh a page. If not then that means the image is coming from your cache and is not the correct image."

However, I still can't fix the problem and can no longer log in.  Any ideas?

Barry
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on June 30, 2008, 06:28:50 am
This is captcha mod thread and i presume you are using captcha plugin. Post your issue in relevant (http://forum.coppermine-gallery.net/index.php?topic=36319.0;topicseen) thread.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: RenesCopper on August 14, 2008, 02:51:00 am
Is there a updated version of this Captcha? Is it only for comments? Or can it be used for registering?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on August 14, 2008, 07:13:39 am
No updated version for this mod. Use Captcha plugin (http://forum.coppermine-gallery.net/index.php?topic=36319.0) instead.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Ludo on August 14, 2008, 12:00:33 pm
Is it only for comments? Or can it be used for registering?
For registration page there is my "extension" (http://forum.coppermine-gallery.net/index.php/topic,53883.0.html) of this mod, if you can't or don't want to use the plugin.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: goku on September 29, 2008, 11:47:33 pm
omg i think i have been askin for help in the wrong place. i have been asking for help on captcha in the captcha plugins, cant see image on login page and dont know how to get it back to normal coz i  did it manually from a post i think by u my abbas. Sir im really depressed coz of this thing. please help me out. cannot see captcha image on login page and can't find the same post again so i cud just undo all the things i did. plz take a look.
http://gallery.gokufanclub.com
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on September 30, 2008, 08:05:31 am
That post is here (http://forum.coppermine-gallery.net/index.php/topic,36319.0.html).
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on October 01, 2008, 12:55:06 am
@goku: Stop the wannabe-gangster gibberish - I already told you:
You have been told to post proper English - why don't you start doing as you have been told? Avoid wannabe-slang expressions like "nuthing", "plz", "coz", "dono" and so on, as this is an international forum - you can't expect people to understand your (pseudo-)cool slang. "Lolz" falls into the same category of words you should not use. I suggest to apply proper capitalization instead and be more carefull when composing your replies to make sure that there are less typos. This increases search-engine-friendliness as well as readability. Thank you.
It's "because", not "coz". It's "you", not "u". It's "please", not "plz". The words "im really depressed" should be "I'm really depressed". You're banned from posting for two days to take a look at a dictionary. Next ban will be permanent.

You have spread your postings over various threads, which is not a bright idea neither (but rather a breach of board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.msg270632.html#msg270632)):
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: cherry on April 25, 2009, 09:59:54 pm
I'd really like to use this mod as I get alot of spam comments but when I go to edit theme.php I get this on all themes:


// ------------------------------------------------------------------------- //
// This theme has all CORE items removed                                     //
// ------------------------------------------------------------------------- //
define('THEME_IS_XHTML10_TRANSITIONAL',1);

?>



What do I do?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Joachim Müller on April 26, 2009, 01:21:13 pm
Read the thread you're replying to closely, as you question has been asked and answered already many times over. If you can't get the mod to work, use the plugin version instead - the initial posting contains reference to it just as well.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: cherry on April 26, 2009, 01:55:24 pm
I've looked through what people are saying and something is still wrong in my theme.php
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: cherry on April 26, 2009, 01:56:09 pm
I've looked through what people are saying and something is still wrong in my theme.php

I've attatched my theme.php as a .txt file
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on April 27, 2009, 05:59:54 am
Use the plugin (http://forum.coppermine-gallery.net/index.php/topic,36319.0.html) instead of this mod.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: 1PLM on July 09, 2009, 04:52:26 am
Hi,
I did the Captcha unzip and install as states here:
http://forum.coppermine-gallery.net/index.php/topic,29564.0.html
I also used this link http://forum.coppermine-gallery.net/index.php/topic,36319.0.html and the instructions below:

Installation:
==========
0. Uninstall any older version of this plugin
1.Copy captcha folder to your plugins folder
2.Use plugin manager to install it
3.Copy captcha.php to gallery root

Now after installation my site is completely gone and displaying this error:

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /usr/local/4admin/apache/vhosts/MasterDomain.com/addon/MyWebSite.com/themes/rainy_day/theme.php on line 23

What do I do now?
Thanks.
           THIS IS THE CODE FROM Theme.php

Coppermine version: 1.4.18
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/themes/rainy_day/theme.php $
  $Revision: 4380 $
  $Author: gaugau $
  $Date: 2008-04-12 12:00:19 +0200 (Sa, 12 Apr 2008) $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has had all redundant CORE items removed                           //
// ------------------------------------------------------------------------- //
'{CONFIRM}' => $lang_display_comments['confirm'],
'{COMMENT}' => $lang_display_comments['comment'],
<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>
<!-- 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>

define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);

Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 09, 2009, 05:13:33 am
A you using captcha mod or captcha plugin? If plugin then you should ask for help in the plugin thread and not here.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: 1PLM on July 09, 2009, 06:17:06 am
Thanks for the quick feedback. Yours truly I do not know the difference between the Mod  and the Plugin, but the one I downloaded and installed was from this link:http://forum.coppermine-gallery.net/index.php/topic,36319.0.html
 I installed the Captcha_3_0.zip. Was it the correct thing I downloaded?
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Abbas Ali on July 09, 2009, 06:26:24 am
Then ask for help in that thread only - http://forum.coppermine-gallery.net/index.php/topic,36319.0.html
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: 1PLM on July 09, 2009, 07:20:52 pm
I Think in my confusion I downloaded the  Captcha_3_0.zip Plugin and used  installation instructions for the Mod.(using the installations instructions of the Mod in place of installation instruction for the Plugin - by accident).
Now I intend to backtrack and try to delete whatever lines I added to existing files and also remove the folders to see if i can get my site back up. The site is http://www.AmericaOnCamera.com
Thanks.
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: TripleFi 10 on May 26, 2011, 04:30:29 am
Thanks, Abbas! Very useful mod. ;D
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: Tata234 on July 22, 2011, 10:30:41 pm
Works great! I love it very much so (just deleted 1000+ spam comments on my site today), and came to coppermine looking for something like this. Thanks so much.

I greatly appreciate it too it help eliminate all the spam and saved me time and money!!!! Thanks
Mike of pioneer 1020 (http://pioneervsx-1020-k.org/pioneer-1020) | pioneervsx-1020-k (http://pioneervsx-1020-k.org)
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: pamibo on October 31, 2011, 08:32:28 am
Hello,
which one ist the latest Captcha plugin for cpg1.4.27?
Thanks
Title: Re: Captcha (Visual Confirmation) for adding comments
Post by: K313 on December 23, 2011, 12:36:59 am
CAPTCHA_K313 (http://k313.bplaced.net/)
created: 0.0015 sec.