diff --git a/index.php b/index.php
index 3efca8c..9feeddb 100644
--- a/index.php
+++ b/index.php
@@ -6,6 +6,33 @@ error_reporting(E_ALL);
define("SITE_ROOT", realpath(dirname(__file__)));
require_once SITE_ROOT . "/lib/init.php";
+function get_downloads()
+{
+ global $DB;
+
+ $ret = array();
+
+ if (!$res = $DB->query("select file_name from downloads")) return;
+
+ while ($row = $DB->fetchRow($res)) {
+ $ret[] = $row["file_name"];
+ }
+
+ return $ret;
+}
+
+$all_downloads = get_downloads();
+
+function download_exists($file_name)
+{
+ global $all_downloads;
+ return in_array($file_name, $all_downloads);
+}
+
+function download_link($file_name)
+{
+ return "http://sourceforge.net/projects/singularityview/files/alphas/{$file_name}/download";
+}
function parse_email($email)
{
@@ -119,30 +146,30 @@ Function print_build($current, $next, $buildNr, $chan)
";
if ($current->file) {
- print " Windows
- Build Log";
+ print " Windows
+ Build Log";
}
if ($current->linux_file) {
- print "
Linux (32 bit)";
- if (file_exists($current->linux_file . ".log")) {
- print " Build Log";
+ print "
Linux (32 bit)";
+ if (download_exists($current->linux_file . ".log")) {
+ print " Build Log";
}
}
if ($current->linux64_file) {
- print "
Linux (64 bit)";
- if (file_exists($current->linux64_file . ".log")) {
- print " Build Log";
+ print "
Linux (64 bit)";
+ if (download_exists($current->linux64_file . ".log")) {
+ print " Build Log";
}
}
if ($current->osx_file) {
- print "
Mac OS X";
- if (file_exists($current->osx_file . ".log")) {
- print " Build Log";
+ print "
Mac OS X";
+ if (download_exists($current->osx_file . ".log")) {
+ print " Build Log";
}
}
@@ -205,16 +232,16 @@ if ($res = $DB->query(kl_str_sql("select * from builds_all where chan=!s $where
$DB->loadFromDbRow($build, $res, $row);
$file = "{$chan}_" . str_replace(".", "-", $build->version) . "_Setup.exe";
- $build->file = file_exists($file) ? $file : false;
+ $build->file = download_exists($file) ? $file : false;
$linux_file = "{$chan}-i686-{$build->version}.tar.bz2";
- $build->linux_file = file_exists($linux_file) ? $linux_file : false;
+ $build->linux_file = download_exists($linux_file) ? $linux_file : false;
$linux64_file = "{$chan}-x86_64-{$build->version}.tar.bz2";
- $build->linux64_file = file_exists($linux64_file) ? $linux64_file : false;
+ $build->linux64_file = download_exists($linux64_file) ? $linux64_file : false;
$osx_file = "{$chan}_" . str_replace(".", "_", $build->version) . ".dmg";
- $build->osx_file = file_exists($osx_file) ? $osx_file : false;
+ $build->osx_file = download_exists($osx_file) ? $osx_file : false;
$builds[] = $build;
}
diff --git a/lib/init.php b/lib/init.php
index 9e56155..d451427 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -15,6 +15,8 @@ function __autoload($class)
require_once(SITE_ROOT . '/lib/' . $class . '.php');
}
+date_default_timezone_set("UTC");
+
/* Directory relative to server root
* No leading or trailing slash.
* Example: http://www.example.com/applications/app1/
|