diff options
-rw-r--r-- | downloads.ini | 10 | ||||
-rw-r--r-- | downloads.php | 14 |
2 files changed, 19 insertions, 5 deletions
diff --git a/downloads.ini b/downloads.ini index 809173f90..3d316564f 100644 --- a/downloads.ini +++ b/downloads.ini @@ -8,6 +8,16 @@ errata = "http://www.mageia.org/wiki/doku.php?id=mageia1:errata" notes = "http://www.mageia.org/wiki/doku.php?id=iso1:rc_release_notes" blog = "http://blog.mageia.org/en/2011/05/17/mageia-1-rc/" +[_popularity] +;extracted/normalized from www download logs; need time to make this automatic + post -rda +dvd-i586 = 5 +dvd-x86_64 = 3 +cd-dualarch = 1 +live-kde-europa-cd-i586 = 4 +live-gnome-europa-cd-i586 = 2 +netboot-i586 = 1 +netboot-x86_64 = 1 + [dvd-i586] name = 32bit DVD size = 4GB diff --git a/downloads.php b/downloads.php index bf1e76252..d9f67397e 100644 --- a/downloads.php +++ b/downloads.php @@ -33,17 +33,17 @@ $tmpl = <<<T <td class="name">%s</td> <td class="lang">%s</td> <td class="size">%s</td> +<td class="pop"><span class="pop_%s">%s</span></td> <td class="link"><a href="%s" rel="nofollow">%s</a></td> <td class="link"><a href="%s" rel="nofollow">%s</a></td> </tr> T; -//<td class="pop"><span class="pop_%s">%s</span></td> $s = ''; $glob = array_shift($prods); +$popularity = array_shift($prods); $i = 0; foreach ($prods as $k => $p) { - $iso = sprintf('%s-%s', $glob['prefix'], $k); $dl_link = sprintf('/%s/downloads/dl.php?product=%s', $locale, $iso); @@ -51,13 +51,16 @@ foreach ($prods as $k => $p) { sprintf('/%s/downloads/dl.php?product=%s&torrent=1', $locale, $iso) : null; - $pop = rand(0,5); + $pop = array_key_exists($k, $popularity) ? $popularity[$k] : 0; + $s .= sprintf($tmpl, '', //($i == 0) ? ' class="reco"' : '', $p['name'], $_t[$p['lang']], $p['size'], - //$pop, $pop, + $pop, $pop, $dl_link, $_t['download'], - $bt_link, !is_null($bt_link) ? $_t['download'] : ''); + $bt_link, + !is_null($bt_link) ? $_t['download'] : '' + ); $i++; } @@ -69,6 +72,7 @@ $dl_table = <<<T <th>{$_t['flavour']}</th> <th>{$_t['language']}</th> <th class="size">{$_t['size']}</th> + <th>Popularity</th> <th>{$_t['link']}</th> <th>BitTorrent</th> </tr> |