$b) ? -1 : 1;
}
function dm_usort_cmp_desc ($a, $b) {
if ($a == $b) return 0;
return ($a > $b) ? 1 : -1;
}
function printHeader()
{
?>
ReactOS Revison ISOs
read())) {
if (is_dir($path . "\\" . $entry) != "dir")
$filelist[$i++] = $entry;
}
$d->close();
if (is_array($filelist)) {
usort($filelist, "dm_usort_cmp_desc");
reset($filelist);
while (list($key, $filename) = each($filelist)) {
if (ereg('ReactOS-' . $branch . '-r([0-9]*).iso', $filename, $regs))
{
$thisRevision = intval($regs[1]);
if ($thisRevision > $revision)
return $regs[1];
$lastRevision = $thisRevision;
}
}
}
return "";
}
function main()
{
$branch = $_POST["branch"];
$revision = $_POST["revision"];
$filename = "ReactOS-" . $branch . "-r" . $revision . ".iso";
if (file_exists(ISO_PATH . $branch . "\\" . $filename))
{
$location = ISO_BASE_URL . $branch . "/" . $filename;
header("Location: $location");
return;
}
else
{
printHeader();
printMenu($_POST["revision"]);
echo "
No ISO exist for branch '" . $branch . "' and revision " . $revision . ".
";
printFooter();
}
}
if (!empty($_POST["getiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
main();
else if (!empty($_POST["getnextiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
{
printHeader();
printMenu(getNextRevisionISO($_POST["branch"], $_POST["revision"]));
printFooter();
}
else
{
printHeader();
printMenu($_POST["revision"]);
printFooter();
}
?>