[pmwiki-users] Arbitrary filtering for (:pagelist:) - code VS wildcards

Michael Tempest michael.tempest at ate-aerospace.com
Wed Jul 19 05:47:03 CDT 2006


Hi

On Tuesday, July 18, 2006 3:05 PM, Caveman wrote:
> Not sure I understand what you are trying to do, but it sounds like
> you could just use wildcards.  From the pagelist documentation, it
> uses this example:
> 
>     # All pages in the PmCal group with names starting with "2005":
>     (:pagelist name=PmCal.2005* :)
> 
> So in your case you could perhaps try
> 
>     (:pagelist YourGroup.Event-2007*:) for all pages in that year...
> Or even maybe
>     (:pagelist *.Event-2007*:)   Haven't tried this though.

I have pages like MyGroup.Event-2006-07-18, MyGroup.Event-2006-07-20,
MyGroup.Event-2006-07-21, MyGroup.Event-2006-07-22.

I also have two more pages: MyGroup.PastEvents and
 MyGroup.FutureEvents.
The (:pagelist:)s on those pages should filter the pages against
the current date. That is, MyGroup.PastEvents should list
MyGroup.Event-2006-07-18 today (since today is 19 July 2006) but
in a week's time it should list all of the event-pages above.

My problem is that I don't know how to do numeric comparisons
in a regex. I don't think it can be done, but I'll be delighted
if I'm wrong :-)

> Hope this helps!
> 
> Cheers
> Caveman

Thank you - I hope I made it clearer this time. (I'm learning the
hard way that the RPM (Read Programmer's Mind) op-code doesn't work
on people either...)

Have a great day
Michael

> On 7/18/06, Michael Tempest wrote:
> > I have pages in my PmWiki that are applicable to a specific date,
> > like a calendar. I've encoded the data in the name (for example
> > "Event-2006-07-13"), which lets me order by name (or -name) and
> > the pages are ordered by date. (I can't use creation date or 
> > last-modified date - these pages may be created in any order and
> > will often be modified after the applicable date.)
[snip]
> > I added a "filter" option to MakePageList() in pagelist.php,
> > configured with a new global called $SearchFilterFunctions.
[snip]
> > This all works. My question is - is there a better way?
> >
> > 1) Is there a way to do with without modifying pagelist.php?
> >
> > 2) I'm not very familiar with php's array functions (in fact,
> >    PmWiki is my first encounter with php), so is there a better
> >    way to reduce the list than
> >    "$list = $SearchFilterFunctions[$opt['filter']]($list);" ?
> >
> > 3) I've not been working with (:pagelist:) for very long. As a
> >    generalisation, is it better to be inclusive or exclusive
> >    with pagelists and the like? I've chosen to include pages
> >    that don't match the desired form. Would it be better to
> >    exclude them?





More information about the pmwiki-users mailing list