I have this project I've been working on that will involve drawing a small picture each day and uploading it to a gallery. After looking at some alternatives, ZenPhoto looks like it might be the best for this, but I'm trying to figure out how to hack together a custom front page using Zen's theme system:
I want the front page to display the latest image at a large size (like 760 x 380), maybe even followed by thumbnails of the five or so next latest. Anyone know what code I might be able to do this with? Thanks!
Comments
You'll need access to some of the image-context functions. You'll need to use the set_context() function to have access to those.
Grrr.... I don't. Sorry. I'll try and rewrite it this weekend.
After some poking around with the theme files, I think I see what to use to display the image itself, so I guess it would be a question of how to use set_context() before the image call. Would you (or any themers who might happen across this) be able to fill me in a bit on how this one function works?
ZP_INDEX
ZP_ALBUM
ZP_IMAGE
ZP_COMMENT
ZP_GROUP
I'm not too sure as to what the group context is all about since I haven't delved into the new code yet, but let's take the album context as an example.
Themes will have an index.php -- this file shows a listing of all the albums. When you click on one of the albums, you're now using album.php. This is basically what handles the display of the albums page (where all the thumbnails for the images are shown). It is in this file that your context is automatically set to ZP_ALBUM. This allows album.php to have access to all of the functions that affect albums such as getting the album's title, getting the album's date, getting the album's thumbnail, etc.
In your case, you'll want to manually set the context to ZP_ALBUM but you'll want to do that inside index.php. The context that is automatically set inside index.php is ZP_INDEX. This means that you won't have access to the album fucntions. This is why you'll need set it manually.
So, you use the set_context() function by the following:
`... ...
set_context(ZP_ALBUM);
set_context(ZP_INDEX);
... ...`
That's all.
I think this explanation you gave shouldn't be lost in the forums. It should be immortalized in the wiki.
I stuck it under http://www.zenphoto.org/trac/wiki/DeveloperReference#Functions in the Developer Reference on the wiki, and it can be edited as necessary from there. I needed to edit it a bit from the first person perspective, so take a look and see what you think.
`set_context(ZP_IMAGE);
printDefaultSizedImage(getImageTitle());`
Is there a function similar to set_context() to set the current image that will be fetched by printDefaultSizedImage() ?
Good luck with the development. If I decide I need a full-on gallery later, I'll know where to go!