|
Cookbook /
Limit Diffs per pageSummary: Paginate the "diff" output (when viewing a page history, limit the number of displayed revisions at once)
Version: 20100217
Prerequisites: PmWiki post-March 2006.
Status: Stable/Beta
Maintainer: Petko
Categories: Administration Editing
![]() See the bottom line. Questions answered by this recipeIs there a possibility to display a smaller number of revisions, on a number of sub-pages? DescriptionA page history can become quite big, as seen on pmwiki.org. When you then take a look at the history, it takes quite some time. This recipe displays a smaller number of revisions, on a number of sub-pages. This is a conversion of my fix, supplied at PITS.00544, into an independent recipe. The distribution file scripts/pagerev.php is replaced on the fly by the provided patched script. Installation
if ($action=='diff') {
$DiffCountPerPage = 10; # Optional
include_once("
Note. Version 20090713 of the recipe will automaticaly incorporate InlineDiff if it exists on the server. To make it work, copy the InlineDiff directories and files in the /cookbook/pagerevinline/ directory, and include_once only the LimitDiffsPerPage recipe in config.php. Note that recent PmWiki versions have a word-level diff highlighting, so PmWiki 2.2.12 with the latest limitdiffsperpage2.php version 20100217 or newer do not need the InlineDiff files. See To enable inline diffs on the wiki markup by default, you can place this code in config.php, right before the "include_once()" line: if(!isset($_GET['source']))
$_GET['source'] = $_REQUEST['source'] = 'y';
Otherwise you will need to follow the "Show changes to markup" link. ConfigurationThe one and only configuration variable is $DiffCountPerPage = 4; # show 4 revisions $DiffCountPerPage = 10; # show 10 revisions (recipe default) $DiffCountPerPage = 0; # show all revisions, like PmWiki NotesThe PmWiki methods to display page history were modified and simplified in PmWiki version 2.2.11 and 2.2.12.
Using this recipe to display diffs is never slower than the original pagerev.php, but it can be drastically faster, especially on pages with long revision history. The patched file was submitted in March 2006. The script has been tested for a long time and should work fine. Release Notes
See Also
Contributors
Comments
User notes: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |