summaryrefslogtreecommitdiffstats
path: root/lib/class/stats.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-24 11:06:38 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-24 11:06:38 +0000
commit9344fd377da5c65a0aabf0ad9838e60dd08ff7f9 (patch)
tree7a6f8fbd03f2aa744879742cb232ecc15da2406f /lib/class/stats.class.php
parent8f78e6885bbbb977af00ce54c74fa2006e384e9a (diff)
downloadampache-9344fd377da5c65a0aabf0ad9838e60dd08ff7f9.tar.gz
ampache-9344fd377da5c65a0aabf0ad9838e60dd08ff7f9.tar.bz2
ampache-9344fd377da5c65a0aabf0ad9838e60dd08ff7f9.zip
added most popular back to the statistics page, formating needs to be tweaked, will do later
Diffstat (limited to 'lib/class/stats.class.php')
-rw-r--r--lib/class/stats.class.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/class/stats.class.php b/lib/class/stats.class.php
index a687cd69..0c8a69cd 100644
--- a/lib/class/stats.class.php
+++ b/lib/class/stats.class.php
@@ -94,13 +94,17 @@ class Stats {
* This returns the top X for type Y from the
* last conf('stats_threshold') days
*/
- public static function get_top($count,$type,$threshold = '') {
+ public static function get_top($type,$count='',$threshold = '') {
/* If they don't pass one, then use the preference */
if (!$threshold) {
$threshold = Config::get('stats_threshold');
}
+ if (!$count) {
+ $count = Config::get('popular_threshold');
+ }
+
$count = intval($count);
$type = self::validate_type($type);
$date = time() - (86400*$threshold);
@@ -114,7 +118,7 @@ class Stats {
$results = array();
while ($r = Dba::fetch_assoc($db_results)) {
- $results[] = $r;
+ $results[] = new $type($r['object_id']);
}
return $results;