|
Cookbook /
ExpireDiffSummary: How to remove a page's history
Version:
Prerequisites:
Status:
Maintainer:
Categories: Administration
Question answered by this recipeHow do I remove a page's history? AnswerThe expirediff.phpΔ script adds In addition, one can add the 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 Example:
ExpireDiffAll('Test',0,5);
means: Remove the history older than 5 days from all files within the Group 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. See Also
Contributors
CommentsShouldn't this be also password protectable? Klonk I made a little modification to add a pwd parameter to pass to the action, you have to encode your password into the expirediff.php file. I use it on my site. Here is the code I added to the original recipe:
<?php
if ($action=='expirediff') {
# Added code START
# Change ABC to the password you like
SDV($MyPwd,'ABC');
$InputPwd = @$_REQUEST['pwd'];
if (! $MyPwd == $InputPwd ) { Abort("Wrong password!!"); }
# Added code END
Lock(2);
.......
Starting with version 2.0.beta50, you can password-protect the action with $HandleAuth['expirediff'] = 'edit';
or $HandleAuth['expirediff'] = 'admin';
to require the edit or admin password respectively.
floozy, That didn't quite work because you could expired the diff without having edit privileges. I made some similar changes that should work. Specifically,
Thanks! --Hagan
You may also add the following code to your
...
include_once('cookbook/expirediff.php');
...
if ($action == 'diff') {
$ExpireDiffFmt = <<<_EOT_
<div id='wikiexpire'>
<form action='\$PageUrl' method='post'>
<input type='hidden' name='action' value='expirediff' />
<input type='hidden' name='n' value='\$FullName' />
<p>Expire difference(s) older than
<input type='text' name='keepdays' value='7' /> day(s)</p>
<input type='submit' />
</form>
</div>
_EOT_;
$HandleDiffFmt = array(&$PageStartFmt, &$PageDiffFmt,
'function:PrintDiff',
&$ExpireDiffFmt, &$PageEndFmt);
}
...
-- Dfaure
#wikiexpire {
border: 1px solid #aaaaaa;
background-color: #dddddd;
padding: 2px 2px 2px 2px;
font-weight: bold;
}
You can change the above styling, just like any other css styling, to suit your skin. --Ian MacGregor ExpireDiffAll('Test',0,5); |