boinc/html/user/download.inc

44 lines
1.2 KiB
PHP

<?php
function platform_downloads($platform, $core_app) {
$result = mysql_query("select * from app_version where platformid=$platform->id and appid=$core_app->id order by version_num desc");
if (!$result) return;
$found = false;
$download_url = parse_config("<download_url>");
if ($app_version = mysql_fetch_object($result)) {
$filename = parse_element($app_version->xml_doc, "<name>");
if (!$filename) {
echo "CAN'T FIND FILENAMEn $app_version->xml_doc\n";
}
$version = sprintf(
$platform->name,
$app_version->version_num/100
);
echo "<tr><td><a href=$download_url/$filename><b>$platform->user_friendly_name</b></td></tr>\n";
//$app_version->md5_cksum";
$found = true;
}
mysql_free_result($result);
}
function print_download_links() {
start_table();
$result = mysql_query("select * from app where name='core client'");
$core_app = mysql_fetch_object($result);
mysql_free_result($result);
$result = mysql_query("select * from platform");
while ($platform = mysql_fetch_object($result)) {
platform_downloads($platform, $core_app);
}
mysql_free_result($result);
echo "</table>\n";
}
?>