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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

LightBox JS for Fullsize Popup Image

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

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Joachim Müller

Dragonfly (aka CPG for Nuke) is a distant relative to Coppermine. It has little in common with our code, since both apps forked long time ago. We can not advice, as we don't know how Dragonfly works. Ask for support on the Dragonfly community. If they can't help, you're stuck: we don't provide DF support at all.

Jo0Lz

Quote from: GauGau on September 25, 2007, 11:44:23 AM
Dragonfly (aka CPG for Nuke) is a distant relative to Coppermine. It has little in common with our code, since both apps forked long time ago. We can not advice, as we don't know how Dragonfly works. Ask for support on the Dragonfly community. If they can't help, you're stuck: we don't provide DF support at all.

CPG-Nuke is now DragonFly CMS, but I feel the community is bleeding. Lots of people are taking their distance from the CMS, because of the path the CMS has taken... I feel the support has died completely, lot's of things that I have on my site, are the things I managed to code/hack in myself.

Now, I have to say, the CMS is great. Functions great and the new ForumsPro is great aswell. Even if I wanted to switch over to another CMS, there is no easy way, to migrate. For the forums, I have all the awnsers, but coppermine, I can't get it to migrate, because of differences with current coppermine releases.

But, I've just managed to get the lightbox functionality into my Coppermine gallery! :D
After all that i've manually altered on my DF board, I'm almost becoming a developer :o

Thanks for your reply, GauGau.

merlin6666

Hi,

Lightbox is a really nice mod (a view count is still missed :( )
It`s in principle working on my website http://www.meyers-web.de, but only with larger pictures Album e.g. http://meyers-web.de/thumbnails.php?album=47 (800x600) and not with all the other albums (640x480).
I found this hint:

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

I have tried this, but then i got "click to enlarge" This is not what i expect.
SaWey can you help me or somebody else to get it work with smaller pictures

Thanks and regards

merlin6666

riderhk

Quote from: SaWey on January 28, 2007, 10:11:30 PM
Summary of how to get the Lightbox thingy working:
Step 3. Download slideshow.zip from http://ahavriluk.home.comcast.net/slideshow.zip.

I'm sorry but the link slideshow.ziip mentioned can not be reached, please let me know where I can download the zip file. Thanks in advance.

merlin6666


SaWey

Quote from: merlin6666 on October 22, 2007, 04:32:53 PM
...

What do you mean by "click to enlarge", it should work like the bigger sized pics.

merlin6666

Now i have changed the theme.php with your code for small pictures and you can see what happened.

No pictures appears only a link "click to enlarge" or in German "Klicken für Bild in voller Größe"

But now lightbox opened. 

merlin6666

@riderhk: you have to login to see attachment`s

SaWey

#268
Ah, yes, this problem occurred but didn't post the solution:

in the second part of the lightbox_update

FIND:

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


AFTER, ADD:

if(!file_exists($picture_url)){
$picture_url = get_pic_url($picture, 'fullsize');
}
[/s]

This should work

riderhk


merlin6666

Thanks SaWey,

its better working, but unfortunately not perfect.

The normal picture doesn`t change, if you click on another thumbnail.
Everytime the first picture of the album will be shown, after closing lightbox.

SaWey

Are you sure you have something like this:


#################################################
//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;
}
$picture_page = "./displayimage.php?album=".$picture['aid']."&pos=-".$picture['pid'];
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');
}
if(!file_exists($picture_url)){
$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\" music=\"scripts/slideshow/music/test.mp3\" picpage=\"$picture_page\" rel=\"lightbox[list]\" title=\"$pic_title\">";
$picList .= "<img src=\"$picture_url\" class=\"image\" border=\"0\" alt=\"$lang_display_image_php[view_fs]\" /><br />";
$picList .= "</a>\n";

}else{
$picList .= "<a href=\"$picture_url_fullsize\" music=\"scripts/slideshow/music/test.mp3\" picpage=\"$picture_page\" rel=\"lightbox[list]\" title=\"$pic_title\"></a>\n";
}
}
}
$i++;
}
return $picList;
}//End of second part
#################################################

merlin6666

Hi SaWey,

i have modified the second part from the post before.
Current status is: I can not see any normal picture.
Attached my theme.php
I hope you can find a solution

Many thanks
merlin6666

SaWey

Try replacing the second part of the update with the above one, as you haven't changed the code correctly.

you removed this code:

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

merlin6666

Sorry to bother you again, I have inserted the missed code, but i still see no intermediate picture  :(
Attached my theme.php (blackbirch)

SaWey

I can't find anything wrong atm, maybe you should start from scratch with this plugin...
With all I said, it works on my install.

hell

Can anybody attach the modification files on theme fruity please, because i try 3 days to make it work but nothing please ..

technozeus

Hi, first this mod is graet! ;D
It works all fine but I have a little problem: I can't see the next and previous buttons.
You can see an example HERE.
In the template.html I add this code:
The pats are correct and the files are in...
Thank for your help!

SaWey

That is because you haven't followed the steps correctly, look a little back in the thread till you get to the last complete instructions.

technozeus

Now it works, I've missed a little mod in the mod of code ;D
sorry and thanks for your great job!