diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-02 03:53:46 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-03-02 03:53:46 +0000 |
commit | d469634f3cd98ad5a42d72c2aff0f1b2a968cf7d (patch) | |
tree | b10cfa6172e66e453cf681bb1f0f8ea46bf98b45 | |
parent | 181e8dfe223b4b5e7ba0dbabeb7ca5c12a58454c (diff) | |
download | ampache-d469634f3cd98ad5a42d72c2aff0f1b2a968cf7d.tar.gz ampache-d469634f3cd98ad5a42d72c2aff0f1b2a968cf7d.tar.bz2 ampache-d469634f3cd98ad5a42d72c2aff0f1b2a968cf7d.zip |
make the popular actually show popular
-rw-r--r-- | lib/class/stats.class.php | 12 | ||||
-rw-r--r-- | stats.php | 2 | ||||
-rw-r--r-- | templates/show_popular.inc.php | 10 |
3 files changed, 14 insertions, 10 deletions
diff --git a/lib/class/stats.class.php b/lib/class/stats.class.php index b57bb56e..2e3d1a07 100644 --- a/lib/class/stats.class.php +++ b/lib/class/stats.class.php @@ -144,8 +144,8 @@ class Stats { $results = array(); - while ($r = Dba::fetch_assoc($db_results)) { - $results[] = new $type($r['object_id']); + while ($row = Dba::fetch_assoc($db_results)) { + $results[] = $row['object_id']; } return $results; @@ -197,15 +197,11 @@ class Stats { switch ($type) { case 'artist': - return 'artist'; - break; case 'album': - return 'album'; - break; case 'genre': - return 'genre'; - break; case 'song': + case 'video': + return $type; default: return 'song'; break; @@ -50,7 +50,7 @@ switch ($_REQUEST['action']) { require_once Config::get('prefix') . '/templates/show_newest.inc.php'; break; case 'popular': - require_once Config::get('preifx') . '/templates/show_popular.inc.php'; + require_once Config::get('prefix') . '/templates/show_popular.inc.php'; break; case 'show': default: diff --git a/templates/show_popular.inc.php b/templates/show_popular.inc.php index 1121d6b6..bb16e8e7 100644 --- a/templates/show_popular.inc.php +++ b/templates/show_popular.inc.php @@ -20,5 +20,13 @@ */ ?> <?php show_box_top(_('Information')); ?> -<?php require_once Config::get('prefix') . '/templates/show_stats_newest.inc.php'; ?> +<em><?php echo _('Songs'); ?></em> +<?php $object_ids = Stats::get_top('song'); ?> +<?php require_once Config::get('prefix') . '/templates/show_songs.inc.php'; ?> +<em><?php echo _('Albums'); ?></em> +<?php $object_ids = Stats::get_top('album'); ?> +<?php require_once Config::get('prefix') . '/templates/show_albums.inc.php'; ?> +<em><?php echo _('Artists'); ?></em> +<?php $object_ids = Stats::get_top('artist'); ?> +<?php require_once Config::get('prefix') . '/templates/show_artists.inc.php'; ?> <?php show_box_bottom(); ?> |