[Home]WikiPatches/QuickRevertToLastRevision

UseModWiki | WikiPatches | RecentChanges | Preferences

Many times, it is useful to quickly revert back a revision for the page so here is a quick hack.

Look for the function doEdit() in wiki.cgi and look for the line

    print &GetHistoryLink($id, T('View other revisions')) . "<br>\n";

And add the following two lines before this.

    $revision = $Page{'revision'} if ($revision eq '');
    print &GetOldPageLink("edit",$id,$revision-1,T('Revert to last revision')) . " | ";

You should have something like

    print '<div class=wikifooter'>;
    $revision = $Page{'revision'} if ($revision eq '');
    print &GetOldPageLink("edit",$id,$revision-1,T('Revert to last revision')) . " | ";
    print &GetHistoryLink($id, T('View other revisions')) . "<br>\n";

So now while editing, you can click on "Revert to last revision".


UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited September 16, 2007 12:57 am by JuanmaMP (diff)
Search: