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

0 views
Skip to first unread message

Daniel Roesler

unread,
Jan 14, 2009, 10:43:09 AM1/14/09
to PmWiki Devel Mailing List
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
dia...@gmail.com

_______________________________________________
pmwiki-devel mailing list
pmwiki...@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply all
Reply to author
Forward
0 new messages