LightBox JS for Fullsize Popup Image - Page 11 LightBox JS for Fullsize Popup Image - Page 11
 

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

LightBox JS for Fullsize Popup Image

Started by Gizmo, August 29, 2006, 04:06:36 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

dennis1

thanks for the post works perfectly!

igcr

hi, i have a problem with the comments. You can see the problem here: http://dcjb.de/galerie/displayimage.php?album=lastcom&cat=0&pos=83
if there are 4 comments, the script show 4 pictures. if 3 comments, then 3 pics, and so on.

Here my theme.php code

<?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.10
  $Source$
  $Revision: 3275 $
  $Author: gaugau $
  $Date: 2006-09-03 12:10:47 +0200 (So, 03 Sep 2006) $
**********************************************/

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

// 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'])) {
#################################################
        //First part of lightbox update
$pic_html lightbox_list($CURRENT_PIC_DATA['pid']);
//End of first part
#################################################
        
} 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['classid'].$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);
}

#################################################
 //Second part of lightbox update
 
function lightbox_list($picId) {
    global 
$lang_display_image_php;

$i 0;
$pid $picId;
$pic_data get_pic_data($_GET['album'], $pic_count$album_name, -1, -1false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
  $condition true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
  $condition true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
  $condition true;
}else{
$condition false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url get_pic_url($picture'normal');
} else {
$picture_url get_pic_url($picture'normal');
}
$picture_url_fullsize get_pic_url($picture'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/""\\1"htmlspecialchars($picture['filename'])), "_"" "));
if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
            
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
            
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}
//End of second part
#################################################

?>

SaWey

Aha, this is because you look at the latest comments album,
there is an easy fix for this,

replace the second part of the update with this one:


#################################################
//Second part of lightbox update

function lightbox_list($picId) {
    global $lang_display_image_php;

$i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
    $firstonly = true;
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
$condition = true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
$condition = true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
$condition = true;
}else{
$condition = false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'normal');
}
$picture_url_fullsize = get_pic_url($picture, 'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($picture['pid'] == $pid && $firstonly) {
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
            $picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
            $picList .= "</a>\n";
            $firstonly = false;
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}//End of second part
#################################################



The multiple pics where shown as the picture exists multiple time in that album.
It will now only show the picture 1 time, but it will show multiple times in the slideshow.

igcr


rterburg

Hi,

I have a little problem with my lightbox script.

I have done all the changes in the theme.php and template.html.

My problem is that the white pop-up is displayed by clicking an image, but the image is not displayed. What am I doing wrong?

the url to my site is www.ronterburg.nl/gallery/

Thanks in advance.

Rgds,

Ron
~Ron~
www.terburg.net, Dutch landscape- and naturephotography

rterburg

Quote from: rterburg on August 10, 2007, 02:02:25 PM
Hi,

I have a little problem with my lightbox script.

I have done all the changes in the theme.php and template.html.

My problem is that the white pop-up is displayed by clicking an image, but the image is not displayed. What am I doing wrong?

the url to my site is www.ronterburg.nl/gallery/

Thanks in advance.

Rgds,

Ron

To complete my info. The theme I use is the classic theme. Coppermine version 1.4.12. The Joomla theme is Seasons from Yootheme.
~Ron~
www.terburg.net, Dutch landscape- and naturephotography

Sami

You've disabled Lightbox !
How could we find the problem without seeing that 
‍I don't answer to PM with support question
Please post your issue to related board

SaWey

    I just looked at your site, but you arn't using the changes as they where discribed here.

    In you theme.php you have changed "lightbox[ list ]" to "slideshowcontent[0]",
    probably because you are using another slidshow script.

rterburg

Quote from: Sami on August 10, 2007, 02:18:59 PM
You've disabled Lightbox !
How could we find the problem without seeing that 

Quote from: Sami on August 10, 2007, 02:18:59 PM
You've disabled Lightbox !
How could we find the problem without seeing that 

I am sorry I was just trying to solve the problem. I have enabled the lightbox script, but the problem is still there.

This are the changes in my theme.php

--<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2007 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.12
  $Source$
  $Revision: 3636 $
  $Author: gaugau $
  $Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/

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


// 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'])) {
#################################################
        //First part of lightbox update
$pic_html lightbox_list($CURRENT_PIC_DATA['pid']);
//End of first part
#################################################
        
} 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['classid'].$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);
}

#################################################
 //Second part of lightbox update
 
function lightbox_list($picId) {
    global 
$lang_display_image_php;

$i 0;
$pid $picId;
$pic_data get_pic_data($_GET['album'], $pic_count$album_name, -1, -1false);
foreach ($pic_data as $picture) {
if($CONFIG['thumb_use']=='ht' && $picture['pheight'] > $CONFIG['picture_width'] ){
  $condition true;
}elseif($CONFIG['thumb_use']=='wd' && $picture['pwidth'] > $CONFIG['picture_width']){
  $condition true;
}elseif($CONFIG['thumb_use']=='any' && max($picture['pwidth'], $picture['pheight']) > $CONFIG['picture_width']){
  $condition true;
}else{
$condition false;
}
if (is_image($picture['filename'])) {
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url get_pic_url($picture'normal');
} else {
$picture_url get_pic_url($picture'normal');
}
$picture_url_fullsize get_pic_url($picture'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/""\\1"htmlspecialchars($picture['filename'])), "_"" "));
if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
            
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
            
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}
//End of second part
#################################################

?>

--
See attachement.

rgds,

Ron
~Ron~
www.terburg.net, Dutch landscape- and naturephotography

SaWey

It's something with the effects library, try downloading and uploading the javascripts again.
It also could be a conflict between 2 javascripts

rterburg

Quote from: SaWey on August 10, 2007, 02:51:17 PM
It's something with the effects library, try downloading and uploading the javascripts again.
It also could be a conflict between 2 javascripts

This could be, because the lightbox script is also included in the Joomla theme. Could this be the problem? Can I link directly to the js files from the Joomla Theme?
~Ron~
www.terburg.net, Dutch landscape- and naturephotography

SaWey

yes, you can, once included in the main page, it will be available for the rest of the page (except for iframes)

rterburg

Quote from: rterburg on August 10, 2007, 03:00:01 PM
This could be, because the lightbox script is also included in the Joomla theme. Could this be the problem? Can I link directly to the js files from the Joomla Theme?

This has solved the problem. When you use a Joomla template with the lightbox (or slimbox) script included, then link to the js script of the Joomla theme in your template.html.

I have changed the following lines:

<link rel="stylesheet" href="http://your_domain/gallery/themes/your_theme/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://your_domain/gallery/themes/your_theme/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="http://your_domain/gallery/themes/your_theme/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="http://your_domain/gallery/themes/your_theme/lightbox/js/lightbox.js"></script>



to:

<link href="http://your_domain/templates/your_joomla_template/lib/js/lightbox/css/slimbox.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="http://your_domain/templates/your_joomla_template/lib/js/lightbox/slimbox.js" type="text/javascript"></script>


Thanks for the help.

Rgds,
~Ron~
www.terburg.net, Dutch landscape- and naturephotography

SaWey


rrwwxx

Great script. I described here how I included it on my own gallery together with a couple of other visual mods mentioned in this section of the Coppermine gallery subforum.

I just have one question: There is a file named song.mp3 in the script that I downloaded from http://ahavriluk.home.comcast.net/slideshow.zip. And it sounds quite nice and interesting but I can't hear any music playing when the slideshow is running. So is there an additional function that needs to be enabled to get it be working? Of course the mp3 file is more than 600kB in size, so it would probably be loading quite slowly when being invoked at the first time. I am just curious to know what it is for when there is no reference to it in the js files?
cu,
Roli
°¿°

Widi

Hi,

thanks for this mod, really like it and had it implemented in my site for a while now. The first version. With the addition of the slideshow and being able to see all pictures in the albums, I'm trying to mod it so i can skip the whole intermediate page at all. Instead showing:

a) the intermediate pictures in lightbox, with the ability to scroll through all the pictures of the album

or

b) the full-size picture in lightbox, skipping the intermediate picture.

i've been at this for a while, but have little coding exp. I looked in theme.php and also in thumbnails.php, but never got it to work so i gave up on it months ago...

Do you have any suggestions?

Thanks,

Cheers.

SaWey

@rrwwxx:
I know the lightbox_s.js has some music playback function, but haven't tried it.
You just have to add a tag to your image links, like now you have rel="lightbox
    " , just add music="path/to/your/music/file"
    you can add this in your theme.php file in the 'lightbox update'.
    I for instance have it like this:


if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url_fullsize\" music=\"scripts/slideshow/music/test.mp3\" picpage=\"$picture_page\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
$picList .= "</a>\n";

}else{
$picList .= "<a href=\"$picture_url_fullsize\" music=\"scripts/slideshow/music/test.mp3\" picpage=\"$picture_page\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}


and you will also have to include the swfobject.js in your template.
The music will start playing as soon as you start the slideshow by pressing the play button.

@Widi:
It would take some time of coding, and I don't have that time.
I saw some topics about this, but don't know if they solved the problem. You might want to try looking for them.

OzButcher

I love it thanks!! :)

Very easy to integrate!

zenlunch

Can someone please help me find a way to insert a hyperlink in the title of the lightbox image? I've tried inserting the standard [ url ] tags as well as the HTML a href but neither seems to work. Both instances show the entire URL within the image title. See my gallery for examples: http://constantcraftsman.com/gallery

Not sure if it's even possible. If I should be posting this to a new thread I apologize - just let me know and I'll move it.

SaWey

I took this off the lightbox site:


Can I insert links in the caption?
Yes, but you need to convert quotes and greater and less than symbols into their html entity equivalents. For example:
<a href="images/image-4.jpg" rel="lightbox" title="&lt;a href=&quot;link.html&quot;&gt;my link&lt;/a&gt;">Image</a>


To convert, you can use this site: http://centricle.com/tools/html-entities/