2003-02-07 09:00:35 +00:00
|
|
|
<?php
|
|
|
|
|
2003-06-05 18:16:37 +00:00
|
|
|
function platform_downloads($platform) {
|
2003-09-05 22:53:04 +00:00
|
|
|
$result = mysql_query("select * from core_version where platformid=$platform->id and version_num>=200 order by version_num desc");
|
2003-02-07 09:00:35 +00:00
|
|
|
|
|
|
|
if (!$result) return;
|
|
|
|
|
|
|
|
$found = false;
|
|
|
|
|
2003-08-04 23:05:39 +00:00
|
|
|
// if less than this many days old, print "New!"
|
|
|
|
$NEW_THRESHOLD = 14;
|
|
|
|
|
2003-06-05 18:16:37 +00:00
|
|
|
if ($core_version = mysql_fetch_object($result)) {
|
|
|
|
$version = sprintf("%.2f", $core_version->version_num/100);
|
|
|
|
$url = parse_element($core_version->xml_doc, "<url>");
|
2003-08-04 23:05:39 +00:00
|
|
|
$date = date_str($core_version->create_time);
|
|
|
|
if ($core_version->create_time > time()-($NEW_THRESHOLD*60*60*24)) {
|
2003-08-04 23:12:08 +00:00
|
|
|
$date .= ' <font color=red>New!</font>';
|
2003-08-04 23:05:39 +00:00
|
|
|
}
|
|
|
|
row3("<a href=$url>$platform->user_friendly_name", $version, $date);
|
2003-02-12 18:51:05 +00:00
|
|
|
//$app_version->md5_cksum";
|
2003-02-07 09:00:35 +00:00
|
|
|
$found = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
mysql_free_result($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
function print_download_links() {
|
|
|
|
start_table();
|
|
|
|
|
2003-08-04 23:12:08 +00:00
|
|
|
echo "<tr><th>Computer type</th><td>Version</td><td>Release Date</td></tr>\n";
|
2003-08-04 22:55:39 +00:00
|
|
|
$result = mysql_query("select * from platform order by name");
|
2003-02-07 09:00:35 +00:00
|
|
|
while ($platform = mysql_fetch_object($result)) {
|
2003-06-05 18:16:37 +00:00
|
|
|
platform_downloads($platform);
|
2003-02-07 09:00:35 +00:00
|
|
|
}
|
|
|
|
mysql_free_result($result);
|
|
|
|
echo "</table>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|