From 52701665216f947af6f4256c9496f5dfd9f54c14 Mon Sep 17 00:00:00 2001 From: Olivier Berten Date: Wed, 27 Mar 2013 14:19:50 +0100 Subject: [PATCH] Add the sources history --- history.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/history.php b/history.php index f59d331..b9ece52 100644 --- a/history.php +++ b/history.php @@ -25,7 +25,17 @@ while($m = $req1->fetch_assoc()) { while($f = $req2->fetch_assoc()) { echo '

'.$f['field']."
\n"; $from_text = $f['changed']; - $to_text = $c[$f['field']]; + if($f['field'] == 'sources') { + $c_s = array(); + $sql = 'SELECT * FROM '.db('chant_sources').' WHERE chant_id = '.intval($chgset[1]); + $req = $mysqli->query($sql) or die('Erreur SQL !
'.$sql.'
'.$mysqli->error); + while ($s = $req->fetch_assoc()) { + $c_s[] = $s; + } + $to_text = json_encode($c_s); + } else { + $to_text = $c[$f['field']]; + } $diff = new FineDiff($from_text, $to_text, FineDiff::$wordGranularity); $opcodes = FineDiff::getDiffOpcodes($from_text, $to_text); echo ''.FineDiff::renderDiffToHTMLFromOpcodes($from_text, $opcodes)."

\n";