ZenphotoCMS Forum
display the Last image in the Index? - 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 the Last image in the Index? (/thread-4447.html)



display the Last image in the Index? - nicx - 2009-01-11

Hello!

All I want is to display the last image from the entire gallery in index.php. No thumbnails needed, I want it with normal dimensions (just as it is in image.php - getDefaultSizedImage)

So can anyone help me with the code? Thanks in advance




display the Last image in the Index? - fretzl - 2009-01-11

First activate the image_album_statistics plugin.

Then I use this:
``

It gives me the latest image in the entire gallery at 600px wide or 600px high (depending on the orientation of the image)

The way I am showing it is not the right way but it works and probably makes more sense to you.

You should also read:
http://www.zenphoto.org/documentation/plugins/_plugins---image_album_statistics.php.html
and
http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/




display the Last image in the Index? - nicx - 2009-01-12

Are you sure for this? Because I don't see $width and $height parameters in the printLatestImages function. However, it doesn't work for me.




display the Last image in the Index? - acrylian - 2009-01-12

The width and height parameters are new in the svn/nightly and not available in the official 1.2.2 version.

However the right usage is of course without the variable names:
``




display the Last image in the Index? - nicx - 2009-01-12

Thanks! It's working, but not exactly what I need.

Please think about displaying the image in its default sizes, not the defined ones. Most of the people (including me) are uploading photos with different dimensions.

Or at least make possible an option to define only one size. Width as an example - then the height will be calculated towards to the width and the image will keep its original proportions.

I'm asking for this because I want to make Zenphoto more than gallery. I'm thinking to combine photoblog + gallery in one. So on top of the index should be the lastest photo(s) and below are the albums.




display the Last image in the Index? - acrylian - 2009-01-12

That is already possible. If you look at the svn/nightly image_album_statistics plugin's printLatestImages() you will find in the commented documentation:

  • @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
  • @param integer $height the height/cropheight of the thumb if crop=true else not used. (Default 85px)
  • @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not

If you want to do a photoblog I suggest to take a look at the Zenpage plugin and the CombiNews mode. That might save you some work.




display the Last image in the Index? - nicx - 2009-01-12

Nice, it's fine now. Thank you again.

I'll also try with zenpage later.

Zenphoto is great!