Skip to main content.
home | support | download

Back to List Archive

Re: Reverse sort date

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Mon Jul 29 2002 - 00:03:35 GMT
At 04:53 PM 07/28/02 -0700, Scot Hacker wrote:
>Right - but in the swish.cgi script, the highest rank appears first by
>default when sorting  by rank, while the oldest date appears first by
>default if sorting by  date. I would think the default would be that the
>most recent docs appear first on a date sort.

Ah.  Sure you could argue that.  So look for a function called
"set_sort_order" and you will see this bit of code:

     my $direction = $sortby eq 'swishrank'
        ? $q->param('reverse') ? 'asc' : 'desc'
        : $q->param('reverse') ? 'desc' : 'asc';

So that's making an exception for swishrank.  So you just want to apply
that to the date, too, right?

Something like:

    my $direction = $sortby eq 'swishrank' || $sortby eq 'swishlastmodified'
        ? $q->param('reverse') ? 'asc' : 'desc'
        : $q->param('reverse') ? 'desc' : 'asc';

I didn't test, but that should get you close.

Hope that helps.


-- 
Bill Moseley
mailto:moseley@hank.org
Received on Mon Jul 29 00:07:12 2002