summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-08 02:32:45 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-01-08 02:32:45 +0000
commit3460950693c609876022a02eb5f42a59c768029e (patch)
tree4ea3cad99ebd54630f896832ba682d5c25fd3726 /lib
parent47628fb4b901a5737743264ba14dca52be64a268 (diff)
downloadampache-3460950693c609876022a02eb5f42a59c768029e.tar.gz
ampache-3460950693c609876022a02eb5f42a59c768029e.tar.bz2
ampache-3460950693c609876022a02eb5f42a59c768029e.zip
tweaked album of the moment mojo and theoritical fix for flash player
Diffstat (limited to 'lib')
-rw-r--r--lib/class/album.class.php2
-rw-r--r--lib/class/stream.class.php34
-rw-r--r--lib/init.php2
-rw-r--r--lib/stream.lib.php5
4 files changed, 26 insertions, 17 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 6358f489..31a4f54e 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -155,7 +155,7 @@ class Album {
$this->f_name = "<a href=\"$web_path/albums.php?action=show&amp;album=" . $this->id . "\" title=\"" . scrub_out($this->name) . "\">" . $name . "</a>";
$this->f_link = "<a href=\"$web_path/albums.php?action=show&amp;album=" . scrub_out($this->id) . "\" title=\"" . scrub_out($this->name) . "\">" . $name . "</a>";
$this->f_songs = "<div align=\"center\">" . $this->songs . "</div>";
-
+ $this->f_title = $name;
if ($this->artist_count == '1') {
$this->f_artist = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $artist . "</a>";
}
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index c505b380..c27ef17a 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -236,21 +236,29 @@ class Stream {
*/
function create_xspf() {
+ $flash_hack = '';
+
+ if (isset($_REQUEST['flash_hack'])) {
+ $flash_hack = '&flash_hack=' . $_REQUEST['flash_hack'];
+ if (!conf('require_session')) { $flash_hack .= '&sid=' . session_id(); }
+ }
+
+ // Itterate through the songs
foreach ($this->songs as $song_id) {
- $song = new Song($song_id);
- $song->format_song();
-
- $xml = array();
- $xml['track']['location'] = $song->get_url();
- $xml['track']['identifier'] = $xml['track']['location'];
- $xml['track']['title'] = $song->title;
- $xml['track']['creator'] = $song->f_artist_full;
- $xml['track']['info'] = conf('web_path') . "/albums.php?action=show&album=" . $song->album;
- $xml['track']['image'] = conf('web_path') . "/image.php?id=" . $song->album . "&&thumb=3&sid=" . session_id();
- $xml['track']['album'] = $song->f_album_full;
- $xml['track']['duration'] = $song->time;
- $result .= xml_from_array($xml,1,'xspf');
+ $song = new Song($song_id);
+ $song->format_song();
+
+ $xml = array();
+ $xml['track']['location'] = $song->get_url() . $flash_hack;
+ $xml['track']['identifier'] = $xml['track']['location'];
+ $xml['track']['title'] = $song->title;
+ $xml['track']['creator'] = $song->f_artist_full;
+ $xml['track']['info'] = conf('web_path') . "/albums.php?action=show&album=" . $song->album;
+ $xml['track']['image'] = conf('web_path') . "/image.php?id=" . $song->album . "&thumb=3&sid=" . session_id();
+ $xml['track']['album'] = $song->f_album_full;
+ $xml['track']['duration'] = $song->time;
+ $result .= xml_from_array($xml,1,'xspf');
} // end foreach
diff --git a/lib/init.php b/lib/init.php
index 58454ec2..02b54184 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -67,7 +67,7 @@ if (!$results = read_config($configfile,0)) {
}
/** This is the version.... fluf nothing more... **/
-$results['version'] = '3.3.3 Build (001)';
+$results['version'] = '3.3.3 Build (002)';
$results['raw_web_path'] = $results['web_path'];
$results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path'];
diff --git a/lib/stream.lib.php b/lib/stream.lib.php
index cb935aaf..3cdb4ccf 100644
--- a/lib/stream.lib.php
+++ b/lib/stream.lib.php
@@ -31,7 +31,8 @@ function delete_now_playing($insert_id) {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
- if (stristr($user_agent,"NSPlayer")) {
+ // Account for WMP and the Flash Player
+ if (stristr($user_agent,"NSPlayer") || $_REQUEST['flash_hack'] == 1) {
// Commented out until I can figure out the
// trick to making this work
return true;
@@ -89,7 +90,7 @@ function insert_now_playing($song_id,$uid,$song_length) {
/* Set the Expire Time */
// If they are using Windows media player
- if (stristr($user_agent,"NSPlayer")) {
+ if (stristr($user_agent,"NSPlayer") || $_REQUEST['flash_hack'] == 1) {
// WMP does keep the session open so we need to cheat a little here
$session_id = sql_escape($_REQUEST['sid']);
}