forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Visuals => Topic started by: Gizmo on August 29, 2006, 04:06:36 am

Title: LightBox JS for Fullsize Popup Image
Post by: Gizmo on August 29, 2006, 04:06:36 am
This afternoon I posted a hack for a different type of popup window for the fullsize image using the GreyBox-http://amix.dk/greybox/demo.html (http://amix.dk/greybox/demo.html) script at http://forum.coppermine-gallery.net/index.php?topic=35530.0 (http://forum.coppermine-gallery.net/index.php?topic=35530.0). I've been trying to incorporate the LightBox script but had a few issues passing the popup image variable to LightBox since it needs to have an image file ending in .gif or .jpg (maybe others as well) and the method used in the function theme_html_picture() wasn't working. After nearly choking on my steak at dinner, I thought of passing the information to a new variable and using this method worked as planned.  :D You can check it out here by clicking on any intermediate image to get the popup - http://www.bullseyephotos.com/gallery/index.php?theme=OrangeSky_LB (http://www.bullseyephotos.com/gallery/index.php?theme=OrangeSky_LB).

So on with the good stuff.
Step 1: Download the LightBox JS v2.02 scripts from http://www.huddletogether.com/projects/lightbox2/ (http://www.huddletogether.com/projects/lightbox2/) and follow the instructions for setting up the files.

Step 2: Paste this code into your theme.php. If you already have the function theme_html_picture() in your theme.php, at the end I've shown only the parts I've modified. You'll have to test it to make sure they work with any modifications you may have.

Code: [Select]
// 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']) > 4) array_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']==0 || $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'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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['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);
}

The code that I modified is this-
Code: [Select]
    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']+3; //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=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";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" {$image_size['geom']} class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }

to this-
Code: [Select]
    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
    $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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";
        }


I think this is even cooler than the GreyBox hack since it allows for smoother scrolling if the image doesn't fit completely in the browser window. As I said in the other post, I'm not a solid PHP coder and Coppermine Guru so I'm hoping a more experienced user or Dev will have a look and make sure the method I've used is solid and safe.

Many thanks go out to Lokesh Dhakar who developed this code so please support him with an email or a donation at http://www.huddletogether.com/projects/lightbox2/#contact (http://www.huddletogether.com/projects/lightbox2/#contact).

Cheers,

Gizmo  :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Stramm on August 29, 2006, 07:30:38 am
I love the lightbox look and I'm using it myself on my joomla powered site. Unfortunately it's a pain to do the slideshow with it... at least with bigger albums.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: volcanina on September 26, 2006, 09:20:37 pm
I love it! Install is easy, effect is great, and I get rid of the pop-up I always hated. Thanks Gizmo!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 01:42:44 am
yes this does look cool !!  nice work

you say easy to instal!   :(

can you tell how to please :)

ive read everthing and i have dl the files.... but where do i put them? which folder?

and where to do i paste the code in the theme.php? top, bottom, between where?

thx in advance.........
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 02:16:51 am
Wayne Dude... lay off the caffeine!

1. Download the LightBox JS files from the above link

2. Copy the js & css folders to your theme folder

3. Copy the images from the LightBox JS image folder to your theme/images folder

4. Add this code to the head section of your template.html file and change the directories to match yours
Code: [Select]
<link rel="stylesheet" href="themes/your_theme_folder/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/your_theme_folder/js/prototype.js"></script>
<script type="text/javascript" src="themes/your_theme_folder/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/your_theme_folder/js/lightbox.js"></script>

5. Paste this code before the ?> at the end of your theme.php file
Code: [Select]
// 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']) > 4) array_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']==0 || $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'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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['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);
}

6. Upload

7. Relax!

[EDIT] - see below for better installation details.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 02:31:23 pm
LMAO..... ;D ;D  i am relaxed, very relaxed in fact .... maybe it was the way i typed the post???, did it look like a stressful post???

anyhow, thx for a more detailed way of how to do it. i will give it a go in a mo and let you know how i get on.

cheers Gizmo 
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 02:43:22 pm
GIZMO! worked wonderfully....thankyou kindly for your help, and more detailed how to.
 ;)

Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 04:58:54 pm
Great. :D  Glad to have another happy user onboard.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: David9 on September 27, 2006, 05:51:49 pm
Hello!

I tried to install it in my CG but the image stays very big.

How can i reduce the size of it?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 06:25:45 pm
thx Gizmo...  :D

the images arent showing though!  The close and loading ones.

i have tried editing the lightbox.js with that showed:

Code: [Select]
var fileLoadingImage = "/images/loading.gif";
var fileBottomNavCloseImage = "/images/closelabel.gif";

and replaced with

Code: [Select]
var fileLoadingImage = "photos/themes/mac_ox_x/images/loading.gif";
var fileBottomNavCloseImage = "photos/themes/mac_ox_x/images/closelabel.gif";

but didnt make any difference?

any ideas,

thx again!  a happy poster  ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on September 27, 2006, 08:00:37 pm
the images arent showing though!  The close and loading ones.

You need to put the lightbox images in your   ...gallery root/images/ folder.

Another nice one Gizmo !


Just a little tid-bit...

If you want to close the image by just a "click to close", find in lightbox.js:

Code: [Select]
var objLightbox = document.createElement("div");
objLightbox.setAttribute('id','lightbox');
objLightbox.style.display = 'none';
// Add the next line
objLightbox.onclick = function() { myLightbox.end(); return false; }

Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 08:09:31 pm
cool thx......  ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 10:26:53 pm
OK... in my original post I said to follow the instructions for installing the LightBox JS scripts and now I remember why. I didn't want to have to write out all the details but seems I better do so since I left a few items out last night. So below are all the details to completely install this script. It's easy so don't let this put you off from trying it.

Step 1. Backup your theme folder!

Step 2. Create a folder called lightbox in your theme folder.

Step 3. Download the LightBox JS v2.02 scripts from http://www.huddletogether.com/projects/lightbox2/ (http://www.huddletogether.com/projects/lightbox2/).

Step 4. Extract the css, images & js folders into the newly created lightbox folder.

Step 5. In the js folder, edit lightbox.js to point to the correct image folder path for the loading and closelabe images.
Find
Code: [Select]
var fileLoadingImage = "images/loading.gif";
var fileBottomNavCloseImage = "images/closelabel.gif";

Change to
Code: [Select]
var fileLoadingImage = "themes/your_theme/lightbox/images/loading.gif";
var fileBottomNavCloseImage = "themes/your_theme/lightbox/images/closelabel.gif";

Step 6. Add this code to the head section of your template.html file and change the directories to match yours
Code: [Select]
<link rel="stylesheet" href="themes/your_theme_folder/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/lightbox.js"></script>

Step 7. Paste this code before the ?> at the end of your theme.php file
Code: [Select]
// 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']) > 4) array_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']==0 || $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'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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['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);
}

Step 8. Upload

This should do it.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 10:37:41 pm
Wayne,

You need to do step 5 above to change the image path of the loading and close images in the lightbox.js file. Sorry, I left that out last night. Chaulking it up to a lack of beer!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 27, 2006, 10:41:56 pm
yep that explains it simply enough!... i would have been able to do that 1st time round.... nice work again!!!

there is another lil thing that i would like to adjust:

when i open a larger image (with lightbox fx), its a lil low.. and i have to scroll down (about 30px) to see the whole image and to see the close button. but the larger image with white border fits fully in the screen area.

so i was wondering if theres an anchor point that i could adjust, so that i could it fits exactly??

is this possible? if so could you direct me to the right place of coding to adjust

many thx again   ;D

a happy user
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 11:26:34 pm
@David9
Quote
I tried to install it in my CG but the image stays very big.

How can i reduce the size of it?

Attached is a new lightbox.js file I found on this post - http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0 (http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0) that seems to do what you want. I only briefly tested it so it's up to you to make sure it works 100% but I think it's still beta. Follow Step 5 above to configure the image path for the loading and close image.

Also. check out the above link for other features. The file I've attached here is called lightbox_s.js in the zip file from the above link. I changed the name to make the installations the same as my previous post.

@Wayne, either try the attached script for fitting larger images in the browser window or take a look at this code in the lightbox.js file.
Code: [Select]
    var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 15);

Changing it to this raises the popup
Code: [Select]
    var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 30);

I'll leave it to you to find the best fit for your needs.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 27, 2006, 11:37:25 pm
Hey rphMedia,

Thanks and nice little patch there to allow closing on clicking the image. I was using a different fix but this one is only a single line change. Always better to change only one line when possible. ;)

Cheers,

Gizmo

Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 28, 2006, 12:45:03 am
thx Gizmo...that worked fine  ;D

Code: [Select]
var lightboxTop = arrayPageScroll[1] + (arrayPageSize[3] / 40); centered at 40!

i only put the css and js files in the (new) lightbox folder (4got 2move images folder), and the images for close/loading are working fine !..... just 4t id mention it ::)

hey rphMedia, that little line was sweet 4me 2...thx!    do you know how to set the alt= saying: click this photo to close window, like in original popup window.... any ideas?? code would be sweet.

thx 4ya time guys..... next time u go 2ya local pub say ya drinks is on wayne (hehe)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: -|wayne|- on September 28, 2006, 12:50:01 am
oops !!  :-\

Gizmo i 4got to ask if you might be able to help on this issue

http://forum.coppermine-gallery.net/index.php?topic=36660.0 (http://forum.coppermine-gallery.net/index.php?topic=36660.0)

'as u seem 2b sum1 that knows whats wot....'

thx in advance  ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 28, 2006, 02:18:15 am
Wayne, one issue per post. Start a new post or check out this - http://forum.coppermine-gallery.net/index.php?topic=18635.msg86000#msg86000 (http://forum.coppermine-gallery.net/index.php?topic=18635.msg86000#msg86000).
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on September 28, 2006, 04:34:52 pm
Hey rphMedia,

Thanks and nice little patch there to allow closing on clicking the image. I was using a different fix but this one is only a single line change. Always better to change only one line when possible. ;)

Cheers,

Gizmo



NP, I actually found that at the discussion forum you referenced in the earlier post.  David9 PM"d me and I gave him the thread you referenced as well. 

PS, understand that the resize modified lightbox.js - Firefox ignores it.  Just info.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on September 28, 2006, 10:00:46 pm
You're definitely going to want this mod after you see what IE7 does to the popup of the intermediate (attached).  The new browser is nice in some ways, but intrusive in others.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on September 29, 2006, 12:17:33 am
Hey Ron,

I hate IE... just wish people would stop using it and move to anything else (I prefer FF myself).

Quote
PS, understand that the resize modified lightbox.js - Firefox ignores it.  Just info.
I have the resize script running with the "close on image click" and it's works fine on FF. What it won't do is resize the popup if I resize the browser window once it's up.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on September 29, 2006, 09:08:20 am
I have the resize script running with the "close on image click" and it's works fine on FF. What it won't do is resize the popup if I resize the browser window once it's up.

Oh yeah, I know that the "close on image click" works ;)

The resize portion doesn't. If the original image is 1024x768, when I click the intermediate with the new lightbox.js script in Firefox, the image is not scaled to fit at all.     
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on October 03, 2006, 02:51:28 pm
Hey Gizmo, just a heads up.  You have a typo in your first post modifying theme.php -

this line:

Code: [Select]
$pic_html  = '<object id="'.$player['id'].'" '.$player['classid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
should be   (( clsid )):

Code: [Select]
$pic_html  = '<object id="'.$player['id'].'" '.$player['clsid'].$player['codebase'].$player['mime'].$image_size['whole'].'>';
Symptoms: Flash Files in your gallery are inoperable in Firefox ! (which, I didn't know that FF reads the '<object>' tag  ???

Spent about 3 hours figuring this one out :)





Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on October 03, 2006, 04:05:24 pm
Oppss... I used sample>theme.php version 1.4.4 to grab that code. I just downloaded the latest sample theme folder and it's correct as you state. I have too 3 computers that I work from so it's time to go and make sure they all have the latest Coppermine files on them. Sorry.... I owe you a beer or two.  :P
Title: Re: LightBox JS for Fullsize Popup Image
Post by: ppeter on October 21, 2006, 09:09:38 pm
hi!

LightBox JS is not working in the k2 theme!

regards
peter
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Joachim Müller on October 22, 2006, 12:57:00 am
Fine. Great report. Did you actually bother to read th thread you're replying to? If not, do so now. The mod is experimental and known not to work with all themes.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on October 22, 2006, 03:45:55 am
Sorry to hear you're having problems but following the instructions I've posted, I was able to get LightBox running with K2 in 5 minutes. If you'd like help then you'll have to ask... a bit more nice this time!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Sami on October 22, 2006, 06:54:33 am
Maybe we could create a plugin for this one too ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on October 22, 2006, 12:44:44 pm
I was hoping you'd ask so please do. :D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Sami on October 22, 2006, 01:31:04 pm
Okey , let see what can do ... ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: prhodan on November 02, 2006, 05:42:49 am
hello

do you know of any bugs with the theme eyeball ?
I have installed everything, but if I click the pic it pops up in a normal IE screen, when using IE 7
It pops up in a new screen also when using FF 1.5

When I click "home" the links that use to be there are now gone. Links like "upload pictures"

I used winmerge to add your codes to theme.php.
I have "filetypes" plugin installed and I have a hack in the theme.php for using a flashplayer (flv).

Thank you!

here follows the //Displays a picture:

Code: [Select]
// 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']) > 4) array_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']==0 || $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'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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';
        }

        if ($mime_content['content']=='movie' && $mime_content['extension']=='flv') {
    $flv =  $CONFIG['fullpath'] . $CURRENT_PIC_DATA['filepath'] . $CURRENT_PIC_DATA['filename'];
    $pic_html  = "<object type=\"application/x-shockwave-flash\" width=\"320\" height=\"260\" wmode=\"transparent\" data=\"flvplayer.swf?file=$flv?autoStart=false\">";
    $pic_html .= "<param name=\"movie\" value=\"flvplayer.swf?file=$flv?autoStart=false\" />";
    $pic_html .= "<param name=\"wmode\" value=\"transparent\" />";
            $pic_html .= "</object><br />\n";

        } else {

        $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);
}

[Edit by Sami]: put php under code block
Title: Re: LightBox JS for Fullsize Popup Image
Post by: prhodan on November 02, 2006, 12:57:17 pm
I didnt realise the code thingy.

Okay I found out what was "wrong".
Apparently in the template.html it is important in what sequence you paste the 4 lines in.
First I had the 4 lines you have to paste in below the 3 last lines you see below. and the lightbox didnt work.
Then i pasted the 4 lines above the last 3 lines, like you see below, and lightbox functions fine.

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/eyeball/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/eyeball/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/eyeball/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/eyeball/lightbox/js/lightbox.js"></script>

<link rel="stylesheet" href="themes/eyeball/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Shelia on November 06, 2006, 03:05:15 am
I have Lightbox working on my site using the information I found here, but it will not process .gif's. I am using the andreas09 them and 1.4.10. When I include <meta http-equiv="imagetoolbar" content="no"> nothing works using Lightbox. I realize that "rightclick" protection" is useless but visitors uploading pictures ask that I use any method to slow down the image stealing. Is there any part of the lightbox.js code or my template code that deals with the image extention or image size or am I just not aware of limitations of Coppermine using Lightbox?

Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on November 06, 2006, 01:02:42 pm
I got it to work first time using the below header setup and with .gif's. Also, <meta http-equiv="imagetoolbar" content="no"> only disables the IE image toolbar that pops up when hovering over an image and does nothing for "right clicking".

Code: [Select]
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta name="mssmarttagspreventparsing" content="true" />
<meta http-equiv="imagetoolbar" content="no">
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/andreas09_lightbox/cpg_style.css" type="text/css" />
<link rel="stylesheet" href="themes/andreas09_lightbox/wp_style.css" type="text/css" />

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

<script type="text/javascript" src="scripts.js"></script> 
<script type="text/javascript" src="themes/andreas09_lightbox/changeStyle.js"></script>

</head>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: arlon on November 07, 2006, 12:27:40 am
Everything seems to work fine, except the image on the "displayimage", which suddenly became "normal sized" instead of the intermediate.. really strange

EXAMPLE PAGE (http://www.agfx.eu/_/displayimage.php?album=3&pos=2)

I followed all the instructions, now I'm stuck (not being a programmer at all, sorry)

Any help would be sincerely appreciated
Title: Re: LightBox JS for Fullsize Popup Image
Post by: arlon on November 07, 2006, 12:35:40 am
sorry, I forgot to say that my version is "modded by stramm" .. maybe this is what messes it up? :(
Title: Re: LightBox JS for Fullsize Popup Image
Post by: aldonc on November 12, 2006, 06:04:48 am
HI,

I have this working and love it. In the popup, the title of the picture at the bottom is either transparent or white (on the white border/background). I can highlight it and see it in reverse text but it is not visible otherwise. THe close button and label are there and fine. I got this working fine on one theme but then applied it to the eyeball theme which is my normal one and the title disappeared. I've checked and rechecked the mods and even created a second one from scratch to see if it was my fingers but same results.

Any direction on where to look for this?

thanks,
aldon
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on November 14, 2006, 12:52:13 pm
Find in your style.css file
Code: [Select]
#imageData #caption{ font-weight: bold; }
Add a color property to the text to meet your needs such as
Code: [Select]
#imageData #caption{ font-weight: bold; color: red;}
Title: Re: LightBox JS for Fullsize Popup Image
Post by: alecc on November 15, 2006, 08:21:45 pm
Is there a big problem to implement this for coppermine ver.1.3.4?
(i know i should update to 1.4.10, but mine it's hevely modified and the only good bridged verson for E107)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Joachim Müller on November 16, 2006, 07:02:52 am

Your posting (and subsequently mine as well) is very off-topic. Please don't discuss your issue further on this thread. As your version is outdated and unsupported, you're only allowed to ask questions on upgrading (on the board "cpg1.4 upgrading (http://forum.coppermine-gallery.net/index.php?board=59.0)"), nothing else.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: tiagobr on December 15, 2006, 07:20:00 am
thanks everyone for all infos!!!
I really liked this lightbox!!! works perfect !!!!

I have never asked anything, always looking, searching, and trying until I can get what I want, but tonight after hours and hours trying, I couldnt figure out!

I 'd like to ask how could I use this lightbox and still using the "overlay (transparent gif overlay)" together! Is that possible? Im sure it's possible, but I have no idea anymore!

I was using this "transparent gif overlay" ( http://forum.coppermine-gallery.net/index.php?topic=33782.0 ) and now, with the lightbox, the intermediate picture works perfect with the gif overlay (if try to save will get the overlay.gif) but after clicking to get the normal/original/big photo with lightbox the overlay (gif) does not work (I can save the file  **.jpg)!

I know about disabling the right click but some old IE have the option with the mouse to save it after leaving the mouse over the photo for a few seconds... you know!?

soooo.... How can I change, the lightbox.js I believe, to put my overlay.gif to work ?!

I hope you guys understand and can help me!!!

thank you very much even for reading this!!! take care!!!

Tiago
Title: Re: LightBox JS for Fullsize Popup Image
Post by: tiagobr on December 16, 2006, 09:58:45 pm
couldn't delete or edit my previous post ,,,
Already got what I needed... thx !!!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: publishpictures on December 24, 2006, 06:35:23 pm

Is it supposed to be for Firefox only? It doesn't work (on my website) when I use IE7.

to check: www.PublishPictures.com
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Garibaldi on December 25, 2006, 12:01:29 am
I was doing some thinking recently and I think on some of my bigger images some users may not know how to close the ajax window because the image is large. Could you modify the code so that if they simply click on the image it will close the lightbox and go back to the regular page?
Thanks
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on December 28, 2006, 02:43:11 pm
@Garibaldi,
Quote
Could you modify the code so that if they simply click on the image it will close the lightbox and go back to the regular page?

Reading through this thread I found your answer:
http://forum.coppermine-gallery.net/index.php?topic=35539.msg172606#msg172606 (http://forum.coppermine-gallery.net/index.php?topic=35539.msg172606#msg172606)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Garibaldi on December 29, 2006, 04:24:54 am
Thanks Gizmo!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rterburg on January 04, 2007, 08:57:55 pm
This hack works fine with the project_vii theme. Thanks for the great hack.

Regards,

Ron ter Burg
http://www.terburg.net
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Bas Meelker on January 05, 2007, 11:44:23 am
Great feature. Thanks! It works great on my site as well!

Bas Meelker
www.basmeelker.com

Title: Re: LightBox JS for Fullsize Popup Image
Post by: MadLine on January 09, 2007, 10:09:00 pm
Your instruction even is simple in English.

THX Gizmo

German instruction to

http://www.flashtoflash.de/blog/?p=55 (http://www.flashtoflash.de/blog/?p=55)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Xanders on January 14, 2007, 11:29:39 pm
Good evening,

copied and pasted the code for lightbox exactly as you wrote.

When i want to use the theme it gives me the following message:

Fatal error: Cannot redeclare theme_html_picture() (previously declared in /data/members/paid/k/o/koolephotography.com/htdocs/www/coppermine1410/themes/andreas09/theme.php:187) in /data/members/paid/k/o/koolephotography.com/htdocs/www/coppermine1410/themes/andreas09/theme.php on line 376

Sometimes I also get only blank pages when trying to combine the lightbox with the andreas09 theme.

I've tried it with the connections theme and had no problems there.

What can I be doing wrong that it is not working and that I get these messages.

Thanx
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Gizmo on January 14, 2007, 11:44:37 pm
@Xanders

Check to make sure that theme_html_picture() function doesn't appear twice in your theme.php file. If it does, you'll have to apply the mod to the original function and I believe that it's already present.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Xanders on January 15, 2007, 12:24:58 pm
Thanx,

indeed had it twice in the code

works fine now
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nielsk on January 15, 2007, 09:11:13 pm
Hi Gizmo,
This feature works fine with the Hardwired theme!
I only had to add the code below to the displayimage.php file.
<link rel="stylesheet" href="themes/andreas09_lightbox/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/andreas09_lightbox/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/andreas09_lightbox/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/andreas09_lightbox/lightbox/js/lightbox.js"></script>

Niels
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rphMedia on January 15, 2007, 09:40:50 pm
You should really add it to the template.html file as per his instruction.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 15, 2007, 11:20:31 pm
Hi, i've been messing around with this neat future.
I wanted to be able to view all the images in the selected album with the LighBox addon,
so after a bit of coding i came up with the solution.

In stead of following the steps you saw before, take these changed steps: (changes are only made in the CSS and theme.php file --> step 6 and 8)

Step 1. Backup your theme folder!

Step 2. Create a folder called lightbox in your theme folder.

Step 3. Download the LightBox JS v2.02 scripts from http://www.huddletogether.com/projects/lightbox2/ (http://www.huddletogether.com/projects/lightbox2/).

Step 4. Extract the css, images & js folders into the newly created lightbox folder.

Step 5. In the js folder, edit lightbox.js to point to the correct image folder path for the loading and closelabe images.
Find
Code: [Select]
var fileLoadingImage = "images/loading.gif";
var fileBottomNavCloseImage = "images/closelabel.gif";

Change to
Code: [Select]
var fileLoadingImage = "themes/your_theme/lightbox/images/loading.gif";
var fileBottomNavCloseImage = "themes/your_theme/lightbox/images/closelabel.gif";

Step 6. Be sure to link the "next.gif" and "previous.gif" correctly in the CSS!!!!
           With the CSS you have to link it like the following example:
           If the images are in the same folder of the css, then put in
Code: [Select]
#prevLink:hover, #prevLink:visited:hover { background: url(prevlabel.gif) left 15% no-repeat; }
#nextLink:hover, #nextLink:visited:hover { background: url(nextlabel.gif) right 15% no-repeat; }


Step 7. Add this code to the head section of your template.html file and change the directories to match yours
Code: [Select]
<link rel="stylesheet" href="themes/your_theme_folder/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/your_theme_folder/lightbox/js/lightbox.js"></script>

Step 8. Paste this code before the ?> at the end of your theme.php file
Code: [Select]
// 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']) > 4) array_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']==0 || $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)
{
$i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
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, 'fullsize');
}
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($picture['pid'] == $pid) {
$picList .= "<a href=\"$picture_url\" rel=\"lightbox[list]\" title=\"$pic_title\">";
            $picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"Click to view full size image\" /><br />";
            $picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}
//End of second part
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

I've put in a very ugly
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
to show what changes where made (there are 2 blocks that have been changed)

Step 9. Upload


There are still 2 bugs I can't get rid of:

I hope i make someone happy with this feature.
Good luck and if you find the solution to the problems, please post them here.

SaWey
Title: Re: LightBox JS for Fullsize Popup Image
Post by: dprundle on January 26, 2007, 09:10:38 pm
Thanks mate works perfect.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 27, 2007, 04:12:06 pm
Nice first post SaWey, thanks for contributing!  ;)


Your modification makes the effect that images are shown in original size as single image instead of the "_normal" size in the "regular displayimage" -

any idea how to fix that ?!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 27, 2007, 05:06:32 pm
Normally it is configured like the original popup of coppermine.

You can, if you want, adjust this at the bottom of the script
in the following function
Code: [Select]
function lightbox_list($picId)
where it says:

Code: [Select]
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'fullsize');
}

And make it like this:
Code: [Select]
$picture_url = get_pic_url($picture, 'normal');

I hope that is what you meant.
Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 27, 2007, 06:07:59 pm
Hey SaWey,

thanks for your quick reply.

I already tried this: then the image in the CPG "display single image" is displayed in "_normal", just as it should by default, but also in the lightbox popup.

Without changing, both are displayed in full size.

How can we handle it, that an image in the CPG "display single image" is displayed in "_normal", but in full size in the lightbox popup? ...

With kind regards
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 27, 2007, 06:36:00 pm
To that, there is a simple solution by just adding a variable like $picture_url_fullsize like i did in the following code:

Code: [Select]
function lightbox_list($picId)
{
$i = 0;
$pid = $picId;
$pic_data = get_pic_data($_GET['album'], $pic_count, $album_name, -1, -1, false);
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=\"Klik op de foto om originele grootte te bekijken\" /><br />";
            $picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
$i++;
}
}
return $picList;
}

If you want, you can simply replace the old function with this one.

I hope this time I got it right  :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 27, 2007, 08:30:37 pm
SaWey,

fantastic, absolutely fantastic, that's exactly what I was talking about.

There are still 2 bugs I can't get rid of:
  • The alternate text when hovering over the image won't change so i hard coded it in the alt="" tag

The solution is simple: just add global $lang_display_image_php to the lightbox_list($picId) function

Code: [Select]
function lightbox_list($picId) {
    global $lang_display_image_php;

and change the corresponding line in that function:

Code: [Select]
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
  • When you click on a random image, there is a fault caused by the get_pic_data-function in functions.inc.php
    can someone help??

Please, a developer must fix this  ::)

... 'cause with the new lightbox script contributed by Gizmo (http://forum.coppermine-gallery.net/index.php?topic=35539.msg172643#msg172643) - not only viewing all the images in a selected album, even the lightbox slideshow is possible!

I'm preparing a post to summarize what we have reached so far ...
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 27, 2007, 10:42:14 pm
EDIT: Be aware of problems caused by Step 7 and read the posts below first!

Summary of what we reached so far
- enclosing all contributions of this thread -

(Note: attachment and install-guide based on new lightbox/ slideshow script contributed in the link on http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0 (http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0))

Step 1. Backup your theme folder!

Step 2. If you haven't done already, create a folder called scripts in your gallery root directory.

Step 3. Download slideshow.zip from http://ahavriluk.home.comcast.net/slideshow.zip (http://ahavriluk.home.comcast.net/slideshow.zip).

Step 4. Extract the whole slideshow folder into your (newly created) scripts folder.

Step 5. Download the attached lightbox_s.js.zip and replace scripts/slideshow/js/lightbox_s.js with the included file.

Step 6. Add this code to the head section of your template.html file:

Code: [Select]
<link rel="stylesheet" href="scripts/slideshow/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/slideshow/js/prototype.js"></script>
<script type="text/javascript" src="scripts/slideshow/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="scripts/slideshow/js/lightbox_s.js"></script>

Step 7. Paste this code before the ?> at the end of your theme.php file:

Code: [Select]
// 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']) > 4) array_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']==0 || $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, -1, false);
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
#################################################

Step 8. Upload.

Step 9. Relax  8)

Step 10. Pay attention/ developers request:

  • When you click on a random image, there is a fault caused by the get_pic_data-function in functions.inc.php
    can someone help??

(And a few images lightbox doesn't seem to like, they are simply not loaded - i can't specify the problem exactly atm...)

If someone could fix that, the world would be perfect ...
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nibbler on January 27, 2007, 11:38:55 pm
I don't know if this is a bug or not, doesn't cause problems on its own.

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";
change to

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";
Also, $CONFIG needs to be global in the lightbox_list function.

Code: [Select]
function lightbox_list($picId) {
    global $lang_display_image_php, $CONFIG;

This mod will not work well on large albums, bear that in mind.

Another also is this code

Code: [Select]
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'normal');
}

 ??? :( ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 28, 2007, 12:01:42 am
... another problem:

Static links (like http://www.my_gallery.net/displayimage.php?pos=-411) don't work ("Error: The selected album/file does not exist !") while they do with Gizmo's contribution?

Until these problems are solved, the original mod by Gizmo is to prefer ...

That's kind of sad 'cause viewing all the images in a selected album and the lightbox slideshow would be great features in my opinion :'(
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 28, 2007, 12:08:43 am
Hey Nibbler,

First of all, thank you for taking the notice.

For the big albums, tomorow i'll look into the code to make it possible
to set a limit to the amount of pics loaded.

The change of the first code you put above, in which file is this?
And what's the problem with the last part?
Code: [Select]
if ($CONFIG['make_intermediate'] && $condition ) {
$picture_url = get_pic_url($picture, 'normal');
} else {
$picture_url = get_pic_url($picture, 'normal');
}


And for you Mark, i'll also look into that one,
this has to work :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nibbler on January 28, 2007, 12:13:12 am
For the absolute link:

Change

Code: [Select]
$pic_html = lightbox_list($CURRENT_PIC_DATA['pid']);
to

Code: [Select]
$pic_html = lightbox_list($CURRENT_PIC_DATA);
and adjust here

Code: [Select]
function lightbox_list($picId) {
    global $lang_display_image_php, $CONFIG;

$i = 0;
$pid = $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];


$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);

The code in the previous post was a correction to include/functions.inc.php inside get_pic_data().

There is no point in using a conditional statement if both parts are identical.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 28, 2007, 12:57:48 am
Thanks Nibbler, that actually solved the problem with static links.

There is no point in using a conditional statement if both parts are identical

... just the heat i guess ...  ::)

And for you Mark, i'll also look into that one, this has to work :)

We are on our way!
Thanks & good night for today
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 28, 2007, 03:03:31 pm
I made the changes so it is possible to set a max amount of pics shown in the slideshow.
You have to update the whole 'lightbox_list' function as following:

Code: [Select]
#################################################
 //Second part of lightbox update
 
function lightbox_list($picId) {
################################################
//Set max number of images
$max = 10; //(-1 for all pics in album)
################################################
    global $lang_display_image_php, $CONFIG;
$i = 0;
$pid = $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);
$imax = 0; //counter
$max = $max/2;
foreach ($pic_data as $picture){
if ($picture['pid'] == $pid) {
//the number of the picture in  order
$picnumber = $imax;
}
$imax++;
}
//Check beginning and ending of album
if(! ($max == ((-1)/2))){
if ($imax > $max){
if ($picnumber < $max || $picnumber == 0){
$down = 0;
$up = 0 + ($max*2);
}elseif (($picnumber + $max) > $imax){
$down = $imax - ($max*2);
$up = $imax;
}else{
$down = $picnumber - $max;
$up = $picnumber + $max;
}
}else{
$down = 0;
$up = $imax;
}
}else{
$down = 0;
$up = $imax;
}

foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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, 'fullsize');
}
$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
#################################################

I think this solves all the problems.
Please test it.... (I haven't found any bugs yet)

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 28, 2007, 08:13:55 pm
Seems to work fine. Good work so far.

If we only could fix the "random image" problem ...  ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nibbler on January 28, 2007, 08:43:13 pm
I don't know if this is a bug or not, doesn't cause problems on its own.

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";
change to

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";

That fixes it for me, not you?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 28, 2007, 09:12:25 pm
Sorry, I don't get that -

this results in permanent "critical error while processing a database query"?


ooops - I didn't follow your instruction properly - seems we finally got it  ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 28, 2007, 10:11:30 pm
Summary of how to get the Lightbox thingy working:
- enclosing all contributions of this thread -

(Note: attachment and install-guide based on new lightbox/ slideshow script contributed in the link on http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0 (http://www.huddletogether.com/forum/comments.php?DiscussionID=307&page=1#Item_0))

Step 1. Backup your theme folder!

Step 2. If you haven't done already, create a folder called scripts in your gallery root directory.

Step 3. Download slideshow.zip from http://ahavriluk.home.comcast.net/slideshow.zip (http://ahavriluk.home.comcast.net/slideshow.zip).

Step 4. Extract the whole slideshow folder into your (newly created) scripts folder.

Step 5. Download the attached lightbox_s.js.zip and replace scripts/slideshow/js/lightbox_s.js with the included file.

Step 6. Add this code to the head section of your template.html file:

Code: [Select]
<link rel="stylesheet" href="scripts/slideshow/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/slideshow/js/prototype.js"></script>
<script type="text/javascript" src="scripts/slideshow/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="scripts/slideshow/js/lightbox_s.js"></script>

Step 7. Paste this code before the ?> at the end of your theme.php file:

Code: [Select]
// 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']) > 4) array_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']==0 || $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) {
################################################
//Set max number of images
$max = 10; //(-1 for all pics in album)
################################################
    global $lang_display_image_php, $CONFIG;
$i = 0;
$pid = $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);
$imax = 0; //counter
$max = $max/2;
foreach ($pic_data as $picture){
if ($picture['pid'] == $pid) {
//the number of the picture in  order
$picnumber = $imax;
}
$imax++;
}
//Check beginning and ending of album
if(! ($max == ((-1)/2))){
if ($imax > $max){
if ($picnumber < $max || $picnumber == 0){
$down = 0;
$up = 0 + ($max*2);
}elseif (($picnumber + $max) > $imax){
$down = $imax - ($max*2);
$up = $imax;
}else{
$down = $picnumber - $max;
$up = $picnumber + $max;
}
}else{
$down = 0;
$up = $imax;
}
}else{
$down = 0;
$up = $imax;
}

foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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, 'fullsize');
}
$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
#################################################

Step 8. Making sure the random images are shown:

I don't know if this is a bug or not, doesn't cause problems on its own.

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";

change to

Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";

Step 9. Upload

Step 10. Relax  8)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: olti on January 30, 2007, 01:22:59 pm
For me it doesnt work, the image opens up in a new page!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Ben.Hahlen on January 30, 2007, 01:27:30 pm
For me the latest code of the theme.php doesn't work either, ie the pictures are not shown. When using the code for theme.php a few posts up, it does work properly, but I'm not enough of a coder to find what the difference is.
Another question I have is in which file the following code
Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() LIMIT $limit2";should be changed to
Code: [Select]
$query = "SELECT $select_columns FROM {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET ORDER BY RAND() $limit";Thanks in advance
Title: Re: LightBox JS for Fullsize Popup Image
Post by: m@rk on January 30, 2007, 01:59:15 pm
The code in the previous post was a correction to include/functions.inc.php inside get_pic_data().
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 30, 2007, 07:20:54 pm
For those where it won't work,
be absolutly sertain the paths to the corresponding files are right!

maybe you put in the code:
Code: [Select]
<script type="text/javascript" src="scripts/slideshow/js/prototype.js"></script>

When actualy you putted the file in:
Code: [Select]
<script type="text/javascript" src="scripts/js/prototype.js"></script>

Check that and if it still won't work, give all info you can so we can help.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Ben.Hahlen on January 30, 2007, 11:58:04 pm
Whoops, missed that one, sorry for that.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: olti on January 31, 2007, 12:55:08 am
I think I know where is the problem for me.

I found this:

Quote
It doesn't work at all. The image opens up in a new page. What's wrong?
    This is commonly caused by a conflict between JS scripts. Check your body tag and look for an onload attribute. Example:
    <body onload="MM_preloadImages(‘/images/menu_on.gif’)…;">
    A quick fix to this problem is to append the initLightbox() to the onload attribute as so:
    <body onload="MM_preloadImages(‘/images/menu_on.gif’)…;initLightbox()">

The problem is I don't know where to put …;initLightbox()">. Which is the file that should be modified?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nibbler on January 31, 2007, 01:10:53 am
Probably your theme's template.html
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 31, 2007, 08:59:27 am
olti,
If that doesn't work, could you post what is between your <head> tags from template.html?
to see what scripts you are loading.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: olti on January 31, 2007, 11:04:45 am
olti,
If that doesn't work, could you post what is between your <head> tags from template.html?
to see what scripts you are loading.

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html dir="{LANG_DIR}">
<head>
<link rel="stylesheet" href="themes/water_drop/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/water_drop/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/water_drop/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/water_drop/lightbox/js/lightbox.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/water_drop/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<!-- $Id: template.html 2688 2005-12-04 03:22:35Z donnoman $ -->
</head>
<body>
  {CUSTOM_HEADER}
  <table width="100%" border="0" cellpadding="20" cellspacing="20">
    <tr>
      <td valign="top" style="border: 1px solid #CCD7E0; background-color: #FFFFFF;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" align="center">
              <br><script type="text/javascript"><!--
google_ad_client = "pub-0961475972968219";
google_alternate_ad_url = "http://www.galeriashqiptare.net/google_adsense_script.html";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "image";
//2007-01-25: GSH, galeriashqiptare.net
google_ad_channel = "9956356473+0005703492";
google_color_border = "DD1414";
google_color_bg = "FFFFFF";
google_color_link = "DD1414";
google_color_text = "000000";
google_color_url = "C0C0C0";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br>
              {SYS_MENU}<br />{SUB_MENU}
            </td>
          </tr>
        </table>
        <img src="images/spacer.gif" width="1" height="15" alt="" />
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td valign="top">
              {ADMIN_MENU}
              {GALLERY}
              <div style="text-align:center;">
              <div>
<script type="text/javascript"><!--
google_ad_client = "pub-0961475972968219";
google_alternate_ad_url = "http://www.galeriashqiptare.net/google_adsense_script.html";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "image";
//2007-01-25: GSH, galeriashqiptare.net
google_ad_channel = "9956356473+0005703492";
google_color_border = "DD1414";
google_color_bg = "FFFFFF";
google_color_link = "DD1414";
google_color_text = "000000";
google_color_url = "C0C0C0";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br><br>

<center><font face="Arial" style="font-size: 9pt"><a href="http://www.galeriashqiptare.net/cms/index.php?option=com_content&task=view&id=12&Itemid=35">
<font color="#C0C0C0">Klauzole</font></a><font color="#C0C0C0"> | </font> <a href="http://www.galeriashqiptare.net/cms/index.php?option=com_content&task=view&id=13&Itemid=36">
<font color="#C0C0C0">Kush jemi ne</font></a><font color="#C0C0C0"> | </font> <a href="http://www.galeriashqiptare.net/cms/index.php?option=com_contact&Itemid=33">
<font color="#C0C0C0">Kontakt</font></a><font color="#C0C0C0"> | </font> <a href="http://www.galeriashqiptare.net/cms/index.php?option=com_joomlaboard&Itemid=42">
<font color="#C0C0C0">Forum</font></a><font color="#C0C0C0"> | </font> <a href="http://www.galeriashqiptare.net/cms/index.php?option=com_joomlaboard&Itemid=42&func=showcat&catid=2">
<font color="#C0C0C0">Ndihme</font></a><font color="#C0C0C0"> | </font> <br> &#169; Te gjitha te drejtat e materialeve te publikuara i takojne autoreve perkates.</font>
<br><font color="#C0C0C0">
</font>
<font face="Arial" style="font-size: 7pt">
<a href="http://www.galeriashqiptare.net"><font color="#C0C0C0">Albanian Photography - Art - Culture - History - Maps - Sport - Fashion - Beauty</font></a><font color="#C0C0C0"> |
</font> <a href="http://coppermine.sourceforge.net/">
<font color="#C0C0C0">Powered by Coppermine Photo Gallery</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.zeriyt.com/index.php?option=com_smf&forumi=politik&Itemid=43"><font color="#C0C0C0">Forumi Politik</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.zeriyt.com/"><font color="#C0C0C0">Forumi Shkencor
</font> </a><font color="#C0C0C0">&nbsp;| </font> <a href="http://www.zeriyt.com/">
<font color="#C0C0C0">Forumi
Kulturor</font></a><font color="#C0C0C0"> | </font> <a href="http://www.zeriyt.com/">
<font color="#C0C0C0">Forumi Teologjik</font></a><font color="#C0C0C0"> | </font> <a href="http://www.zeriyt.com/">
<font color="#C0C0C0">Forumi Letrar</font></a><font color="#C0C0C0">
| </font> <a href="http://www.zeriyt.com/"><font color="#C0C0C0">Komuniteti Zeri YT!</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.arnavutum.com/"><font color="#C0C0C0">Arnavutum.Com</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.albaniafoto.com/"><font color="#C0C0C0">AlbaniaFoto</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.Alblinux.com/"><font color="#C0C0C0">AlbLinux</font></a><font color="#C0C0C0"> |
</font> <a href="http://www.konsumerizem101.com/"><font color="#C0C0C0">Konsumerizem101</font></a><font color="#C0C0C0"> 
| </font> <a href="http://www.kaltersiashqiptare.com/"><font color="#C0C0C0">Kaltersia Shqiptare</font></a><font color="#C0C0C0"> 
| </font><a href="http://www.radioiliria.com/"><font color="#C0C0C0">Radio Iliria</font></a><font color="#C0C0C0"> 
| </font><a href="http://faretop.com/"><font color="#C0C0C0">Njoftime Interesante</font></a><font color="#C0C0C0"> 
| </font> </font><br>

</center>
 

{LANGUAGE_SELECT_FLAGS}<br />
  {THEME_SELECT_LIST}{LANGUAGE_SELECT_LIST}
  </div>
  </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  {CUSTOM_FOOTER}{VANITY}
</body>
</html>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: olti on January 31, 2007, 11:05:40 am
Of using the first version of the  hack, from Gizmo.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on January 31, 2007, 12:52:05 pm
I think your problem is you don't add the "lightbox_s.js" script.
It is highly possible that it won't work without that one.

Follow the steps as described in the last explanation and then it will have to work.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: olti on January 31, 2007, 03:45:59 pm
No, it don't! I tried the last version too, but without results.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: iserah on February 21, 2007, 02:20:46 am
Goodday,

well to make a long story short im using Coppermine v1.4.10 and i bridged it using this (http://forum.coppermine-gallery.net/index.php?topic=36151.0) script/mod. Now i have tryed allmost all lightbox scripts posted here on the forums, but none of them works  ???

here are the scripts after adding the scripts provided on this threath:

my theme.php
Code: [Select]
<?php
/*************************
Coppermine Photo Gallery
e107 integrated theme
************************
This theme is based on original 'Classic' theme from Coppermine.
v1.0

Coppermine version: 1.4.9
$Source$
$Author: v3 <v3@sonic-world.ru>$
$Revision: 1.02 $
$Date: 2006-09-28 04:48:42 +0400 $
**********************************************/

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

// get tablestyle
global $CONFIG;

if (!
defined('CPG_E107_CLASS_INCLUDED')) {
header("Location: ".$_SERVER['PHP_SELF']."?theme=classic");
die;
}

ob_start();
tablestyle("{{{CAPTION}}}""{{{TEXT}}}");
$_e107_table =
ob_get_clean();
define ("e_PAGETITLE"$CONFIG['gallery_name']);

$_e107_table_start substr ($_e107_table0strpos($_e107_table"{{{TEXT}}}"));
$_e107_table_end substr ($_e107_tablestrpos($_e107_table"{{{TEXT}}}") + 10);

// table_stack
$v3_table_stack = array();

$v3v3 1;

function 
pageheader($section$meta '')
{
global $sql$tp$HEADER;
 global $CONFIG$THEME_DIR$USER;
global $_e107_table_start$_e107_table_end;

$eplug_css "themes/" . ($USER['theme'] ? $USER['theme'] : $CONFIG['theme']) . "/style.css";
$eplug_js "scripts.js";

if (!is_object($sql)) $sql = new db;
require_once(HEADERF);

echo str_replace("{{{CAPTION}}}"$CONFIG['gallery_name'], $_e107_table_start);
/* default */

    global 
$template_header$lang_charset$lang_text_dir$lang_index_php$lang_main_menu;
    

    
$custom_header cpg_get_custom_include($CONFIG['custom_header_path']);

    
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    
user_save_profile();

    
$template_vars = array('{LANG_DIR}' => $lang_text_dir,
        
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' strip_tags(bb_decode($section)),
        
'{CHARSET}' => $CONFIG['charset'] == 'language file' $lang_charset $CONFIG['charset'],
        
'{META}' => $meta,
        
'{GAL_NAME}' => $CONFIG['gallery_name'],
        
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        
      
/*  '{SYS_MENU}' => tablestyle($lang_index_php['welcome'], theme_main_menu('sys_menu')),
        '{SUB_MENU}' => tablestyle($lang_main_menu['alb_list_lnk'], theme_main_menu('sub_menu')),*/
        
        
'{SYS_MENU}' => theme_main_menu('sys_menu'),
        
'{SUB_MENU}' => theme_main_menu('sub_menu'),      
        
        
'{ADMIN_MENU}' => theme_admin_mode_menu(),
        
'{CUSTOM_HEADER}' => $custom_header,
        );

    echo 
template_eval($template_header$template_vars);
}

function 
starttable($width '-1'$title ''$title_colspan '1')
{
    global 
$CONFIG$v3_table_stack$_e107_table_start;

    if (
$width == '-1'$width $CONFIG['picture_table_width'];
    if (
$width == '100%'$width $CONFIG['main_table_width'];
    
$tablestart "";
$bck debug_backtrace();
$func $bck[1]['function'];

$add "";

if (preg_match("#<h2>(.*)<\/h2>#"$title$tmp)) {
$add "<div class='forumheader'>$title</div>";
$title $tmp[1];
}

if ($title) {
$tablestart str_replace ("{{{CAPTION}}}"$title$_e107_table_start);
array_push($v3_table_stacktrue);
} else {
array_push($v3_table_stackfalse);
}

    echo <<<EOT
$tablestart
<!-- Start standard table -->
$add
<table align="center" width="
$width" cellspacing="1" cellpadding="0" class="maintable">
EOT;

}

function 
endtable()
{
global $_e107_table_end$v3_table_stack;

$tableend "";
if (array_pop($v3_table_stack))
$tableend $_e107_table_end;

    echo <<<EOT
</table>
<!-- End standard table -->
$tableend
EOT;
}

function 
pagefooter()
{
    
//global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    
global $USER$USER_DATA$ALBUM_SET$CONFIG$time_start$query_stats$queries;;
    global 
$template_footer;

    
$custom_footer cpg_get_custom_include($CONFIG['custom_footer_path']);

    if (
$CONFIG['debug_mode']==|| ($CONFIG['debug_mode']==&& GALLERY_ADMIN_MODE)) {
    
cpg_debug_output();
    }

    
$template_vars = array(
        
'{CUSTOM_FOOTER}' => $custom_footer,
        
'{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
    );

    echo 
template_eval($template_footer$template_vars);
/* e107 */
global $sql$tp$HEADER;
global $_e107_table_start$_e107_table_end;

echo $_e107_table_end;

require_once(FOOTERF);
    
}
$template_album_admin_menu = <<<EOT
         <div align="center" class="admin_menu_div">
                        <div align="center" valign="middle" class="admin_menu">
                                <a href="delete.php?id={ALBUM_ID}&amp;what=album"  class="adm_menu" onclick="return confirm('{CONFIRM_DELETE}');">{DELETE}</a>
                        </div>
                        <div align="center" valign="middle" class="admin_menu">
                                <a href="modifyalb.php?album={ALBUM_ID}"  class="adm_menu">{MODIFY}</a>
                        </div>
                        <div align="center" valign="middle" class="admin_menu">
                                <a href="editpics.php?album={ALBUM_ID}"  class="adm_menu">{EDIT_PICS}</a>
                        </div>
                        <br clear="all" />
        </div>

EOT;
$template_gallery_admin_menu = <<<EOT

                <div align="center" class="admin_menu_div">
<!-- BEGIN admin_approval -->
                                <div class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></div>
<!-- END admin_approval -->
                                <div class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></div>
                                <div class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></div>
                                <div class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></div>
                                <div class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></div>
                                <div class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></div>
                                <div class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></div>
                                <div class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></div>
                                <br clear="all" />
<!-- BEGIN log_ecards -->
                                <div class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></div>
<!-- END log_ecards -->
                                <div class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></div>
                                <div class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></div>
                                <div class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></div>
                                <div class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></div>
<!-- BEGIN documentation -->
                                <div class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></div>
<!-- END documentation -->
<br clear="all" />
                </div>

EOT;
// HTML template for user admin menu
if (!isset($template_user_admin_menu))  //{THEMES}
$template_user_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
                                <td class="admin_menu"><a href="albmgr.php" title="{ALBMGR_TITLE}">{ALBMGR_LNK}</a></td>
                                <td class="admin_menu"><a href="modifyalb.php" title="{MODIFYALB_TITLE}">{MODIFYALB_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                        </tr>
                </table>
                </div>

EOT;

$template_sys_menu_spacer "";

$template_sys_menu = <<<EOT
<div class="sys_menu">
          {BUTTONS}
          <br clear="all" />
</div>
EOT;

// 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'])) {
        $picfull_url get_pic_url($CURRENT_PIC_DATA'fullsize');
        $pic_title $CURRENT_PIC_DATA['title'];
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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['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);
}
?>

and my template.html
Code: [Select]
<link rel="stylesheet" href="themes/e107/lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="themes/e107/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="themes/e107/lightbox/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/e107/lightbox/js/lightbox.js"></script>
{CUSTOM_HEADER}
<div align="center" class="top_menu_div">
{SYS_MENU}<br clear="all" />{SUB_MENU}
</div>
<br clear="all" />
<img src="images/spacer.gif" width="1" height="15" alt="" />
{ADMIN_MENU}
<br />
{GALLERY}
<div align="center">
{THEME_SELECT_LIST}
{LANGUAGE_SELECT_LIST}
</div>
{CUSTOM_FOOTER}

My dir looks like
Quote
-/e107/
-------theme.php
-------template.html
-------style.css
-------/images/
---------------button_bg.gif
---------------button_bg_anim.gif
---------------tile.gif
-------/lightbox/
----------------index.html
----------------/js/
-------------------effects.js
-------------------lightbox.js
-------------------prototype.js
-------------------scriptaculous.js
----------------/css/
---------------------lightbox.css
----------------/images/
------------------------lots of jpg but not relevant

Please if anyone can help me with this i would be very thankfull ;)

Thanks in advance,

IseraH
www.kaizen.nl.tt
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 21, 2007, 03:17:47 am
When you use your E107 style, it works perfectly!

If the problem is it won't work with all your themes, then you've got to add the lightbox code to every theme.php file (one for each theme).

And because the E107 theme fits your site, you might want to disable the "choose a theme" and default it to E107.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: iserah on February 21, 2007, 04:44:27 am
hey,

huh suddenly it works  ??? :o

im sooo SORRY for taking some of your time  :-X :-[

Greetings,

IseraH
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 23, 2007, 08:18:45 pm
I can't find atached file lightbox_s.js.zip mentioned in step 5. Can someone help me?

Thanks

Nuno Chaleta
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 23, 2007, 08:25:34 pm
You can find it here:
http://forum.coppermine-gallery.net/index.php?topic=35539.msg192915#msg192915 (http://forum.coppermine-gallery.net/index.php?topic=35539.msg192915#msg192915)

Or download it here:
http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=35539.0;attach=6283 (http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=35539.0;attach=6283)


Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 24, 2007, 02:13:46 am
Hi,

Now I see it. Don't know how could I not see it before  :P

Thanks
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Nibbler on February 24, 2007, 02:19:18 am
Attachments are only visible to logged in users. :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 24, 2007, 01:37:38 pm
It is not working for me. I've tried it whit two diferent themes and the same thing happens. When selecting a picture for display it doesn't appear. Only a small square does. I get no error messages. My gallery is version 1.4.3 and I've tried the mac and project VII themes. The site is running on a windows server (wondering if it could be it).

The gallery url is www.chaleta.com/gallery

Thanks for your help
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 24, 2007, 01:54:39 pm
Are you sertain you haven't modified the code that you had to copy/paste in your theme.php file?
Some of your random images are shown the right way.

The problem on most pages is there is nor <img> tag defined to show the pic.

[edit] I think it is a problem in the $CURRENT_PIC_DATA that isn't passed correctly.

you can find it in the following part:
Code: [Select]
#################################################
                    //First part of lightbox update
                    $pic_html = lightbox_list($CURRENT_PIC_DATA);
                    //End of first part
#################################################
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 24, 2007, 03:27:10 pm
Hi,

First off all thanks for your help.

I've pasted the code provided in the last summary off the post in the theme.php file of my current theme. In fact i've tried it in two diferent themes to see if it could be a theme related problem.

Hi have photo of the day by casper hack installed, dont know if it could be a problem for the javascript.

Here is the code i've pasted at the end of my theme.php file just before the ?> tag.
Thanks again.

Code: [Select]

// 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']) > 4) array_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']==0 || $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) {

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

//Set max number of images

$max = 10; //(-1 for all pics in album)

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

    global $lang_display_image_php, $CONFIG;

$i = 0;

$pid = $picId['pid'];

$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];

$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);

$imax = 0; //counter

$max = $max/2;

foreach ($pic_data as $picture){

if ($picture['pid'] == $pid) {

//the number of the picture in  order

$picnumber = $imax;

}

$imax++;

}

//Check beginning and ending of album

if(! ($max == ((-1)/2))){

if ($imax > $max){

if ($picnumber < $max || $picnumber == 0){

$down = 0;

$up = 0 + ($max*2);

}elseif (($picnumber + $max) > $imax){

$down = $imax - ($max*2);

$up = $imax;

}else{

$down = $picnumber - $max;

$up = $picnumber + $max;

}

}else{

$down = 0;

$up = $imax;

}

}else{

$down = 0;

$up = $imax;

}



foreach ($pic_data as $picture) {

if ($i >= $down && $i <= $up){

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, 'fullsize');

}

$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

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

?>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 24, 2007, 04:31:41 pm
in the following part you have something wrong,
Code: [Select]
#################################################
                 //First part of lightbox update
                 $pic_html = lightbox_list($CURRENT_PIC_DATA['pid']);
                 //End of first part
#################################################

Has to be:
Code: [Select]
#################################################
                 //First part of lightbox update
                 $pic_html = lightbox_list($CURRENT_PIC_DATA);
                 //End of first part
#################################################
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 25, 2007, 05:05:55 am
Hi,

I've changed it as you said.

Now it shows the picture put the full image desnt show lightbox.

Slideshow is not lightbox as well?

Thanks

chaleta

Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 25, 2007, 05:21:35 am
Hi,

I've changed it as you said.

Now it shows the picture put the full image desnt show lightbox.

Slideshow is not lightbox as well?

Thanks

chaleta



Spoken to soon.

It is working fine, thanks  ;)

Still there is a problem.

My gallery integreted in joomla doesn't work the same way?

Is there a way to meke it work?

Thanks

Chaleta
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 25, 2007, 02:47:54 pm
I've looked at the source of your Yoomla integrated gallery and may have found the problem.

You might try to add the following in your second body tag:

Code: [Select]
<body onload="initLightbox()">

Make sure it is in the body tag of the Coppermine template, and not in your Yoomla template.
It could be a problem of interfering javascripts.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 25, 2007, 03:35:34 pm
Hi,

Didn't worked. :-[

Thanks

Nuno Chaleta
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 25, 2007, 04:03:11 pm
Hi again,

Are you sure the script references are right, now you have:

Code: [Select]
<script type="text/javascript" src="scripts/slideshow/js/prototype.js"></script>
<script type="text/javascript" src="scripts/slideshow/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="scripts/slideshow/js/lightbox_s.js"></script>

You might try adding gallery/ before those:


Code: [Select]
<script type="text/javascript" src="gallery/scripts/slideshow/js/prototype.js"></script>
<script type="text/javascript" src="gallery/scripts/slideshow/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="gallery/scripts/slideshow/js/lightbox_s.js"></script>

Because your gallery script is in that folder.

Grtz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 25, 2007, 04:53:42 pm
That did the trik

1000 thanks.

Only problem now is that the close button is not showing, but i'm looking into it


Once again thanks for your patience.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on February 25, 2007, 04:57:12 pm
the close button is configured in the css, you also will have to change the path to that image.

I'm glad it's workin :)

Title: Re: LightBox JS for Fullsize Popup Image
Post by: chaleta on February 26, 2007, 12:24:29 am
Hi,

It's done.

After adding gallery to all images link in lightbox_s.js file the lightbox efect is showing ok in joomla.

Thanks for the help

Nuno Chaleta
Title: Re: LightBox JS for Fullsize Popup Image
Post by: aspirin on March 04, 2007, 11:05:19 pm
Helo,

Thank you for the Lightbox hack for Coppermine its work great !

But there is a little Problem in the Slideshow from the Lightbox its only displaying 11 Pictures then it goes again from the front ! Where can i change this  ???

Is this a Bug  :(

My Gallery www.landhausopp.de.vu

Pleas help me
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 04, 2007, 11:10:50 pm
Hi

In the Lightbox code of your 'theme.php' file, there is a setting to set a maximum amount of pictures to show in the slideshow:

Code: [Select]
function lightbox_list($picId) {
################################################
//Set max number of images
$max = 10; //(-1 for all pics in album)
################################################
...

10 actualy means 11, that's a little bug.
Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: aspirin on March 05, 2007, 08:30:31 pm
Thank you very mouch, that´s it  ;D ;D

It´s work perfectly  ;)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: aznole on March 08, 2007, 12:56:16 pm
Greetings all ... this site is great along with cpg ... I am fairly new to cpg and have installed this mod and have it working along side of the Highslide mod without any issues.  I am going for a real user friendly minimal click user experience I have no need for a rating system, comments or details ... in other words less is more.  I have removed the details link from the highslide mod and would like for my users to be able to view each album as a slideshow from a link in the album header ... I wish for this b.c even if I link to cpg's slideshow then when they exit they are back at the intermediate page and I want to avoid that at all costs ... it's just not appealing to me.

What I am wishing to do is totally bypass the cpg slideshow function and create a link in the album title bar to launch the lightbox slide show.  Given my little knowledge of js I was curious if this is possible to do ... I have searched and tinkered with it to no avail ...

Anyone care to point me in the right direction?

TIA

Any suggestions
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 08, 2007, 01:24:21 pm
You could try to call the lightbox function from the album page and instead of returning an image, return a link.

in the following code I've done so:

Code: [Select]
function lightbox_list($picId) {
################################################
//Set max number of images
$max = 10; //(-1 for all pics in album)
################################################
    global $lang_display_image_php, $CONFIG;
$i = 0;
$pid = $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);
$imax = 0; //counter
$max = $max/2;
foreach ($pic_data as $picture){
if ($picture['pid'] == $pid) {
//the number of the picture in  order
$picnumber = $imax;
}
$imax++;
}
//Check beginning and ending of album
if(! ($max == ((-1)/2))){
if ($imax > $max){
if ($picnumber < $max || $picnumber == 0){
$down = 0;
$up = 0 + ($max*2);
}elseif (($picnumber + $max) > $imax){
$down = $imax - ($max*2);
$up = $imax;
}else{
$down = $picnumber - $max;
$up = $picnumber + $max;
}
}else{
$down = 0;
$up = $imax;
}
}else{
$down = 0;
$up = $imax;
}

foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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, 'fullsize');
}
$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 .= "Click here for a slideshow<br />";
$picList .= "</a>\n";
}else{
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";

}
}
$i++;
}
return $picList;
}

You will still have to pass a picId, if you always want to show the complete album,
try to edit the function and pass the albumId ($aid) as here:

Code: [Select]
function lightbox_list($aid) {
################################################
//Set max number of images
$max = 10; //(-1 for all pics in album)
################################################
    global $lang_display_image_php, $CONFIG;
$i = 0;
$pic_data = get_pic_data($aid, $pic_count, $album_name, -1, -1, false);
foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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, 'fullsize');
}
$picture_url_fullsize = get_pic_url($picture, 'fullsize');
$pic_title = ($picture['title'] ? $picture['title'] : strtr(preg_replace("/(.+)\..*?\Z/", "\\1", htmlspecialchars($picture['filename'])), "_", " "));
if ($i == 0) {
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "Click here for a slideshow<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

I don't know if the above code will work, I haven't tested it,
but it should look something like that.

Grz
Title: SlideShow with LightBox JS + Highslide
Post by: Gephri on March 09, 2007, 01:41:50 am
I've installed the Lightbox+Highslide combo codes and love it!  So I went right trying to add the Slideshow mod - but haven't found a working demo and can't seem to get the code to work.
Does anyone have a demo link and does anyone have clean clear code?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: aznole on March 09, 2007, 01:42:46 am
Thanks SaWay ... would I be adding that first part of code to thumbnails.php or to theme.php?  I am assuming it is in theme.php in the  " HTML template for title row of the thumbnail view" section I also assume that would put the the link there up for people to to view the slide show ...

Now the second part of code I am little lost as to where that would go and why?  I assume you are meaning for me to use that in theme.php as above instead  of the first part of code? 

Also if I use the first block of code instead ... what would that result in? 

Thanks again ... I have only been learning php for about 2 months ... I find it rather enjoyable ... off to tinker after I go spray some weeds ...

 
Title: Re: SlideShow with LightBox JS + Highslide
Post by: aznole on March 09, 2007, 01:56:01 am
I've installed the Lightbox+Highslide combo codes and love it!  So I went right trying to add the Slideshow mod - but haven't found a working demo and can't seem to get the code to work.
Does anyone have a demo link and does anyone have clean clear code?

Gephri ... I have got them both working ... I followed a combination of the instructions in this link here: http://forum.coppermine-gallery.net/index.php?topic=39195.0 and in this specific post : http://forum.coppermine-gallery.net/index.php?topic=35539.msg192762#msg192762

Follow marks instructions from above SKIPPING STEP 6 ... do all the rest ... then follow Garibaldi's instructions except you need to make the changes for slideshow as shown below ...

Instead of making the ajax.php as Garibaldi suggests (that is just for Lightbox and doesnt include the slideshow) I made one that looks like this:
Code: [Select]
<html>
<head>
<link rel="stylesheet" href="scripts/slideshow/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/slideshow/js/prototype.js"></script>
<script type="text/javascript" src="scripts/slideshow/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="scripts/slideshow/js/lightbox_s.js"></script>
</head>
<body>
</body>
</html>

Lemme know if you get stuck ....
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 09, 2007, 03:54:42 am
Thanks SaWay ... would I be adding that first part of code to thumbnails.php or to theme.php?  I am assuming it is in theme.php in the  " HTML template for title row of the thumbnail view" section I also assume that would put the the link there up for people to to view the slide show ...

Now the second part of code I am little lost as to where that would go and why?  I assume you are meaning for me to use that in theme.php as above instead  of the first part of code? 

Also if I use the first block of code instead ... what would that result in? 

Thanks again ... I have only been learning php for about 2 months ... I find it rather enjoyable ... off to tinker after I go spray some weeds ...


If I'm right in thinking what you want to do, you should only have to use the second part in your theme.php.
The you should call the function from within the function that creates the album header, where you want to put a link to the slideshow.

The difference between the two blocks:
Block 1 -you have to pass a $picId
          - it will work

Block 2 - You have to pass an $aid (album id)
          - not sure if it will work (haven't tryed it)

The simplest way would be block two.


You also will have to add the following code to your theme.php:

Code: [Select]
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb')
{
    global $CONFIG;
    global $template_thumb_view_title_row,$template_fav_thumb_view_title_row, $lang_thumb_view, $template_tab_display, $template_thumbnail_view, $lang_album_list;

    static $header = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $row_separator = '';
    static $footer = '';
    static $tabs = '';
    static $spacer = '';

    if ($header == '') {
        $thumb_cell = template_extract_block($template_thumbnail_view, 'thumb_cell');
        $tabs = template_extract_block($template_thumbnail_view, 'tabs');
        $header = template_extract_block($template_thumbnail_view, 'header');
        $empty_cell = template_extract_block($template_thumbnail_view, 'empty_cell');
        $row_separator = template_extract_block($template_thumbnail_view, 'row_separator');
        $footer = template_extract_block($template_thumbnail_view, 'footer');
        $spacer = template_extract_block($template_thumbnail_view, 'spacer');
    }

    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;
    $uid_link = (isset($_GET['uid']) && is_numeric($_GET['uid'])) ? '&amp;uid=' . $_GET['uid'] : '';

    $theme_thumb_tab_tmpl = $template_tab_display;

    if ($mode == 'thumb') {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $aid == 'lastalb' ? $lang_album_list['album_on_page'] : $lang_thumb_view['pic_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&amp;page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&amp;page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'thumbnails.php?album=' . $aid . $cat_link . $uid_link . '&amp;page=%d'));
    } else {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&amp;page=%d'));
    }

    $thumbcols = $CONFIG['thumbcols'];
    $cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';

    $tabs_html = $display_tabs ? create_tabs($nbThumb, $page, $total_pages, $theme_thumb_tab_tmpl) : '';
    // The sort order options are not available for meta albums
    if ($sort_options) {
        $param = array('{ALBUM_NAME}' => $album_name . ' ' . lightbox_list($aid),
            '{AID}' => $aid,
            '{PAGE}' => $page,
            '{NAME}' => $lang_thumb_view['name'],
            '{TITLE}' => $lang_thumb_view['title'],
            '{DATE}' => $lang_thumb_view['date'],
            '{SORT_TA}' => $lang_thumb_view['sort_ta'],
            '{SORT_TD}' => $lang_thumb_view['sort_td'],
            '{SORT_NA}' => $lang_thumb_view['sort_na'],
            '{SORT_ND}' => $lang_thumb_view['sort_nd'],
            '{SORT_DA}' => $lang_thumb_view['sort_da'],
            '{SORT_DD}' => $lang_thumb_view['sort_dd'],
            '{POSITION}' => $lang_thumb_view['position'],
            '{SORT_PA}' => $lang_thumb_view['sort_pa'],
            '{SORT_PD}' => $lang_thumb_view['sort_pd'],
            );
        $title = template_eval($template_thumb_view_title_row, $param);
    } else if ($aid == 'favpics' && $CONFIG['enable_zipdownload'] == 1) { //Lots of stuff can be added here later
       $param = array('{ALBUM_NAME}' => $album_name,
                             '{DOWNLOAD_ZIP}'=>$lang_thumb_view['download_zip']
                               );
       $title = template_eval($template_fav_thumb_view_title_row, $param);
    }else{
        $title = $album_name;
    }


    if ($mode == 'thumb') {
        starttable('100%', $title, $thumbcols);
    } else {
        starttable('100%');
    }

    echo $header;

    $i = 0;
    foreach($thumb_list as $thumb) {
        $i++;
        if ($mode == 'thumb') {
            if ($aid == 'lastalb') {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            } else {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            }
        } else {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );
        }
        echo template_eval($thumb_cell, $params);

        if ((($i % $thumbcols) == 0) && ($i < count($thumb_list))) {
            echo $row_separator;
        }
    }
    for (;($i % $thumbcols); $i++) {
        echo $empty_cell;
    }
    echo $footer;

    if ($display_tabs) {
        $params = array('{THUMB_COLS}' => $thumbcols,
            '{TABS}' => $tabs_html
            );
        echo template_eval($tabs, $params);
    }

    endtable();
    echo $spacer;
}

This code generates the tumbnail page where you want to put a link to the slideshow on.
I've already altered the code :

Code: [Select]
  $param = array('{ALBUM_NAME}' => $album_name . ' ' . lightbox_list($aid),

I've added the [. ' ' . lightbox_list($aid)] part to call the function that generates the slideshow
and the would put it next to the title.

Play around with it for a bit,
I'm sure you can figure it out.

If it won't work, I'll try to look at it when I have some time (not realy soon)

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 04:20:34 pm
I get this error when I paste the code in my theme.php

Fatal error: Cannot redeclare theme_html_picture() (previously declared in /home/content/w/i/l/willtaka05/html/gallery/themes/andreas09/theme.php:218) in /home/content/w/i/l/willtaka05/html/gallery/themes/andreas09/theme.php on line 407

 ???
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 04:24:35 pm
This means you have 2 times the same function named 'theme_html_picture()'

You probably pasted the code in your file before deleting the old function.
Try looking for that function and remove it completely.

if you don't n-know exactly which one it is, or have problems with it, paste the complete code of your theme.php file here.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 04:30:26 pm
Here's the coding of my theme.php without the lightbox coding

Code: [Select]
<?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.4
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/

/*
Ported to Coppermine Photo Gallery by Billy Bullock - Oct. 2, 2006 : Last Update - Oct. 7, 2006
Porter URL: http://www.billygbullock.com
Coppermine Theme Version: 1.1
*/

function theme_display_image($nav_menu$picture$votes$pic_info$comments$film_strip)
{
    global 
$CONFIG;

    
$width $CONFIG['picture_table_width'];

    
starttable();
    echo 
$nav_menu;
    
endtable();

    
$picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' 'none');
    echo 
"<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    
starttable();
    echo 
$pic_info;
    
endtable();
    echo 
"</div>\n";


    
starttable();
    echo 
$picture;
    
endtable();
    if (
$CONFIG['display_film_strip'] == 1) {
        echo 
$film_strip;
    }


    echo 
$votes;




    echo 
"<div id=\"comments\">\n";
        echo 
$comments;
        echo 
"</div>\n";

}

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_HAS_NAVBAR_GRAPHICS'1);
define('THEME_HAS_FILM_STRIP_GRAPHIC'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.
define('THEME_HAS_NO_SUB_MENU_BUTTONS'1);

$CONFIG['max_film_strip_items'] = 4//overrides the number of thumbnails set in the admin configuration
$CONFIG['thumbcols'] = 4//overrides the number of columns for thumbnails set in the admin configuration


// HTML template for sys menu
$template_sys_menu = <<<EOT
                                        <ul class="level1">

<!-- BEGIN home -->
                                                <li><a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a></li>
<!-- END home -->
<!-- BEGIN my_gallery -->
                                                <li><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></li>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                                                <li><a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a></li>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                                                <li><a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a></li>
<!-- END my_profile -->
<!-- BEGIN faq -->
                                                <li><a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a></li>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                                                <li><a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a></li>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                                                <li><a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a></li>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                                                <li><a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a></li>
<!-- END upload_pic -->
<!-- BEGIN register -->
                                                <li><a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a></li>
<!-- END register -->
<!-- BEGIN login -->
                                                <li><a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a></li>
<!-- END login -->
<!-- BEGIN logout -->
                                                <li><a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a></li>
<!-- END logout -->
                                        </ul>

EOT;


// HTML template for sub menu
$template_sub_menu = <<<EOT
                                        <ul>
<!-- BEGIN custom_link -->
                                            <li><a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a></li>
<!-- END custom_link -->
                                            <li><a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a></li>
                                            <li><a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a></li>
                                            <li><a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a></li>
                                        </ul>

EOT;

// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                            <ul class="level1">
<!-- BEGIN admin_approval -->
                                <li><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></li>
<!-- END admin_approval -->
                                <li><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></li>
                                <li><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></li>
                                <li><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></li>
                                <li><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></li>
                                <li><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></li>
                                <li><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></li>
                                <li><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></li>
<!-- BEGIN log_ecards -->
                                <li><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></li>
<!-- END log_ecards -->
                            </ul>
                            <ul class="level1">
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></li>
                                <li><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></li>
                                <li><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></li>
<!-- BEGIN documentation -->
                                <li><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></li>
<!-- END documentation -->
                            </ul>
EOT;

// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                        <ul>
                                <li><a href="albmgr.php" title="{ALBMGR_TITLE}" class="navmenu">{ALBMGR_LNK}</a></li>
                                <li><a href="modifyalb.php" title="{MODIFYALB_TITLE}" class="navmenu">{MODIFYALB_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}" class="navmenu">{MY_PROF_LNK}</a></li>
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}" class="navmenu">{PICTURES_LNK}</a></li>
                        </ul>

EOT;

// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
                        </tr>
                        </table>

EOT;

// HTML template for the image rating box
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}" rel="nofollow">RUBBISH<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}" rel="nofollow">POOR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}" rel="nofollow">FAIR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}" rel="nofollow">GOOD<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}" rel="nofollow">EXCELLENT<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}" rel="nofollow">GREAT<br /></a></td>
        </tr>
</table>
EOT;

?>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 04:38:59 pm
Have you changed code in 'include/themes.inc.php'?

Look for the function
Code: [Select]
function theme_html_picture()in 'include/themes.inc.php' and make sure above that function there is a line:
Code: [Select]
if (!function_exists('theme_html_picture')) {  //{THEMES}and below that function there is a
Code: [Select]
}
If it already is in there, please post your 'theme.php' file with the changed lightbox code.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 04:42:04 pm
In the list of instructions you don't need to edit themes.inc.php  ???
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 04:48:18 pm
No, you don't have to, but those lines I described are nececery to make it work.

there has to be an error in one of those files.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 04:58:04 pm
I got it to work but the images are big, how do I reduce them ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 05:09:06 pm
Its working now, I installed the new script gizmo posted, but I keep getting a red x before the image loads and then get a red x instead of the close image ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 05:13:21 pm
please give me a link to your cpg site so I can see what is wrong.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 05:15:15 pm
http://cdcoverhideout.com/gallery ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 05:27:48 pm
In your 'lightbox.js' script, check the correctnes of the folowing lines:

Code: [Select]
//
// Configuration
//
var fileLoadingImage = "images/loading.gif";
var fileBottomNavCloseImage = "images/closelabel.gif";

You have to link your images correctly

For the moment your images are linked to:
Code: [Select]
http://cdcoverhideout.com/gallery/themes/your_theme_folder/lightbox/images/close.gif
http://cdcoverhideout.com/gallery/themes/your_theme_folder/lightbox/images/loading.gif
These links are just copied and pasted from your site, so you actualy have a 'your_theme_folder/' folder according to the URL
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 05:29:24 pm
Ok, thank you, 1 more thing, on my theme I have a immediate image restriction so the theme doesn't look ugly, how do I add this back to my theme.php as the new coding for lightbox as took over it, heres the code:

Code: [Select]
function compute_img_size_max($width, $height)
{
         global $CONFIG;
        $thumb_use=$CONFIG['thumb_use'];
        $max = 420;
        if($thumb_use=='ht') {
          $ratio = $height / $max;
        } elseif($thumb_use=='wd') {
          $ratio = $width / $max;
        } else {
          $ratio = max($width, $height) / $max;
        }
        if ($ratio > 1.0) {
                $image_size['reduced'] = true;
        }
        $ratio = max($ratio, 1.0);
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);
        $image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if($thumb_use=='ht') {
          $image_size['geom'] = ' height="'.$image_size['height'].'"';
        } elseif($thumb_use=='wd') {
          $image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          $image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return $image_size;
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 05:45:38 pm
Paste that function somewhere in your theme.php file. make sure you add the closing brackets, because in your previous post they're not there.

in the added code of the lightbox plugin:

Code: [Select]
if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
    $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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";
        }


change
Code: [Select]
{$image_size['geom']}
with
Code: [Select]
compute_img_size_max($CURRENT_PIC_DATA['pwidth'],$CURRENT_PIC_DATA['pheight'])

I hope this is what you mean, because I didn't understand your question quite well.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 17, 2007, 06:06:27 pm
I got this error when adding the coding to the lightbox code

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/w/i/l/willtaka05/html/gallery/themes/andreas09/theme.php on line 121
 ???
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 17, 2007, 06:23:47 pm
Please again post your code of the theme.php file
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 18, 2007, 02:07:58 pm
Here the my theme.php

Code: [Select]
<?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.4
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/

/*
Ported to Coppermine Photo Gallery by Billy Bullock - Oct. 2, 2006 : Last Update - Oct. 7, 2006
Porter URL: http://www.billygbullock.com
Coppermine Theme Version: 1.1
*/

function theme_display_image($nav_menu$picture$votes$pic_info$comments$film_strip)
{
    global 
$CONFIG;

    
$width $CONFIG['picture_table_width'];

    
starttable();
    echo 
$nav_menu;
    
endtable();

    
$picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' 'none');
    echo 
"<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    
starttable();
    echo 
$pic_info;
    
endtable();
    echo 
"</div>\n";


    
starttable();
    echo 
$picture;
    
endtable();
    if (
$CONFIG['display_film_strip'] == 1) {
        echo 
$film_strip;
    }


    echo 
$votes;




    echo 
"<div id=\"comments\">\n";
        echo 
$comments;
        echo 
"</div>\n";

}

// 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']  = 240// 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'])) {
        $picfull_url get_pic_url($CURRENT_PIC_DATA'fullsize');
        $pic_title $CURRENT_PIC_DATA['title'];
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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['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);
}

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_HAS_NAVBAR_GRAPHICS'1);
define('THEME_HAS_FILM_STRIP_GRAPHIC'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.
define('THEME_HAS_NO_SUB_MENU_BUTTONS'1);

$CONFIG['max_film_strip_items'] = 4//overrides the number of thumbnails set in the admin configuration
$CONFIG['thumbcols'] = 4//overrides the number of columns for thumbnails set in the admin configuration


// HTML template for sys menu
$template_sys_menu = <<<EOT
                                        <ul class="level1">

<!-- BEGIN home -->
                                                <li><a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a></li>
<!-- END home -->
<!-- BEGIN my_gallery -->
                                                <li><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></li>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                                                <li><a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a></li>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                                                <li><a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a></li>
<!-- END my_profile -->
<!-- BEGIN faq -->
                                                <li><a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a></li>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                                                <li><a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a></li>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                                                <li><a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a></li>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                                                <li><a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a></li>
<!-- END upload_pic -->
<!-- BEGIN register -->
                                                <li><a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a></li>
<!-- END register -->
<!-- BEGIN login -->
                                                <li><a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a></li>
<!-- END login -->
<!-- BEGIN logout -->
                                                <li><a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a></li>
<!-- END logout -->
                                        </ul>

EOT;


// HTML template for sub menu
$template_sub_menu = <<<EOT
                                        <ul>
<!-- BEGIN custom_link -->
                                            <li><a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a></li>
<!-- END custom_link -->
                                            <li><a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a></li>
                                            <li><a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a></li>
                                            <li><a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a></li>
                                        </ul>

EOT;

// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                            <ul class="level1">
<!-- BEGIN admin_approval -->
                                <li><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></li>
<!-- END admin_approval -->
                                <li><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></li>
                                <li><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></li>
                                <li><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></li>
                                <li><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></li>
                                <li><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></li>
                                <li><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></li>
                                <li><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></li>
<!-- BEGIN log_ecards -->
                                <li><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></li>
<!-- END log_ecards -->
                            </ul>
                            <ul class="level1">
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></li>
                                <li><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></li>
                                <li><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></li>
<!-- BEGIN documentation -->
                                <li><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></li>
<!-- END documentation -->
                            </ul>
EOT;

// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                        <ul>
                                <li><a href="albmgr.php" title="{ALBMGR_TITLE}" class="navmenu">{ALBMGR_LNK}</a></li>
                                <li><a href="modifyalb.php" title="{MODIFYALB_TITLE}" class="navmenu">{MODIFYALB_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}" class="navmenu">{MY_PROF_LNK}</a></li>
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}" class="navmenu">{PICTURES_LNK}</a></li>
                        </ul>

EOT;

// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
                        </tr>
                        </table>

EOT;

// HTML template for the image rating box
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}" rel="nofollow">RUBBISH<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}" rel="nofollow">POOR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}" rel="nofollow">FAIR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}" rel="nofollow">GOOD<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}" rel="nofollow">EXCELLENT<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}" rel="nofollow">GREAT<br /></a></td>
        </tr>
</table>
EOT;

function 
compute_img_size_max($width$height)
{
         global 
$CONFIG;
        
$thumb_use=$CONFIG['thumb_use'];
        
$max 300;
        if(
$thumb_use=='ht') {
          
$ratio $height $max;
        } elseif(
$thumb_use=='wd') {
          
$ratio $width $max;
        } else {
          
$ratio max($width$height) / $max;
        }
        if (
$ratio 1.0) {
                
$image_size['reduced'] = true;
        }
        
$ratio max($ratio1.0);
        
$image_size['width'] = ceil($width $ratio);
        
$image_size['height'] = ceil($height $ratio);
        
$image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if(
$thumb_use=='ht') {
          
$image_size['geom'] = ' height="'.$image_size['height'].'"';
        } elseif(
$thumb_use=='wd') {
          
$image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          
$image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return 
$image_size;
}

?>

I'm currently using the Andreas09 theme which has a left & right side nav so there is a restriction on the immediate picture so on lower resolution screens you don't get a right & bottom scroll bar

Hope you understand

Thanks ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 18, 2007, 05:49:07 pm
is this the code you used to get the error? Because I can't find anything that's wrong on line 121.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 19, 2007, 12:02:34 am
No heres the code with the changes

Code: [Select]
<?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.4
  $Source:
  $Revision:
  $Author:
  $Date:
**********************************************/

/*
Ported to Coppermine Photo Gallery by Billy Bullock - Oct. 2, 2006 : Last Update - Oct. 7, 2006
Porter URL: http://www.billygbullock.com
Coppermine Theme Version: 1.1
*/

function theme_display_image($nav_menu$picture$votes$pic_info$comments$film_strip)
{
    global 
$CONFIG;

    
$width $CONFIG['picture_table_width'];

    
starttable();
    echo 
$nav_menu;
    
endtable();

    
$picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' 'none');
    echo 
"<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    
starttable();
    echo 
$pic_info;
    
endtable();
    echo 
"</div>\n";


    
starttable();
    echo 
$picture;
    
endtable();
    if (
$CONFIG['display_film_strip'] == 1) {
        echo 
$film_strip;
    }


    echo 
$votes;




    echo 
"<div id=\"comments\">\n";
        echo 
$comments;
        echo 
"</div>\n";

}

// 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']  = 240// 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'])) {
        $picfull_url get_pic_url($CURRENT_PIC_DATA'fullsize');
        $pic_title $CURRENT_PIC_DATA['title'];
            
$winsizeX $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            
$winsizeY $CURRENT_PIC_DATA['pheight']+3//the +'s are the mysterious FF and IE paddings
            
$pic_html "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$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 "\" compute_img_size_max($CURRENT_PIC_DATA['pwidth'],$CURRENT_PIC_DATA['pheight']) 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);
}

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_HAS_NAVBAR_GRAPHICS'1);
define('THEME_HAS_FILM_STRIP_GRAPHIC'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until
                                           // you have validated it. See docs/theme.htm.
define('THEME_HAS_NO_SUB_MENU_BUTTONS'1);

$CONFIG['max_film_strip_items'] = 4//overrides the number of thumbnails set in the admin configuration
$CONFIG['thumbcols'] = 4//overrides the number of columns for thumbnails set in the admin configuration


// HTML template for sys menu
$template_sys_menu = <<<EOT
                                        <ul class="level1">

<!-- BEGIN home -->
                                                <li><a href="{HOME_TGT}" title="{HOME_TITLE}">{HOME_LNK}</a></li>
<!-- END home -->
<!-- BEGIN my_gallery -->
                                                <li><a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}">{MY_GAL_LNK}</a></li>
<!-- END my_gallery -->
<!-- BEGIN allow_memberlist -->
                                                <li><a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a></li>
<!-- END allow_memberlist -->
<!-- BEGIN my_profile -->
                                                <li><a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}">{MY_PROF_LNK}</a></li>
<!-- END my_profile -->
<!-- BEGIN faq -->
                                                <li><a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a></li>
<!-- END faq -->
<!-- BEGIN enter_admin_mode -->
                                                <li><a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}">{ADM_MODE_LNK}</a></li>
<!-- END enter_admin_mode -->
<!-- BEGIN leave_admin_mode -->
                                                <li><a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}">{USR_MODE_LNK}</a></li>
<!-- END leave_admin_mode -->
<!-- BEGIN upload_pic -->
                                                <li><a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a></li>
<!-- END upload_pic -->
<!-- BEGIN register -->
                                                <li><a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a></li>
<!-- END register -->
<!-- BEGIN login -->
                                                <li><a href="{LOGIN_TGT}" title="{LOGIN_LNK}">{LOGIN_LNK}</a></li>
<!-- END login -->
<!-- BEGIN logout -->
                                                <li><a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}">{LOGOUT_LNK}</a></li>
<!-- END logout -->
                                        </ul>

EOT;


// HTML template for sub menu
$template_sub_menu = <<<EOT
                                        <ul>
<!-- BEGIN custom_link -->
                                            <li><a href="{CUSTOM_LNK_TGT}" title="{CUSTOM_LNK_TITLE}">{CUSTOM_LNK_LNK}</a></li>
<!-- END custom_link -->
                                            <li><a href="{LASTUP_TGT}" title="{LASTUP_LNK}">{LASTUP_LNK}</a></li>
                                            <li><a href="{TOPN_TGT}" title="{TOPN_LNK}">{TOPN_LNK}</a></li>
                                            <li><a href="{SEARCH_TGT}" title="{SEARCH_LNK}">{SEARCH_LNK}</a></li>
                                        </ul>

EOT;

// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                            <ul class="level1">
<!-- BEGIN admin_approval -->
                                <li><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></li>
<!-- END admin_approval -->
                                <li><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></li>
                                <li><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></li>
                                <li><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></li>
                                <li><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></li>
                                <li><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></li>
                                <li><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></li>
                                <li><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></li>
<!-- BEGIN log_ecards -->
                                <li><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></li>
<!-- END log_ecards -->
                            </ul>
                            <ul class="level1">
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></li>
                                <li><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></li>
                                <li><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></li>
<!-- BEGIN documentation -->
                                <li><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></li>
<!-- END documentation -->
                            </ul>
EOT;

// HTML template for user admin menu
$template_user_admin_menu = <<<EOT

                        <ul>
                                <li><a href="albmgr.php" title="{ALBMGR_TITLE}" class="navmenu">{ALBMGR_LNK}</a></li>
                                <li><a href="modifyalb.php" title="{MODIFYALB_TITLE}" class="navmenu">{MODIFYALB_LNK}</a></li>
                                <li><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}" class="navmenu">{MY_PROF_LNK}</a></li>
                                <li><a href="picmgr.php" title="{PICTURES_TITLE}" class="navmenu">{PICTURES_LNK}</a></li>
                        </ul>

EOT;

// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td width="100%" class="statlink"><h2>{ALBUM_NAME}</h2></td>
                        </tr>
                        </table>

EOT;

// HTML template for the image rating box
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}" rel="nofollow">RUBBISH<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}" rel="nofollow">POOR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}" rel="nofollow">FAIR<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}" rel="nofollow">GOOD<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}" rel="nofollow">EXCELLENT<br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}" rel="nofollow">GREAT<br /></a></td>
        </tr>
</table>
EOT;

function 
compute_img_size_max($width$height)
{
         global 
$CONFIG;
        
$thumb_use=$CONFIG['thumb_use'];
        
$max 300;
        if(
$thumb_use=='ht') {
          
$ratio $height $max;
        } elseif(
$thumb_use=='wd') {
          
$ratio $width $max;
        } else {
          
$ratio max($width$height) / $max;
        }
        if (
$ratio 1.0) {
                
$image_size['reduced'] = true;
        }
        
$ratio max($ratio1.0);
        
$image_size['width'] = ceil($width $ratio);
        
$image_size['height'] = ceil($height $ratio);
        
$image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if(
$thumb_use=='ht') {
          
$image_size['geom'] = ' height="'.$image_size['height'].'"';
        } elseif(
$thumb_use=='wd') {
          
$image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          
$image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return 
$image_size;
}

?>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 19, 2007, 10:25:35 am
Hey

I've found my mistake, there's an array returned instead of a string.

After line 157 (just above the '$pic_html = ') add:
Code: [Select]
$geom = compute_img_size_max($CURRENT_PIC_DATA['pwidth'],$CURRENT_PIC_DATA['pheight']);
And in line 159 replace
Code: [Select]
compute_img_size_max($CURRENT_PIC_DATA['pwidth'],$CURRENT_PIC_DATA['pheight'])
With:
Code: [Select]
$geom[whole]
Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 19, 2007, 07:16:13 pm
The images are still bigger than 300, this is what I set in the immediate image restriction here:

Code: [Select]
function compute_img_size_max($width, $height)
{
         global $CONFIG;
        $thumb_use=$CONFIG['thumb_use'];
        $max = 300;
        if($thumb_use=='ht') {
          $ratio = $height / $max;
        } elseif($thumb_use=='wd') {
          $ratio = $width / $max;
        } else {
          $ratio = max($width, $height) / $max;
        }
        if ($ratio > 1.0) {
                $image_size['reduced'] = true;
        }
        $ratio = max($ratio, 1.0);
        $image_size['width'] = ceil($width / $ratio);
        $image_size['height'] = ceil($height / $ratio);
        $image_size['whole'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        if($thumb_use=='ht') {
          $image_size['geom'] = ' height="'.$image_size['height'].'"';
        } elseif($thumb_use=='wd') {
          $image_size['geom'] = 'width="'.$image_size['width'].'"';
        } else {
          $image_size['geom'] = 'width="'.$image_size['width'].'" height="'.$image_size['height'].'"';
        }



        return $image_size;
}
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 19, 2007, 07:23:41 pm
Ok, found your solution:

Replace the 'if' construction between lines 148-159 with:

Code: [Select]
    $geom = compute_img_size_max($CURRENT_PIC_DATA['pwidth'],$CURRENT_PIC_DATA['pheight']);
    if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
        $picfull_url = get_pic_url($CURRENT_PIC_DATA, 'fullsize');
        $pic_title = $CURRENT_PIC_DATA['title'];
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"$picfull_url\" rel=\"lightbox\" title=\"$pic_title\">";
            $pic_html .= "<img src=\"" . $picture_url . "\" $geom[whole] class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
            $pic_html = "<img src=\"" . $picture_url . "\" $geom[whole] class=\"image\" border=\"0\" alt=\"\" /><br />\n";
        }
Title: Re: LightBox JS for Fullsize Popup Image
Post by: nivar on March 20, 2007, 10:49:09 pm
hope im not getting off topic, i have similar question regarding flash (swf) files.

I converted the jpg files into swf files and uploaded to th cp gallery, but the images wont pop up as jpg images would.
I would like to have flash images popup, similar to the jpg or gif images would.

for example visit: http://www.arvins.us/c/index.php
- in this gallery if you click on the jpg image it pops up and swf file wont.

any help on this would be appreciated.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 20, 2007, 11:11:39 pm
I don't know what the point is of converting jpg to swf.
I also don't know if it is possible to do this just with the swf's.
Maybe with a transparant overlay over the swf which points to the link of the popup?
Or you could try to let the swf link to a javascript in the actionscript?



Title: Re: LightBox JS for Fullsize Popup Image
Post by: will on March 21, 2007, 12:04:53 am
thanks matey, worked a treat ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Joachim Müller on March 21, 2007, 09:25:24 am
hope im not getting off topic
You are. Stay out of this thread. You already have one of your own (http://forum.coppermine-gallery.net/index.php?topic=42407.0).

As SaWey suggested: converting jpeg to flash is simply not a bright thing to do.

Title: Re: LightBox JS for Fullsize Popup Image
Post by: Commander Keen on March 25, 2007, 07:31:13 pm
Hi.
I sucessfully installed lightbox and it worked great. Until I noticed, that the inermediate picture isn't shown anymore. Has anyone had similar problems?

THX, Commander Keen
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 25, 2007, 09:44:54 pm
Hey Keen

Can you post a link to your gallery? so I can see what the problem is.

Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 25, 2007, 10:53:37 pm
Are you certain you followed the instructions of this message: http://forum.coppermine-gallery.net/index.php?topic=35539.msg192915#msg192915

There is a problem with finding the image that has to be displayed.

Please post your complete theme.php file.

Something 's going wrong in the lightbox_list function :
Code: [Select]
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";
}

Title: Re: LightBox JS for Fullsize Popup Image
Post by: Commander Keen on March 25, 2007, 11:06:53 pm
I'm pretty shure I did. After all it was only copy and paste...

But here's my theme.php:

Code: [Select]
<?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 had all redundant CORE items removed                           //
// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS'1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);

// HTML template for sys_menu
$template_sys_menu = <<<EOT
  <div class="topmenu">
          <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
  {BUTTONS}
                  </tr>
          </table>
  </div>
EOT;

// HTML template for template sys_menu buttons
$template_sys_menu_button = <<<EOT
<!-- BEGIN {BLOCK_ID} -->
  <td><img src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
  <td><img src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" alt="" /></td>
  <td style="background-image:url(themes/rainy_day/images/button1_r1_c2.gif)">
          <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a>
  </td>
  <td><img src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" alt="" /></td>
<!-- END {BLOCK_ID} -->
EOT;


// Displays a picture /start of lightscript
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) {
################################################
//Set max number of images
$max 10 //(-1 for all pics in album)
################################################
    
global $lang_display_image_php$CONFIG;
$i 0;
$pid $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
$pic_data get_pic_data($aid$pic_count$album_name, -1, -1false);
$imax 0; //counter
$max $max/2;
foreach ($pic_data as $picture){
if ($picture['pid'] == $pid) {
//the number of the picture in  order
$picnumber $imax;
}
$imax++;
}
//Check beginning and ending of album
if(! ($max == ((-1)/2))){
if ($imax $max){
if ($picnumber $max || $picnumber == 0){
$down 0;
$up + ($max*2);
}elseif (($picnumber $max) > $imax){
$down $imax - ($max*2);
$up $imax;
}else{
$down $picnumber $max;
$up $picnumber $max;
}
}else{
$down 0;
$up $imax;
}
}else{
$down 0;
$up $imax;
}

foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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'fullsize');
}
$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
#################################################
?>

Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 26, 2007, 12:13:08 am
Try changing this at line 140:

Code: [Select]
$pic_html = lightbox_list($CURRENT_PIC_DATA['pid']);
to
Code: [Select]
$pic_html = lightbox_list($CURRENT_PIC_DATA);
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Commander Keen on March 26, 2007, 09:53:50 am
It worked! Thanks very much!

Greetings, Commander Keen
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Commander Keen on March 26, 2007, 10:29:09 am

This mod will not work well on large albums, bear that in mind.


Can you tell me why? Because I would like to increase the number of Pics schown in a slideshow
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 26, 2007, 03:28:47 pm
Hey Keen,

Big albums are not a problem anymore,
The problem was it would take a lot of time loading all images if you have very large albums.
Now you can set a maximum amount of images to load.
Default it is 10, look at the first line of the lightbox_list function in your theme.php yo change this.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Commander Keen on March 26, 2007, 04:24:30 pm
Yes, i understand.
Do you mean this:
Code: [Select]
################################################
//Set max number of images
$max = -1; //(-1 for all pics in album)
################################################
I think the question is, what is a big album? I had already set the value to -1 and had no problems watching slideshows with 80 pictures.
I don't think, lightbox is loading all images in the folder at once
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on March 26, 2007, 05:13:15 pm
I think you will have to see that yourself,
Every server has his limits. When the loading slows down, you probably should set a limit.

I've got an album with 1200 pics loading without any delay.

See for yourself and if it going bad, you know you can set a limit.
Grz
Title: Re: LightBox JS for Fullsize Popup Image
Post by: liberte on April 03, 2007, 01:27:30 am
Gizmo
This is very nice, thank you for this contribution.

i have seen such galleries at some joomla gallery components
and was trying to do it for coppermine whole this day,
but you have written the solution few months ago
You are great
Title: Re: LightBox JS for Fullsize Popup Image
Post by: CucAgMuH on April 12, 2007, 03:33:06 pm
 Hi,
 
 I'm completely new to cpg and all this stuff(img`s never been my passion :) ) I've installed cpg before a week, after two or three days I'finished modifyng some themes. Now I have just a little problem - Light/Grey Box. I was trying again, and again to make this thing work, but the result wasn't from the good ones :) Can somebody look at my gallery and try to tell me where I messed up the things, and(if he can, wants and has free time) to tell me how to fix this ... the gallery I'm experimenting with is at: http://gallery.badmin.org (http://gallery.badmin.org)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on April 12, 2007, 05:36:24 pm
Hey CucAgMuH

The problem is you haven't linked your scripts and css right.
use these links instead:
Code: [Select]
<script type="text/javascript" src="themes/caliSkinV6/js/prototype.js"></script>
<script type="text/javascript" src="themes/caliSkinV6/js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="themes/caliSkinV6/js/lightbox.js"></script>
<link rel="stylesheet" href="themes/caliSkinV6/css/lightbox.css" type="text/css" media="screen" />
Title: Re: LightBox JS for Fullsize Popup Image
Post by: CucAgMuH on April 12, 2007, 06:38:51 pm
Yeah, got it... :)

It's just messed up all... as usual. :) Sorry for the time I wasted you with this stupid problem, but I have to make this work, before going to bed... it just drove me crazy. Tommorow I'll finish the rest of the problems(some stupid back buttons conflict[it appears that they use the same path+name], some traffic reduce and so on... and so on...). The problem is that I just can't keep my eyes open any more... everything smells like bed :) Thanks for the fast help, I really appreciate the you've done for me :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Alcor on April 17, 2007, 12:07:15 pm
I've tried to install the Lightbox with Highslide plugin. I followed all the steps but Lightbox didn't work so I decided to apply the Ajax Lightbox (http://forum.coppermine-gallery.net/index.php?topic=39195.0):. Now it seems work but the load of the large image is slowest in FF, and in the IE the browser shows me a popup warning about a script. I think that the wrong thing is in my theme.php, the functions theme_joomla_menu() and user_joomla_menu() . Here I paste the code, if somebody can help me...

Code: [Select]
<?php

function theme_joomla_menu(){
$joomla_menu '
<link href="themes/cda07/mod_d4j_transmenu/mod_d4j_transmenu.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
/* this DIV is the semi-transparent white background of each menu. the -moz-opacity is a proprietary way to get transparency in mozilla, the filter is for IE/windows 5.0+. */
/* we set the background color in script because ie mac does not use it; that browser only uses a semi-transparent white PNG that the spacer gif inside this DIV is replaced by */
.transMenu .background {
position:absolute;
left:0px; top:0px;
z-index:1;
-moz-opacity:0.5;
filter:alpha(opacity=50);
}
/* same concept as .background, but this is the sliver of shadow on the right of the menu. It\'s left, height, and background are set by script. In IE5/mac, it uses a PNG */
.transMenu .shadowRight {
position:absolute;
z-index:3;
top:3px; width:2px;
-moz-opacity:0.4;
filter:alpha(opacity=40);
}
/* same concept as .background, but this is the sliver of shadow on the bottom of the menu. It\'s top, width, and background are set by script. In IE5/mac, it uses a PNG */
.transMenu .shadowBottom {
position:absolute;
z-index:1;
left:3px; height:2px;
-moz-opacity:0.4;
filter:alpha(opacity=40);
}
</style>
<table cellpadding="0" cellspacing="0" class="moduletable">
<tr>
<td>

<div id="transmenu45438" style="display:none"></div>
<script language="JavaScript" type="text/JavaScript">function getBgColor(root) {
var bgColor = \'\';
if (typeof root.style != \'\') {
if (typeof root.style.backgroundColor != \'undefined\' && root.style.backgroundColor != \'\') {
bgColor = root.style.backgroundColor;
}
} else if (typeof root.bgColor != \'undefined\' && root.bgColor != \'\') {
bgColor = root.bgColor;
} else {
bgColor = getBgColor(root.parentNode);
}
return bgColor;
}</script>
<script language="javascript" type="text/javascript" src="themes/cda07/mod_d4j_transmenu/transmenu.compact.js"></script>
<script language="JavaScript" type="text/JavaScript">var menu_class_suffix = "-menu";

// Placeholder CSS class
var sub_placeholder_style = "mainlevel";

// TransMenu settings
TransMenu.spacerGif = "themes/cda07/mod_d4j_transmenu/img/x.gif";                     // path to a transparent spacer gif
TransMenu.dingbatOn = "themes/cda07/mod_d4j_transmenu/img/submenu-on.gif";            // path to the active sub menu dingbat
TransMenu.dingbatOff = "themes/cda07/mod_d4j_transmenu/img/submenu-off.gif";          // path to the inactive sub menu dingbat
TransMenu.shadowPng = "themes/cda07/mod_d4j_transmenu/img/grey-40.png";               // a PNG graphic to serve as the shadow for mac IE5
TransMenu.backgroundPng = "themes/cda07/mod_d4j_transmenu/img/white-90.png";          // a PNG graphic to server as the background for mac IE5
TransMenu.dingbatSize = 16;
TransMenu.menuPadding = 0;
TransMenu.itemPadding = 0;
TransMenu.shadowSize = 2;
TransMenu.shadowOffset = 3;
TransMenu.shadowColor = "#888";

TransMenu.backgroundColor = "#fff";

TransMenu.hideDelay = 1000;
TransMenu.slideTime = 400;

// if supported, initialize TransMenu
function initTransMenu() {
if (TransMenu.isSupported()) {
TransMenu.initialize();
}
}</script>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle"><a id="transmenu68022_menu1" class="mainlevel-menu" href="/component/option,com_frontpage/Itemid,1/">Inicio</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu2" class="mainlevel-menu" href="/content/section/1/2/">Noticias</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu71" class="mainlevel-menu" href="/component/option,com_smf/">Foros</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu72" class="mainlevel-menu" href="/content/section/4/72/">Art&iacute;culos</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu68" class="mainlevel-menu" href="/cpg/">Fotos</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu110" class="mainlevel-menu" href="/component/option,com_blastchatc/Itemid,110/">Chat</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu69" class="mainlevel-menu" href="/component/option,com_bookmarks/Itemid,69/">Enlaces</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu80" class="mainlevel-menu" href="/index.php">Aplicaciones</a>
</td>
<td valign="middle"> <img border="0" src="themes/cda07/mod_d4j_transmenu/img/x.gif" align="absmiddle" />
</td>
<td valign="middle"><a id="transmenu68022_menu82" class="mainlevel-menu" href="/component/option,com_sobi/Itemid,82/">List&iacute;n</a>
</td>
</tr>
</table>
<script language="JavaScript" type="text/JavaScript">if (TransMenu.isSupported()) {
self[\'transmenu68022\'] = new TransMenuSet(TransMenu.direction.down, 0, 0, TransMenu.reference.bottomLeft);

document.getElementById(\'transmenu68022_menu1\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
document.getElementById(\'transmenu68022_menu2\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
document.getElementById(\'transmenu68022_menu71\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
document.getElementById(\'transmenu68022_menu72\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
document.getElementById(\'transmenu68022_menu68\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
document.getElementById(\'transmenu68022_menu110\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
var transmenu68022_menu69 = self[\'transmenu68022\'].addMenu(document.getElementById("transmenu68022_menu69"));
transmenu68022_menu69.addItem("Cont&aacute;ctanos", "/component/option,com_contact/Itemid,3/", 0);

var transmenu68022_menu80 = self[\'transmenu68022\'].addMenu(document.getElementById("transmenu68022_menu80"));
transmenu68022_menu80.addItem("Calculadora", "/component/option,com_calgye/Itemid,74/", 0);
transmenu68022_menu80.addItem("Ficha cr&iacute;a", "/component/option,com_facileforms/Itemid,79/", 0);
transmenu68022_menu80.addItem("Nombres de agapornis", "/component/option,com_scrollnames/Itemid,112/", 0);

document.getElementById(\'transmenu68022_menu82\').onmouseover = function() { self[\'transmenu68022\'].hideCurrent(); }
TransMenu.renderAll();
}
if (window.addEventListener) {
window.addEventListener(\'load\', initTransMenu, false);
} else if (window.attachEvent) {
var tmev = window.attachEvent(\'onload\', initTransMenu);
} else {
initTransMenu();
}</script>
</td>
</tr>
</table>'
;
return 
$joomla_menu;
}
function 
user_joomla_menu(){
if (
USER_ID){
$user_menu '
<link rel="stylesheet" type="text/css" href="../modules/dm-t_2-0-1/css/dm-t.css" />
<script type = "text/javaScript" src="../modules/dm-t_2-0-1/js/menu.js"></script>
<script type = "text/javascript">
var link = document.createElement( \'link\' );
link.setAttribute( \'href\', \'/modules/dm-t_2-0-1/css/dm-t.css\' );
link.setAttribute( \'rel\', \'stylesheet\' );
link.setAttribute( \'type\', \'text/css\' );
var head = document.getElementsByTagName(\'head\').item(0);
head.appendChild(link);
</script>

<script type = "text/javascript">
var MENU_ITEMS263322 =
[

 wrap([\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;Men&uacute; usuario\', \'http://www.domain.com/#\', {\'tw\' : \'_self\', \'sb\' : \'Men&uacute; usuario\'},
 [\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;Comunidad\', \'http://www.domain.com/ index.php?option=com_places&Itemid=59\', {\'tw\' : \'_self\', \'sb\' : \'Comunidad\'},
 [\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;A&ntilde;adir nuevo\', \'http://domain.com/index.php?option=com_places&task=new\', {\'tw\' : \'_self\', \'sb\' : \'Añadir nuevo\'}],],
 [\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;Enviar enlace\', \'http://domain.com/index.php?option=com_bookmarks&task=new&Itemid=60&mode=0&catid=-1&navstart=0&search=*\', {\'tw\' : \'_self\', \'sb\' : \'Enviar enlace\'}],
 [\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;Enviar noticia\', \'http://www.domain.com/index.php?option=com_content&task=new&sectionid=1&Itemid=0\', {\'tw\' : \'_self\', \'sb\' : \'Enviar noticia\'}],
 [\'<img src="http://www.domain.com/images/M_images/arrow.png" border="0">&nbsp;Mi informaci&oacute;n\', \'http://www.domain.com/component/option,com_user/task,UserDetails/\', {\'tw\' : \'_self\', \'sb\' : \'Mi información\'}],]),

];

function wrap( item ) {
var url_current = String(window.location);
var url_link = \'\' + \'/\' + item[1];

if ( url_current == url_link )
item[0] = \'<span id="dm_t-active_link">\' + item[0] + \'</span>\';
return (item);
}
</script> 


<script type = "text/javascript">
var MENU_POS263322 =
[

{
\'width\': 110,
\'height\': 20,

\'top\': 0,
\'left\': 110,

\'block_top\': 0,
\'block_left\': 0,

\'hide_delay\': 200,
\'expd_delay\': 200,

\'css\' : {
\'outer\': \'\',
\'inner\': [\'dm_t-0\', \'dm_t-0_over\', \'dm_t-0_down\']
}
},
{

\'width\': 110,
\'height\': 20,

\'top\': 21,
\'left\': 0,

\'block_top\': 21,
\'block_left\': 30,

\'hide_delay\': 200,
\'expd_delay\': 200,

\'css\': {
\'outer\': \'\',
\'inner\': [\'dm_t-1\', \'dm_t-1_over\', \'dm_t-1_down\']
}
},
{

\'width\': 110,
\'height\': 20,

\'top\': 21,
\'left\': 0,

\'block_top\': 5,
\'block_left\': 90,

\'hide_delay\': 200,
\'expd_delay\': 200,

\'css\': {
\'outer\': \'\',
\'inner\': [\'dm_t-2\', \'dm_t-2_over\', \'dm_t-2_down\']
}
},
{

\'width\': 110,
\'height\': 20,

\'top\': 21,
\'left\': 0,

\'block_top\': 5,
\'block_left\': 90,

\'hide_delay\': 200,
\'expd_delay\': 200,

\'css\': {
\'outer\': \'\',
\'inner\': [\'dm_t-3\', \'dm_t-3_over\', \'dm_t-3_down\']
}
}


];
</script> 
<div style="position: relative; z-index: 1000;"> 
<script type = "text/javascript">
new menu( MENU_ITEMS263322, MENU_POS263322 );
</script>
</div>
<div class="dm_t-whole" style="height: 0px; width: 0px;"></div>'
;
return $user_menu;
}
}
?>

Thanks.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Alcor on April 17, 2007, 12:09:57 pm
And the template.html

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
{META}
<link rel="stylesheet" href="themes/cda07/style.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../templates/cda07/css/template_css.css" />
<script type="text/javascript" src="scripts.js"></script>
<!-- $Id: template.html,v 1.6 2005/12/04 03:22:35 donnoman Exp $ -->
</head>
<body>
  {CUSTOM_HEADER}
 
<div id="pagewidth-800" >
<div id="top">
<!--header-->
<div id="logo"><div id="pathway"><span class="pathway"><a href="http://www.domain.com/" class="pathway">Inicio</a> <img src="http://www.domain.com/images/M_images/arrow.png" alt="arrow" />   Galer&iacute;a de fotos </span></div><a href="index.php"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="790" height="165" id="logocda" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="../templates/cda07/images/cda07.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><embed src="../templates/cda07/images/cda07.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="790" height="165" name="logocda" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></a></div>
<div class="joomla_menu"><div style="padding-left:5px;">{JOOMLA_MENU}</div></div>
<div id="top-top"><div style="padding-left:10px;padding-top:1px ">{USER_JOOMLA_MENU}</div></div>
<div class="clr"></div>
</div>
<!--fin header-->
<div id="outer">
<div id="adsense"><center><script type="text/javascript"><!--
google_ad_client = "pub-0252299653xxxxx";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="9780023781";
google_color_border = "6688AA";
google_color_link = "FF6600";
google_color_bg = "FFFFFF";
google_color_text = "000000";
google_color_url = "6699CC";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center></div>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center" valign="top"><div align="center">
              <p>&nbsp;</p>
              <p>{SYS_MENU} <br />
      {SUB_MENU}
              </p>
            </div></td>
          </tr>
          <tr>
            <td align="center" valign="top">
              <div align="center">{LANGUAGE_SELECT_FLAGS}{THEME_SELECT_LIST}
              {LANGUAGE_SELECT_LIST}
            </div></td>
          </tr>
        </table>
        <img src="images/spacer.gif" width="1" height="15" alt="" />
        <br />
        <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="center" valign="top">
              <div align="left">{ADMIN_MENU}
              {GALLERY}
            </div></td>
          </tr>
        </table>{CUSTOM_FOOTER}<div id="vanity">{VANITY}</div>
<div class="clr"></div>
</div>
<div id="bottom">
<div id="footer-800"><div align="center">&copy; 2006 Cosas de Agapornis</div></div>
</div>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-700497-1";
urchinTracker();
</script>
</body>
</html>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on April 17, 2007, 12:43:12 pm
I think you should ask the one who wrote the ajax plugin, in the thread you linked to.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Alcor on April 17, 2007, 01:59:09 pm
I think you should ask the one who wrote the ajax plugin, in the thread you linked to.

Yes, I will do it. But I think that the issue is in the theme.php or in the template.html. Lightbox JS and  Ajax lightbox are very similar, isn't it? I proved to add the lightbox scripts inside the head tags of template.html, but Highslide didn't work for me, by this reason I decide use the Ajax.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on April 17, 2007, 02:37:20 pm
If you give a link to your gallery, I might see what the problem is, now I'm looking in the dark.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Kenshino on April 21, 2007, 05:57:24 pm
Is there anyway to define the popup size area for the Lightbox?

I have a CMS that uses a module to shrink the gallery so it loads inside Postnuke.

When I try to use lightbox, it doesn't appear over the whole website, instead it loads only over the small area where the gallery is occupying. Is there anyway I can change this?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on April 21, 2007, 06:21:25 pm
Hey,

That is because Postnuke load CPG in an iframe.
I found a script that might work better for you: http://www.dolem.com/lytebox/
This script can (according to the site) handle iframes.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Kenshino on April 21, 2007, 07:10:50 pm
Thanks for your reply!

Are there any changes I'll need to make to LightBox's additions to theme.php to make LyteBox work?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on April 21, 2007, 07:25:26 pm
Yes, but you will have to check with the website to know what.
for example: change "lightbox[ list]" to "LyteBox[ list]" or something.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: kissman on May 01, 2007, 04:07:26 pm
I edited my Classic theme, lightbox working, but i cannot view gallery graphics...  :-[ ??? my gall: http://air-spotting.pichrt.info
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 01, 2007, 04:41:08 pm
Have you checked for the existance of the images dir of that theme?
I think you may have removed that one.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: kissman on May 01, 2007, 04:48:34 pm
Have you checked for the existance of the images dir of that theme?
I think you may have removed that one.
i checked, and images dir is in themplate dir ok... maybe bad paths in theme files?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: kissman on May 01, 2007, 04:58:09 pm
Solved: i changed name of theme but i forgot rename in template.html  ;) sorry
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 01, 2007, 04:59:00 pm
I checked your site logo and it should be at
http://www.pichrt.info/air-spotting/themes/classic/images/site_logo.png

can you verfy that?

OK, nice one :-)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: jrexi on May 02, 2007, 06:15:21 pm
Hi All,

First off I want to say thanks for this mod, it is simply awesome!

My question is, how can I have the Lightbox launch earlier in the process and not wait until the full image stage?  For example, I want the lightbox to launch from the thumbnail stage instead of the page where you can enter comments and ratings.

Thanks in advance for your help.

Jrexi.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 03, 2007, 05:49:45 pm
You will find something like that in this thread: http://forum.coppermine-gallery.net/index.php?topic=36558.180
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 03, 2007, 10:52:11 pm
Hi SaWey... really great mod.  Thanks for this !  I was wondering how hard it would be to add more functionality to the actual popup.  Could there be other buttons sandwiched between the pic title and the close button?   For example maybe an add to favorites link or other stuff from the info panel, links from the sys or sub menu.   I imagine this might be some pretty major programming but if anyone has an idea for a fairly quick and easy way to mod this I would love to hear it. 

Thanks again.. love this ! ;D
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 04, 2007, 12:49:26 am
I changed my code of the script again, now whenever a user exits the lightbox slideshow, he gets redirected to the page of the image where he stopped.

A few changes are necesarry:

in lightbox_s.js:

Find (line 413):
Code: [Select]
// add single image to imageArray
imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title')));

Replace with:
Code: [Select]
// add single image to imageArray
imageArray.push(new Array(imageLink.getAttribute('href'), imageLink.getAttribute('title'), imageLink.getAttribute('picpage')));

Find (line 421):
Code: [Select]
if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){
imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title')));

Replace with:
Code: [Select]
if (anchor.getAttribute('href') && (anchor.getAttribute('rel') == imageLink.getAttribute('rel'))){
imageArray.push(new Array(anchor.getAttribute('href'), anchor.getAttribute('title'), anchor.getAttribute('picpage')));

Find (line 852):
Code: [Select]
end: function() {
this.stopSlideShow();
this.disableKeyboardNav();
Element.hide('lightbox');
new Effect.Fade('overlay', { duration: 0.2});
showSelectBoxes();

slideshow = saveSlideshow;
foreverLoop = saveForeverLoop;
loopInterval = saveLoopInterval;

slideShowWidth = saveSlideShowWidth;
slideShowHeight = saveSlideShowHeight;

After add:
Code: [Select]
window.location = imageArray[activeImage][2];


And then in your theme.php file:

Find:
Code: [Select]
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);
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;
}

After add:
Code: [Select]
$picture_page = "./displayimage.php?album=".$picture['aid']."&pos=-".$picture['pid'];

Find:
Code: [Select]
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\"

Replace with:
Code: [Select]
$picList .= "<a href=\"$picture_url_fullsize\" picpage=\"$picture_page\" rel=\"lightbox[list]\"

Find:
Code: [Select]
$picList .= "<a href=\"$picture_url_fullsize\" rel=\"lightbox[list]\"

Replace with:
Code: [Select]
$picList .= "<a href=\"$picture_url_fullsize\" picpage=\"$picture_page\" rel=\"lightbox[list]\"

(above is mentioned twice as you have to change 2 lines that are the same)

That's it.
Enjoy

@zac: It is possible to do so, you just need to edit the lightbox_s.js script to your needs.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 12:58:52 am
Hey SaWey.. how totally weird!! Your update was something I was going to bug you for but I didnt ask it because I thought it would be too complicated... that is exactly what I wanted.  I will let you know if I have any luck adding stuff to the js.  Thanks again!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 01:01:23 am
erm.. wait.. where did lightbox_q come from?  I just have lightbox_s.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 04, 2007, 01:05:29 am
Sorry, spelling error, it should be lightbox_s.js, fixed it now.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 01:14:46 am
ok.. i did all the edits but not working for me.  when I close the popup the main page does reload but it stays on the same picture as when i started
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 04, 2007, 01:17:09 am
hmm, did you click the close button to close the screen or did you hit a key?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 01:23:58 am
button
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 04, 2007, 01:45:56 am
Can you post the content of the two files?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 01:56:52 am
k ... i attached em.  Let me know what i can do to help diagnose this.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 04, 2007, 03:04:07 am
I think I found your problem, you should have looked for the

Code: [Select]
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);
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;
}

in the second part of the lightbox update.
and add the code under that:

Code: [Select]
$picture_page = "./displayimage.php?album=".$picture['aid']."&pos=-".$picture['pid'];
PS: don't forget to remove the line you misplaced.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: zac on May 04, 2007, 06:53:29 am
Ahhh yes works great now :)  Thanks so much SaWey.. you rock!! 
Title: Re: LightBox JS for Fullsize Popup Image
Post by: GladiatoR on May 06, 2007, 01:00:27 pm
hey guys...just installed this script working great. one think i don't like is if you click on the image to activate the lightbox and it hasnt fully loaded, it loads the image into something like this....

http://www.jlp.ugtech.net/gallery/albums/uploads/westernregion_barrabool/IMG_3511.jpg

how do i stop this so if you press on a half loaded image it still loads up in that lighbox thing?

thanks in advance.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 06, 2007, 07:10:33 pm
First of all, you have a slow server :-)

To answer your question: I have no idea, it is the browser being to slow, it first wants to load the images before it does the lightbox popup.
When an image is loading and you press the stop button of your browser, then click on the image and it shows up in the lightbox.

So to conclude: I don't know how to fix this. Sorry.
Maybe try searching the lightbox webpage or something.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: GladiatoR on May 07, 2007, 06:03:38 am
your the only that that has complained about my server being slow....also, i have experienced same problem on other peoples sites with same script installed. Only thing I don't like about the script, other than that it's fantastic.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: HighlanderICT on May 08, 2007, 07:25:36 pm
I have been dabbling with Coppermine, Gallery2, zOOm and RSGallery2 and finally decided the choice was between Coppermine and RSGallery2 ......

RSGallery2 displays the images the way I want - categories -> albums -> thumbs -> intermediate and when I click on the intermediate image it gives me a popup based on my browser window size. The one thing it also has is a full size option in the bottom corner - see attachment. I believe this is done with 'highslide' (?)
see rsgallery here - http://www.torpics.com/index.php?option=com_rsgallery2&Itemid=15

I found this thread and was happy to read that it might be possible to achieve the same thing with Coppermine (the lack of this feature was the reason I even bothered with RSGallery2). I have read through all 10 pages and have followed the instructions in the relevant posts to get the gallery functioning the way it should and the popup is also working as it should (i think). However, I can find no way for the user to view the full size pic either by clicking a link on the intermediate image page or within the popup - is there a way to do this ? Ideally i would like it to work like this
galleries -> albums -> thumbs -> intermediate -> popup with an option to view the full size pic either from the popup or from a link on the intermediate image page.
see coppermine gallery here - http://www.torpics.com/gallery/index.php

have also attached my theme.php and template.html files - using classic theme.

Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 09, 2007, 01:07:17 am
Have a look at this post: http://forum.coppermine-gallery.net/index.php?topic=36302.0
you should be able to adjust it so suits your needs.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: HighlanderICT on May 09, 2007, 02:25:50 am
Thanks SaWey - not quite what I am looking for but a good place to start :)
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Mamps on May 15, 2007, 11:45:02 am
Hi there,
this Mod is working great for me, but
is there a way to skip the whole intermediate page and go directly from the thumbmail page to lightbox?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on May 15, 2007, 10:20:54 pm
It should be possible to do so, but at the moment I don't have the time too look how it should be done.
Hope someone else covers your request.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: GuiLinux on June 05, 2007, 05:43:03 am
I've looked through this thready, and I may have missed it, but I have a quick question.  Is it possible, when viewing the image, that it add to the view count?  When I view my images, everything works with the lightbox script as it's supposed to, but it does not add to the view count.  Thanks for any help you can provide.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on June 05, 2007, 11:53:33 am
At the moment this plugin doesn't add views. Maybe if someone could add a little ajax to do that?
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Sami on June 06, 2007, 08:03:11 am
Actually I'm working on adding ajax view count to highslide plugin maybe you can use it on this plugin too
Title: Re: LightBox JS for Fullsize Popup Image
Post by: CaleyD on June 07, 2007, 01:50:19 pm
This is a cry for help...lol

I'm no expert at coding but I normally manage to find my way through even the most complex of hacks (especially when instructions are as clear as they are on this one) but I seem to have come to a total standstill on getting this to work on my site.

Myself and the guy I run the site with are at a loss.

We (or should I say he) got it to work on one of our other sites (www.torpics.com) but we can't get it to work on http://www.sandbox.caleythistleonline.com/gallery/ for love nor money.

The problem seems simple, when you open up the image it's not allowing you to click it to get the lightbox.  Have read through this entire thread and tried everything.  I have a feeling I (we) are missing something really simple.

Rather than me posting up a load of stuff if someone gets a chance to have a look and tells me what they need to see or where I should be looking then that's probably easier.

Thanks in advance.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Sami on June 07, 2007, 02:25:22 pm
You missed step 2 of modification , check your theme.php again
Title: Re: LightBox JS for Fullsize Popup Image
Post by: CaleyD on June 07, 2007, 02:34:41 pm
theme.php located in gallery/themes/classic/ reads as follows

Code: [Select]
<?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) {
################################################
//Set max number of images
$max 10 //(-1 for all pics in album)
################################################
    
global $lang_display_image_php$CONFIG;
$i 0;
$pid $picId['pid'];
$aid = empty($_GET['album']) ? $picId['aid'] : $_GET['album'];
$pic_data get_pic_data($aid$pic_count$album_name, -1, -1false);
$imax 0; //counter
$max $max/2;
foreach ($pic_data as $picture){
if ($picture['pid'] == $pid) {
//the number of the picture in  order
$picnumber $imax;
}
$imax++;
}
//Check beginning and ending of album
if(! ($max == ((-1)/2))){
if ($imax $max){
if ($picnumber $max || $picnumber == 0){
$down 0;
$up + ($max*2);
}elseif (($picnumber $max) > $imax){
$down $imax - ($max*2);
$up $imax;
}else{
$down $picnumber $max;
$up $picnumber $max;
}
}else{
$down 0;
$up $imax;
}
}else{
$down 0;
$up $imax;
}

foreach ($pic_data as $picture) {
if ($i >= $down && $i <= $up){
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'fullsize');
}
$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
#################################################
?>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on June 07, 2007, 06:18:49 pm
I don't think anything is wrong in your code, your images are just to small.
When they fit in your page, no lightboxlist is created.

If you always want the lightbox to work, then you have to change some code in the first part of the update:

change:
Code: [Select]
        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";
        }

to:
Code: [Select]
#################################################
        //First part of lightbox update
        $pic_html = lightbox_list($CURRENT_PIC_DATA['pid']);
        //End of first part
#################################################
Title: Re: LightBox JS for Fullsize Popup Image
Post by: CaleyD on June 09, 2007, 03:24:40 pm
The above didn't work, it just stopped showing the images on the page altogether.

Decided it was easier to alter the gallery settings than try hacking the code for the lightbox and now have it working.

Thanks for the help.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: testomat on June 10, 2007, 02:41:30 am
How can i remove the animation of lightbox, because it is too slow ? Just only show the grey layer with the picture, with a next/prev button and comments under the picture.

Like this http://wolke10.de/Charming82     click on the picture. Next/Prev Button and Comments is only visible, if you signed on.



Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on June 10, 2007, 12:05:42 pm
You have two options:

you can change the current lightbox_s.js script this way:

FIND:
Code: [Select]
resizeDuration = (11 - resizeSpeed) * 0.15;

REPLACE WITH:
Code: [Select]
resizeDuration = 0;

This will stop the animation, but it can cause some flickering.

The second option is to download the latest version of the lightbox script at huddletogether.com (http://www.huddletogether.com/projects/lightbox2/#download), wich has an option to disable animation, but this won't have the functionality added by the people here (automatically redirect to current pic when sideshow ends etc...).
Title: Re: LightBox JS for Fullsize Popup Image
Post by: testomat on June 10, 2007, 10:10:01 pm
Hello Sawey,
thank you. That's it. I did it in my gallery.
One problem i only got, is that the prev/next button doesn't come up. I can't see it. You have an idea ?
I attached a zip file with my code.

You can see my gallery here: http://bilderbluete.de/e107_plugins/cpg149/displayimage.php?album=22&pos=1
Title: Re: LightBox JS for Fullsize Popup Image
Post by: dennis1 on July 12, 2007, 10:04:57 pm
thanks for the post works perfectly!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: igcr on July 23, 2007, 03:11:35 pm
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 (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

Code: [Select]
<?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
#################################################

?>
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on July 23, 2007, 03:35:49 pm
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:

Code: [Select]
#################################################
//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.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: igcr on July 23, 2007, 03:45:18 pm
THANK YOU :D It works!
Title: Re: LightBox JS for Fullsize Popup Image
Post by: 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/ (http://www.ronterburg.nl/gallery/)

Thanks in advance.

Rgds,

Ron
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rterburg on August 10, 2007, 02:04:35 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/ (http://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.
Title: Re: LightBox JS for Fullsize Popup Image
Post by: Sami on August 10, 2007, 02:18:59 pm
You've disabled Lightbox !
How could we find the problem without seeing that 
Title: Re: LightBox JS for Fullsize Popup Image
Post by: SaWey on August 10, 2007, 02:20:46 pm
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rterburg on August 10, 2007, 02:44:52 pm
You've disabled Lightbox !
How could we find the problem without seeing that 

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

Code: [Select]
--<?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
Title: Re: LightBox JS for Fullsize Popup Image
Post by: 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
Title: Re: LightBox JS for Fullsize Popup Image
Post by: rterburg on August 10, 2007, 03:00:01 pm