diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-15 09:28:23 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-11-15 09:28:23 +0000 |
commit | ad6644d6cb748929108dad3143021e85ed048906 (patch) | |
tree | 34dce627a366ae1e6a1b19280c2cb7c7a36e55ff | |
parent | 9c30aa01fec45685f2cd12db63f031cd4d1ce422 (diff) | |
download | ampache-ad6644d6cb748929108dad3143021e85ed048906.tar.gz ampache-ad6644d6cb748929108dad3143021e85ed048906.tar.bz2 ampache-ad6644d6cb748929108dad3143021e85ed048906.zip |
fixed some localplay issues
-rw-r--r-- | artists.php | 2 | ||||
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/localplay.class.php | 4 | ||||
-rw-r--r-- | localplay.php | 5 | ||||
-rw-r--r-- | server/ajax.server.php | 5 | ||||
-rw-r--r-- | templates/default.css | 11 | ||||
-rw-r--r-- | templates/show_localplay.inc.php | 28 | ||||
-rw-r--r-- | templates/show_localplay_playlist.inc.php | 52 |
8 files changed, 75 insertions, 34 deletions
diff --git a/artists.php b/artists.php index 7e83c331..8e8a8612 100644 --- a/artists.php +++ b/artists.php @@ -51,7 +51,7 @@ switch($action) { $song_ids = $artist->get_song_ids(); $artist_id = $artist->id; require(conf('prefix') . '/templates/show_artist_box.inc.php'); - show_songs($song_ids); + show_songs($song_ids,''); break; case 'update_from_tags': diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 1c166a64..def60c4e 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.3-Beta1 + - Fixed a problem with Localplay Skip to song and added + highlighting of currently playing song - Added new Flash Player with full support for Non-US Char and colors. (Thx PB1DFT/Enrico Lai http://www.enricolai.com) - Tweaked how MPD is handled, if MPD is stopped a new play action diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index 48097882..9dbc7958 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -118,9 +118,9 @@ class Localplay { $name = scrub_out($name); if ($this->has_function('skip')) { - $url = conf('web_path') . '/server/ajax.server.php?action=localplay&cmd=skip&value=' . $id . '&user_id=' . $GLOBALS['user']->id . '&sessid=' . session_id(); + $url = conf('ajax_url') . "?action=localplay&cmd=skip&value=$id" . conf('ajax_info'); - $name = "<span style=\"cursor:pointer;text-decoration:underline;\" onclick=\"ajaxRequest('$url');\">$name</span>"; + $name = "<span style=\"cursor:pointer;text-decoration:underline;\" onclick=\"ajaxPut('$url');return true;\">$name</span>"; } return $name; diff --git a/localplay.php b/localplay.php index d91ea86e..df79ce3a 100644 --- a/localplay.php +++ b/localplay.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 diff --git a/server/ajax.server.php b/server/ajax.server.php index 244679e1..b3059e33 100644 --- a/server/ajax.server.php +++ b/server/ajax.server.php @@ -58,6 +58,11 @@ switch ($action) { $results['lp_state'] = $localplay->get_user_state('play'); $results['lp_playing'] = $localplay->get_user_playing(); break; + case 'skip': + ob_start(); + require_once(conf('prefix') . '/templates/show_localplay_playlist.inc.php'); + $results['lp_playlist'] = ob_get_contents(); + ob_end_clean(); case 'volume_up': case 'volume_down': case 'volume_mute': diff --git a/templates/default.css b/templates/default.css index d746e7f8..a8bda27d 100644 --- a/templates/default.css +++ b/templates/default.css @@ -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 @@ -648,6 +647,12 @@ li.current-rating{ #tv_left { float:left; } + +/* Localplay Styles */ +.lp_current { + font-weight: bold; +} + /* User Online/Offline style, used in users.php */ td.user_online { background-color: green; diff --git a/templates/show_localplay.inc.php b/templates/show_localplay.inc.php index 0ad5938c..206389d2 100644 --- a/templates/show_localplay.inc.php +++ b/templates/show_localplay.inc.php @@ -22,7 +22,6 @@ $web_path = conf('web_path'); $localplay = init_localplay(); -$songs = $localplay->get(); ?> <?php show_box_top(ucfirst($localplay->type) . ' ' . _('Localplay')); ?> <table> @@ -41,28 +40,7 @@ $songs = $localplay->get(); <?php show_box_top(_('Current Playlist')); ?> -<table class="border" cellspacing="0" border="0"> -<tr class="table-header"> - <th><?php echo _('Track'); ?></th> - <th><?php echo _('Name'); ?></th> - <th><?php echo _('Action'); ?></th> -</tr> -<?php foreach ($songs as $song) { ?> -<tr class="<?php echo flip_class(); ?>"> - <td> - <?php echo scrub_out($song['track']); ?> - </td> - <td> - <?php echo $localplay->format_name($song['name'],$song['id']); ?> - </td> - <td> - <a href="<?php echo $web_path; ?>/localplay.php?action=delete_song&song_id=<?php echo $song['id']; ?>"><?php echo _('Delete'); ?></a> - </td> -</tr> -<?php } if (!count($songs)) { ?> -<tr class="<?php echo flip_class(); ?>"> - <td colspan="3"><span class="error"><?php echo _('No Records Found'); ?></span></td> -</tr> -<?php } ?> -</table> +<div id="lp_playlist"> +<?php require_once(conf('prefix') . '/templates/show_localplay_playlist.inc.php'); ?> +</div> <?php show_box_bottom(); ?> diff --git a/templates/show_localplay_playlist.inc.php b/templates/show_localplay_playlist.inc.php new file mode 100644 index 00000000..4fec41f3 --- /dev/null +++ b/templates/show_localplay_playlist.inc.php @@ -0,0 +1,52 @@ +<?php +/* + + Copyright (c) 2001 - 2006 Ampache.org + 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 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 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ + +$songs = $localplay->get(); +$status = $localplay->status(); +?> +<table cellspacing="0"> +<tr class="table-header"> + <th><?php echo _('Track'); ?></th> + <th><?php echo _('Name'); ?></th> + <th><?php echo _('Action'); ?></th> +</tr> +<?php +foreach ($songs as $song) { + $class = ''; + if ($status['track'] == $song['track']) { $class=' class="lp_current"'; } +?> +<tr class="<?php echo flip_class(); ?>"> + <td> + <?php echo scrub_out($song['track']); ?> + </td> + <td<?php echo $class; ?>> + <?php echo $localplay->format_name($song['name'],$song['id']); ?> + </td> + <td> + <a href="<?php echo $web_path; ?>/localplay.php?action=delete_song&song_id=<?php echo scrub_out($song['id']); ?>"><?php echo _('Delete'); ?></a> + </td> +</tr> +<?php } if (!count($songs)) { ?> +<tr class="<?php echo flip_class(); ?>"> + <td colspan="3"><span class="error"><?php echo _('No Records Found'); ?></span></td> +</tr> +<?php } ?> +</table> |