';
$last = $first + $conf['recent'];
@@ -782,17 +831,63 @@
require_once(DOKU_INC.'inc/DifferenceEngine.php');
global $ID;
global $REV;
+ //multi-compare revision
+ global $REV2;
+
global $lang;
global $conf;
+
+ //start multi-compare revision
+ // get the filetime of the current revision
+ // might use this for allowing the RSS feed to show diffs of current to old
+ $filetime = filemtime(wikiFN($ID));
- if($text){
+ if( $REV == $filetime ){
+ //print 'Filetime matched, using current
';
+ $REV = '';
+ }
+
+ if( $REV2 == $filetime ){
+ //print 'Filetime matched, using current
';
+ $REV2 = '';
+ }
+ //end multi-compare revision
+
+ if($text){ // diff for conflicts
$df = new Diff(explode("\n",htmlspecialchars(rawWiki($ID,''))),
explode("\n",htmlspecialchars(cleanText($text))));
$left = '
'.
$ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).''.
$lang['current'];
$right = $lang['yours'];
- }else{
+ }
+
+ //start multi-compare revision
+ elseif($REV && $REV2){ // diff between versions
+ $df = new Diff(explode("\n",htmlspecialchars(rawWiki($ID,$REV2))),
+ explode("\n",htmlspecialchars(rawWiki($ID,$REV))));
+
+ $left = '
'.
+ $ID.' '.date($conf['dformat'],$REV2).'';
+
+ $right = '
'.
+ $ID.' '.date($conf['dformat'],$REV).'';
+
+ }elseif($REV2){ // diff between current and REV2
+ $df = new Diff(explode("\n",htmlspecialchars(rawWiki($ID,$REV2))),
+ explode("\n",htmlspecialchars(rawWiki($ID,$REV))));
+
+ $left = '
'.
+ $ID.' '.date($conf['dformat'],$REV2).'';
+
+ $right = '
'.
+ $ID.' '.date($conf['dformat'],@filemtime(wikiFN($ID))).' '.
+ $lang['current'];
+
+ }
+ //end multi-compare revision
+
+ else{
//check if current revision exist
if(!@file_exists(wikiFN($ID))){
$revs = getRevisions($ID, 0, 2);
**lang.php.diff** (./inc/lang/en/lang.php)
--- old/lang.php 2007-06-26 20:27:15.000000000 +0200
+++ new/lang.php 2007-09-29 11:18:21.000000000 +0200
@@ -233,4 +233,6 @@
$lang['i_retry'] = 'Retry';
+$lang['compareselected'] = 'Compare selected versions';
+
//Setup VIM: ex: et ts=2 enc=utf-8 :
===== Discussion =====
This is an excellent modification, hopefully it'll make into the core. I'm so used to MoinMoin and Mediawiki and being able to compare arbitrary versions. Has anyone implemented this in a recent version of Dokuwiki -- January 4, 2006
Has anyone tested this to see if it works? Super mod! -- January 13, 2006
> I'm answering my own question, yes it works! I tried it and then customized it a bit per the 2nd screenshot above. --ryan Jan 15, 2006
I've fixed some minor bugs in multidiff code (no form is shown now if there is only one revision of the file, the radio buttons for the newest release are now in right column (like they’re in [[http://www.mediawiki.org/wiki/MediaWiki|Mediawiki]]) and the diff view also behaves accordingly to radio buttons positions (it swapped the side where each revision should be shown)). You can get here the [[http://lusi.berlios.de/dokuwiki/_media/wiki/customization/dokuwiki-multidiff.diff?id=wiki%3Acustomization%3Adiff|diff file against 2006-03-09 release]] --- //[[kalvy@users.berlios.de|Daniel Calviño Sánchez]] 2006/04/28//
> Daniel, A diff against the 2006-03-09 release may not be much good. You should at least try to use a [[http://dev.splitbrain.org/browse/snapshots/|current snaphot]] of the [[wiki:development]] version. Irregardless of whether this gets added, you could now implement it as an [[wiki:action plugin]]. Action plugins are currently [[wiki:develonly]] but will be available in the next release of DokuWiki. --- //[[chris@jalakai.co.uk|Christopher Smith]] 2006-09-11 14:40//
Here is an update for doku.php and html.php - DokuWiki version 2006-11-06. You can download these versions here: [[http://www.germanplaces.com/software/doku-wiki-diff.html | Update for doku.php, html.php Doku Wiki release 2006-11-06]] --- //[[lemsi@germanplaces.com|Lemsi]] 2007-01-23 11:08//
> Hello Lemsi, when I download doku.php or html.php I get the error:
Warning: main(/www/htdocs/w005f11d/downloads/doku-wiki/inc/init.php): failed to open stream: No such file or directory in /www/htdocs/w005f11d/downloads/doku-wiki/doku.php on line 12
> Means, they were interpreted by php. Could you please put them as *.php.txt on your site ?
> Thanke, Uwe
I added a new section with an [[wiki:discussion:diff#update for Dokuwiki 2006-11-06]]. Is my first time with php, so be carefull. Anyway, I tested it quite carefully and, at least for me, seems to work with no problemas at all.
Please report any problems you find with it... --- //[[ialdazabal@ehu.es|Inigo Aldazabal]] 2007/01/31 23:05//
Can someone please upload the patche files for 2007-06-26b? "Patch for Windows" (Yes, I know... ;-) ) doesn't work correctly and I really need this patch... --- //Alfred 2007/11/27 //