On Wed, Mar 11, 2009 at 4:13 PM, Peter Bowers <span dir="ltr"><<a href="mailto:pbowers@pobox.com">pbowers@pobox.com</a>></span> wrote:<br><div><div class="h5">On Wed, Mar 11, 2009 at 10:29 AM, noskule <span dir="ltr"><<a href="mailto:noskule@gmx.net" target="_blank">noskule@gmx.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Actually this is possible using wikish. See<br>
<br>
<a href="http://www.pmwiki.org/wiki/Cookbook/WikiShExamples#PageHistForm" target="_blank">http://www.pmwiki.org/wiki/Cookbook/WikiShExamples#PageHistForm</a><br>
<br>
This solution gives you a form to type in a pagename and a date description<br>
("1 hour ago", "yesterday", "1/1/09 1:00am", "last Thursday", etc.) and the<br>
page will be displayed immediately below the form between horizontal lines.<br>
<br>
-Peter<br>
<br>
<br>
<br>
</blockquote></div>
this looks very promissing to me (except I have to switch to php5 first). But one question.<br>
Would it be possible to have an action called something like action=showdiff&timestamp=unixtime, witch would<br>
display/highlight the changes directly in the rendered page?<br>
</blockquote></div></div><br>After a little messing around with pear (1st time I've used it to install something) I ended up with this in my config.php which does in fact give me a prettily highlighted diff. (Note that I had to specify $action == 'browse' as well because it was messing up the page history otherwise.)<br>
<br>if ($pagename == 'Test.Diff' && $action=='browse') {<br> $DiffFunction = 'mydiff';<br> include_once("Text/Diff.php");<br> include_once("Text/Diff/Renderer.php");<br>
include_once("Text/Diff/Renderer/inline.php");<br> function mydiff($text1, $text2)<br> {<br> $diff = &new Text_Diff(explode("\n", $text1), explode("\n", $text2));<br> $renderer = &new Text_Diff_Renderer_inline();<br>
return($renderer->render($diff));<br> }<br>}<br><br>I went ahead and coded up the diff form too (it's virtually identical to the previous solution except using the diff command.) You can see it here: <br>
<br><a href="http://www.pmwiki.org/wiki/Cookbook/WikiShExamples#HistDiffForm">http://www.pmwiki.org/wiki/Cookbook/WikiShExamples#HistDiffForm</a><br><br>This form allows you to enter the page name and some date string. After you submit you will be shown the diff output comparing that revision with the current revision, even if there are several revisions in between. If you combine this with the PEAR Text_Diff mentioned above then you've got a very useful little tool that's very user-friendly...<br>
<br>-Peter<br>