Summary: Search the RecentChanges entries similarly to a pagelist
Version: 2010-02-05
Prerequisites: PHP 5, Pmwiki 2.0 or beyond
Status: Beta
Maintainer: Peter Bowers
Users: (View? / Edit?)
Download: greprc.phpΔ
Discussion: GrepRC-Talk

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

  • How can I view just some part of the RecentPages without having to resort to the overhead of a pagelist?
  • How can I see changes just by one author?
  • How can I see changes made during a certain date range?
  • How can I see changes made to just certain pages?


Search RecentChanges entries by page name, author, date, etc. and list matching lines.


Download attach:greprc.php and put it in your cookbook directory.

Include this line in your config.php or farmconfig.php:


Optionally set any default values in $GrepRCDefaults array.

If you have changed your RecentChanges format then you will need to set a new value for $GrepRCPat. This will require some knowledge of regular expressions.

Place the (:recentchanges:) markup on a page in the location you want to view the subset of lines. (Include arguments to that markup or include arguments in your URL to specify the search.)


The following arguments are honored:

  • name=x,y,-z just like pagelist syntax, but applied to the page names row by row in RecentChanges
  • group=a,b,-c yeah, like pagelist again
  • list=default (or all or whatever) once again, the pagelist syntax thing
  • scanlines=100 Only scan the first 100 lines of the RecentChanges page (default 1000)
  • after=datestring only list lines where the date occurs after this date string (date can be anything strtodate() recognizes -- "yesterday", "last week", "November 21, 2007", "last Monday", etc.)
  • before=datestring just like after but before. (isn't that profound?)
  • authname=Sam,Jane* Specify just like name= or group= but it applies to author names instead (wildcards accepted)
  • source=Site.AllRecentChanges Get the lines from a different page besides $Group.RecentChanges.

Arguments can be specified in one of 3 ways, each successive one superseding the prior one:

  • Defaults set in config.php by setting in the $GrepRCDefaults array
    $GrepRCDefaults['scanlines'] = 500;
    $GrepRCDefaults['after'] = "last week";
  • Arguments specified in the (:recentchanges:) markup (put quotes around arguments with spaces)
    (:recentchanges scanlines=500 after="last week":)
  • Parameters in the URL (replace spaces with + sign)

Defaults are overridden by markup arguments. Markup arguments are overridden by parameters in the URL. This allows an administrator to set global defaults but a page author can set it up to see what he wants to see and then a page viewer can change those defaults without editing the page. (The URL parameters also allow forms to be created to do the search very easily.)

Note that most (all?) of this capability and more could be easily created via pagelists. However, a pagelist can easily take tens of seconds to generate if it is at all complicated (see WatchLists) whereas this recipe can quickly scan through a single page without taking hardly any time or system resources.

Changes to your RecentChanges format or to your standard time format or etc. will have significant impact on this recipe and will require potential re-coding or at least re-configuring.

I cannot verify whether it will work for sites in other languages.

A form could very easily be set up like this, allowing dynamic searches to be done:

(:input form method="GET":)
(:input default request=1:)
|| border=1 width=50%
|| Page Names:|| (:input text name:) ||
|| Group Name(s):|| (:input text group:) ||
|| Author Name(s):|| (:input text authname:) ||
|| Show changes '''before''' this date:|| (:input text before:) ||
|| Show changes '''after''' this date:|| (:input text after:) ||
|| ||(:input submit Search Search:) ||
(:input end:)
Page Names:
Group Name(s):
Author Name(s):
Show changes before this date:
Show changes after this date:

Release notes

  • Release 2010-02-05 Initial release

See also



See discussion at GrepRC-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.