summaryrefslogtreecommitdiffstats
path: root/lib/class/stats.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-10 03:50:35 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-11-10 03:50:35 +0000
commitad05301d549924663370e447286f68b4c0ccdfde (patch)
tree500bb2a26c909b4ea0020a2e157bf89780d66230 /lib/class/stats.class.php
parent29aca5c21898ad71bbb537bf533a8adf0e74978d (diff)
downloadampache-ad05301d549924663370e447286f68b4c0ccdfde.tar.gz
ampache-ad05301d549924663370e447286f68b4c0ccdfde.tar.bz2
ampache-ad05301d549924663370e447286f68b4c0ccdfde.zip
fixed the title on registration, and a bunch of random other things
Diffstat (limited to 'lib/class/stats.class.php')
-rw-r--r--lib/class/stats.class.php13
1 files changed, 7 insertions, 6 deletions
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'" .