[pmwiki-users] link to particular diff in history

Petko Yotov 5ko at 5ko.fr
Thu Feb 4 01:40:45 CST 2010


On Thursday 04 February 2010 08:24:17, Rik Blok wrote :
> Wow, that's great, thanks Petko!  I've tried it out and it looks like it
> works perfectly.  (I had some problems at first until I realized I was
> using the InlineDiff recipe.  So I copied your changes from pagerev.php.)

Actually, after the refactoring of the core, the InlineDiff recipe will 
require dramatically less code. Here is the *full* content of my working 
pagerevinline.php file (on subversion code):

<?php 
  $DiffRenderFromFunction = 'DiffRenderInline';
  function DiffRenderInline($in, $out) {
    $diff = &new Text_Diff($in, $out);
    $renderer = &new Text_Diff_Renderer_inline();
    return str_replace("\n","<br />",$renderer->render($diff));
  }
  include_once("$FarmD/cookbook/pagerevinline/Text/Diff.php");
  include_once("$FarmD/cookbook/pagerevinline/Text/Diff/Renderer/inline.php");


This is so cool, that I'm considering adding "inline diffs" to the core, 
earlier than I thought. 
If you haven't voted, you can vote for or against it at this page:

  http://www.pmwiki.org/wiki/PITS/00571

Petko

> On 2010-02-03 10:24 PM, Petko Yotov wrote:
> > Hello. Anchors/links to single edits were added to the core today and
> > will appear in the next release. Then you'll be able to remove the above
> > code from your config file. The links are now enabled on pmwiki.org, and
> > if you're in a hurry, you can get the scripts/pagerev.php file from
> > Subversion :
> >
> >    http://www.pmwiki.org/pub/pmwiki-devel/pmwiki-latest-svn.zip
> >
> >> But how do I get the notification to point to it?  I tried
> >>
> >>> $NotifyItemFmt = " * {\$FullName} ... \$PostTime by {\$Author}\n
> >>> Summary: {\$LastModifiedSummary}\n
> >>> {\$PageUrl}?action=diff#{\$DiffId}\n";
> >
> > This will be possible in the nearest future (now with subversion, or
> > later with 2.2.11 stable). When you upgrade, you can use
> >
> >    {\$PageUrl}?action=diff#diff\$Now
> >
> > Thanks,
> > Petko
> 



More information about the pmwiki-users mailing list