diff options
Diffstat (limited to 'downloads.php')
-rw-r--r-- | downloads.php | 14 |
1 files changed, 9 insertions, 5 deletions
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> |