Hi,
I'm trying to get some custom thumbnails for my last updated albums and print them on the main page of my galley, so I try to tweak the image_album_statistics.php plugin but I can't manage to mix the getAlbumThumb() function and the printCustomAlbumThumbImage() function.
Would you be kind enough to tell me what I have to change in this line :
echo "<img src=\"".$tempalbum->getAlbumThumb()."\">\n";
(line 140 of image_album_statistics.php)
to get a 75px x 75px square thumbnail for example (or maybe a simpler way to proceed...) ?
Thank you for your time.
(something else : I don't see the search form anymore till the forum upgrade. Is it normal ?)
Comments
You would have to use `$tempalbum->getAlbumThumbImage()` and a image url like this:
`WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75`
More about these direct image processing options on top of `zp-core/i.php`
Excuse me but... where am I supposed to add
WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75
exactly ?
As I'm not a coder (as you guess) this simple question is very important to me (anyway I can try to find it by myself but it will take a year getting 1 billion syntax errors).
I'm not sure how to incorporate this option into my function printAlbumStatisticItem.
Could you please tell me how to make it work with it :
`
function printAlbumStatisticItem($album, $option, $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='') {
global $_zp_gallery;
$albumpath = rewrite_path("/", "index.php?album=");
$tempalbum = new Album($_zp_gallery, $album['folder']);
echo "name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
echo "
";
if($showtitle) {
echo "
name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
\n";echo $tempalbum->getTitle()."
}
`
";`
I definatly think about adding that as an option parameter some time, but, well, these functions have already a lot parameters...
I'm sorry but I just get an error processing like that.
I'm not sure to understand exactly where I have to put
`WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75` exactly in the function printAlbumStatisticItem :
`
function printAlbumStatisticItem($album, $option, $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='') {
global $_zp_gallery;
$albumpath = rewrite_path("/", "index.php?album=");
$tempalbum = new Album($_zp_gallery, $album['folder']);
echo "name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
echo "
";
`
Sorry to ask again...
";`
to
`echo "
";`
Sorry there was a typo (beware of mixing single and doube quotes!). Also I did not try that myself yet, it should theoretically work...
In fact I get this in my generated html code :
`
which doesn't print the thumbnail. When I directly paste the adress above (mywonderfullwebsite/zenphoto/zp-core/i.php?a=album-name/subalbum-name&i=Object&cw=75&ch=75) in my browser adress bar, I get :
The Zenphoto object you are requesting cannot be found.
Album: albums/album-name/subalbum-name
Image: Object
Theme page: index
Replace the line in question with this:
`
$albumthumb = $tempalbum->getAlbumThumbImage();
echo "
";
`
Wunderbach ! Thank you, Acrylian !