Mail Index


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ApacheGallery] patch to allow sorting of directories



Very nice. In the past I've just prefaced directory names with "YYYYMMDD-" but I'll definitely be giving this a try. Thanks.

On Apr 9, 2004, at 2:34 PM, Chris Knight wrote:

I wanted to sort some directories based off of their create date (instead of
their name).  (More usefull in .htaccess than httpd.conf)

See example: http://ck1.is-a-geek.org/pics/House

GalleryDirectotySortBy
Instead of the default directory ordering you can sort by mtime or ctime.

217,218d216
<
< my $dirsortby = $r->dir_config('GalleryDirectorySortBy');
220,224c218
<               if ($dirsortby && $dirsortby =~ m/^(mtime|ctime)$/) {
<                       @directories= map(/^\d+ (.*)/, sort
map(stat("$filename/$_")->$dirsortby." $_", @directories));
<               } else {
<       @directories = sort @directories;
<               }
---
              @directories = sort @directories;
_______________________________________________
users mailing list
users@xxxxxxxxxxxxxxxx
http://ufo.hestdesign.com/cgi-bin/mailman/listinfo/agusers


_______________________________________________
users mailing list
users@xxxxxxxxxxxxxxxx
http://ufo.hestdesign.com/cgi-bin/mailman/listinfo/agusers