Skip to content

Commit

Permalink
Add links to checksums
Browse files Browse the repository at this point in the history
  • Loading branch information
SkewedZeppelin committed Jun 14, 2020
1 parent fd0b966 commit aa60c99
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pages/devices.html
Expand Up @@ -82,19 +82,28 @@
if(strlen($file) > 30) {
$zip = $file;
$downloadButtons = "<a href=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $file . "\" value=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $file . "\" class=\"button primary rom-unknown\" onMouseOver=\"this.style.backgroundColor='#COLOUR'\" onMouseOut=\"this.style.backgroundColor='var(--button-back-color)'\">Download</a>";
if(file_exists($realRootdir . $device . "/" .$file . ".sha512sum")) {
$downloadButtons .= "<a href=\"/builds/" . $base . "/" . $device . "/" . $file . ".sha512sum\" class=\"button inverse small\">512sum</a>";
}
$latestFileTime = filemtime($realRootdir . $device . "/" .$file);
break;
}
}
//Output the recovery.img
$recovery = str_replace(".zip", "-recovery.img", $zip);
if(strlen($recovery) > 36 && file_exists($realRootdir . $device . "/" . $recovery)) {
$downloadButtons .= "<br><a href=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $recovery . "\" class=\"button inverse small\">Recovery</a>";
$downloadButtons .= "<br><a href=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $recovery . "\" class=\"button teritary\">Recovery</a>";
if(file_exists($realRootdir . $device . "/" . $recovery . ".sha512sum")) {
$downloadButtons .= "<a href=\"/builds/" . $base . "/" . $device . "/" . $recovery . ".sha512sum\" class=\"button inverse small\">512sum</a>";
}
}
//Output the fastboot.zip
$fastboot = str_replace(".zip", "-fastboot.zip", $zip);
if(strlen($fastboot) > 36 && file_exists($realRootdir . $device . "/" . $fastboot)) {
$downloadButtons .= "<br><a href=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $fastboot. "\" class=\"button inverse small\">Fastboot</a>";
$downloadButtons .= "<br><a href=\"/mirror.php?base=" . $base . "&f=" . $device . "/" . $fastboot. "\" class=\"button teritary\">Fastboot</a>";
if(file_exists($realRootdir . $device . "/" . $fastboot . ".sha512sum")) {
$downloadButtons .= "<a href=\"/builds/" . $base . "/" . $device . "/" . $fastboot . ".sha512sum\" class=\"button inverse small\">512sum</a>";
}
}
$outdated = !(($latestFileTime >= $lastSecRelease) && (($curTime - $latestFileTime) <= 3456000));
list($color, $statusMessage) = getStatus(file_get_contents($realRootdir . $device . "/status"), $outdated);
Expand Down

0 comments on commit aa60c99

Please sign in to comment.