[pmwiki-devel] [Patch] Add deep linking to Page History

Daniel Roesler diafygi at gmail.com
Wed Jan 14 09:43:09 CST 2009


Currently, you are not allowed to link directly to a specific page
revision in the Page History. I've created a simple patch that
basically adds an anchor tags to each diffbox with a unique time
notation (unix time). That way, you can link directly to that revision
with a ?action=diff#[uniquenumber] (i.e.
http://example.com/wiki/Main/HomePage?action=diff#1231775855).

Patch for /scripts/pagerev.php

Change lines 26-28 FROM:
------------------------------
SDV($DiffStartFmt,"
      <div class='diffbox'><div class='difftime'>\$DiffTime
        \$[by] <span class='diffauthor'
title='\$DiffHost'>\$DiffAuthor</span> - \$DiffChangeSum</div>");
------------------------------
TO:
------------------------------
SDV($DiffStartFmt,"
      <div class='diffbox'><div class='difftime'><a
name='\$DiffTimeUnique'
href='{\$PageUrl}?action=diff#\$DiffTimeUnique'>\$DiffTime</a>
        \$[by] <span class='diffauthor'
title='\$DiffHost'>\$DiffAuthor</span> - \$DiffChangeSum</div>");
------------------------------

Change line 76 FROM:
------------------------------
    $diffgmt = $match[1]; $FmtV['$DiffTime'] = strftime($TimeFmt,$diffgmt);
------------------------------
TO:
------------------------------
    $diffgmt = $match[1]; $FmtV['$DiffTime'] =
strftime($TimeFmt,$diffgmt); $FmtV['$DiffTimeUnique'] = $diffgmt;
------------------------------

Avast!
Daniel Roesler
diafygi at gmail.com



More information about the pmwiki-devel mailing list