Pages (2): 1 2   
Member
Member
lamy   24-07-2012, 15:15
#1

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

Administrator
Administrator
acrylian   24-07-2012, 16:40
#2

I am not sure I exactly understand what you are trying to do. You want to list articles with the same date as an album on that album's page?

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.

Member
Member
sbillard   24-07-2012, 16:42
#3

I presume you mean a function you can use to make a news item current since makeAlbumCurrent() will indeed do so for an album. No such function currently exists. However the code you would want is:

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!

Member
Member
lamy   25-07-2012, 07:25
#4

Hey,

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!

Administrator
Administrator
acrylian   25-07-2012, 11:05
#5

If you are using the COmbiNews mode you can set several things via the options that then are put out by printNewsContent.

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.

Member
Member
lamy   27-07-2012, 14:40
#6

Thanks for your reply!

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?

Member
Member
sbillard   27-07-2012, 16:22
#7

There is no method for that in the album class. However, the album class does have a method to return the thumbnail image and the image class does have a custom size method that can return a thumb the size you want.

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.

Member
Member
lamy   30-07-2012, 15:37
#8

Okay, apparentyl, I am too dumb for this :-(.
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!

Administrator
Administrator
acrylian   30-07-2012, 15:57
#9

You need to read the documentation correctly:

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.

Member
Member
lamy   30-07-2012, 17:43
#10

FINALLY!!!
OMG, IT WAS THAT EASY!
dancing

Thank you very much for your patience!

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.