display first image of album on index

My problem is that I want to display the first image of an album on the index page one time.. if possible including a link to that album..
I got as far as finding a thread which deals with a similar problem and this code:

`<?php global $_zp_gallery;<br />
$alb = $_zp_gallery->getAlbums(0);

$first = $alb[0];

$firstAlbum = new Album($_zp_gallery, $first);

$img = $firstAlbum->getImages(0);

$first = $img[0];

$firstImage = new Image($firstAlbum, $first);

?> `

The problem is now to display an image thumbnail but not use the "while-next-Album"
function as it should be a unique image...

I hope somebody understands what my problem is and might have a hint as I'm no php expert...

Comments

  • You will need to gain a bit of php knowledge. You can find the documentation of all the relevant zenphoto functions on the zenphoto.org 'User Documentation' page.
  • Thank you, I'm trying to gain php knowledge all the time, just sometimes I get kind of stuck
  • acrylian Administrator, Developer
    hamsterbacke82: So you want to show only one unique image of one album on index.php, like on a photoblog? If you could use the nightly build and the printlatestimages function that now can show the latest (=first?) image of an album. See the documentation for more info.
  • Thank you I will keep on trying
Sign In or Register to comment.