linking Full size images linking Full size images
 

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

linking Full size images

Started by matikrimerman, June 02, 2007, 07:10:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

matikrimerman



I thought I saw a thread discussing this , But I spent all day looking for it and only found one about linking the intermediate size images

I would like to have my full size images linked , like the example here :

http://www.fullgaz.co.il/galleries/display_image.php?gal=57&img=5&noBuy=1

I found today the way of making the fullsize image page larger then the image size , how to insert "html" code into the fullsize images but still couldn't find the answer to this problem (or the thread about it)

Thank you all in advance

Mati

Joachim Müller

The page you refered to doesn't appear to be using Coppermine, so I'm not sure what you're talking about. Please re-phrase your question.

matikrimerman

thank you for your reply

The page Is just an example of a gallery that contains a full size image with the option to move to the next image or back. that is what i"m looking for in coopermine - to have the possibility to go from one full size image directly to the other


Thank's

Mati

Joachim Müller

Well, just a matter of configuration: disbable the creation of intermediate images and set intermediate image dimensions to the max size that your images are suppossed to have.

matikrimerman

thank's but this is not the solution I was hoping for.

I would like to leave the intermediate images as well as the full size one's.

The main goal of this is to make the gallery even more user-friendly then it all ready is - If a visitor goes from thumbnails to intermediate and then to full size , he'll be able to continue watching the gallery in the full size  view mode without the hassle of opening and closing the full size images.

beside that , the intermediate view mode as a very big advantage - the images fit on every screen - if I'll disable it , then the full size images may be too big for some screens...

I hope I'm understandable , since my English is far from been perfect :-[

Joachim Müller

OK, what you're up to requires some adjustments of themes/yourtheme/theme.php. It would have been easier to give you a detailed answer if you would have clarified what you're up to in the first place, as this is mainly a theme customization (moving your thread accordingly).
Basically, you'll just have to edit// Display the full size image
function theme_display_fullsize_pic()
accordingly - just add the code to previous/next images there.
To get a basic understanding how to accomplish this, read the thread Add Adsense code to full size images that basically describes what you need to edit in the first place.
Reading that thread should give you an idea what you need to edit and how to add the navigation arrows.

matikrimerman

Thank you

I'm familiar with this thread. I used it to add my full-size images (I added space around the image so the window opens more then the image-size  , and added html code in order to unable right-clicking and to Prevent Internet Explorer to show the image toolbar when a user hovers over a pic with the mouse).

I'll try and find the code to previous/next images by my self  .

matikrimerman

well I had a bit of aprogress but I'm stuck - I copied the part of code about prev/next  image from the "HTML template for the image navigation bar" on my Theme.php into the part of "Display the full size image function" . what i got was this :
http://www.matikrimerman.com/Gallery/displayimage.php?pid=5600&fullsize=1

Help will be great , since I'm on a deadend

Mati

Joachim Müller

You can't just borrow placeholders in curly brackets from other functions, as they are just placeholders and not filled within your function.
Inside the function function theme_html_img_nav_menu(), the target for the "previous"-link is being generated by using $prev_tgt = "{$_SERVER['PHP_SELF']}?album=$album$cat_link&pos=$prev$uid_link";. You'll have to review the code around it that determines the variables.

matikrimerman

I apologize but I don't understand the last post

I don't have the "$prev_tgt" code on my "theme_html_img_nav_menu()" function
I tried to copy this code (from what you're post)  into the "Display the full size image" function , but it didn't work  (obviously..)

Can you please give me some more specific instructions ? I'm a ware of your afford so if this is too much to ask I'll just drop the issue


Thank's a lot

Mati

Joachim Müller

OK, this is harder than I thought, as the regular displayimage.php pages uses pos (in cpg1.4.x), while the pop-up uses pid, so the code needs to be tweaked even more to come up with previous/next targets. I'll paste the code of theme.php that I have come up with so far - as suggested, it needs further modifications. Can't look into this any longer, as I'm late already and have to leave now. Try if you can come up with a solution based on this:<?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.
**********************************************/

// Display the full size image
function theme_display_fullsize_pic()
{
    global 
$CONFIG$THEME_DIR$ALBUM_SET;
    global 
$lang_errors$lang_fullsize_popup$lang_charset;
    global 
$CURRENT_PIC_DATA$meta_nav$album$cat$pos$pic_count$lang_img_nav_bar$lang_text_dir$template_img_navbar;

    if (isset(
$_GET['picfile']))
    {
        if (!
GALLERY_ADMIN_MODEcpg_die(ERROR$lang_errors['access_denied'], __FILE____LINE__);

    
$picfile $_GET['picfile'];
    
$picname $CONFIG['fullpath'] . $picfile;
    
$imagesize = @getimagesize($picname);
    
$imagedata = array('name' => $picfile'path' => path2url($picname), 'geometry' => $imagesize[3]);
    }
    elseif (isset(
$_GET['pid']))
    {
    
$pid = (int)$_GET['pid'];
    
$sql "SELECT * " "FROM {$CONFIG['TABLE_PICTURES']} " "WHERE pid='$pid$ALBUM_SET";
    
$result cpg_db_query($sql);

    if (!
mysql_num_rows($result)) cpg_die(ERROR$lang_errors['non_exist_ap'], __FILE____LINE__);

    
$row mysql_fetch_array($result);
    
$pic_url get_pic_url($row'fullsize');
    
$geom 'width="' $row['pwidth'] . '" height="' $row['pheight'] . '"';
    
$imagedata = array('name' => $row['filename'], 'path' => $pic_url'geometry' => $geom);
    }

    
$human_pos $pos 1;
    
$page ceil(($pos 1) / ($CONFIG['thumbrows'] * $CONFIG['thumbcols']));

    if (
$pos 0) {
        
$prev $pos 1;
        
$prev_tgt "{$_SERVER['PHP_SELF']}?pid=&amp;fullsize=1";
        
$prev_title $lang_img_nav_bar['prev_title'];
    } else {
        
$prev_tgt "javascript:;";
        
$prev_title "";
    }

    if (
$pos < ($pic_count -1)) {
        
$next $pos 1;
        
$next_tgt "{$_SERVER['PHP_SELF']}?pid=&amp;fullsize=1";
        
$next_title $lang_img_nav_bar['next_title'];
    } else {
        
$next_tgt "javascript:;";
        
$next_title "";
    }

    if (
defined('THEME_HAS_NAVBAR_GRAPHICS')) {
            
$location$THEME_DIR;
        } else {
            
$location'';
        }

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=<?php echo $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'?>" />
  <title><?php echo $CONFIG['gallery_name'?>: <?php echo $lang_fullsize_popup['click_to_close'];
      
?>
</title>
  <link rel="stylesheet" href="themes/igames/style.css" type="text/css" />
  <script type="text/javascript" src="scripts.js"></script>
  <style type="text/css">
  body { margin: 0; padding: 0; background-color: gray; }
  img { margin:0; padding:0; border:0; }
  #content { margin:0 auto; padding:0; border:0; }
  table { border:0; height:100%; width:100%; border-collapse:collapse}
  td {         vertical-align: middle; text-align:center; }
  </style>
  <script type="text/javascript">
    <!--
    // No rightclick script v.2.5
    // (c) 1998 barts1000
    // barts1000@aol.com
    // Keep this header for copyrights!
    var message="All rights are reserved to MATI KRIMERMAN."; // Message for the alert box
    // Don't edit below!
    function click(e) {
      if (document.all) {
        if (event.button == 2) {
          alert(message);
          return false;
        }
      }
      if (document.layers) {
        if (e.which == 3) {
          alert(message);
          return false;
        }
      }
    }
    if (document.layers) {
      document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown=click;
    // -->
  </script>
  </head>
  <body>
  <?php
  print_r
($CURRENT_PIC_DATA);
  
?>

    <script language="JavaScript" type="text/JavaScript">
      adjust_popup();
    </script>
    <table>
      <tr>
        <td align="center" valign="middle" class="navmenu" width="48">
          <a href="<?php print $prev_tgt?>" class="navmenu_pic" title="<?php print $prev_title?>"><img src="<?php print $location?>images/prev.gif"  border="0" align="middle" alt="<?php print $prev_title?>" /><?php print $prev_title?></a>
        </td>
        <td align="center" valign="middle" class="navmenu" width="48">
          <a href="<?php print $next_tgt?>" class="navmenu_pic" title="<?php print $next_title?>"><?php print $next_title?><img src="<?php print $location?>images/next.gif"  border="0" align="middle" alt="<?php print $next_title?>" /></a>
        </td>
      </tr>
      <tr>
      <tr>
            <td colspan="2">
          <div id="content">
              <?php     echo  '<a href="javascript: window.close()"><img src="'
                
htmlspecialchars($imagedata['path']) . '" '
                
$imagedata['geometry']
                . 
'alt="'
                
htmlspecialchars($imagedata['name'])
                . 
'" title="'
                
htmlspecialchars($imagedata['name'])
                . 
"\n" $lang_fullsize_popup['click_to_close']
                . 
'" /></a><br />' ."\n";
               
?>

          </div>
        </td>
      </tr>
    </table>
  </body>
</html>
<?php
}

// 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'])) {
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+20//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,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";
        } 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['clsid'].$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);
}

?>

matikrimerman

thank you very much - I was surprised by how detailed your answer was - you even added the massage I had when "right-clicking" on the full size image

unfourtnatlly I encountered 3 problems which I couldn't fix:

1. the full size image open but not in the dimensions it should - see pic"1" attached

2.above the full size image there are all kind of details showing that shouldn't be there , beside that the prev/next buttons are spread on 4 bars - please see pic"2"

3. finally once the prev/next buttons are clicked , instead of seeing the next image , I get to a page saying : "The selected album/file does not exist ! ". - pic "3"

Again - thank you very much for your help so far!!

Mati