Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

ExpireDiff

Summary: How to remove a page's history
Version: 20150821
Prerequisites:
Status: Stable
Maintainer: Petko (original author: Pm)
Discussion: ExpireDiff-Talk
Categories: Administration
License: GPLv2

Question answered by this recipe

How do I remove a page's history?

Answer

The expirediff.phpΔ script adds ?action=expirediff, which removes all of the page revision history information from a wiki page. It requires the user to have edit permissions to the page, and handles locking. It also creates a backup copy of the page with the page revisions intact (same as if someone had requested to delete a page).

In addition, one can add the keepdays=nn parameter, which says to keep any page history within the past nn days. For example, ?action=expirediff&keepdays=7 will remove any page history older than seven days. By default keepdays is zero, which expires the entire page history.

You can also remove the history of all pages or only the history of a specified group. It is possible to specify some options when calling the function ExpireDiffAll from your config.php. The first parameter specifies the group whose files history should be removed. Default is '' which means all files. The second parameter specifies whether backups should be created, 0 means overwrite existing files (defaults to 1). Be careful with this option! The third parameter specifies which histories should be kept, see keepdays above (defaults to 0).

Example:
    
    ExpireDiffAll('Test',0,5);
    

means: Remove the history older than 5 days from all files within the Group Test and overwrite existing files (no backup).

To install this script, simply copy it into your cookbook/ subdirectory, and then add the line

    include_once('cookbook/expirediff.php');

to your local/config.php file.

Release notes

  • 20150821, Add license block and $RecipeInfo tag (Petko)
  • 20050824, Fixed bug introduced with last change (Klonk)
  • 20050810, Updated to add the action with help of $HandleActions (Klonk)
  • 20050414, Added function ExpireDiffAll (Klonk)
  • 20041218, original release (Pm)

See Also

Contributors

  • See Release notes for contributions to the source code.
  • Hagan, Suggestion to fix password protection.
  • Dfaure, Suggestion to add ExpireDiff to end of history page.
  • Ian MacGregor, Suggestion to style (via CSS) ExpireDiff on history page.
  • Petko is the maintainer of this recipe.

Comments

See discussion at ExpireDiff-Talk

User notes +2: 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.

Edit - History - Print - Recent Changes - Search
Page last modified on August 21, 2015, at 07:28 AM