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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Captcha (Visual Confirmation) for adding comments

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Abbas Ali

Remove


include('include/init.inc.php');


from captcha.php and see if it works.
Chief Geek at Ranium Systems

nerrick

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");


Nibbler

You have whitespace after the closing php tag in the theme.php. Remove it.

nerrick

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

Abbas Ali

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.
Chief Geek at Ranium Systems

JustKia

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.

Abbas Ali

Read through this thread from starting. I think someone has posted how to do that.
Chief Geek at Ranium Systems

superdave

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:

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

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?

Hein Traag

Quote from: superdave on April 27, 2007, 04:44:14 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.

superdave


wordup

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!

Tranz

Quote from: 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!
I got Server Not Found

XeoX

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

jerryleelewis

Hi Gyus i just change my Theme from Ocadia to Mesh Theme   here you can see 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

Jochus

Thanks!

Works perfect on 1.4.10 and theme Hardwired. You can check it at http://album.jochus.be

agnes1983

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?

Abbas Ali

Quote from: agnes1983 on June 26, 2007, 04:33:30 PM
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


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


Change the size attribute to whatever you like.
Chief Geek at Ranium Systems

____Alma____

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.

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

____Alma____

Pardon forgot to put the page for if you want to see it your same.
Thank you

http://almaweb.es/Mi_album/index.php

Abbas Ali

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?
Chief Geek at Ranium Systems