Pages (3):    1 2 3   
Member
Member
Wete   03-02-2012, 15:44
#21

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

here:

`

Administrator
Administrator
acrylian   03-02-2012, 15:55
#22

Then use imageNumber().

Member
Member
Wete   03-02-2012, 15:59
#23

marvelous!!!

Member
Member
Wete   03-02-2012, 16:24
#24

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

Member
Member
Wete   03-02-2012, 16:57
#25

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

Administrator
Administrator
acrylian   03-02-2012, 17:17
#26

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

Member
Member
Wete   03-02-2012, 17:21
#27

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

Member
Member
sbillard   03-02-2012, 18:02
#28

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

Member
Member
Wete   03-02-2012, 18:29
#29

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

Member
Member
Wete   03-02-2012, 18:45
#30

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

Administrator
Administrator
acrylian   03-02-2012, 19:11
#31

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

Member
Member
Wete   03-02-2012, 19:11
#32

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

`

Member
Member
Wete   03-02-2012, 19:12
#33

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

Administrator
Administrator
acrylian   03-02-2012, 19:29
#34

Great..:-)

Member
Member
sbillard   04-02-2012, 00:53
#35

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.

Member
Member
Wete   04-02-2012, 16:51
#36

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

Member
Member
ferentz   26-09-2012, 16:24
#37

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

Regards,
Adrian

Member
Member
ferentz   28-09-2012, 17:03
#38

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!

Administrator
Administrator
acrylian   28-09-2012, 17:16
#39

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

Member
Member
ferentz   29-09-2012, 12:08
#40

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

Regards,
Adrian

Pages (3):    1 2 3   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.