cvs: php-master-web /fetch mirrors.php
| From: | jim winstead | Date: | Sun, 02 Jun 2002 05:08:08 +0000 |
| Subject: | cvs: php-master-web /fetch mirrors.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-10616@lists.php.net to get a copy of this message | ||
jimw Sun Jun 2 01:08:08 2002 EDT
Modified files:
/php-master-web/fetch mirrors.php
Log:
list mirrors that aren't current as not active
Index: php-master-web/fetch/mirrors.php
diff -u php-master-web/fetch/mirrors.php:1.3 php-master-web/fetch/mirrors.php:1.4
--- php-master-web/fetch/mirrors.php:1.3 Sun Apr 21 13:58:50 2002
+++ php-master-web/fetch/mirrors.php Sun Jun 2 01:08:08 2002
@@ -7,13 +7,13 @@
// Connect and generate the list from the DB
if (@mysql_pconnect("localhost","nobody","")) {
if (@mysql_select_db("php3")) {
- $res = @mysql_query("SELECT mirrors.*,country.name AS cname FROM mirrors LEFT JOIN country
ON mirrors.cc = country.id ORDER BY country.name,hostname");
+ $res = @mysql_query("SELECT mirrors.*,country.name AS cname,(DATE_SUB(NOW(),INTERVAL 3
DAY) < mirrors.lastupdated) AS current FROM mirrors LEFT JOIN country ON mirrors.cc = country.id
ORDER BY country.name,hostname");
if ($res) {
echo "<?php\n\$MIRRORS = array(\n";
while ($row = @mysql_fetch_array($res)) {
if (!strstr("http:",$row[hostname])) {
$row[hostname]="http://$row[hostname]/"; }
// Set inactive mirrors to type 2 so they won't show up in the drop-down.
- if (!$row["active"]) { $row["mirrortype"] = 2; }
+ if (!$row["active"] || !$row["current"]) { $row["mirrortype"]
= 2; }
echo " \"$row[hostname]\" =>
array(\"$row[cc]\",\"$row[providername]\",$row[has_stats],\"$row[providerurl]\",$row[mirrortype],$row[has_search],\"$row[lang]\"),\n";
}
echo ' 0 => array("xx", "Unknown", 0, "/", 2, 0,
"en")', "\n";