Member
Member
Barbara   2009-08-31, 11:02
#1

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

Administrator
Administrator
acrylian   2009-08-31, 12:12
#2

What archive view?

Member
Member
Barbara   2009-09-02, 14:41
#3

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.

Member
Member
sbillard   2009-09-02, 23:13
#4

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']))

Member
Member
Barbara   2009-09-03, 18:57
#5

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

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

Member
Member
sbillard   2009-09-03, 20:15
#6

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.

`

Member
Member
Barbara   2009-09-04, 21:53
#7

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

Member
Member
sbillard   2009-09-05, 00:54
#8

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.

Member
Member
Barbara   2009-09-06, 18:23
#9

Thank you! Works like a charm.

Member
Member
sbillard   2009-09-07, 01:13
#10

Glad to help

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.