diff options
author | pb1dft <pb1dft@ampache> | 2006-11-09 01:37:19 +0000 |
---|---|---|
committer | pb1dft <pb1dft@ampache> | 2006-11-09 01:37:19 +0000 |
commit | 29aca5c21898ad71bbb537bf533a8adf0e74978d (patch) | |
tree | 0b94d25c1816de63096fd52b04ba14abf9451069 /lib/class/stats.class.php | |
parent | 70853913cf0d21bd44643c7333dd5810fe5a81d3 (diff) | |
download | ampache-29aca5c21898ad71bbb537bf533a8adf0e74978d.tar.gz ampache-29aca5c21898ad71bbb537bf533a8adf0e74978d.tar.bz2 ampache-29aca5c21898ad71bbb537bf533a8adf0e74978d.zip |
Fixed mail threshold and added user ability to change it
Diffstat (limited to 'lib/class/stats.class.php')
-rw-r--r-- | lib/class/stats.class.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/class/stats.class.php b/lib/class/stats.class.php index ee4fb3aa..7ccb3d60 100644 --- a/lib/class/stats.class.php +++ b/lib/class/stats.class.php @@ -73,12 +73,16 @@ class Stats { * This returns the top X for type Y from the * last conf('stats_threshold') days */ - function get_top($count,$type) { + function get_top($count,$type,$threshold = '') { $count = intval($count); $type = $this->validate_type($type); - $date = time() - (86400*conf('stats_threshold')); - + if (empty($threshold)){ + $date = time() - (86400*conf('stats_threshold')); + } + else { + $date = time() - (86400*$threshold); + } /* Select Top objects counting by # of rows */ $sql = "SELECT object_id,COUNT(id) AS `count` FROM object_count" . " WHERE object_type='$type' AND date >= '$date'" . |