diff options
-rw-r--r-- | browse.php | 6 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/browse.class.php | 15 | ||||
-rw-r--r-- | lib/class/random.class.php | 2 | ||||
-rw-r--r-- | lib/class/song.class.php | 2 | ||||
-rw-r--r-- | lib/class/stream.class.php | 32 | ||||
-rw-r--r-- | modules/kajax/ajax.js | 6 | ||||
-rw-r--r-- | templates/header.inc.php | 1 | ||||
-rw-r--r-- | themes/classic/templates/default.css | 12 | ||||
-rw-r--r-- | themes/greysme/templates/default.css | 12 |
10 files changed, 76 insertions, 14 deletions
@@ -42,26 +42,31 @@ switch($_REQUEST['action']) { case 'file': case 'album': Browse::set_type('album'); + Browse::set_sort('name','ASC'); $album_ids = Browse::get_objects(); Browse::show_objects($album_ids); break; case 'artist': Browse::set_type('artist'); + Browse::set_sort('name','ASC'); $artist_ids = Browse::get_objects(); Browse::show_objects($artist_ids); break; case 'genre': Browse::set_type('genre'); + Browse::set_sort('name','ASC'); $genre_ids = Browse::get_objects(); Browse::show_objects($genre_ids); break; case 'song': Browse::set_type('song'); + Browse::set_sort('title','ASC'); $song_ids = Browse::get_objects(); Browse::show_objects($song_ids); break; case 'live_stream': Browse::set_type('live_stream'); + Browse::set_sort('name','ASC'); $live_stream_ids = Browse::get_objects(); Browse::show_objects($live_stream_ids); break; @@ -70,6 +75,7 @@ switch($_REQUEST['action']) { break; case 'playlist': Browse::set_type('playlist'); + Browse::set_sort('name','ASC'); $playlist_ids = Browse::get_objects(); Browse::show_objects($playlist_ids); break; diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 2e4f9dcd..6f7714ee 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.4-Alpha3 + - Fixed Random methods (rightbar) + - Added Loading box for ajax actions - Added ability to append to existing playlists - Modified Play Method to use hidden iframe - Fixed album random and by min random diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index fae2670b..89341ec2 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -119,7 +119,7 @@ class Browse { * set_sort * This sets the current sort(s) */ - public static function set_sort($sort) { + public static function set_sort($sort,$order='') { switch ($_SESSION['browse']['type']) { case 'song': @@ -145,9 +145,13 @@ class Browse { // If it's not in our list, smeg off! if (!in_array($sort,$valid_array)) { return false; - } - - if ($_SESSION['browse']['sort'][$sort] == 'DESC') { + } + + if ($order) { + $_SESSION['browse']['sort'] = array(); + $_SESSION['browse']['sort'][$sort] = $order; + } + elseif ($_SESSION['browse']['sort'][$sort] == 'DESC') { // Reset it till I can figure out how to interface the hotness $_SESSION['browse']['sort'] = array(); $_SESSION['browse']['sort'][$sort] = 'ASC'; @@ -572,6 +576,9 @@ class Browse { // First pull the objects $objects = self::get_saved(); + // If there's nothing there don't do anything + if (!count($objects)) { return false; } + foreach ($objects as $object_id) { $object_id = Dba::escape($object_id); $where_sql .= "`id`='$object_id' OR"; diff --git a/lib/class/random.class.php b/lib/class/random.class.php index 4b0efe84..8887bd28 100644 --- a/lib/class/random.class.php +++ b/lib/class/random.class.php @@ -98,7 +98,7 @@ class Random { } if (Config::get('require_session')) { - $session_string = '&sid=' . session_id(); + $session_string = '&sid=' . Stream::get_session(); } $web_path = Config::get('web_path'); diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 98de5616..732a0539 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -793,7 +793,7 @@ class Song { $session_string = "&sid=" . $session_id; } else { - $session_string = "&sid=" . session_id(); + $session_string = "&sid=" . Stream::get_session(); } } // if they are requiring a session diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 7c07b8f3..ffd4be6f 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -53,9 +53,6 @@ class Stream { if (Config::get('force_http_play')) { $this->web_path = preg_replace("/https/", "http",$this->web_path); } - - // Generate the session ID - self::$session = md5(uniqid(rand(), true));; } // Constructor @@ -104,6 +101,16 @@ class Stream { } // manual_url_add /** + * get_session + * This returns the current stream session + */ + public static function get_session() { + + return self::$session; + + } // get_session + + /** * insert_session * This inserts a row into the session_stream table */ @@ -207,7 +214,7 @@ class Stream { if ($GLOBALS['user']->prefs['play_type'] == 'downsample') { $ds = $GLOBALS['user']->prefs['sample_rate']; } - echo $song->get_url(self::$session); + echo $song->get_url(); } // end foreach /* Foreach the additional URLs */ @@ -443,7 +450,7 @@ class Stream { // Foreach the stuff we've got and add it foreach ($this->objects as $object) { - $localplay->add($object,self::$session); + $localplay->add($object); } $localplay->play(); @@ -474,7 +481,7 @@ class Stream { // Build up our object $song_id = $this->songs['0']; $song = new Song($song_id); - $url = $song->get_url(self::$session); + $url = $song->get_url(); // Append the fact we are downloading $url .= '&action=download'; @@ -496,11 +503,22 @@ class Stream { header("Content-Type: audio/x-pn-realaudio ram;"); foreach ($this->songs as $song_id) { $song = new Song($song_id); - echo $song->get_url(self::$session); + echo $song->get_url(); } // foreach songs } // create_ram + /** + * auto_init + * This is called on class load it sets the session + */ + public static function auto_init() { + + // Generate the session ID + self::$session = md5(uniqid(rand(), true));; + + } // auto_init + } //end of stream class ?> diff --git a/modules/kajax/ajax.js b/modules/kajax/ajax.js index 1d6b57e8..4d7a04b1 100644 --- a/modules/kajax/ajax.js +++ b/modules/kajax/ajax.js @@ -46,6 +46,10 @@ function ajaxPut(url,source) { function getContents(http_request) {
+
+ // Display the loading doodly
+ document.getElementById('ajax-loading').style.display = 'block';
+
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var data = http_request.responseXML;
@@ -58,7 +62,7 @@ function getContents(http_request) { $(newID).update(newContent[i].firstChild.nodeValue);
}
}
-
+ document.getElementById('ajax-loading').style.display = 'none';
}
}
}
diff --git a/templates/header.inc.php b/templates/header.inc.php index 4042eed4..ef3672f1 100644 --- a/templates/header.inc.php +++ b/templates/header.inc.php @@ -80,6 +80,7 @@ if (Config::get('use_rss')) { ?> <!-- I hate IE... <table class="smeg-ie" width="100%"><tr><td> --> <!-- Tiny little iframe, used to cheat the system --> +<div id="ajax-loading">Loading . . .</div> <iframe id="util_iframe" style="display:none;" src="<?php echo Config::get('web_path'); ?>/util.php"></iframe> <div id="content"> <?php if (Config::get('int_config_version') != Config::get('config_version') AND $GLOBALS['user']->has_access(100)) { ?> diff --git a/themes/classic/templates/default.css b/themes/classic/templates/default.css index 7b45af13..1523cfc7 100644 --- a/themes/classic/templates/default.css +++ b/themes/classic/templates/default.css @@ -724,6 +724,18 @@ td.user_disabled { border:2px solid #000;
}
+#ajax-loading {
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ float: right;
+ z-index: 100;
+ background: #99ccff;
+ display: none;
+ padding: 3px 25px 5px 25px;
+ border: 1px solid #000;
+}
+
#mpdpl td {
padding:0 2px 0 2px;
text-align:left;
diff --git a/themes/greysme/templates/default.css b/themes/greysme/templates/default.css index 1ed25425..c509423a 100644 --- a/themes/greysme/templates/default.css +++ b/themes/greysme/templates/default.css @@ -818,6 +818,18 @@ input.text_input { .display {}
+#ajax-loading {
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ float: right;
+ z-index: 100;
+ background: #99ccff;
+ display: none;
+ padding: 3px 25px 5px 25px;
+ border: 1px solid #000;
+}
+
#mpdpl td {
padding: 0 2px 0 2px;
text-align: left;
|