ZenPage Combinews group by publish date

What I would like with the Combinews feature is group images by their publish date rather than the creation date.
For example I shot some pictures about 2 months ago with the images dates set 2 months back and the publish date set to today, but I can't get the "x new items in album y" news article on top of my previous ones

I have the combinews feature enabled with the "Latest images by album: thumbnail" option.
Tried changing the CombiNews Sort order, but none of the 3 options (id, date, mtime) give the result I want.
I thought mtime would group in the order uploaded but they are still grouped by image creation date, with the `getNewsDate()` function inside the `next_news` loop displaying the published date from last image, today??

Comments

  • acrylian Administrator, Developer
    Combinews uses the value that is stored in the "date" column of the image db entry. What date is stored there depends on meta data import. It would be possible to sort by publish date but that does not exist. Of course then all images would have to have a publish date otherwise the results would be unexpected as well.

    You could open a ticket and then this probably can go into 1.4.3.

    (As noted id and mime don't and can't really work directly as articles by definition are sorted by date only (maybe this sort orders should even be removed with 1.4.3...).)
  • Pitty I'll have to modify the ZenPage plugin.. Ok I'll try out opening a ticket.
    Yeah publish dates are needed. I would like to set these automaticly on the date I upload the images (I'll FTP them to the server)
    I guess I need to write a plugin with filter that sets the publish date?

    Any tips welcome. Especially as in to about where I can change the creation date to publish date..
  • acrylian Administrator, Developer
    Yes, you would have to modify the plugin indeed. A ticket will put this as an option on the list for 1.4.3. That is quite some time though as that is schedule in a few months. f you really need this now look at the zenpage-class.php and getCombiNews(). This contains the db queries.

    Yes for setting the publish date you need to create a filter. You need to read and understand the object model of Zenphoto first. (the publish date is actually meant to be used for scheduled publishing).

    Sidenote, generally the ID is the order of discovery from the filesystem. So that roughly equals the publish order (unless you unpublished new items by default naturally).
  • OK, Ill give it a try. I wanted to use ZP also to archive my old photo's, so I can "publish" photo's on the day I'll upload them and the "(creation) date" becomes secondary.
    Cheers acrylian for the hints!
  • acrylian, I tried your tip and changed the query from
    `DATE_FORMAT(images.date,'%Y-%m-%d')`
    to
    `DATE_FORMAT(images.publishdate,'%Y-%m-%d')`

    The resulting array from `getCombiNews()` looks good.
    The `next_news()` loop groups the right articles by publishdate but I get
    "0 new images in album X" and no thumbnails.

    I am kinda stuck here..
    I find the `getCombiNews()` function in use in
    zp-extensions/zenpage/zenpage-template-functions.php
    getNumNews()
    next_news()
    getLatestNews()
  • acrylian Administrator, Developer
    The combinews function uses a UNION query so you need only to change the image one for the right option. If images have no publish date it might get unexpected results. There might need to be other place that need changes

    Sorry, I don't know that offhand and have also no time right now to dig into this in-between. Please create ticket and I will look into it for 1.4.3.
  • OK I found it :-)
    I needed to mod the `getNewsTitle()` and `getNewsContent()` queries from date -> publishdate
    `... AS images WHERE publishdate LIKE ...`
Sign In or Register to comment.