cvs: php-master-web /fetch mirrors.php

From: Date: Mon, 06 Jan 2003 11:02:37 +0000
Subject: cvs: php-master-web /fetch mirrors.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-14785@lists.php.net to get a copy of this message
goba Mon Jan 6 06:02:37 2003 EDT Modified files: /php-master-web/fetch mirrors.php Log: Use the last checktime as a base, also switch back to 3 days in the inactive test Index: php-master-web/fetch/mirrors.php diff -u php-master-web/fetch/mirrors.php:1.18 php-master-web/fetch/mirrors.php:1.19 --- php-master-web/fetch/mirrors.php:1.18 Sun Jan 5 13:18:28 2003 +++ php-master-web/fetch/mirrors.php Mon Jan 6 06:02:37 2003 @@ -45,11 +45,15 @@ // Select php3 database if (@mysql_select_db("php3")) { + // Select last mirror check time from table + $lct = mysql_query("SELECT UNIX_TIMESTAMP(lastchecked) FROM mirrors ORDER BY lastchecked DESC LIMIT 1"); + list($checktime) = mysql_fetch_row($lct); + // Select mirrors list with some on-the-fly counted columns $res = @mysql_query( "SELECT mirrors.*, country.name AS cname, " . - "(DATE_SUB(NOW(),INTERVAL 7 DAY) < mirrors.lastchecked) AS up, " . - "(DATE_SUB(NOW(),INTERVAL 7 DAY) < mirrors.lastupdated) AS current " . + "(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 3 DAY) < mirrors.lastchecked) AS up, " . + "(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 7 DAY) < mirrors.lastupdated) AS current " . "FROM mirrors LEFT JOIN country ON mirrors.cc = country.id " . "ORDER BY country.name,hostname" );

« previous php.mirrors (#14785) next »