ZenphotoCMS Forum
Archive view sort method - 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: Archive view sort method (/thread-5772.html)



Archive view sort method - Barbara - 2009-08-31

Right now in archive view looks like all the files are sorted by name. How can I change this to filemtime?




Archive view sort method - acrylian - 2009-08-31

What archive view?




Archive view sort method - Barbara - 2009-09-02

The link near the rss feed in the default theme for example, this one http://site.com/zenphoto/page/archive
There's a list with all the months and the number of the photos uploaded.
When I click on the month the photos are sorted by name, I would like to have them sorted by the time of the upload.




Archive view sort method - sbillard - 2009-09-02

That view is produced by the search.php script. You would have to change the next_image() function to pass in the sorttype and direction. See the functions guide for detils. If you want to do this only for these date searches, you will have to make the parameters conditional on the search being that kind. (isset($_REQUEST['date']))




Archive view sort method - Barbara - 2009-09-03

Just an attempt cause I know nothing about php. I changed
` to

`
Of course, it's not working. Can you help a bit? Thanks.




Archive view sort method - sbillard - 2009-09-03

Well, you have to pass a string for the sort type and direction so it would be "mtime" and "DESC" if you want descending otherwise just leave out the parameter.

Plus, you can't put a part of a loop in an if statement. So our if statement should setup say $sorttype and $sortdirection Then pass these as parameters in the original loop.

`




Archive view sort method - Barbara - 2009-09-04

Thank you! It does not appear to be working, though. The images are still sorted by name...




Archive view sort method - sbillard - 2009-09-05

Seems that the serarch class did not implement the passing of sorttype and direction. But don't dispair. It will be there in tonight's build.




Archive view sort method - Barbara - 2009-09-06

Thank you! Works like a charm.




Archive view sort method - sbillard - 2009-09-07

Glad to help