ZenphotoCMS Forum
Forum RSS smilesmile Notifications4InboxBookmarksAccount Options New Discussion Quick Links My Dis - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Forum RSS smilesmile Notifications4InboxBookmarksAccount Options New Discussion Quick Links My Dis (/thread-13166.html)



Forum RSS smilesmile Notifications4InboxBookmarksAccount Options New Discussion Quick Links My Dis - smilesmile - 2018-11-04

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




Forum RSS smilesmile Notifications4InboxBookmarksAccount Options New Discussion Quick Links My Dis - fretzl - 2018-11-04

Can you please change the title of your topic to something that actually makes sense?
Thanks.




Forum RSS smilesmile Notifications4InboxBookmarksAccount Options New Discussion Quick Links My Dis - acrylian - 2018-11-04

I second fretzl's request for a proper topic title ;-)

As far as I understand you want a combine listing of albums and articles on the same page, the album.php? This is not directly possible with the standard theming especially not with proper pagination.

There was once a feature called "CombiNews" that allowed albums being listed within articles (so the other way round). This was technically a "beast" (especially to maintain) since both item types work a bit different being different tables and it was outside the core object model. Therefor it was dropped a while ago.

But it would be possible to mix articles within albums if you don't care that the items per page number may vary and that pagination may be a bit weird.

There is no makeArticleCurrent() function. Instead take a look at the object model that lies below everything:
https://www.zenphoto.org/news/zenphotos-object-model-framework/

Info on the Zenpage classes here:
https://docs.zenphoto.org/package-plugins.zenpage.html

Fetch the articles and on those that match the album date of the page create an news article object. You then could pass that object to the global $_zp_current_news_article to use standard news article template functions. Or you use the object model directly. It may have some unexpected side effects though.