Hi!
Long time no see, I'm glad to see that Zenphoto is so successful!
I want to include the Zenpage posts in the Albums-View as follows:
Album 1 (13th of March)
Album 2 (14th of March)
News1 (15th of March)
Album 3 (16th of March)
News2 (18th of March)
and so on.
I have already managed to collect the timestamps and names of the zenpage posts and the albums and I have sorted them by the timestamps. The resulting array looks like this:
array(3) { [0]=> array(3) {
["Datum"]=> int(1343080800)
["Name"]=> string(9) "Test-Post"
["type"]=> string(4) "news" }
...
[2]=> array(3) {
["Datum"]=> int(1343141224)
["Name"]=> string(10) "Test-Album"
["type"]=> string(7) "gallery"
}
Now I am looking for a function like makeAlbumCurrent(); that I can use to output the albums.
Any suggestions?
Cheers!
lamy
Comments
Or do you just want to list articles and albums togehter as a kind of news page? Then the easiest is to do that on the news page and use the combinews mode "latest albums".
In any case you should take a look at the object model.
`
save_context();
add_context(ZP_ZENPAGE_NEWS_ARTICLE | ZP_ZENPAGE_SINGLE);
$_zp_current_zenpage_news = new ZenpageNews($titlelink);
`
Where `$titlelink` is the title link of the news article (Which you do not yet have in your array.) You should do a `restore_context()` after you are done with the article.
NOTE: this code has not been tested!
thank you for your replies, I appreciate them. However, I have decided not to pursue that idea but to use ZenPages included functionality instead (pagination was too complicated for me).
However, I have managed to get the album thumbnail displayed with the function
$_zp_current_zenpage_news->getAlbumThumb();
Is it somehow possible to get a custom album thumbnail?
Thank you!
You can of course skip that and use the object model directly to do all manually. If the news item is an album object as in this case you can use all album class methods. Please see the functions documentation.
I have already tried everything I could think of to get it right, but I just can't. There is no method in the album class that returns me the custom thumbnail that I want. (920x400px).
Letting the theme handling it is for various reasons not an option. Do you have another idea for me?
BTW, not sure about that size being a "thumb" even though you can do it. The difference between thumbnails and normal sized images (other than size) is the watermarking choices.
Can you help me get this right?
$img = newImage($_zp_current_zenpage_news, $_zp_current_zenpage_news->getAlbumThumb());
$img->getCustomImage(920,920,250,920,250,100,100);
Thanks!
If `$_zp_current_zenpage_new` is an album object:
1 `$_zp_current_zenpage_new->>getAlbumThumb()` gets the URL to the album thumb image.
2. `$_zp_current_zenpage_new->>getAlbumThumb()` gets the image object of the album thumb.
OMG, IT WAS THAT EASY!
*dancing*
Thank you very much for your patience!