HideDiff

Summary: Hide specific edits from page histories
Version: 20220120
Prerequisites: PmWiki 2.3.1 or more recent
Status: Experimental
Maintainer: Petko
License: GPLv2+
Users: (view? / edit)
Discussion: HideDiff-Talk?

Is there a way to hide or delete some edits from page histories?

Description

Hide specific edits from page histories, or revert and delete recent edits.

An open wiki that anyone can edit, occasionally gets spam, vandalism or simply inexperienced users may break something unintentionally. While it is easy to revert to the previous version, the "bad" edits and the reverts stay visible in the page history, which can be distracting or even disturbing.

This recipe allows for edits to be marked as "hidden" and to not appear in page histories, except to the wiki administrator. The "hidden" edits and their diffs are kept in the page history.

In addition, the recipe allows the administrator to blank any number of the most recent edits, and instantly revert to an earlier version. For security purposes, the "expunged" edits are blanked but not fully removed; the time stamps, user names, and IP addresses are kept (hidden) in the page history in case the administrator needs to review them at a later point.

Installation

  1. Place hidediff.phpΔ in your pmwiki/cookbook directory.
  2. Add to config.php such a line:
    if($action == 'hidediff') {
      include_once("$FarmD/cookbook/hidediff.php");
    }

Configuration

Internationalization

The following strings can be translated in an XLPage, for example in French:

'Show hidden' => 'Afficher les modifications cachées',
'Expunge' => 'Effacer',
'Submit changes' => 'Enregistrer',
'Confirm' => 'Confirmer',
'Confirm checkbox unchecked.' => 'Case confirmer non cochée.',

Usage

Instead of opening Page?action=diff, an administrator can open Page?action=hidediff.

The new action page looks very much like the history page, augmented with a few additions:

  • There are checkboxes "Hide" before the time stamps. These can be checked to mark the edit as "hidden", or unchecked if a hidden edit needs to be made visible.
  • At the top, and at the bottom of the page, there are "Submit changes" buttons that allow to save the state of the "Hide" checkboxes.
  • At the top, there is a checkbox "Show hidden" that allows to show or hide "hidden" entries.
  • Hidden edits are shown with a red dotted border.
  • Next to the "Restore" link, there is a new checkbox "Expunge". Checking it, and then clicking on a button which appears after it, will cause the page to be restored, and that edit, and all later edits, to be blanked and hidden. Unlike the "Restore" link, this is instant, the edit form does not open for preview. This makes it very easy to clean up recent spam.

Notes

Edits marked as "hidden" are actually hidden from the page history since PmWiki 2.3.0.

To do / some day / maybe

If you have future plans or wishes for this recipe.

Change log / Release notes

  • 20220120 Fix a typo.
  • 20220118 Allow for internationalization. First public release, ready to be tested.
  • Early January 2022, recipe written and tested on pmwiki.org.

See also

Cookbook /
FuseEdit  Merge the latest successive minor edits in page histories (Beta)
LocalTimes  Display RecentChanges and History timestamps in the local timezone of each visitor. (Beta)
Security  Security authentication and authorization methods and systems
SpamFilters  Automatic blocking of some spambots (beta)

Contributors

Written and maintained by Petko

Comments

See discussion at HideDiff-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.