Advanced search  

News:

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

Pages: 1 ... 8 9 10 11 [12] 13 14 15 16 ... 24   Go Down

Author Topic: Captcha (Visual Confirmation) for adding comments  (Read 586487 times)

0 Members and 4 Guests are viewing this topic.

Sosha

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Captcha (Visual Confirmation) for adding comments
« Reply #220 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Captcha (Visual Confirmation) for adding comments
« Reply #221 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.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #222 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.
Logged
Chief Geek at Ranium Systems

Sosha

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Captcha (Visual Confirmation) for adding comments
« Reply #223 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 :)
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #224 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.
Logged
Chief Geek at Ranium Systems

plathw

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Captcha (Visual Confirmation) for adding comments
« Reply #225 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!
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Captcha (Visual Confirmation) for adding comments
« Reply #226 on: November 30, 2006, 05:07:42 pm »

Do you have freetype?
Logged

SiamJai

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • The world is my home.
    • Thaiwonders Art Gallery
Configuring Captcha for the Fruity theme
« Reply #227 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 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
« Last Edit: December 04, 2006, 04:15:09 am by GauGau »
Logged
Thaiwonders Media Hub - Piano music, Photos and Videos - powered by Coppermine, of course. ;)

SiamJai

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • The world is my home.
    • Thaiwonders Art Gallery
long quotes
« Reply #228 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. 
Logged
Thaiwonders Media Hub - Piano music, Photos and Videos - powered by Coppermine, of course. ;)

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #229 on: December 04, 2006, 05:49:36 am »

Thanks Siam for sharing.
Logged
Chief Geek at Ranium Systems

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Captcha (Visual Confirmation) for adding comments
« Reply #230 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.
Logged

jeffreybr

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Captcha (Visual Confirmation) for adding comments
« Reply #231 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?
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #232 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.
Logged
Chief Geek at Ranium Systems

jeffreybr

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Captcha (Visual Confirmation) for adding comments
« Reply #233 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/
Logged

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Captcha (Visual Confirmation) for adding comments
« Reply #234 on: December 14, 2006, 06:23:49 pm »

Hello Abbas Ali
URL to Gephri's site ishttp://www.superstarstudents.com/gallery/index.php

Thanks for taking a look at why unregistered users can't see the captcha and comment area.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #235 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).
Logged
Chief Geek at Ranium Systems

Gephri

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 235
Re: Captcha (Visual Confirmation) for adding comments
« Reply #236 on: December 15, 2006, 10:10:33 pm »

thanks  - sometimes we're just looking too deep !
Logged

etnies

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Captcha (Visual Confirmation) for adding comments
« Reply #237 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!
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Captcha (Visual Confirmation) for adding comments
« Reply #238 on: December 19, 2006, 06:43:57 am »

You probably didn't modified db_input.php file.
Logged
Chief Geek at Ranium Systems

etnies

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Captcha (Visual Confirmation) for adding comments
« Reply #239 on: December 19, 2006, 03:20:17 pm »

I did modify it though.
This is what it looks like:  www.vanessa-anne.org/pictures
Logged
Pages: 1 ... 8 9 10 11 [12] 13 14 15 16 ... 24   Go Up
 

Page created in 0.032 seconds with 20 queries.