Custom thumbnail size for Album

Hi there,

I'm doing a custom theme and after looking through the zenphoto cms and the forums for more info I can't seem to find how to change the thumbnail size for albums on the index page. I would have though it would be in options but it looks like I need to change a bit of the code.

I've changed the print thumb image code to: printCustomAlbumThumbImage

Which throws back up the full size image as a thumb currently. I'm not much of a developer, but I'm not sure where I put in the image dimensions in the arguement.

It now reads:

<?php printCustomAlbumThumbImage(getAnnotatedAlbumTitle()); ?>

Which I know is wrong. I want the images width to be 190. It'd be perfect if it actually ran off the same bit of script used to gallery thumbs in the album page, that's generated from the options menu, but I think that's quite a bit more complex! lol.

Any help or ideas would be really appreciated.

Comments

  • Thanks for the link. I've done various attempts, but I'm not sure how to put in the different values.

    <?php string printCustomAlbumThumbImage( string $alt, int $size, [int $width = 190], [int $height = 100], [int $cropw = NULL], [int $croph = NULL], [int $cropx = NULL], [int $cropy = null], [string $class = NULL], [string $id = NULL] );?>

    If I take out bit's im not using, what do i need to leave in it's place if anything? I'm getting the error message:

    Parse error: syntax error, unexpected T_STRING in /home/matthewbriuk/public_html/megamegamega/mega/themes/default MEGA/index.php on line 26
  • I get what I need to insert, but exactly where? The guide isn't making that very clear..
  • acrylian Administrator, Developer
    Since that functions is for a custom album thumb you need to replace the printAlbumThumbImage() function on your theme's album.php (or index.php for the toplevel albums) with it. Please also read the theming tutorial if you haven't already.
  • Got it, thanks. Although, can I use
    `<?php printCustomAlbumThumbImage( $alt, $size, $width = 140, $height = 78 ); ?>`
    instead of
    `<?php printCustomAlbumThumbImage( $alt, $size, $width = 140, $height = 78, $cropw = NULL, $croph = NULL, $cropx = NULL, $cropy = null, $class = NULL, $id = NULL ); ?>`
    ?
    I tried it and it seems to work but I just want to be sure cutting the extra stuff out doesn't cause any potential conflicts anywhere else..
  • acrylian Administrator, Developer
    You did not read http://www.zenphoto.org/2008/04/how-to-read-the-zenphoto-functions-guide/ as suggested to mbrindle, did you?

    You need to write `<?php printCustomAlbumThumbImage(NULL, NULL, 140, 78 ); ?>` (instead of NULL "" will work, too) if you don't set parameters before the ones you use. You can skip the ones after if there is none used since they always have default values (indicated by `$class=NULL`). If you want to set `$id` for example, you need to set the ones before to NULL/"", too.

    Also a look at the theme files itself and the theming tutorial should give a little insight in how php functions are used.
  • I did go over that, but I can see why you think I didn't. Thanks a lot for the assistance, I'll keep my eyes more open next time.
  • acrylian Administrator, Developer
    I hope you did not get me wrong. I thought that because you posted `$height = 78` as paramenter value example. This is normally a sign not to have read the above mentioned article.

    If that article is somehow not clear enough please let us know. Feedback is always appreciated.
  • No-no, we understand each other. I read that page, I just apparently didn't get thorough enough with it the first time. After really focusing on it, it's all perfectly understandable.
  • acrylian Administrator, Developer
    Alright!
  • Hello there,

    as you can see, I'm not any good at php. But I need to fix the size of the albumthumbs
    I read all these posts, I read the "how to read" file. I read the function file. I think I somehow understood how it is supposed to work principally, but whatever I type in there my images will not change their size. When I copy the code that acrylian suggested it will also not affect the image size.

    It seems I just don't get it.
    I know I can't expect it, but I would be very thankful if one of the pros could walk me through this. For you it's few minutes, for me an infinite loop.

    Thank you for your time

    Best
    Sebastian
  • acrylian Administrator, Developer
    It is important what theme page you put the code. The code is meant for the album thumbnail (representing an album). So it goes into the next_album loop on the album.php page.

    You also should also clear your image cache.
  • Thank you very much!

    That's what I thought too. I can't explain it myself, but changes only apply once I alter the code in gallery.php, where I found the same code. To be exact: As far as I can see, zenphoto runs nice an smoothly even if I delete album.php.

    In general, there is something strange happening. E.g. editing themeoption.php will not do anything, also deleting the file seems to have no effect. But changing values on the theme option panel will do something.

    I must have made a mistake somewhere along the line duplicating your zenpage theme, which I did to customize it.

    E.g. if I want to add a menu with menu_manager zenphoto will offer "effervescene", "zenpage" and "mytheme" as possible locations for the navigation. But only placing menus under "zenpage" will create output on my theme, even though I deleted the complete "zenpage"-theme folder.

    E.g. once I hit the "edit" button under the duplicated theme I can't edit the files. zenpage throws out a warning:

    Fatal error: Die Datei kann nicht bearbeitet werden! in /homepages/2/d94567386/htdocs/alexberg/zp-core/functions-common.php on line 284

    seems like the path to my theme is messed up.
    I can edit the css file though....

    any idea?

    Thank you

    Sebastian
  • acrylian Administrator, Developer
    Yes, there are two places where album thumbs appears. The album index page for the top levels ( depending on the theme structure on official themes either index.php or gallery.php) and for possible subalbums of an album (album.php). You should know that if you read the theming tutorial :-) That is the case with the Zenpage theme. On complex third party themes that have custom structure there might be more places.

    themeoptions.php creates the theme options on the backend. The top of that tab is theme independent, those below are theme specific and should disappear actually.

    However if you copy a theme it shares the same options with the original unless you rename the options (specific ones have a prefix "zenpage_"). Others are general options that are automatically prefixed theme dependent like search enabled.

    The menu_manager uses sets which have nothing to do with the theme. In this case the theme can setup a set that is named "zenpage". You can have several sets and call them in various places. The Zenpage themes only calls the set "zenpage".
  • Dear acrylian,

    thank you again for your time.
    I did read the theming tutorial. But I will get back to it. I don't want to ask stuff that's already answered.

    I changed al the prefixes to "my_theme". I'm totally new to the structure of zenphoto. Using it will clear the the clouds I guess.

    I found the menu_manager problem. I forgot to enable it on theme option panel. sorry for that, a lot check boxes...

    I still wanted to say that I like zenphoto and zenpage a lot.
    I very glad I found it.

    I still have some other issues but they belong in other topics.

    Thank you

    Sebastian
  • acrylian Administrator, Developer
    Glad you like it. Yes, like any other program it takes some time to get used to. But the core functionality is really easy as you might learn on the way.

    Yes, the best is to use separate topics for each issue.
Sign In or Register to comment.