ZenphotoCMS Forum
(invisible) links to pictures before and after the actual album page - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: (invisible) links to pictures before and after the actual album page (/thread-9554.html)

Pages: 1 2 3


(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

Not in my "own" loop, but in the next_image-loop when zenphoto generates the thumbnails (the visible links )

here:

`




(invisible) links to pictures before and after the actual album page - acrylian - 2012-02-03

Then use imageNumber().




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

marvelous!!!




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

sigh
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




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

This seems to be a bug!

$_zp_current_album->getImages($page) does not consider, if sub-albums do effect the number of image thumbnails!

Wete




(invisible) links to pictures before and after the actual album page - acrylian - 2012-02-03

Not really, as only next_image() in "standard theme usage" does calculate that actually.




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

That means, there is no solution for my problem - to get a list of all image links before and after the actually shown set of image thumbnails. :-(

Wete




(invisible) links to pictures before and after the actual album page - sbillard - 2012-02-03

`
$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.




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

With $images = $album->getImages(0) I get a list of all images in $album. What I need are 2 lists:

  • 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




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

If it would be possible to calculate, how many image thumbs are shown on page 1, I could set that value as parameter for $firstPageCount in $images = $album->getImages

Wete




(invisible) links to pictures before and after the actual album page - acrylian - 2012-02-03

I suggest to take a look at next_image()'s code.




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

Solved it - with absolute values right now. Maybe I look for the variables for "thumbs on each row / page" ...

`




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-03

I read the next_image()'s code, but I felt like I did not reach the Age of Enlightment right now.




(invisible) links to pictures before and after the actual album page - acrylian - 2012-02-03

Great..:-)




(invisible) links to pictures before and after the actual album page - sbillard - 2012-02-04

There is a global varaiable $_firstPageImages which should contain the number you want. If it is not setup then you need to call the setThemeColumns() function.




(invisible) links to pictures before and after the actual album page - Wete - 2012-02-04

Great. This saved 2 hours of brain-squeezing - if I had known this fact yesterday.




(invisible) links to pictures before and after the actual album page - ferentz - 2012-09-26

Exactly what I was needing. Thank you very much Wete for sharing your code!

Regards,
Adrian




(invisible) links to pictures before and after the actual album page - ferentz - 2012-09-28

Sorry for bringing this thread up again.. I have a little problem with this piece of code from Wete's script:

$imageobject->getDefaultTitle()

Printing the title attribute for the hidden links doesn't print the string value from the database, it just prints the filename without the extension (i.e. "filename_13" instead of "Filename Thirteen"). This messes up the image presentation a bit for paginated albums. All of this is happening while it's counterpart in the visible thumb links loop

``

works just fine.. Also I would like to know if there is any way to get the image description?

(Something similar to this
``
I have tried looking here but with no succes http://www.zenphoto.org/documentation/classes/_Image.html )

Thank you very much!




(invisible) links to pictures before and after the actual album page - acrylian - 2012-09-28

Of course, you can get everything via the object model. $imageobject->getDesc(). $imageobject->getTitle(). The image class has parent classes shared with albums that provides this by inheritance (one definition for both):
http://www.zenphoto.org/news/zenphotos-object-model-framework#zenphotos-main-classes




(invisible) links to pictures before and after the actual album page - ferentz - 2012-09-29

Thank you very much Acrylian. It seems I really must spend some time learning about php object programming and zenpohto object model.

Regards,
Adrian