summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-05 06:19:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-05 06:19:22 +0000
commit6daae3271c5126c2cd4c08b98b451ebe51fa90e0 (patch)
treefc2f1527670ae6fd9d9f7b56529e5938b808fe40
parent75aa0cf62494939224098ca60bbef000b21a3c23 (diff)
downloadampache-6daae3271c5126c2cd4c08b98b451ebe51fa90e0.tar.gz
ampache-6daae3271c5126c2cd4c08b98b451ebe51fa90e0.tar.bz2
ampache-6daae3271c5126c2cd4c08b98b451ebe51fa90e0.zip
fixed up some more playlist stuff
-rw-r--r--lib/class/playlist.class.php1
-rw-r--r--playlist.php3
-rw-r--r--templates/show_play_selected.inc.php6
-rw-r--r--templates/show_songs.inc4
4 files changed, 9 insertions, 5 deletions
diff --git a/lib/class/playlist.class.php b/lib/class/playlist.class.php
index 23b1f5f2..aea55323 100644
--- a/lib/class/playlist.class.php
+++ b/lib/class/playlist.class.php
@@ -377,6 +377,7 @@ class Playlist {
$id = sql_escape($value);
$sql = "DELETE FROM playlist_data WHERE id='$id'";
+ echo $sql;
$db_results = mysql_query($sql, dbh());
} // end foreach dead songs
diff --git a/playlist.php b/playlist.php
index 02b64665..914a167c 100644
--- a/playlist.php
+++ b/playlist.php
@@ -114,7 +114,7 @@ switch ($action) {
access_denied();
break;
}
- $playlist->remove_songs($_REQUEST['song_ids']);
+ $playlist->remove_songs($_REQUEST['song']);
show_playlist($playlist);
break;
case 'update':
@@ -139,6 +139,7 @@ switch ($action) {
show_import_playlist();
break;
case 'set_track_numbers':
+ print_r($_REQUEST);
/* Make sure they have permission */
if (!$GLOBALS['user']->has_access(100) && $GLOBALS['user']->username != $playlist->user) {
access_denied();
diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php
index 1f7ac16c..d85997d6 100644
--- a/templates/show_play_selected.inc.php
+++ b/templates/show_play_selected.inc.php
@@ -57,14 +57,15 @@ function ToBatch(action)
-->
</td>
</tr>
-<?php if ($GLOBALS['playlist_id']) { ?>
+<?php if (is_object($GLOBALS['playlist'])) { ?>
<tr>
<td>
+ <input type="hidden" name="playlist_id" value="<?php echo $GLOBALS['playlist']->id; ?>" />
<input class="button" type="button" name="super_action" value="<?php echo _("Set Track Numbers"); ?>" onclick="return ToPlaylist('set_track_numbers');" />
<input class="button" type="button" name="super_action" value="<?php echo _("Remove Selected Tracks"); ?>" onclick="return ToPlaylist('remove_song');" />
</td>
</tr>
-<?php } ?>
+<?php } else { ?>
<tr align="center">
<td colspan="2">
<?php echo _("Playlist"); ?>: <input type="button" name="super_action" value="<?php echo _("Add to"); ?>" onclick="return ToPlaylist('add_to');" />
@@ -73,4 +74,5 @@ function ToBatch(action)
<input class="button" type="button" name="super_action" value="<?php echo _("Edit"); ?>" onclick="return ToPlaylist('edit');" />
</td>
</tr>
+<?php } ?>
</table>
diff --git a/templates/show_songs.inc b/templates/show_songs.inc
index 8329588b..7e0eee8b 100644
--- a/templates/show_songs.inc
+++ b/templates/show_songs.inc
@@ -88,14 +88,14 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
?>
<tr class="<?php echo flip_class(); ?>">
<td align="center">
- <input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" id="song_<?php echo $song->id; ?>" />
+ <input type="checkbox" name="song[]" value="<?php echo $track_id; ?>" id="song_<?php echo $track_id; ?>" />
</td>
<?php
if ($playlist_owner) {
$tracknum = $playlist->get_track($track_id);
?>
<td>
- <input type="text" tabindex="<?php echo $tab; ?>" size="3" name="<?php echo "tr_" . $song->id; ?>" value="<?php echo $tracknum; ?>" onchange="<?php echo "document.getElementById('song_" . $track_id . "').checked='checked';"; ?>" />
+ <input type="text" tabindex="<?php echo $tab; ?>" size="3" name="<?php echo "tr_" . $track_id; ?>" value="<?php echo $tracknum; ?>" onchange="<?php echo "document.getElementById('song_" . $track_id . "').checked='checked';"; ?>" />
</td>
<?php $tab++; } ?>
<td>