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:

Instead of the default directory ordering you can sort by mtime or ctime.
< my $dirsortby = $r->dir_config('GalleryDirectorySortBy');
<               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
[email protected]

users mailing list
[email protected]