LoadPageById($_REQUEST["a"]);
$pageB = $this->LoadPageById($_REQUEST["b"]);
// prepare bodies
$bodyA = explode("\n", $pageA["body"]);
$bodyB = explode("\n", $pageB["body"]);
$added = array_diff($bodyA, $bodyB);
$deleted = array_diff($bodyB, $bodyA);
$output .= "Comparing href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]." to href("", "", "time=".urlencode($pageB["time"]))."\">".$pageB["time"]."
\n";
if ($added)
{
// remove blank lines
$output .= "
\nAdditions:
\n";
$output .= "".$this->Format(implode("\n", $added))."
";
}
if ($deleted)
{
$output .= "
\nDeletions:
\n";
$output .= "".$this->Format(implode("\n", $deleted))."
";
}
if (!$added && !$deleted)
{
$output .= "
\nNo differences.";
}
print($output);
?>