From ad05301d549924663370e447286f68b4c0ccdfde Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 10 Nov 2006 03:50:35 +0000 Subject: fixed the title on registration, and a bunch of random other things --- lib/class/stats.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/class/stats.class.php') diff --git a/lib/class/stats.class.php b/lib/class/stats.class.php index 7ccb3d60..965b3362 100644 --- a/lib/class/stats.class.php +++ b/lib/class/stats.class.php @@ -75,14 +75,15 @@ class Stats { */ function get_top($count,$type,$threshold = '') { + /* If they don't pass one, then use the preference */ + if (!$threshold) { + $threshold = conf('stats_threshold'); + } + $count = intval($count); $type = $this->validate_type($type); - if (empty($threshold)){ - $date = time() - (86400*conf('stats_threshold')); - } - else { - $date = time() - (86400*$threshold); - } + $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