hi
I want to make a dynamic album called "portfolio".
I would like to display a random image taken in this album.
the getRandomImagesAlbum() function needs the folder name from which to get the image, but there is no folder created for a dynamic album.
so, how can I displayed a random image taken in a dynamic album ?
thanks for your help
Comments
so you pass it the album object.
could you help me to write the correct syntax to obtain the object of my dynamic album called "portfolio" ?
I'm stuck on this thing since one week :-(
thanks in advance.
I have read it before posting, but the only way to create an album object is with the folder name of the album :
`$albumobject = new Album($galleryobject,"");`
how should i do to create an object from a dynamic album ?
there is the code I try to implement :
`
<?php<br />
$gallery_object = new Gallery();
$album_object = new Album($gallery_object,'Portfolio.alb');
$image = getRandomImagesAlbum($album_object, true);
if (is_object($image) && $image->exists) {
echo '';
echo 'getCustomImage(null, 400, null, null, null, null, null, true)) . '" alt="' . html_encode(gettext('Gallery')) . '"/>';
echo '';
} ?>
Image du jour
but it doesn't work : the random pic is taken from the whole gallery and not in my dynamic album.
what's going wrong ?
maybe you could try something like that ?
`<?php printRandomImages(1,'daily-image','album','portfolio.alb','','',true);?>`
according to me, the problem will be the same.
@sbillard : I don't understand what you would say.
My dynamic album have 10 pictures.
Actually, the call of the function returns other pictures than de 10 ones of my dynamic album.
where is the problem ?
I get random pics from my dynamic album without problem.
Did you try it ?
Cheers.
you are right :
`<?php printRandomImages(1,'daily-image','album','portfolio.alb','','',true);?>` works well
and `<?php<br />
$gallery_object = new Gallery();
$album_object = new Album($gallery_object,'Portfolio.alb');
$image = getRandomImagesAlbum($album_object); ?>` works well too
but if I want daily picture it doesn't work : the random pic is taken from the whole gallery and not in my dynamic album.
=> the daily option seems to cause an issue.
What I mean is? Is there any functions that says getImagesAlbum, to list down all the contents of the dynamic album, instead of random. Thanks.
Of course dynamic albums are special as the images still belong to their real albums.