[pmwiki-users] Capture all pages within date range.

Ben Wilson dausha at gmail.com
Tue May 22 13:35:38 CDT 2007


On 5/22/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
[...]
> > However, I want to have a page (Summary-2007W21) list all journal
> > entries for that week. Each week, there will be a new summary page. In
> > six months, a visitor should be able to visit Summary-2007W21 and see
> > the same pages as they would this week.
>
> Okay, then
>
>     (:pagelist if="date {(ftime %GW%V {*$Name})} {=$Name}" :)
>
> which returns all of the pages where the name is in the same
> week as that of the current page.

Spot on!

[...]
>
> Even simpler would be to make it a page variable instead of a
> page text variable:
>
>     $FmtPV['$NameISOWeek'] =
>       "strftime('%GW%V', array_shift(DRange(\$name)))";
>
> Then {$NameISOWeek} returns the ISO week corresponding to the page's name,
> for any page.  Then you can do pagelist of pages in the current ISO week
> with:
>
>     # all pages in the current week
>     (:pagelist $NameISOWeek="{(ftime %GW%V)}" :)
>
> And to get all of the pages in the same week as the current
> page (e.g., Summary-2007W21 [1]):
>
>     (:pagelist $NameISOWeek={*$NameISOWeek} :)
>
> This would even work if the Summary page has a "normal" date in its
> name instead of a week date -- for example, all of the names below
> would evaluate to the same value of $NameISOWeek (i.e., "2007W21"):
>
>     Summary-2007-05-24
>     Summary-20070521
>     Summary-20070527-XYZ
>
> See, as an example, http://www.pmwiki.org/wiki/Test/NameISOWeek .

Hmm. Is this available now? I upgraded the site using subversion
(Exported revision 2062), but the above does not work. This appears to
be the trunk revision. I believe what you have scratches the itch
perfectly.

-- 
Ben Wilson
"Words are the only thing which will last forever" Churchill



More information about the pmwiki-users mailing list