Captcha (Visual Confirmation) for comments/registration/reporting/login/ecard - Page 5 Captcha (Visual Confirmation) for comments/registration/reporting/login/ecard - Page 5
 

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 comments/registration/reporting/login/ecard

Started by Sami, September 17, 2006, 07:04:22 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Sami

Quote from: claude258 on November 08, 2006, 01:00:11 AM
Ok I will try to update to the most recent version as soon as I have the time... ;)
But I thought this plugin was for 1.4X?  ??? Anyway...
In fact I guess that you may change $template_gallery_admin_menu variable under themes.inc.php and it's cause the issue , but after all you must upgrade ASAP for security reason and upgrade proccess will over write new themes.inc.php and will correct it ...
Quote from: claude258 on November 08, 2006, 01:00:11 AM
Another question, is it possible to change the display of the comment box. In my theme (eyeball), the comment box is beside the name box and it is appearing small. can I put the comment box below the name box? This way it will take all the space from the left to the right.

http://claudebriere.net/coppermine/displayimage.php?pos=-1697&PHPSESSID=aa633cb40c4535680cce9ca26c87fcf0
Yes it's possible
- Copy $template_image_comments variable from themes/sample/theme.php to your theme , if you don't have it already
- Move the textarea to a new TR
‍I don't answer to PM with support question
Please post your issue to related board

m@rk

Here's my German Translation, but...

I'm wondering why the Language Detection in "init.inc.php" doesn't seem to work ??

I had to rename "german.php" to "english.php" to get results - this is curious ...

Sami

Your German.php works fine with my test bed !
what version of captcha plugin you're using?
‍I don't answer to PM with support question
Please post your issue to related board

m@rk

You say it works? Strange thing.
I'm using CAPTCHA v1.7, currently attached in the very first post of this thread, running with CPG 1.4.10.

I thought this might be related to the language detection in include/init.inc.php:

if (file_exists("plugins/captcha/lang/{$CONFIG['lang']}.php")) {
  require "plugins/captcha/lang/{$CONFIG['lang']}.php";
} else {require "plugins/captcha/lang/english.php";}

Sami

‍I don't answer to PM with support question
Please post your issue to related board

m@rk

Hallo Sami,

thank you for engagement!

I didn't implement your fine plugin in my gallery finally, since I want to make layout modifications first.

The problem occurs in following test environment:

XAMPP for Windows Version 1.5.3a
Apache/2.2.2 (Win32)
PHP/5.1.4

while similar language detection with other plugins works.

Sami

Can you enable debug mode and see if it's giving you any error
And also check if file_exists is enable and working (safe mode restrictions)
‍I don't answer to PM with support question
Please post your issue to related board

Tommy2506

#87
Hello

I have problem with this plugin

After instalation everything seemd to be ok

but when you enter wrong cnofirmation code and pressed OK in order to add a comment there appears some window with

Template error
Failed to find block 'admin_approval'(#(<!-- BEGIN admin_approval -->)(.*?)(<!-- END admin_approval -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>

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


this above
My theme is

<?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.5
  $Source:$
  $Revision$
  $Author$
  $Date$
**********************************************/

// ------------------------------------------------------------------------- //
// 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;
}

// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="left" valign="middle"><img src="themes/fiblack3dgreen/images/folder.gif" border="0" width="25" height="25" alt="" align="left" />{CAT_THUMB}</td><td align="left"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><table border="0"><tr><td valign="middle"><img src="themes/fiblack3dgreen/images/folder.gif" border="0" width="25" height="25" alt="" align="left" />{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
        </tr>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;


?>




Sorry if I've done sth wrong - My English is very poor ;]

My gallery adres is http://www.delirium.ovh.org

Please help me :) what should I do ?

Sami

Rename your theme.php (themes/your theme/theme.php) to theme.txt and attach it to this thread using additional option
‍I don't answer to PM with support question
Please post your issue to related board

Tommy2506

I've added my theme php in my post above , and I still don't know what to do ?

Sami

Tommy you are running 1.4.2 which is very old !
Upgrade to 1.4.10 and you'll be fine
‍I don't answer to PM with support question
Please post your issue to related board

spikeweb

Hi all,
Attached is the french translation  ;)
But I had to modify english.php in lang folder as french.php is not recognized ??

HF OADA

Hi,

attached the dutch translation.
I see that I'm not the only one that's having troubles with getting the correct language file to be set. I've had to hard code mine to set it as dutch as default instead of english. Is there something wrong with the language selection of this plugin or is it something related to coppermine? To make it clear I'm running version 1.4.10 at the moment. You can see the version running at the following URL: http://vakantieparken.hfoada.nl

With kind regards,
HF OADA

moli

i've installed the plugging, it seems to work but imagen is not clearly readeble

BigWig

Hi Sami,

I have overwrote the codebase.php included to Captcha plugin v1.7 form first message of this topic with your codebase.php for Captcha registration attached to your message http://forum.coppermine-gallery.net/index.php?topic=36319.msg180154#msg180154, however on the registration page I don't see any visual confirmation, whereas Captcha for comments is working well down.
Could you please advice me what I did wrong?
My album updated to 1.4.10 and located here http://stepclub.net .

Thank you.

BigWig

Sorry, after reinstalling all works fine!

Thank you!

JvM

Is there a possibility to use this plugin without a freetype GD.
The next code works perfect it gives a verification code, however it isn't working correct. You can enter the comment without code too.
I pasted this code in catcha.php and commented (//) the require(...class..) and the constructors ($oPhpCaptcha)


session_start();

// !!! don't edit this file except for the hex code for the background color - line 27 and line 30 for text color
// go to http://web.forret.com/tools/color.asp for color conversions - do not edit any other lines!!!

// make a string with all the characters that we want to use as the verification code
// left out o, 0, U and V - look too much alike
$alphanum  = "ABCDEFGHIJKLMNPQRSTWXYZ123456789";

// generate the verication code
$rand = substr(str_shuffle($alphanum), 0, 5);

// create the hash for the verification code and put it in the session
$_SESSION['php_captcha'] = md5($rand);

// create the image
$image = imagecreate(60, 23);

// use lite blue as the background image - change the hex code to match your background - ex. 245, 245, 255 is light blue; 255, 255, 255 would be white on so on - go to http://web.forret.com/tools/color.asp for color conversions
$bgColor = imagecolorallocate ($image, 245, 245, 255);

// the text color is black - change the hex code to clor of your choice - ex. 0, 0, 0 is black
$textColor = imagecolorallocate ($image, 0, 0, 0);

// write the random number
imagestring ($image, 5, 5, 8, $rand, $textColor);
   
// send several headers to make sure the image is not cached   
// taken directly from the PHP Manual
   
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");

// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

// HTTP/1.0
header("Pragma: no-cache");

// send the content type header so the image is displayed properly
header('Content-type: image/png');

// send the image to the browser
imagepng($image);

// destroy the image to free up the memory
imagedestroy($image);

moli

i´ve tryed other ways with out fortune. now, I´'m doing all steps but captcha don't apear on plugins installed (but it's on plugins folder)

i'm getting crazy.


Sami

You should have FreeType support on your PHP and you don't have
this means you can't use this plugin try another solutions
‍I don't answer to PM with support question
Please post your issue to related board