Member
Member
flu   2008-08-25, 19:32
#1

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 "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 ?)

Administrator
Administrator
acrylian   2008-08-25, 19:58
#2

Hm, good idea, we probably should have that as an option...

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

Member
Member
flu   2008-08-25, 20:17
#3

Danke Acrylian !
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).

Member
Member
flu   2008-08-26, 18:36
#4

Well, I don't get it :
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 "getAlbumThumb()."\">\n "; if($showtitle) { echo "name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n"; echo $tempalbum->getTitle()."\n"; }

Administrator
Administrator
acrylian   2008-08-26, 19:02
#5

The code I posted should replace the $tempalbum->getAlbumThumb() in this line echo "getAlbumThumb()."\">\n ";

I definatly think about adding that as an option parameter some time, but, well, these functions have already a lot parameters...

Member
Member
flu   2008-08-26, 19:48
#6

Thanks Acrylian.
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 "getAlbumThumbImage()."\">\n ";
Sorry to ask again...

Administrator
Administrator
acrylian   2008-08-26, 20:11
#7

Change echo "getAlbumThumbImage()."\">\n ";

to

echo "name."&i=".$tempalbum->getAlbumThumbImage()."&cw=75&ch=75\">\n ";

Sorry there was a typo (beware of mixing single and doube quotes!). Also I did not try that myself yet, it should theoretically work...

Member
Member
flu   2008-08-26, 20:29
#8

Thank you Acrylian.
In fact I get this in my generated html code :
[img]/mywonderfullwebsite/zenphoto/zp-core/i.php?a=album-name/subalbum-name&i=Object&cw=75&ch=75[/img]
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

Administrator
Administrator
acrylian   2008-08-27, 14:56
#9

Ok, I had an error in my example. Since I think about adding it as an option, here we go again:

Replace the line in question with this:
$albumthumb = $tempalbum->getAlbumThumbImage(); echo "name."&i=".$albumthumb->name."&s=75&cw=75&ch=75\">\n ";

Member
Member
flu   2008-08-27, 17:06
#10

Woaw ! That did the trick !
Wunderbach ! Thank you, Acrylian !

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.