[pmwiki-users] annoying behavior of AllRecentChanges

Patrick R. Michaud pmichaud at pobox.com
Fri Mar 17 08:38:39 CST 2006


On Fri, Mar 17, 2006 at 09:22:55AM -0500, Neil Herber wrote:
> What I really want is a change journal, and that may be easy (for 
> someone who knows PHP) to do. The behavior I would like to see is:
> 1) log all edits
> 2) combine successive edits of the same page by one author into a single record
> 
> and if possible:
> 
> 3) if two successive edits of the same page by one author are more 
> than a day apart, do not combine them
> 
> Is there a cookbook entry for this that I have missed?

Not really.  Logging all edits is no problem --  it's just:

    $RecentChangesFmt['Site.AllEdits'] =
      '* [[{$FullName}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';

The key to getting this to work is to make sure that there *aren't*
two consecutive spaces in the formatting line (unlike the standard
RC entries which use the two spaces to figure out what's the same
and what is different).

I've never tried this, but one could conceivably reformat the line
to get successive edits of a page by a single author into a single
record:

    $RecentChangesFmt['Site.AllRecentChangesPerAuthor'] =
      '* [[{$FullName}]] $[by] $AuthorLink  . . . $CurrentTime: [=$ChangeSummary=]';

Note the two spaces after "$AuthorLink".  This will combine changes
of the same page by the same author into a single entry, but edits
from different authors will generate new entries.  It technically
doesn't show every edit --  it just shows the last edit for each
page by each author.

(Just to see if this works or not, I've now enabled the above on 
http://www.pmwiki.org/wiki/Site/AllRecentChangesPerAuthor, we'll
see how it goes.)

Does that get close enough, or is the fact that lines still get
replaced going to be too confusing?

I'll have to think about how I might rework RecentChanges to do
something along the lines of what you're asking.  I'm already
having to reconsider it for blogging support.

Pm




More information about the pmwiki-users mailing list