[pmwiki-users] pagelist order=month?

Peter Bowers pbowers at pobox.com
Fri Sep 4 08:36:49 CDT 2009


On Fri, Sep 4, 2009 at 8:15 AM, Graham Archer<Graham.Archer at sun.com> wrote:
> order=month lists ....  Jan,Feb,Mar,Apr ..etc
> order=-month lists .... Dec,Nov,Oct,Sept ....etc
>
> I can't figure out a way to order the pagelist other than alphabetically

Looking through
http://www.pmwiki.org/wiki/PmWiki/CustomPagelistSortOrder I see it
doesn't have an example that will help you in what you are doing, so
here's some more help.

For month, set up an array like this:

$Months = array ('Jan'=>1, 'Feb'=>2, ..., 'Dec'=>12);

then compare

$Months[PageVar($pagenamex, '$:Month')] with
$Months[PageVar($pagenamey, '$:Month')]

That will get you past the alphabetic comparison...

(Subtracting rather than comparing those 2 values may optimize slightly.)

-Peter



More information about the pmwiki-users mailing list