summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 22:27:45 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-29 22:27:45 +0000
commitd61f395465ed22effccd154782fde7f78f903dbf (patch)
treec3e48c5b1e46baa95383473cfc2f2555fc60b528
parent3fa94f564493d930f5049526e18d35c1213ba9ca (diff)
downloadampache-d61f395465ed22effccd154782fde7f78f903dbf.tar.gz
ampache-d61f395465ed22effccd154782fde7f78f903dbf.tar.bz2
ampache-d61f395465ed22effccd154782fde7f78f903dbf.zip
more tweaks, hopefully fixing the flash player mostly needs to be embeded to fix some remaining bugs
-rw-r--r--lib/class/catalog.class.php6
-rw-r--r--lib/class/stream.class.php4
-rw-r--r--modules/flash/xspf_player.php34
-rw-r--r--templates/show_artist.inc.php5
-rw-r--r--templates/show_login_form.inc2
-rw-r--r--templates/show_xspf_player.inc.php2
6 files changed, 38 insertions, 15 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index e92b1942..61bc19fa 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1408,7 +1408,7 @@ class Catalog {
* clean_playlists
* cleans out dead files from playlists
*/
- public static function clean_playlists($catalog_id) {
+ public static function clean_playlists() {
/* Do a complex delete to get playlist songs where there are no songs */
$sql = "DELETE FROM playlist_data USING playlist_data LEFT JOIN song ON song.id = playlist_data.song WHERE song.file IS NULL";
@@ -1424,7 +1424,7 @@ class Catalog {
* clean_ext_info
* This function clears any ext_info that no longer has a parent
*/
- public static function clean_ext_info($catalog_id) {
+ public static function clean_ext_info() {
$sql = "DELETE FROM `song_data` USING `song_data` LEFT JOIN `song` ON `song`.`id` = `song_data`.`song_id` " .
"WHERE `song`.`id` IS NULL";
@@ -1436,7 +1436,7 @@ class Catalog {
* clean_stats
* This functions removes stats for songs/albums that no longer exist
*/
- public static function clean_stats($catalog_id) {
+ public static function clean_stats() {
// Crazy SQL Mojo to remove stats where there are no songs
$sql = "DELETE FROM object_count USING object_count LEFT JOIN song ON song.id=object_count.object_id WHERE object_type='song' AND song.id IS NULL";
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 2f5c4aee..6fca492c 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -302,7 +302,7 @@ class Stream {
/* Add the songs to this new playlist */
foreach ($this->songs as $song_id) {
- $tmp_playlist->add_object($song_id);
+ $tmp_playlist->add_object($song_id,'song');
} // end foreach
/* Build the extra info we need to have it pass */
@@ -321,7 +321,7 @@ class Stream {
echo "<script language=\"javascript\" type=\"text/javascript\">\n";
echo "<!-- begin\n";
echo "function PlayerPopUp(URL) {\n";
- echo "window.open(URL, 'XSPF_player', 'width=400,height=200,scrollbars=0,toolbar=0,location=0,directories=0,status=0,resizable=0');\n";
+ echo "window.open(URL, 'XSPF_player', 'width=400,height=170,scrollbars=0,toolbar=0,location=0,directories=0,status=0,resizable=0');\n";
echo "window.location = '" . return_referer() . "';\n";
echo "return false;\n";
echo "}\n";
diff --git a/modules/flash/xspf_player.php b/modules/flash/xspf_player.php
index 4a4d63c4..2015f8f1 100644
--- a/modules/flash/xspf_player.php
+++ b/modules/flash/xspf_player.php
@@ -32,12 +32,40 @@ switch ($action) {
// Set for hackage!
$_REQUEST['flash_hack'] = 1;
$tmp_playlist = new tmpPlaylist($_REQUEST['tmp_id']);
- $items = $tmp_playlist->get_items();
- $stream = new Stream('xspf',$items);
+ $objects = $tmp_playlist->get_items();
+
+ //Recurse through the objects
+ foreach ($objects as $object_data) {
+ // Switch on the type of object we've got in here
+ switch ($object_data['1']) {
+ case 'radio':
+ $radio = new Radio($object_data['0']);
+ $urls[] = $radio->url;
+ $song_ids[] = '-1';
+ break;
+ case 'song':
+ $song_ids[] = $object_data['0'];
+ break;
+ default:
+ $random_url = Random::play_url($object_data['1']);
+ // If there's something to actually add
+ if ($random_url) {
+ $urls[] = $random_url;
+ $song_ids[] = '-1';
+ }
+ break;
+ } // end switch on type
+ } // end foreach
+ $stream = new Stream('xspf',$song_ids);
+ if (is_array($urls)) {
+ foreach ($urls as $url) {
+ $stream->manual_url_add($url);
+ }
+ }
$stream->start();
break;
case 'show':
- $play_info = "?tmp_id=" . scrub_out($_REQUEST['tmpplaylist_id']);
+ $play_url = Config::get('web_path') . '/modules/flash/xspf_player.php?tmp_id=' . scrub_out($_REQUEST['tmpplaylist_id']);
require_once Config::get('prefix') . '/templates/show_xspf_player.inc.php';
break;
} // end switch
diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php
index 0e7613a1..6756ae05 100644
--- a/templates/show_artist.inc.php
+++ b/templates/show_artist.inc.php
@@ -64,11 +64,6 @@ foreach ($albums as $album_id) {
<?php echo get_user_icon('batch_download'); ?>
</a>
<?php } ?>
- <?php if ($GLOBALS['user']->has_access('100')) { ?>
- <a href="<?php echo $web_path; ?>/admin/flag.php?action=show_edit_album&amp;album_id=<?php echo $album->id; ?>">
- <?php echo get_user_icon('edit'); ?>
- </a>
- <?php } ?>
</td>
</tr>
<?php } //end foreach ($albums as $album)?>
diff --git a/templates/show_login_form.inc b/templates/show_login_form.inc
index 23b8d0fe..076bc1b1 100644
--- a/templates/show_login_form.inc
+++ b/templates/show_login_form.inc
@@ -43,7 +43,7 @@ function focus(){ document.login.username.focus(); }
<body bgcolor="#D3D3D3" onload="focus();">
<div id="container">
- <h1><span><?php echo Config::get('site_title'); ?></span></h1>
+ <h1 onclick="document.location='http://www.ampache.org';" title="<?php echo Config::get('site_title'); ?>" style="cursor:pointer;" ><span><?php echo Config::get('site_title'); ?></span></h1>
<div>
<p id="loginp_0"><?php echo Config::get('site_title'); ?></p>
<form name="login" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ; ?>/login.php" style="Display:inline">
diff --git a/templates/show_xspf_player.inc.php b/templates/show_xspf_player.inc.php
index 67cf3104..73b656e4 100644
--- a/templates/show_xspf_player.inc.php
+++ b/templates/show_xspf_player.inc.php
@@ -60,7 +60,7 @@ document.oncontextmenu=new Function("return false")
<param name="movie" value="xspf_player.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
- <embed src="<?php echo Config::get('web_path'); ?>/modules/flash/xspf_player.swf?autoplay=true&playlist_url=<?php echo Config::get('web_path'); ?>/modules/flash/xspf_player.php<?php echo $play_info; ?>" quality="high" bgcolor="#ffffff" width="400" height="170" name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
+ <embed src="<?php echo Config::get('web_path'); ?>/modules/flash/xspf_player.swf?autoplay=true&playlist_url=<?php echo $play_url; ?>" quality="high" bgcolor="#ffffff" width="400" height="170" name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>