MajorChanges
Questions answered by this recipe
- How can I track all major changes to pages instead of "recent" changes
- How can I have an RSS feed show major changes only
Description
Create group.MajorChanges pages and Site.AllMajorChanges to track all major changes..
I've been unsatisfied with Recent Changes as implemented in PmWiki and although there are several Cookbook recipes available for modifying the Recent Changes behaviour, I decided to roll my own Major Changes tracking. I have left the Recent Changes processing unaltered.
Recent Changes track the last change to each page - each entry is overwritten as a new change is made to that page. Modifications described in other cookbooks allow you to track the last change made per author or track ALL changes. What I wanted was something to track ALL of the changes, but not repeat multiple edits for the same "change". This means that if an author edits the page several times but keeps the Summary of the change the same, it only creates a single entry on the Major Changes pages. If the author changes the Summary, then a new entry is made on the Major Changes pages. If the Minor Edit checkbox is checked, then an entry is never made on the Major Changes pages.
In this way, all major changes are documented without the extreme of logging each individual edit.
In order to accomplish this configuration change, we make several changes to one of the local configuration files local/farmconfig.php
, local/config.php
, or local/group.php
.
- The first change defines the recent changes output to include the new Site.AllMajorChanges page and the group.MajorChanges pages. This is not done for minor edits. By rearranging the order of the information and placing the magic "2 consecutive blanks" just before the current time, we add a new entry for the change unless only the time is different.
- The second change adds Recent Uploads tracking to the Major Changes pages too since I use Cookbook:Recent Uploads. The detailed information about the uploaded file is included in the Major Changes pages and the information has been reordered to match the recent changes order.
- The third change adds the AllMajorChanges and MajorChanges pages to the list of "recent" pages that pagelist should normally ignore.
# Add Major Changes # record every major change unless just different date/time if (@$_POST['diffclass'] != 'minor') { $RecentChangesFmt['$SiteGroup.AllMajorChanges'] = '* [[{$Group}.{$Name}]] . . . $[by] $AuthorLink: [=$ChangeSummary=] [$CurrentTime]'; $RecentChangesFmt['$Group.MajorChanges'] = '* [[{$Group}/{$Name}]] . . . $[by] $AuthorLink: [=$ChangeSummary=] [$CurrentTime]'; } # record uploads as major change if (@$_REQUEST['action'] == 'postupload') { $RecentUploadsFmt['$SiteGroup.AllMajorChanges'] = '* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]' .' . . . $[by] $AuthorLink ($upsize) [$CurrentTime]'; $RecentUploadsFmt['$Group.MajorChanges'] = '* [[{$Group}/{$Name}]]/[[(Attach:{$Group}.{$Name}/)$upname]]' .' . . . $[by] $AuthorLink ($upsize) [$CurrentTime]'; } # add AllMajorChanges and MajorChanges to the normal pages Search should ignore $SearchPatterns['normal']['recent'] = '!\.(All)?(Recent|Major)(Changes|Uploads)$!';
If the page Site.AllMajorChanges is used as part of an RSS feed, the RSS feed will show all of the major changes made to a wiki.
Notes
Release notes
See also
Other Recent Changes cookbooks:
Other related cookbooks:
Contributors
Comments
See discussion at MajorChanges-Talk?
User notes +1: 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.