index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | mirrors.php | 34 |
diff --git a/mirrors.php b/mirrors.php index 7758846..5bbace0 100644 --- a/mirrors.php +++ b/mirrors.php @@ -26,7 +26,7 @@ array_splice( if (count($uri_parts) == 0) { // index $cutoff = 3600; - + $sorts = array( "server" => array( "title" => "server", @@ -49,7 +49,7 @@ if (count($uri_parts) == 0) { // index "mysql" => "`protocols`" ) ); - + $query = "SELECT " . "GROUP_CONCAT(`l_ms`.`protocol`) AS `protocols`," . @@ -72,28 +72,28 @@ if (count($uri_parts) == 0) { // index " AND `ls`.`start`=`l_ms`.`start`" . " GROUP BY `url`" . " ORDER BY "; - + if (array_key_exists("sort", $_GET)) { if (isset($sorts[$_GET["sort"]]["mysql"])) $query .= $sorts[$_GET["sort"]]["mysql"] . ","; elseif (isset($sorts[substr($_GET["sort"],1)]["mysql"])) $query .= $sorts[substr($_GET["sort"],1)]["mysql"] . " DESC,"; } - + $query .= "`url`"; - + $result = mysql_run_query( $query ); - + $last_check = 0; $max_count = 0; - + while($row = $result->fetch_assoc()) $rows[] = $row; - + print_header("Mirror Overview"); - + ?> <div id="dev-mirrorlist" class="box"> <h2>Mirror Overview</h2> @@ -119,7 +119,7 @@ if (count($uri_parts) == 0) { // index </thead> <tbody> <?php - + $oddity = "odd"; foreach ($rows as $row) { print " <tr class=\"" . $oddity ."\">\n"; @@ -146,13 +146,13 @@ if (count($uri_parts) == 0) { // index else $oddity = "odd"; } - + ?> </tbody> </table> </div> <?php - + print_footer(); die(); @@ -161,7 +161,7 @@ if (count($uri_parts) == 0) { // index if ($uri_parts[0] == 'status') { $cutoff = 86400; - + $result = mysql_run_query( "SELECT " . "`l_ms`.`protocol`," . @@ -196,10 +196,10 @@ if ($uri_parts[0] == 'status') { " AND `a_ms`.`start` > UNIX_TIMESTAMP(NOW())-" . $cutoff . " GROUP BY `l_ms`.`id`" ); - + $last_check = 0; $max_count = 0; - + while($row = $result->fetch_assoc()) { foreach (array( "start", @@ -222,7 +222,7 @@ if ($uri_parts[0] == 'status') { $last_check = max ($row["start"], $last_check); $max_count = max ($row["count"], $max_count); } - + $content = array( "cutoff" => $cutoff, "check_frequency" => $cutoff/$max_count, @@ -231,7 +231,7 @@ if ($uri_parts[0] == 'status') { // "version" => 3, "urls" => $urls ); - + if (count($uri_parts) == 1) { // human readable } // human readable |