[pmwiki-users] Pagelist ordering by name

Simon nzskiwi at gmail.com
Tue Oct 13 01:11:48 CDT 2009


Thanks Peter, thats great

2009/10/13 Peter Bowers <pbowers at pobox.com>

> On Mon, Oct 12, 2009 at 11:53 AM, Simon <nzskiwi at gmail.com> wrote:
> > I've been wanting to do something similar,
> > with the added proviso that if the first wiki work is one of A, An, The
> then
> > that should be ignored in the sort.
>
> Here's a rough idea, depending on the {$Title} for your sorting, but
> getting rid of A, An, & The:
>
> $article_pat = '/^(?:The|An?) /i';
> SDV($PageListSortCmp['title_no_article'],
>    '@strcasecmp(preg_replace(\''.$article_pat.'\', \'\',
> $PCache[$x][\'=title\']), preg_replace(\''.$article_pat.'\', \'\',
> $PCache[$y][\'=title\']))');
>
> The quoting is pretty messy and could be cleaned up, but it seems to
> work in my (albeit brief) testing.
>
> -Peter
>



-- 
____
http://kiwiwiki.co.nz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20091013/30d25a5a/attachment.html 


More information about the pmwiki-users mailing list