display the Last image in the Index?

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 :)

Comments

  • fretzl Administrator, Developer
    First activate the `image_album_statistics` plugin.

    Then I use this:
    `<?php printLatestImages($number=1, $albumfolder='', $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='',$width=600,$height=600,$crop=false);?>`

    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/
  • 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.
  • acrylian Administrator, Developer
    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:
    `<?php printLatestImages(1,'', $false, false, false, 40,'',600,600,false);?>`
  • 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.
  • acrylian Administrator, Developer
    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.
  • Nice, it's fine now. Thank you again.

    I'll also try with zenpage later.

    Zenphoto is great! :D
Sign In or Register to comment.