summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 08:11:01 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-01-04 08:11:01 +0000
commit4e9823cd1064cc876b449752b933c89c367d84c6 (patch)
treec21f0f5c9d77176caefe5701c20afbd9d610409f /templates
parentc917726df7e3d327e3bc3030bb0b7f63925d0b42 (diff)
downloadampache-4e9823cd1064cc876b449752b933c89c367d84c6.tar.gz
ampache-4e9823cd1064cc876b449752b933c89c367d84c6.tar.bz2
ampache-4e9823cd1064cc876b449752b933c89c367d84c6.zip
fixed mysql5 crap, thx WarrenG cleaned up some of the show_songs code and stuff that calls it, did a little work on playlists
Diffstat (limited to 'templates')
-rw-r--r--templates/show_artist.inc23
-rw-r--r--templates/show_artist_box.inc.php44
-rw-r--r--templates/show_playlist_box.inc.php31
-rw-r--r--templates/show_songs.inc13
4 files changed, 83 insertions, 28 deletions
diff --git a/templates/show_artist.inc b/templates/show_artist.inc
index 8e125740..a71ddaca 100644
--- a/templates/show_artist.inc
+++ b/templates/show_artist.inc
@@ -26,28 +26,7 @@ $artist_id = $artist->id;
$web_path = conf('web_path');
?>
<br />
-<table class="text-box">
-<tr>
- <td>
- <span class="header1"><?php print _("Albums by") . " " . $artist->full_name; ?></span>
- <ul>
- <?php
- if (conf('ratings')) {
- show_rating($artist->id,'artist');
- } // end if ratings
- echo "<br />\n";
- ?>
- <li><a href="<?php print $web_path; ?>/artists.php?action=show_all_songs&amp;artist=<?php print $artist_id; ?>"><?php print _("Show All Songs By") . " " . $artist->full_name; ?></a></li>
- <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist=<?php print $artist_id; ?>"><?php print _("Play All Songs By") . " " . $artist->full_name; ?></a></li>
- <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist_random=<?php print $artist_id; ?>"><?php print _("Play Random Songs By") . " " . $artist->full_name; ?></a></li>
- <?php if ($user->has_access('100')) { ?>
- <li><a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php print $artist_id; ?>"><?php print _("Update from tags"); ?></a></li>
- <li><a href="<?php echo $web_path; ?>/artists.php?action=show_rename&amp;artist=<?php echo $artist_id; ?>"><?php echo _("Rename Artist"); ?></a></li>
- <?php } ?>
- </ul>
- </td>
-</tr>
-</table>
+<?php require (conf('prefix') . '/templates/show_artist_box.inc.php'); ?>
<!-- *** Multi-Album Art Display Thx MrBlahh Updated by clader *** -->
<br />
<form name="songs" method="post" enctype="multipart/form-data" action="artists.php">
diff --git a/templates/show_artist_box.inc.php b/templates/show_artist_box.inc.php
new file mode 100644
index 00000000..83908e94
--- /dev/null
+++ b/templates/show_artist_box.inc.php
@@ -0,0 +1,44 @@
+<?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
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ 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.
+
+*/
+?>
+<table class="text-box">
+<tr>
+ <td>
+ <span class="header1"><?php print _("Albums by") . " " . $artist->full_name; ?></span>
+ <ul>
+ <?php
+ if (conf('ratings')) {
+ show_rating($artist->id,'artist');
+ } // end if ratings
+ echo "<br />\n";
+ ?>
+ <li><a href="<?php print $web_path; ?>/artists.php?action=show_all_songs&amp;artist=<?php print $artist_id; ?>"><?php print _("Show All Songs By") . " " . $artist->full_name; ?></a></li>
+ <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist=<?php print $artist_id; ?>"><?php print _("Play All Songs By") . " " . $artist->full_name; ?></a></li>
+ <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist_random=<?php print $artist_id; ?>"><?php print _("Play Random Songs By") . " " . $artist->full_name; ?></a></li>
+ <?php if ($user->has_access('100')) { ?>
+ <li><a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php print $artist_id; ?>"><?php print _("Update from tags"); ?></a></li>
+ <li><a href="<?php echo $web_path; ?>/artists.php?action=show_rename&amp;artist=<?php echo $artist_id; ?>"><?php echo _("Rename Artist"); ?></a></li>
+ <?php } ?>
+ </ul>
+ </td>
+</tr>
+</table>
diff --git a/templates/show_playlist_box.inc.php b/templates/show_playlist_box.inc.php
new file mode 100644
index 00000000..ee9f314c
--- /dev/null
+++ b/templates/show_playlist_box.inc.php
@@ -0,0 +1,31 @@
+<?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
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ 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.
+
+*/
+?>
+
+<table class="text-box">
+<tr><td>
+ <span class="header1"><?php echo _('Playlist Actions'); ?></span><br />
+ &nbsp;&nbsp;&nbsp;<a href="<?php echo conf('web_path'); ?>/playlist.php?action=new"><?php echo _('Create New Playlist'); ?></a><br />
+ &nbsp;&nbsp;&nbsp;<a href="<?php echo conf('web_path'); ?>/playlist.php"><?php echo _('View All Playlists'); ?></a><br />
+ &nbsp;&nbsp;&nbsp;<a href="<?php echo conf('web_path'); ?>/playlist.php?action=show_import_playlist"><?php echo _('Import From File'); ?></a><br />
+</td></tr>
+</table>
diff --git a/templates/show_songs.inc b/templates/show_songs.inc
index db69d7e4..8329588b 100644
--- a/templates/show_songs.inc
+++ b/templates/show_songs.inc
@@ -55,11 +55,12 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
<?php
/* FIXME: don't even get me started with how many things are wrong with this code */
foreach ($song_ids as $song_id) {
-
+
/* Arr matey crapy code abounds! */
- if ($playlist_owner) {
+ if (is_object($playlist)) {
if ($song_id['song']) {
$song = new Song($song_id['song']);
+ $track_id = $song_id['id'];
}
else {
$song = new Song();
@@ -90,11 +91,11 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
<input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" id="song_<?php echo $song->id; ?>" />
</td>
<?php
- if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $GLOBALS['user']->has_access('100'))) {
- /* $tracknum = $playlist->get_track($track_id); */
+ 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_" . $song->id; ?>" value="<?php echo $tracknum; ?>" onchange="<?php echo "document.getElementById('song_" . $track_id . "').checked='checked';"; ?>" />
</td>
<?php $tab++; } ?>
<td>
@@ -161,7 +162,7 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
?>
<tr class="table-header">
<td></td>
- <?php if (isset($playlist_id) && $playlist_id != 0 && ($user->username == $pluser->username || $user->access === 'admin')) { ?> <td></td> <?php } ?>
+ <?php if (is_object($playlist)) { ?> <td></td> <?php } ?>
<td><?php echo _("Total"); ?>:</td>
<td nowrap="nowrap"><?php echo $num; ?> song(s)</td>
<td></td>