Remove full size image option for 1.4x Remove full size image option for 1.4x
 

News:

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

Main Menu

Remove full size image option for 1.4x

Started by JasonR, February 13, 2006, 07:02:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JasonR

Hi, first let me say that I've searched the boards and I know this question has been asked many times before and I've read many if not all of those threads. HOWEVER, it seems the code that needs to be edited/removed in 1.4x to prevent the full size image pop up is different than in previous versions. I've seen suggestions for 1.3x to edit the code in displayimage.php but the code that is referenced is not in that file in 1.4x.

Can anyone tell me where the code in 1.4x is that I can edit and/or remove to prevent the option of the full size image pop up? I would also like to preven the small popup msg that says "click to view full size images".

I know that there is a plugin that someone (Paver maybe?) created to controll access to this feature by groups but I would like it shut off for my entire site.

Thanks

Joachim Müller

Instructions how to remove the link to the fullsize pop-up have been posted various times as far as I can remember. I have posted instructions on the German support board only yesterday (http://forum.coppermine-gallery.net/index.php?topic=27732.msg128535#msg128535) - you should be able to accomplish the hack even if you don't speak German.

Rough translation: edit themes/yourtheme/theme.php findfunction html_picture_menu(). If it doesn't exist, copyfunction html_picture_menu()
{
    global $lang_display_image_php, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $CONFIG;

    $mime_content = cpg_get_type($CURRENT_PIC_DATA['filename']);
    $picmenu = '';

  if (false) { //(!($mime_content['content']=='image')) {
    $picmenu = <<<EOT
     <a href="#" onclick="return MM_openBrWindow('setplayer.php?={$mime_content['extension']}','Set_Player','scrollbars=no,toolbar=no,status=no,resizable=no')" class="admin_menu" >{$lang_display_image_php['set_player']}</a>
EOT;
  }

  if ((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) {
    $picmenu .= <<<EOT
     <a href="javascript:;" onclick="return MM_openBrWindow('picEditor.php?id={$CURRENT_PIC_DATA['pid']}','Crop_Picture','scrollbars=yes,toolbar=no,status=yes,resizable=yes')" class="admin_menu" >{$lang_display_image_php['crop_pic']}</a> <a href="editOnePic.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu">{$lang_display_image_php['edit_pic']}</a> <a href="delete.php?id={$CURRENT_PIC_DATA['pid']}&amp;what=picture"  class="admin_menu" onclick="return confirm('{$lang_display_image_php['confirm_del']}'); return false; ">{$lang_display_image_php['del_pic']}</a>
EOT;
  }

  return $picmenu;
}
into an empty line right before ?>Then find            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
and replace with            $pic_html = "<!--<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">-->";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "<!--</a>-->\n";


Better still: avoid creation of full-size image in the first place.

JasonR

Thank you for the help and I'm sorry for posting in the wrong forum.

Your instructions were very helpful but I am confused on the last part, which is the same place that confused me on the previous posts I'd seen explaing how to do this. I am using the Joombla template for Coppermine and I have searched the themes/joombla/theme.php and I cannot find

            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";


I then searched themes/project_vii/theme.php as well as the theme.php for hardwired and in none of these theme.php's can I find the code listed above? That is where I get stumped every time. Sorry for the hassle, should I be looking somewhere besides theme.php for that code to replace? And for the record, I'm using Coppermine Photo Gallery 1.4.3 (stable).   

Thank you.

Nibbler

The same instruction applies. Copy the entire theme_html_picture() function from themes/sample/theme.php into your theme's theme.php and then modify your copy.

JasonR

Thanks for the reply Nibbler. So I need to add to the code and then change it. I looked in the sample theme.php and I found the code you are talking about but I'm not sure how much of it I need. It starts at line 1909 and I can't tell exactly where it stops....possibly at the end of the page at 2405. Do I need to copy that whole code to mytheme/theme.php and if at what line to I paste it into my theme.php?

Sorry for all the questions but I want to make sure I do this correctly. Thanks for the help.

Nibbler

It ends around 2069


    return template_eval($template_display_media, $params);
}


You need to copy the whole thing, even if you just change one line.

JasonR

Thank you for your fast response. Ok here is what I've done....I've added the code that GauGau mentioned right above the ?> . As soon as I did this, I uploaded the theme.php although I know we aren't done and when I click on a photo I get the error....

QuoteFatal error: Cannot redeclare html_picture_menu() (previously declared in /usr/home/appleby/public_html/coppermine/displayimage.php:63) in /usr/home/appleby/public_html/coppermine/themes/joombla/theme.php on line 57

Figuring that is just part of it, I then insert the code you mentioned but I had no idea where to insert it, so I tried at the top and then right above the code GauGau had me insert. Either way, I got this error when clicking on a photo....

QuoteFatal error: Cannot redeclare html_picture_menu() (previously declared in /usr/home/appleby/public_html/coppermine/displayimage.php:63) in /usr/home/appleby/public_html/coppermine/themes/joombla/theme.php on line 218

Any idea on what I've done wrong?

And also I checked my settings as GauGau mentioned and I have the option of "create intermediate pictures" set to OFF. My album folders show my orginal photo I uploaded (which is already prefectly resized) and the thumbnails Coppermine created. However, I still have the option of clicking on my photos to see the "full size image" which is really just opening a window with the same image in it. That's what I want to prevent. I'm just passing along this info, in case it matters. Thanks

Nibbler

It means that your theme already has it's own version of html_picture_menu(). You will need to find that in the file and either remove it or merge its changes with those posted in this thread.

JasonR

I'm sorry for being such a pain in the rear end. Thanks for being so paitent. My theme.php is VERY short and very simple. I do not see any sort of html_picture_menu. I'll post it here and you can tell me what I'm doing wrong or I should do, if you don't mind. This is the orginal theme.php I'm using.

<?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: /cvsroot/coppermine/devel/themes/classic/theme.php,v $
  $Revision: 1.70 $
  $Author: donnoman $
  $Date: 2005/04/10 16:24:27 $
**********************************************/

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

$template_film_strip = <<<EOT

        <tr>
         <td valign="top" style="background-image: url(themes/joombla/{TILE1}); background-repeat: repeat-x;"><img src="{TILE1}" alt="" border="0" /></td>
        </tr>
        <tr>
        <td valign="bottom" class="thumbnails" align="center">
          <table width="100%" cellspacing="0" cellpadding="3" border="0">
              <tr>
                 <td width="50%"></td>
                 {THUMB_STRIP}
                 <td width="50%"></td>
              </tr>
          </table>
        </td>
        </tr>
        <tr>
         <td valign="top" style="background-image: url(themes/joombla/{TILE2}); background-repeat: repeat-x;"><img src="{TILE2}" alt="" border="0" /></td>
        </tr>
<!-- BEGIN thumb_cell -->
                <td valign="top" align="center">
                                        <a href="{LINK_TGT}">{THUMB}</a>
                                        {CAPTION}
                                        {ADMIN_MENU}
                </td>
<!-- END thumb_cell -->
<!-- BEGIN empty_cell -->
                <td valign="top" align="center" >&nbsp;</td>
<!-- END empty_cell -->

EOT;

?>

Joachim Müller

Quote from: JasonR on February 14, 2006, 05:29:27 AM
  Coppermine version: 1.4.1
Do you actually have cpg1.4.1 or is this just a leftover? I suggest upgrading to cpg1.4.3 before doing anything else. Version cpg1.4.1 had beta status and goes unsupported - there have been changes in the theming engine from cpg1.4.1 to the release version as far as I remember.

Nibbler

That's not the file you pasted the new function into though, it can't be.

JasonR

I just looked at the orginal download folder for Coppermine that I installed on my server and it is the JoomBla modified Coppermine 1.4.2. I'm using the CoppermineVis package put out my Joombla to integrate my gallery with Mambo.(and it works great!!) Not sure why it says 1.4.1 at the top of my config menu. Since I'm using their modified files I'm not sure if I should I upgrade to 1.4.3? I'd rather not mess with it unless I really need to because of the hassle.

Nibbler, that is the file I attempted to paste all that new code into....I just had no idea where to put it and I was obviously doing it wrong. That file I posted above is the theme.php I have running right now and working fine.

Ok, I just found something interesting....  this post right here that was recently solved.....  http://forum.coppermine-gallery.net/index.php?topic=27891.0 seems to be the problem I was having. As a test, I copied his entire theme.php code and uploaded it to my server. It worked perfectly and solved the full size image problem. However, it made the thumbnails in my filmstrip much smaller than they currently are. Everything else seemed to work perfectly. He appeard to be using a theme.php that is very similar to mine. Not sure if that all means anything or not.

Again, thank you for your paitence and support.

JasonR

Ok, I solved it on my own but I have no idea really how and this thread will be of no help to anyone else because I don't have a good answer.

What I did was go to the topic that I refereced above and the org. poster had solved his own probem and dind't know how and he attached a copy of his theme.php. I realized his theme.php was almost identical to mine except his thumbnail coding. So I just deleted his thumbnail coding, inserted everything else from my theme.php and BAM, problem solved.

Not sure why his theme worked but it did and I guess that is all that matters, I hope this could somehow be some help to all the other people with this problem. I will attach my working theme.php below which is actually the Joombla theme that came with a slightly edited verson of Coppermine to use with CoppermineVis.

Thanks for the support guys, I'm still not sure what I did wrong to make it not work? You can mark this solved.

Syree


romans815

Ok, so I am confused after reading all the post. This is the 1.4.5 theme and it has none of the referenced lines in it. What to do???

<?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: /cvsroot/coppermine/stable/themes/project_vii/theme.php,v $
  $Revision: 1.18 $
  $Author: gaugau $
  $Date: 2006/03/02 08:25:19 $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has had all redundant CORE items removed                       //
// ------------------------------------------------------------------------- //
define('THEME_HAS_NO_SUB_MENU_BUTTONS'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 ="|";

// HTML template for sub_menu
if ($CONFIG['custom_lnk_url'] != '') {

$template_sub_menu = <<<EOT
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN custom_link -->
                                                                                <td class="top_menu_left_bttn">
                                                <a href="{CUSTOM_LNK_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
<!-- END custom_link -->
                                        <td class="top_menu_bttn">
                                                <a href="{ALB_LIST_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">@</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTUP_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTUP_TITLE}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPN_LNK}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPRATED_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{FAV_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{FAV_LNK}">{FAV_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_right_bttn">
                                                <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
                                        </td>
                                </tr>
                        </table>
EOT;



} else {
$template_sub_menu = <<<EOT
                        <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
<!-- BEGIN custom_link -->
<!-- END custom_link -->
                                        <td class="top_menu_left_bttn">
                                                <a href="{ALB_LIST_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{ALB_LIST_TITLE}">{ALB_LIST_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0" alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="javascript:;" onmouseover="MM_showHideLayers('SYS_MENU','','show')">@</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTUP_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTUP_TITLE}">{LASTUP_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{LASTCOM_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{LASTCOM_LNK}">{LASTCOM_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPN_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPN_LNK}">{TOPN_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{TOPRATED_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{TOPRATED_LNK}">{TOPRATED_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_bttn">
                                                <a href="{FAV_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{FAV_LNK}">{FAV_LNK}</a>
                                        </td>
                                        <td><img src="themes/project_vii/images/menu_spacer.gif" width="2" height="35" border="0"  alt="" /><br /></td>
                                        <td class="top_menu_right_bttn">
                                                <a href="{SEARCH_TGT}" onmouseover="MM_showHideLayers('SYS_MENU','','hide')" title="{SEARCH_LNK}">{SEARCH_LNK}</a>
                                        </td>
                                </tr>
                        </table>
EOT;
}

?>

Nibbler

Quote from: Nibbler on February 13, 2006, 10:48:00 PM
Copy the entire theme_html_picture() function from themes/sample/theme.php into your theme's theme.php and then modify your copy.

Paver

A quick note for archival reasons (since I didn't read this thread back in February): the plugin "Full-Size Photos Access Control" will do what the original request was.  You can set all groups to not have full-size photos access, just leave all the groups checkboxes off (on the plugin control panel).  Administrators always have access, but I'm assuming you don't have rogue administrators (generally, there is only one administrator).