From 29aca5c21898ad71bbb537bf533a8adf0e74978d Mon Sep 17 00:00:00 2001 From: pb1dft Date: Thu, 9 Nov 2006 01:37:19 +0000 Subject: Fixed mail threshold and added user ability to change it --- lib/class/stats.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') 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'" . -- cgit