Excuse for my English. Today has made for itself " templates upgrade tool ".For comparison of variables such as " {$TemplateVars} ".
While only for local. I shall soon make the advanced version.
Will consist of two files: form.html and script.php
Start a file form.html. Files should is in one catalogue.
Templates Compare(upgrade?) Tool V0.01
form.html :
<html><head><title></title></head>
<form name="form1" action="script.php" method="post">
<input type="file" name="file1"><input type="file" name="file2">
<div align="center"><br></div>
<input type="submit" value="go!">
</form>
</body></html>
script.php :
<html><head><title></title></head><body>
<?php
$a1 = array();
$a2 = array();
foreach(file($_POST["file1"]) as $value) {
preg_match_all("/(\{\\$.*\})/sU",$value,$array);
foreach($array[1] as $v1)
$a1[] = $v1;
}
foreach(file($_POST["file2"]) as $value) {
preg_match_all("/(\{\\$.*\})/sU",$value,$array);
foreach($array[1] as $v1)
$a2[] = $v1;
}
$a1 = array_unique($a1);
$a2 = array_unique($a2);
sort($a1);
sort($a2);
?>
<table border="1" width="100%" id="table1">
<tr>
<td><?php foreach($a1 as $v2) echo $v2 . '<br>'; ?></td>
<td><?php foreach($a2 as $v2)echo $v2.'<br>'; ?></td>
</tr>
<tr>
<td><br><b><font color=#FF0000>No more use in <br><small><?php echo str_replace('\\\\','\\',$_POST["file1"]) ?>:</small></font></b><br><br><?php foreach(array_diff($a1,$a2) as $b) echo $b . '<br>'; ?></td>
<td><b><font color=#0000FF>New in <br><small><?php echo str_replace('\\\\','\\',$_POST["file2"]) ?> :</small></font></b><br><br><?php foreach(array_diff($a2,$a1) as $b) echo $b . '<br>'; ?></td>
</tr>
</table>
</body></html>