diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-10 03:50:35 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-10 03:50:35 +0000 |
commit | ad05301d549924663370e447286f68b4c0ccdfde (patch) | |
tree | 500bb2a26c909b4ea0020a2e157bf89780d66230 /lib | |
parent | 29aca5c21898ad71bbb537bf533a8adf0e74978d (diff) | |
download | ampache-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')
-rw-r--r-- | lib/class/song.class.php | 4 | ||||
-rw-r--r-- | lib/class/stats.class.php | 13 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php index c986daa1..69f86db5 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -711,7 +711,7 @@ class Song { * a stream URL taking into account the downsampling mojo and everything * else, this is used or will be used by _EVERYTHING_ */ - function get_url($session_id='') { + function get_url($session_id='',$force_http='') { /* Define Variables we are going to need */ $username = $GLOBALS['user']->username; @@ -737,7 +737,7 @@ class Song { $web_path = conf('web_path'); - if (conf('force_http_play')) { + if (conf('force_http_play') AND !$force_http) { $port = conf('http_port'); $web_path = preg_replace("/https/", "http",$web_path); $web_path = preg_replace("/:\d+/",":$port",$web_path); 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'" . |