Hi everybody!
I'd prefer to use Fancybox instead of image.php to show the single images of an album. It's no problem to change the image links in album.php, so that I have a nice slideshow in Fancybox, but the problem is, that with this approach I only have those images, which are shown on the actual album page. Fancybox should show all images of the album - like the original slideshow of ZenPhoto.
To solve this problem, I could place invisible links `(
)` before and after the image thumbnails that contain exactly the complement image links. The other solution would be to show ALL images of an album on one album page, what would be problematic for large albums.
There is the function `$images = $album->getImages();`, but is there another function which gives back "all images on previous album pages" and "all images on next album pages"?
Greetings!
Wete
Comments
Now I only need the answer. (Images on previous pages, images on next pages ...)
;-)
Wete
Page 1: no invisible links / 12 thumbs / 38 inv. links
Page 2: 12 inv. links / 12 thumbs / 26 inv. links
Page 3: 24 inv. links / 12 thumbs / 14 inv. links
Page 4: 36 inv. links / 12 thumbs / 2 inv. links
Page 5: 48 inv. links / 2 thums / no inv. links
Wete
So I only need values for "actual page" and "number of pages in this album". `getGalleryPage( )` should help.
Thx!
Wete
I now have a wonderful list of all images I need - but without path. I thought, this would work, but it does not. :-(
`
<?
$galleryobject = new Gallery();
$albumobject = new Album($galleryobject,$_GET['album']);
$albumseiten = getTotalPages();
$aktuelleseite = getCurrentPage();
if (($albumseiten > 1) AND ($aktuelleseite > 1)) {
for($vorseite = 1; $vorseite < $aktuelleseite; ++$vorseite) {
$bilder = $albumobject->getImages($vorseite);
$i=0;
foreach ($bilder as $bild) {
$bild = html_encode(getUnprotectedImageURL($bilder[$i]));
++$i;
echo''."\n";
}
}
}
?>
`
Wete
`
$albumurl = '/galerie/albums'.substr(getAlbumLinkURL(), 8);
`
`
$galleryobject = new Gallery();
$albumobject = new Album($galleryobject,$_GET['album']);
`
http://www.zenphoto.org/news/zenphotos-object-model-framework#global-object-variables
`getUnprotectedImageURL($bilder[$i])`
http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functiongetUnprotectedImageURL
`
<?
$galleryobject = new Gallery();
$albumobject = new Album($galleryobject,$_GET['album']);
$albumseiten = getTotalPages();
$aktuelleseite = getCurrentPage();
if (($albumseiten > 1) AND ($aktuelleseite > 1)) {
for($vorseite = 1; $vorseite < $aktuelleseite; ++$vorseite) {
$bilder = $albumobject->getImages($vorseite);
$i=0;
foreach ($bilder as $bild) {
$bild = $bilder[$i];
$imageobject = newImage($albumobject,$bild);
++$i;
echo'getFullImage().'">'."\n";
}
}
}
?>
`
Wete
Update: You have the number of the image already, why not just echo `$i`?
here:
`
<?php while (next_image()): ?>
<?php endwhile; ?>
`
instead of the "xx"
The whole system does not work properly in "mixed" albums because of the "wrong" number of thumbnails on the first album page. It's a pity.
But there must be a solution. ZenPhoto knows which images have to be on page 2, even if there are less then the usual quantity on page 1.
Wete
`$_zp_current_album->getImages($page)` does not consider, if sub-albums do effect the number of image thumbnails!
Wete
Wete
$images = $album->getImages(0);
foreach ($images as $imagename) {
$image = newImage($album, $imagename);
}
`
In other words, you need to revert to the object model when the built-in functions do not do what you need.
- all images before the actually shown set of image thumbs
- all images after the actually shown set of image thumbs
No file should be listed twice, so that you can watch all images of the album in lightbox/fancybox/... in the given order and without repetitions or gaps. The first list + the set of thumbs + the second list would make such a list.
Wete
Wete