Author: mike
Date: 2010-12-28 19:56:18 -0800 (Tue, 28 Dec 2010)
New Revision: 585
Log:
Fix home page to show only the correct stable release.

Also fix mirror code to only do the lookups when the corresponding extension is
loaded.


Modified:
   trunk/index.php
   trunk/phplib/mirrors.php

Modified: trunk/index.php
===================================================================
--- trunk/index.php     2010-12-28 09:31:37 UTC (rev 584)
+++ trunk/index.php     2010-12-29 03:56:18 UTC (rev 585)
@@ -33,13 +33,15 @@
 
 $version="";
 $fp = fopen("data/software.md5", "r");
-// first entry is current stable release
-//while ($line = fgets($fp, 1024))
-//{
+while ($line = fgets($fp, 1024))
+{
   $line = fgets($fp, 1024);
   $data    = explode(" ", $line);
   $version = $data[1];
-//}
+
+  if (preg_match("/^[1-9][0-9]*\\.[0-9]+\\.[0-9]+\$/", $version))
+    break;
+}
 fclose($fp);
 
 print("<td><a href='software.php?VERSION=$version'>v$version</a></tr>\n"

Modified: trunk/phplib/mirrors.php
===================================================================
--- trunk/phplib/mirrors.php    2010-12-28 09:31:37 UTC (rev 584)
+++ trunk/phplib/mirrors.php    2010-12-29 03:56:18 UTC (rev 585)
@@ -32,8 +32,15 @@
 
 
   // Get the current longitude for the client...
-  $current = geoip_record_by_name($_SERVER["REMOTE_ADDR"]);
-  $lon     = $current["longitude"];
+  if (!extension_loaded("geoip.so") ||
+      $_SERVER["REMOTE_ADDR"] == "::1" ||
+      $_SERVER["REMOTE_ADDR"] == "127.0.0.1")
+    $lon = -120;
+  else
+  {
+    $current = geoip_record_by_name($_SERVER["REMOTE_ADDR"]);
+    $lon     = $current["longitude"];
+  }
 
   // Loop through the mirrors to find the closest one, currently just using
   // the longitude...

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to