I found the getalbumstatistic and getimagestatistic functions. I'm new to all this and want to use these to make a nested loop where I get each recent album and for each recent album show the most recent images. How do I feed the name of each recent album from the getalbumstatistic function to the name field of the getimagestatistic function?
PS. I can tell already, I'm going need to start learning some PHP...
Comments
`<?php <br />
$latestalbums = getAlbumStatistic(5, "latest");
foreach ($latestalbums as $latestalbum) {
printImageStatistic(5, "latest", $latestalbum['title']);
}
?>`
I think I will add this nested setup as a extra function to the plugin.
Is there a way to create recent image listings from each album in a way that works on the standard build?
Also, another, somewhat unrelated question. On an image page, the images can be paged through with next and previous links. Is it possible to setup an images page that will include all albums, not just one? In chronological order?
The image_album_statistics plugin looks like it has not changed much, though. I believe it will work with the 1.1.7 release. Give it a try.
It is certainly possible to set up page navigation the way you describe. However, it is not simple. We have no functions that do that kind of paging so you would have to code it yourself.
In any case. I fixed your code to work on 1.1.7 the way I expected it to the first time. It was a fairly simple and silly thing.
`<?php<br />
$latestalbums = array(getAlbumStatistic(3, "latest"));
foreach ($latestalbums as $latestalbum) {
printImageStatistic(3, "latest", $latestalbum['title']);
}
?>`
You can see the results at my site, www.ronquillostudios.com
its the stopdesign theme, with the latest gallery output replaced by the above code. Pics are all test images to populate a couple albums.
EDIT: for some reason the loop is only outputing three images, not three from each of the three albums...
That is because your fix fixed the error but not the functionality. The array that is returned does not have the structure that you need. Please try the plugin from the nightly. As sbillard already said it probably will work with 1.1.7 without any problems.
[I don't need to have it be an option for the purposes of my hackery: totally fine with simply replacing the thumb grab with a medium-sized image grab.]
`
$albumthumb = $tempalbum->getAlbumThumbImage();
echo "name."&i=".$albumthumb->name."&s=75&cw=75&ch=75\">\n";
`
Change to something like:
`
$albumthumb = $tempalbum->getAlbumThumbImage();
$url = $albumthumb ->getCustomImage($size, $width, $height, $cropw, $croph, $cropx, $cropy, true);
echo "img src=".$url.">\n";
`
where you have filled in $size, etc. with the values you want.
`
foreach ($images as $image) {
echo "getImageLink() . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
$url = $image ->getCustomImage('default', null, null, null, null, null, null, true);
echo "getTitle()) . "\" />\n";
`
Working like a charm.
(I just noticed, as far as I know, that `echo "img src=".$url.">\n";` is supposed to be `echo "\n";`)
Is there a way to publish recent photos outside of the zenphoto folder/template?
I have zenphoto on its own folder and have an index php file on my server like homepage, is there a way to display the thumbnails on it?
Peace