Source code raw phps
<html>
<head>
<title><?php echo $rfilepath ?></title>
<style type="text/css">
.header {
font-weight: bold;
color: #2E8B57;
}
.add {
color: #008080;
}
.rem {
color: #CC0000;
}
.break {
font-weight: bold;
color: #804040;
}
</style>
</head>
<body>
<a href="http://patches.colder.ch/<?php echo $rfilepath ?>?raw">Raw version</a>
<hr />
<pre>
<?php
$lines = file($filepath);
$format = "<span class=\"%s\">%s</span>\n";
foreach ($lines as $n => $line) {
if (preg_match('/^(Index:|diff|---|\+\+\+)/', $line)) {
$class = 'header';
} else if ($line[0] == '+') {
$class = 'add';
} else if ($line[0] == '-') {
$class = 'rem';
} else if ($line[0] == '@' && $line[1] == '@') {
$class = 'break';
} else {
$class = 'text';
}
printf($format, $class, htmlentities(rtrim($line)));
}
?>
</pre>
</body>
</html>
Comments
There is currently no comment here.