diff options
-rw-r--r-- | config/ampache.cfg.php.dist | 2 | ||||
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/class/song.class.php | 4 | ||||
-rw-r--r-- | lib/class/stats.class.php | 13 | ||||
-rw-r--r-- | modules/localplay/mpd.controller.php | 7 | ||||
-rw-r--r-- | register.php | 19 |
6 files changed, 24 insertions, 22 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 0df6d0cf..0eec2c02 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -161,7 +161,7 @@ use_auth = "yes" # 5 Star Ratings # This allows rattings for almost any object in ampache # POSSIBLE VALUES: false true -# DEFAULT: false +# DEFAULT: true ratings = "true" # This options will turn on/off Demo Mode diff --git a/docs/CHANGELOG b/docs/CHANGELOG index c2b068c2..f69a18ea 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.3.3-Alpha2 + - Added exception to MPD controller, forces HTTP play regardless - Added From File: option to album art (Thx pb1dft) - Updated French Translation (Thx charrea) - Tweaked default config, Ratings are enabled by default 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'" . diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php index a88e28aa..46ea9951 100644 --- a/modules/localplay/mpd.controller.php +++ b/modules/localplay/mpd.controller.php @@ -5,9 +5,8 @@ All Rights Reserved This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -113,7 +112,7 @@ class AmpacheMpd { foreach ($songs as $song_id) { $song = new Song($song_id); - $url = $song->get_url(); + $url = $song->get_url(0,1); if (is_null($this->_mpd->PlAdd($url))) { debug_event('mpd_add','Error: Unable to add $url to MPD ' . $this->_mpd->errStr,'1'); } diff --git a/register.php b/register.php index 6f28f06f..fee00f0e 100644 --- a/register.php +++ b/register.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -30,6 +29,9 @@ $no_session = true; require_once ('lib/init.php'); +/* Load the preferences */ +init_preferences(); + $web_path = conf('web_path'); /* Check Perms */ @@ -41,16 +43,15 @@ if (!conf('allow_public_registration') || conf('demo_mode')) { * These are only needed for this page so they aren't included in init.php * this is for email validation and the cool little graphic */ -require ("modules/validatemail/validateEmailFormat.php"); -require ("modules/validatemail/validateEmail.php"); +require_once (conf('prefix') . '/modules/validatemail/validateEmailFormat.php'); +require_once (conf('prefix') . '/modules/validatemail/validateEmail.php'); /* Don't even include it if we aren't going to use it */ if (conf('captcha_public_reg')) { define ("CAPTCHA_INVERSE, 1"); - include ("modules/captcha/captcha.php"); + require_once (conf('prefix') . '/modules/captcha/captcha.php'); } -/* Show a light header */ $action = scrub_in($_REQUEST['action']); @@ -77,14 +78,14 @@ switch ($action) { if (conf('captcha_public_reg')) { $captcha = captcha::check(); if(!isset ($captcha)) { - $GLOBALS['error']->add_error('captcha',_("Error Captcha Required")); + $GLOBALS['error']->add_error('captcha',_('Error Captcha Required')); } if (isset ($captcha)) { if ($captcha) { $msg="SUCCESS"; } else { - $GLOBALS['error']->add_error('captcha',_("Error Captcha Failed")); + $GLOBALS['error']->add_error('captcha',_('Error Captcha Failed')); } } // end if we've got captcha } // end if it's enabled |