From de8dd3e49308514439f0c593f419fb15ba13b06b Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Wed, 1 Jun 2011 00:48:29 +0000 Subject: downloads update - do NOT commit to production yet --- downloads.php | 83 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 25 deletions(-) (limited to 'downloads.php') diff --git a/downloads.php b/downloads.php index f9d8c184d..9fc6d51c2 100644 --- a/downloads.php +++ b/downloads.php @@ -10,7 +10,7 @@ include 'downloads_locales.php'; if (!array_key_exists($locale, $_t)) $locale = 'en'; -$_t = $_t[$locale]; +$_t = array_merge($_t['en'], $_t[$locale]); $prods = parse_ini_file('downloads.ini', true); $countries = array( @@ -43,50 +43,83 @@ $s = ''; $glob = array_shift($prods); $popularity = array_shift($prods); $i = 0; + +$prods2 = array(); foreach ($prods as $k => $p) { if (isset($p['hidden'])) { continue; } - $iso = sprintf('%s-%s', $glob['prefix'], $k); + $prods2[$p['flavour']][$k] = $p; +} + +$s1 = null; +$s2 = null; +$s3 = null; +foreach ($prods2 as $flavour => $prods) { - $dl_link = sprintf('/%s/downloads/dl.php?product=%s', $locale, $iso); - $bt_link = isset($p['torrent']) ? - sprintf('/%s/downloads/dl.php?product=%s&torrent=1', $locale, $iso) : - null; + $flavour = sprintf('%s', count($prods), $flavour); + foreach ($prods as $k => $p) { + $iso = sprintf('%s-%s', $glob['prefix'], $k); - $pop = array_key_exists($k, $popularity) ? $popularity[$k] : 0; + $dl_link = sprintf('/%s/downloads/dl.php?product=%s', $locale, $iso); + $bt_link = isset($p['torrent']) ? + sprintf('/%s/downloads/dl.php?product=%s&torrent=1', $locale, $iso) : + null; - $s .= sprintf($tmpl, - '', //($i == 0) ? ' class="reco"' : '', - $p['name'], $_t[$p['lang']], $p['size'], - $pop, $pop, - $dl_link, $_t['download'], - $bt_link, - !is_null($bt_link) ? $_t['download'] : '' - ); + $pop = array_key_exists($k, $popularity) ? $popularity[$k] : 0; - $i++; + $s = sprintf($tmpl, + '', + //$flavour, + $p['name'], $_t[$p['lang']], $p['size'], + $pop, $pop, + $dl_link, $_t['download'], + $bt_link, + !is_null($bt_link) ? $_t['download'] : '' + ); + $flavour = null; + $i++; + + if ($p['flavour'] == 'LiveCD 32bit') + $s2 .= $s; + elseif ($p['flavour'] == 'DVD' + || $p['flavour'] == 'CD') + $s1 .= $s; + else + $s3 .= $s; + } } -$dl_table = <<%s - + - + - - {$s} - + %s
{$_t['flavour']}{$_t['flavour']} {$_t['language']} {$_t['size']}Popularity{$_t['popularity']} {$_t['link']} BitTorrent
-

{$_t['all_languages']}

-

{$_t['limited_languages']}

-

{$_t['euro_languages']}

+T; + +$dl_table = sprintf($table_tmpl, $_t['for_full_install'], $s1) + . "

{$_t['all_languages']}

+

{$_t['limited_languages']}


" + + . sprintf($table_tmpl, $_t['for_test_live'], $s2) + . "

{$_t['def-Europa set 1']}

+

{$_t['def-Europa set 2']}

+

{$_t['def-Asia set']}

+

{$_t['def-Africa/India set']}


" + + . sprintf($table_tmpl, $_t['for_network'], $s3); + +$dl_table .= <<Not sure of what ISO to download? This may still be a bit verbose, but you may want to read this article detailing our different install media.

-- cgit v1.2.1