ZenphotoCMS Forum
Display image number on image.php - 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: Display image number on image.php (/thread-3106.html)



Display image number on image.php - os07 - 2008-06-16

Is there a way to display the "sequential" image number on the image.php page?

I.e., if there are four images in the album, when displaying the first image, you would have a field that read "1", when displaying the second image, the field would read "2", etc. (No need for showing total number in album.)

Thanks!




Display image number on image.php - acrylian - 2008-06-16

You know we have a documentation?: http://www.zenphoto.org/documentation-official/zenphoto/_template-functions.php.html#functionimageNumber




Display image number on image.php - os07 - 2008-06-16

Yes, sorry. It's right there. Looked at the file, but I guess not closely enough. Took all of ten seconds to implement, even for me.

What I am trying to do is to have a visual link to each image in the album using the image's sequential number as the basis for the link. Kind of like having a little visual "menu" just consisting of image numbers, with the current image link always highlighted as the user moves through the images in the album.




Display image number on image.php - os07 - 2008-06-17

Is there a way to specify a specific image number (i.e., the image's number in the album's sequence)? I am not experienced much in PHP, I'm afraid.

Thank you.




Display image number on image.php - sbillard - 2008-06-17

No single function, but as with most anything, there is a way:

`$images = $_zp_current_album->getImages();

$tenthimage = new Image($_zp_current_album, $images[10]);`

Of course, you need to be sure there is such an image!




Display image number on image.php - acrylian - 2008-06-17

sbillard, I think he has something different in mind like this:
`

">

`
That prints a " 1 2 3 4 etc" list of the images in the album where the current image is not a link.




Display image number on image.php - os07 - 2008-06-17

Thank you. What I am trying to do is to have a little menu on the image page, so that under each image would be:

1 2 3 4 5 ...

And each number would be a link to that sequential image in the album. A different sort of navigation than the and buttons.




Display image number on image.php - acrylian - 2008-06-17

That is exactly what my code above does.