[Pmwiki-users] Restrict page searches by date
Patrick R. Michaud
pmichaud
Tue Apr 27 20:42:33 CDT 2004
This sounds like a great option to add -- I'll see about adding
it to the default search. Indeed, it might be worthwhile to see
about adding sort-by-date options to the search and search markup/
search results tags. This would then make it possible to provide
alternate views of the RecentChanges on a site (i.e., show me pages
changed within the past two days, sorted by date of change).
Pm
On Wed, Apr 28, 2004 at 02:25:52PM +1200, John Rankin wrote:
> I have been asked about limiting searches to 'pages modified since ...',
> with the idea that the search form includes radio buttons for
>
> (*) All pages ( ) 90 days ( ) 30 days ( ) 7 days
>
> This appears relatively easy to implement as a local search.php,
> although I haven't tried it yet:
>
> modify $SearchTagFmt, extend the $Search array, then
>
> $global $Now;
> $cutoff = ($Search['days']) ? $Now - 86400 * $Search['days'] : 0;
>
> ...
>
> if ($page['time'] < $cutoff) continue;
>
> It would also be easy to show the modified date ($page['timefmt'])
> in the search results, which may be useful in some cases.
>
> I couldn't find any discussion of this in Development or Cookbook.
>
> 1. Would others find this useful?
>
> 2. Any chance that it could be added to pmwiki as an option?
>
> 3. What about alternatives like pages *not* modified since ... ?
>
> 4. Has anyone already done this?
> --
> JR
> --
> John Rankin
More information about the pmwiki-users
mailing list