I want list all albums by its sub albums updated date

Dear support,

I want list(sort) all albums by its sub albums or images updated date, how to do that?

currently I'm listing albums by date, but it is sorting only newly created albums, but not updated albums.

Comments

  • acrylian Administrator, Developer
    HAve you tried setting the option to "filemtime"? Besides that you can list the latest updated albums using the image_album_statistics plugin.
  • There is an option which will transfer the date of a newly uploaded image to the album date of its parent album. Is that what you are looking for?
  • @acrylian:
    I have updated the album options with your solution, with the following query:

    `UPDATE ``zp_albums` SET sort_type ='mtime', subalbum_sort_type='mtime' WHERE 1

    it is working exactly, but it is descending order, but i want latest first!

    @sbillard: Yes, is there another sort way, we can do it.
  • 1. You need to set the direction to ascending. If you wish to do this with SQL, the filed is `album_sortdirection` and needs to be set to 1.

    You can also set all these things via the admin edit facility.
  • Hello sbillard,

    i have changed album_sortdirection=0, but stills the list didn't get change.

    How to change this in admin in single page/click?
  • Well, of course if you sedt it to 0, not 1 as I said above, it will not give you what you want!

    As for how to set it in the admin section--take a close look at the gallery options page.
  • Thanks sbillard, i will try it.
  • sbillard: latest image date was updated album date, but it is not updating it's parent album( which is don't have images, only sub albums).
  • Sorry, there is no option to update anything but the containing album.
  • Is there any possible we can get it future? or please give me idea, how to update the album date with it's latest sub album date.
  • acrylian Administrator, Developer
    You probably could write a function to check the subalbums' dates of an album and then change the parent album's date with the newest found. You will have to use the class methods for that.
  • You can build a filter that does this. Register to the the `new_image` filter. You can use the `filter-new_objects` plugin as a starting point. The `new_image` filter will be called each time a new image is instantiated. Your code should walk back the parent chain setting the date fields as you see fit.
  • Has anyone done this? I would like to do the same thing, but not reinvent the wheel.
Sign In or Register to comment.