aboutsummaryrefslogtreecommitdiffstats
path: root/en/downloads/dl.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2011-05-15 21:03:41 +0000
committerRomain d'Alverny <rda@mageia.org>2011-05-15 21:03:41 +0000
commitadfc2f928918b8556a148a3cd7ac175832628b69 (patch)
tree04dd6c79d139650a1f4338d54351e093b5457820 /en/downloads/dl.php
parentcb6a2fdc21ec7be23bac331684153e23c07d0eeb (diff)
downloadwww-adfc2f928918b8556a148a3cd7ac175832628b69.tar
www-adfc2f928918b8556a148a3cd7ac175832628b69.tar.gz
www-adfc2f928918b8556a148a3cd7ac175832628b69.tar.bz2
www-adfc2f928918b8556a148a3cd7ac175832628b69.tar.xz
www-adfc2f928918b8556a148a3cd7ac175832628b69.zip
use cached mirrors list instead of static one
Diffstat (limited to 'en/downloads/dl.php')
-rw-r--r--en/downloads/dl.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/en/downloads/dl.php b/en/downloads/dl.php
index 2584c5026..fbb9d324a 100644
--- a/en/downloads/dl.php
+++ b/en/downloads/dl.php
@@ -6,7 +6,6 @@ $product = isset($_GET['product']) ? trim(strtolower($_GET['product'])) : null;
$torrent = isset($_GET['torrent']) ? true : false;
$mirror = isset($_GET['mirror']) ? trim(strtolower($_GET['mirror'])) : null;
-include '../../mirrors2.php';
include '../../downloads.php';
include '../../lib/Downloads.php';
@@ -27,6 +26,7 @@ if (!$found) {
die;
}
+$g_mirrors = Downloads::get_all_mirrors();
$product_iso = $product . '.iso';
$wsd = new Downloads('en', null);
@@ -54,6 +54,17 @@ else {
$title = 'Mageia 1 beta1';
$dl_alt_mirrors_table = '';
+
+$g_mirs2 = array();
+foreach ($g_mirrors as $country => $mirs):
+ foreach ($mirs as $mir):
+ $g_mirs2[$countries[$country]][$mir['city']][] = $mir['url'];
+ endforeach;
+endforeach;
+//print_r($g_mirs2);
+$g_mirrors = $g_mirs2;
+ksort($g_mirrors);
+
foreach ($g_mirrors as $country => $cities):
foreach ($cities as $city => $mirrors) {
$mirs = array();
@@ -63,7 +74,7 @@ foreach ($g_mirrors as $country => $cities):
$mirs[] = sprintf('%s://<a href="%s" rel="nofollow">%s</a>',
$pm['scheme'], $alt_dl_link, $pm['host']);
}
- $dl_alt_mirrors_table .= sprintf('<tr><td>%s</td><td>%s</td><td>%s</td></tr>', $country, $city, implode(', ', $mirs));
+ $dl_alt_mirrors_table .= sprintf('<tr><td nowrap>%s</td><td>%s</td><td>%s</td></tr>', $country, $city, implode(', ', $mirs));
}
endforeach;