summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/show_box.inc24
-rw-r--r--templates/show_confirmation.inc.php20
-rw-r--r--templates/show_disabled_songs.inc28
-rw-r--r--templates/show_edit_access.inc74
-rw-r--r--templates/show_genre.inc.php28
-rw-r--r--templates/show_genres.inc.php41
-rw-r--r--templates/show_import_playlist.inc.php3
-rw-r--r--templates/show_local_catalog_info.inc.php4
-rw-r--r--templates/show_localplay.inc77
-rw-r--r--templates/show_login_form.inc97
-rw-r--r--templates/show_mpdpl.inc25
-rw-r--r--templates/show_mpdplay.inc299
-rw-r--r--templates/show_now_playing.inc81
-rw-r--r--templates/show_object_rating.inc.php23
-rw-r--r--templates/show_play_selected.inc.php36
-rw-r--r--templates/show_playlist_box.inc.php26
-rw-r--r--templates/show_playlists.inc.php85
-rw-r--r--templates/show_preference_box.inc.php51
-rw-r--r--templates/show_preferences.inc80
-rw-r--r--templates/show_random_play.inc64
-rw-r--r--templates/show_random_play_bar.inc.php56
-rw-r--r--templates/show_rename_artist.inc.php9
-rw-r--r--templates/show_search.inc10
-rw-r--r--templates/show_songs.inc239
-rw-r--r--templates/show_upload.inc44
-rw-r--r--templates/show_uploads.inc10
-rw-r--r--templates/show_user.inc.php107
-rw-r--r--templates/show_user_registration.inc.php222
-rw-r--r--templates/show_users.inc65
-rw-r--r--templates/sidebar.inc.php200
-rw-r--r--templates/song_edit.inc105
-rw-r--r--templates/subnavbar.inc.php9
-rw-r--r--templates/tool_box.inc24
-rw-r--r--templates/userform.inc32
34 files changed, 1115 insertions, 1183 deletions
diff --git a/templates/show_box.inc b/templates/show_box.inc
index f17cbe16..bf0f10a1 100644
--- a/templates/show_box.inc
+++ b/templates/show_box.inc
@@ -21,16 +21,16 @@
*/
?>
<table class="border" cellspacing="1" cellpadding="3">
- <tr align="center">
- <td background="<?php echo conf('web_path'); ?>/images/ampache-light-bg.gif" bgcolor="#c0c0c0"><?php echo $title; ?></td>
- </tr>
- <tr>
- <td class="even">
- <?
- foreach ($items as $item) {
- echo $item;
- }
- ?>
- </td>
- </tr>
+<tr align="center">
+ <td background="<?php echo conf('web_path'); ?>/images/ampache-light-bg.gif" bgcolor="#c0c0c0"><?php echo $title; ?></td>
+</tr>
+<tr>
+ <td class="even">
+ <?php
+ foreach ($items as $item) {
+ echo $item;
+ }
+ ?>
+ </td>
+</tr>
</table>
diff --git a/templates/show_confirmation.inc.php b/templates/show_confirmation.inc.php
index b91227f4..2ba325a0 100644
--- a/templates/show_confirmation.inc.php
+++ b/templates/show_confirmation.inc.php
@@ -21,13 +21,15 @@
?>
<br />
<table class="text-box" align="center" cellspacing="7">
-<tr><td align="center">
- <span class="header1"><?php echo $title; ?></span>
- <br />
- <?php echo $text; ?>
-</td></tr>
-<tr><td>
- [ <a href="<?php echo $path; ?>"><?php echo _("Continue"); ?></a> ]
- <br />
-</td></tr>
+<tr>
+ <td align="center">
+ <span class="header1"><?php echo $title; ?></span><br />
+ <?php echo $text; ?>
+ </td>
+</tr>
+<tr>
+ <td>
+ [ <a href="<?php echo $path; ?>"><?php echo _("Continue"); ?></a> ]<br />
+ </td>
+</tr>
</table>
diff --git a/templates/show_disabled_songs.inc b/templates/show_disabled_songs.inc
index 92c7fc8f..20d36dbe 100644
--- a/templates/show_disabled_songs.inc
+++ b/templates/show_disabled_songs.inc
@@ -30,20 +30,22 @@
<td>Filename</td>
<td>Addition Time</td>
</tr>
-<?php foreach ($songs as $song) {
- $class = (++$i%2)?'odd':'even';
+<?php
+foreach ($songs as $song) {
+ $class = (++$i%2)?'odd':'even';
+?>
+ <tr class="<?php echo $class; ?>">
+ <td><input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" /></td>
+ <td><?php echo $song->title; ?></td>
+ <td><?php echo $song->get_album_name($song->album); ?></td>
+ <td><?php echo $song->get_artist_name($song->album); ?></td>
+ <td><?php echo $song->file; ?></td>
+ <td><?php echo date("h:i:s, m/d/y",$song->addition_time); ?></td>
+
+ </tr>
+<?php } // end foreach ($songs as $song)
+$class = (++$i%2)?'odd':'even';
?>
-<tr class="<?php echo $class; ?>">
- <td><input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" /></td>
- <td><?php echo $song->title; ?></td>
- <td><?php echo $song->get_album_name($song->album); ?></td>
- <td><?php echo $song->get_artist_name($song->album); ?></td>
- <td><?php echo $song->file; ?></td>
- <td><?php echo date("h:i:s, m/d/y",$song->addition_time); ?></td>
-
-</tr>
-<?php } ?>
-<?php $class = (++$i%2)?'odd':'even'; ?>
<tr class="<?php echo $class; ?>">
<td>&nbsp;</td>
<td colspan="10">
diff --git a/templates/show_edit_access.inc b/templates/show_edit_access.inc
index 93c32999..95adad9e 100644
--- a/templates/show_edit_access.inc
+++ b/templates/show_edit_access.inc
@@ -21,45 +21,45 @@
*/
?>
-<p class="header1"><?php print _('Edit Access List'); ?></p>
+<p class="header1"><?php echo _('Edit Access List'); ?></p>
<form name="edit_access" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/admin/access.php">
<table class="text-box">
- <tr>
- <td><?php print _('Name'); ?>: </td>
- <td><?php echo scrub_out($access->name); ?></td>
- </tr>
- <tr>
- <td><?php print _('Start IP Address'); ?>:</td>
- <td>
- <input type="text" name="start" value="<?php echo int2ip($access->start); ?>" size="20" maxlength="15" />
- </td>
- </tr>
- <tr>
- <td><?php print _('End IP Address'); ?>:</td>
- <td>
- <input type="text" name="end" value="<?php echo int2ip($access->end); ?>" size="20" maxlength="15" />
- </td>
- </tr>
- <tr>
- <td><?php print _('Level'); ?>:</td>
- <td>
- <select name="level">
- <?php $name = 'level_' . $access->level; ${$name} = 'selected="selected"'; ?>
- <option value="5" <?php echo $level_5; ?>><?php echo _('Demo'); ?></option>
- <option value="25" <?php echo $level_25; ?>><?php echo _('Stream'); ?></option>
- <option value="50" <?php echo $level_50; ?>><?php echo _('Stream/Download'); ?></option>
- <option value="75" <?php echo $level_75; ?>><?php echo _('XML-RPC'); ?></option>
- </select>
- </td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td>
- <input type="hidden" name="access_id" value="<?php echo scrub_out($access->id); ?>" />
- <input type="hidden" name="action" value="update_host" />
- <input type="submit" value="<?php print _('Update'); ?>" />
- </td>
- </tr>
+<tr>
+ <td><?php echo _('Name'); ?>: </td>
+ <td><?php echo scrub_out($access->name); ?></td>
+</tr>
+<tr>
+ <td><?php echo _('Start IP Address'); ?>:</td>
+ <td>
+ <input type="text" name="start" value="<?php echo int2ip($access->start); ?>" size="20" maxlength="15" />
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('End IP Address'); ?>:</td>
+ <td>
+ <input type="text" name="end" value="<?php echo int2ip($access->end); ?>" size="20" maxlength="15" />
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Level'); ?>:</td>
+ <td>
+ <select name="level">
+ <?php $name = 'level_' . $access->level; ${$name} = 'selected="selected"'; ?>
+ <option value="5" <?php echo $level_5; ?>><?php echo _('Demo'); ?></option>
+ <option value="25" <?php echo $level_25; ?>><?php echo _('Stream'); ?></option>
+ <option value="50" <?php echo $level_50; ?>><?php echo _('Stream/Download'); ?></option>
+ <option value="75" <?php echo $level_75; ?>><?php echo _('XML-RPC'); ?></option>
+ </select>
+ </td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td>
+ <input type="hidden" name="access_id" value="<?php echo scrub_out($access->id); ?>" />
+ <input type="hidden" name="action" value="update_host" />
+ <input type="submit" value="<?php echo _('Update'); ?>" />
+ </td>
+</tr>
</table>
</form>
diff --git a/templates/show_genre.inc.php b/templates/show_genre.inc.php
index ce94912e..6f9db26f 100644
--- a/templates/show_genre.inc.php
+++ b/templates/show_genre.inc.php
@@ -24,27 +24,21 @@
* This shows a single genre and lets you pick between
* albums/artists or songs
*/
+$web_path = conf('web_path');
?>
<table class="text-box">
<tr>
<td>
- <span class="header1"><?php echo _("Viewing") . " " . $genre->name . " " . _("Genre"); ?></span>
- <br />
- [<?php echo $genre->get_album_count(); ?>]
- <a href="<?php echo conf('web_path'); ?>/genre.php?action=show_albums&amp;genre_id=<?php echo $genre->id; ?>">
- <?php echo _("Albums"); ?>
- </a>
- <br />
- [<?php echo $genre->get_artist_count(); ?>]
- <a href="<?php echo conf('web_path'); ?>/genre.php?action=show_artists&amp;genre_id=<?php echo $genre->id; ?>">
- <?php echo _("Artists"); ?>
- </a>
- <br />
- [<?php echo $genre->get_song_count(); ?>]
- <a href="<?php echo conf('web_path'); ?>/genre.php?action=show_songs&amp;genre_id=<?php echo $genre->id; ?>">
- <?php echo _("Songs"); ?>
- </a>
- <br />
+ <span class="header1"><?php echo _("Viewing") . " " . $genre->name . " " . _("Genre"); ?></span><br />
+ [<?php echo $genre->get_album_count(); ?>]
+ <a href="<?php echo $web_path; ?>/genre.php?action=show_albums&amp;genre_id=<?php echo $genre->id; ?>">
+ <?php echo _("Albums"); ?></a><br />
+ [<?php echo $genre->get_artist_count(); ?>]
+ <a href="<?php echo $web_path; ?>/genre.php?action=show_artists&amp;genre_id=<?php echo $genre->id; ?>">
+ <?php echo _("Artists"); ?></a><br />
+ [<?php echo $genre->get_song_count(); ?>]
+ <a href="<?php echo $web_path; ?>/genre.php?action=show_songs&amp;genre_id=<?php echo $genre->id; ?>">
+ <?php echo _("Songs"); ?></a><br />
</td>
</tr>
</table>
diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php
index dffcd01b..3f857776 100644
--- a/templates/show_genres.inc.php
+++ b/templates/show_genres.inc.php
@@ -28,9 +28,9 @@ $total_items = $view->total_items;
?>
<table class="border" cellspacing="0" cellpadding="0" border="0">
<tr class="even" align="center">
- <td colspan="5">
- <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
- </td>
+ <td colspan="5">
+ <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
+ </td>
</tr>
<tr class="table-header">
<td><?php echo _("Genre"); ?></td>
@@ -38,25 +38,24 @@ $total_items = $view->total_items;
<td><?php echo _("Action"); ?></td>
</tr>
<?php
- foreach ($genres as $genre) {
- $genre->format_genre();
-?>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo $genre->link; ?></td>
- <td><?php echo $genre->get_song_count(); ?></td>
- <td>
- <?php echo _("Play"); ?>:
- <a href="<?php echo $genre->play_link; ?>">All</a>
- |
- <a href="<?php echo $genre->random_link; ?>">Random</a>
- |
- Download
- </td>
-</tr>
+foreach ($genres as $genre) {
+ $genre->format_genre();?>
+ <tr class="<?php echo flip_class(); ?>">
+ <td><?php echo $genre->link; ?></td>
+ <td><?php echo $genre->get_song_count(); ?></td>
+ <td>
+ <?php echo _("Play"); ?>:
+ <a href="<?php echo $genre->play_link; ?>">All</a>
+ |
+ <a href="<?php echo $genre->random_link; ?>">Random</a>
+ |
+ Download
+ </td>
+ </tr>
<?php } // end foreach genres ?>
<tr class="even" align="center">
- <td colspan="5">
- <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
- </td>
+ <td colspan="5">
+ <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
+ </td>
</tr>
</table>
diff --git a/templates/show_import_playlist.inc.php b/templates/show_import_playlist.inc.php
index 1b5b979b..05f32232 100644
--- a/templates/show_import_playlist.inc.php
+++ b/templates/show_import_playlist.inc.php
@@ -23,7 +23,8 @@
<form method="post" name="import_playlist" action="<?php echo conf('web_path'); ?>/playlist.php" enctype="multipart/form-data">
<table border="0" cellpadding="0" cellspacing="0" class="border">
<tr class="table-header" >
- <td colspan="2" align="center"><?php echo _("Importing a Playlist from a File"); ?></td></tr>
+ <td colspan="2" align="center"><?php echo _("Importing a Playlist from a File"); ?></td>
+</tr>
<tr class="<?php echo flip_class(); ?>">
<td>
<?php echo _("Filename"); ?>:
diff --git a/templates/show_local_catalog_info.inc.php b/templates/show_local_catalog_info.inc.php
index abc0a139..c65fc352 100644
--- a/templates/show_local_catalog_info.inc.php
+++ b/templates/show_local_catalog_info.inc.php
@@ -26,7 +26,7 @@
</tr>
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Total Users"); ?></td>
- <td> <b><?php echo $users[0]; ?></b> </td>
+ <td><b><?php echo $users[0]; ?></b></td>
</tr>
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Connected Users"); ?></td>
@@ -49,7 +49,7 @@
<td><b><?php echo $total_size; ?> <?php echo $size_unit; ?></b></td>
</tr>
<tr class="<?php echo flip_class(); ?>">
- <td> <?php echo _("Catalog Time"); ?></td>
+ <td><?php echo _("Catalog Time"); ?></td>
<td><b><?php echo $time_text; ?></b></td>
</tr>
</table>
diff --git a/templates/show_localplay.inc b/templates/show_localplay.inc
index 096c42b3..936f6090 100644
--- a/templates/show_localplay.inc
+++ b/templates/show_localplay.inc
@@ -25,44 +25,43 @@
*/
$web_path = conf('web_path');
?>
- <table class="border" cellspacing="1" cellpadding="3" width="100%" border="0">
- <tr class="table-header">
- <td colspan="2"><?php echo _("Local Play Control"); ?></td>
- </tr>
- <tr class="even"><td>
- <table border="0" cellpadding="0" cellspacing="0"><tr>
- <td>
- <?php echo _("Playback") . ":"; ?>
- </td>
- <td>
- <form action="<?php echo $web_path; ?>/localplay.php" method="post" name="playcontrol" style="display:inline;">
- <input type="submit" title="<?php echo _("Prev"); ?>" name="submit" value="|&lt; " />
- <input type="submit" title="<?php echo _("Stop"); ?>" name="submit" value=" X " />
- <input type="submit" title="<?php echo _("Play"); ?>" name="submit" value=" &gt; " />
- <input type="submit" title="<?php echo _("Pause"); ?>" name="submit" value=" = " />
- <input type="submit" title="<?php echo _("Next"); ?>" name="submit" value=" &gt;|" />
- </form>
- </td>
- </tr>
- <tr class="even">
- <td>
- <?php echo _("Volume") . ":"; ?>
- </td>
+<table class="border" cellspacing="1" cellpadding="3" width="100%" border="0"><!--Localplay Table-->
+<tr class="table-header">
+ <td colspan="2"><?php echo _("Local Play Control"); ?></td>
+</tr>
+<tr class="even">
<td>
- <form action="<?php echo $web_path; ?>/localplay.php" method="post" name="playcontrol" style="display:inline;">
- <input type="submit" title="<?php echo _("Increase Volume"); ?>" name="submit" value=" +1 " />
- <input type="submit" title="<?php echo _("Increase Volume"); ?>" name="submit" value=" +5 " />
- <input type="submit" title="<?php echo _("Decrease Volume"); ?>" name="submit" value=" -1 " />
- <input type="submit" title="<?php echo _("Decrease Volume"); ?>" name="submit" value=" -5 " />
- </form>
- </td>
- </tr>
- <tr class="even">
- <td colspan="2">
- <a href="<?php echo $web_path; ?>/localplay.php?submit=clear"><?php echo _("Clear queue"); ?></a><br />
- <?php @system(conf('localplay_status')) ?>
- </td></tr>
- </table>
+ <table border="0" cellpadding="0" cellspacing="0"><!--Localplayer Table-->
+ <tr>
+ <td><?php echo _("Playback") . ":"; ?></td>
+ <td>
+ <form action="<?php echo $web_path; ?>/localplay.php" method="post" name="playcontrol" style="display:inline;">
+ <input type="submit" title="<?php echo _("Prev"); ?>" name="submit" value="|&lt; " />
+ <input type="submit" title="<?php echo _("Stop"); ?>" name="submit" value=" X " />
+ <input type="submit" title="<?php echo _("Play"); ?>" name="submit" value=" &gt; " />
+ <input type="submit" title="<?php echo _("Pause"); ?>" name="submit" value=" = " />
+ <input type="submit" title="<?php echo _("Next"); ?>" name="submit" value=" &gt;|" />
+ </form>
+ </td>
+ </tr>
+ <tr class="even">
+ <td><?php echo _("Volume") . ":"; ?></td>
+ <td>
+ <form action="<?php echo $web_path; ?>/localplay.php" method="post" name="playcontrol" style="display:inline;">
+ <input type="submit" title="<?php echo _("Increase Volume"); ?>" name="submit" value=" +1 " />
+ <input type="submit" title="<?php echo _("Increase Volume"); ?>" name="submit" value=" +5 " />
+ <input type="submit" title="<?php echo _("Decrease Volume"); ?>" name="submit" value=" -1 " />
+ <input type="submit" title="<?php echo _("Decrease Volume"); ?>" name="submit" value=" -5 " />
+ </form>
+ </td>
+ </tr>
+ <tr class="even">
+ <td colspan="2">
+ <a href="<?php echo $web_path; ?>/localplay.php?submit=clear"><?php echo _("Clear queue"); ?></a><br />
+ <?php @system(conf('localplay_status')) ?>
+ </td>
+ </tr>
+ </table><!--End Localplayer Table-->
</td>
- </tr>
- </table>
+</tr>
+</table><!--End Localplay Table-->
diff --git a/templates/show_login_form.inc b/templates/show_login_form.inc
index c0076e4f..ea692d7d 100644
--- a/templates/show_login_form.inc
+++ b/templates/show_login_form.inc
@@ -20,7 +20,6 @@
*/
$subject = "/ampache\.com/";
-
$referrer = $_SERVER['HTTP_REFERER'];
@@ -37,58 +36,48 @@ if (preg_match($subject,$_SERVER['HTTP_HOST'])) {
</p>
<form name="login" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ; ?>/login.php" style="Display:inline">
<table class="login" bgcolor="<?php echo conf('base_color2'); ?>" border="0" align="center">
- <tr>
- <td align="center" colspan="2"><?php echo conf('login_message'); ; ?>&nbsp;</td>
- </tr>
- <tr>
- <td><?php echo _("Login"); ; ?>:</td>
- <td><input type="text" name="username" value="<?php echo $_REQUEST['username']; ; ?>" /></td>
- </tr>
- <tr>
- <td><?php echo _("Password"); ; ?>:</td>
- <td><input type="password" name="password" value="" /></td>
- </tr>
- <tr>
- <td>&nbsp;</td>
- <td><input type="checkbox" name="rememberme" />
- <?php echo _("Remember Me"); ?></td>
- </tr>
- <tr>
- <td colspan="2" align="center">
- <input class="button" type="submit" value="<?php echo _("Login"); ?>" />
- <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
- <input type="hidden" name="action" value="login" />
- </td>
- </tr>
+<tr>
+ <td align="center" colspan="2"><?php echo conf('login_message'); ; ?>&nbsp;</td>
+</tr>
+<tr>
+ <td><?php echo _("Login"); ; ?>:</td>
+ <td><input type="text" name="username" value="<?php echo $_REQUEST['username']; ; ?>" /></td>
+</tr>
+<tr>
+ <td><?php echo _("Password"); ; ?>:</td>
+ <td><input type="password" name="password" value="" /></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><input type="checkbox" name="rememberme" />
+ <?php echo _("Remember Me"); ?></td>
+</tr>
+<tr>
+ <td colspan="2" align="center">
+ <input class="button" type="submit" value="<?php echo _("Login"); ?>" />
+ <input type="hidden" name="referrer" value="<?php echo $referrer; ?>" />
+ <input type="hidden" name="action" value="login" />
+ </td>
+</tr>
</table>
</form>
- <?php if(conf('allow_public_registration')){ ?>
- <p align="center">
- [<a class="header2" href="<?php echo conf('web_path'); ?>/register.php"><?php echo _("Register"); ?></a>]
- </p>
- <?php } ?>
-
-<!--
-<p align="center">
- <a href="http://validator.w3.org/check/referer">
- <img style="padding:0;border:0;" src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" />
- </a>
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
- <img style="padding:0;border:0;" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" />
- </a>
-</p>
--->
-<?php if ($show_copyright == 1) { ?>
-<p align="center">
- <font color="red" size="+2">
- <a href="http://www.ampache.org/donations.php">Ampache.org</a><br />
- Ampache.com Domain Squatter<br />
- All Rights Reserved, Copyright &copy; 2006<br />
- </font>
-</p>
-<?php } ?>
-<?php if (isset($auth['error'])) { ?>
-<p align="center">
- <font color="red"><?php echo trim($auth['error']); ?></font>
-</p>
-<?php } ?>
+<?php
+if (conf('allow_public_registration')) { ?>
+ <p align="center">
+ [<a class="header2" href="<?php echo conf('web_path'); ?>/register.php"><?php echo _("Register"); ?></a>]
+ </p>
+<?php } // end if (conf('allow_public_registration'))
+if ($show_copyright == 1) { ?>
+ <p align="center">
+ <font color="red" size="+2">
+ <a href="http://www.ampache.org/donations.php">Ampache.org</a><br />
+ Ampache.com Domain Squatter<br />
+ All Rights Reserved, Copyright &copy; 2006<br />
+ </font>
+ </p>
+<?php } // end if ($show_copyright == 1)
+if (isset($auth['error'])) { ?>
+ <p align="center">
+ <font color="red"><?php echo trim($auth['error']); ?></font>
+ </p>
+<?php } // end if (isset($auth['error'])) ?>
diff --git a/templates/show_mpdpl.inc b/templates/show_mpdpl.inc
index 0e5561ee..d6d47e40 100644
--- a/templates/show_mpdpl.inc
+++ b/templates/show_mpdpl.inc
@@ -36,23 +36,12 @@ $nopad = "style='padding: 0px 0px 0px 0px'";
$myMpd = init_mpd();
?>
-<form name="songs" action="<?php echo conf('web_path')."/amp-mpd.php"; ?>" method="post" enctype="multipart/form-data">
+<form name="songs" action="<?php echo $web_path."/amp-mpd.php"; ?>" method="post" enctype="multipart/form-data">
<table id= "mpdpl" border="0" cellpadding="0" cellspacing="1" width="100%" class="tabledata">
<tr>
<td style="text-align:center" class="table-header">
<b><?php echo _("MPD Server Playlist"); ?></b>
-<!-- <i>
- [<a title="<?php echo _("Refresh the Playlist Window"); ?>" href="<?php echo $_SERVER['PHP_SELF']; ?>">refresh</a>]
- <?php if( $myMpd->playlist_count > 0 ) { $un = (conf('condPL')) ? "un" : ""; ?>
- [<a title="<?php echo _("Click to shuffle (randomize) the playlist");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=shuffle"><?php echo _("shuffle")?></a>]
- [<a title="<?php echo _("Click to the clear the playlist");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=clear">clear</a>]
- <?php if( $myMpd->playlist_count > 10 ) { ?>
- [<a title="<?php echo 'Click to '.$un.'condense playlist';?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=condPL"><?php echo $un?>condense</a>]
- <?php } ?>
- [<a title="<?php echo _("Click to the remove all except the Now Playing");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=crop">crop</a>]
- <?php } ?>
- </i>
---> </td>
+ </td>
</tr>
<tr>
<td <?php echo $nopad ?>>
@@ -69,7 +58,7 @@ $myMpd = init_mpd();
</tr>
<?php
$pl = $myMpd->playlist;
- if (is_null($pl)) echo "ERROR: ".$myMpd->errStr."\n";
+ if (is_null($pl)) { echo "ERROR: ".$myMpd->errStr."\n"; }
else {
$maxlen = strlen (count($pl));
$condPL = conf('condPL');
@@ -174,12 +163,12 @@ $myMpd = init_mpd();
<i>
[<a title="<?php echo _("Refresh the Playlist Window"); ?>" href="<?php echo $_SERVER['PHP_SELF']; ?>">refresh</a>]
<?php if($myMpd->playlist_count > 0 ) {$un = (conf('condPL')) ? "un" : ""; ?>
- [<a title="<?php echo _("Click to shuffle (randomize) the playlist");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=shuffle"><?php echo _("shuffle")?></a>]
- [<a title="<?php echo _("Click to the clear the playlist");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=clear">clear</a>]
+ [<a title="<?php echo _("Click to shuffle (randomize) the playlist");?>" href="<?php echo $web_path; ?>/amp-mpd.php?action=shuffle"><?php echo _("shuffle")?></a>]
+ [<a title="<?php echo _("Click to the clear the playlist");?>" href="<?php echo $web_path; ?>/amp-mpd.php?action=clear">clear</a>]
<?php if($myMpd->playlist_count > 10) { ?>
- [<a title="<?php echo 'Click to '.$un.'condense playlist';?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=condPL"><?php echo $un?>condense</a>]
+ [<a title="<?php echo 'Click to '.$un.'condense playlist';?>" href="<?php echo $web_path; ?>/amp-mpd.php?action=condPL"><?php echo $un?>condense</a>]
<?php } ?>
- [<a title="<?php echo _("Click to the remove all except the Now Playing");?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=crop">crop</a>]
+ [<a title="<?php echo _("Click to the remove all except the Now Playing");?>" href="<?php echo $web_path; ?>/amp-mpd.php?action=crop">crop</a>]
<?php } ?>
</i>
</td>
diff --git a/templates/show_mpdplay.inc b/templates/show_mpdplay.inc
index fa106c08..2975204a 100644
--- a/templates/show_mpdplay.inc
+++ b/templates/show_mpdplay.inc
@@ -26,165 +26,153 @@
this looks a goodbit like local_play
*/
$web_path = conf('web_path');
-
-function fmt_time ($seconds) {return sprintf ("%d:%02d", $seconds/60, $seconds % 60);}
-
+function fmt_time($seconds) {return sprintf ("%d:%02d", $seconds/60, $seconds % 60);}
global $condPL;
-
?>
+
<div align="center">
-<!-- MPD Control table -->
-<table border="0" cellpadding="3" cellspacing="0" class="tabledata">
- <tr class="table-header">
+<table border="0" cellpadding="3" cellspacing="0" class="tabledata"><!-- MPD Control table -->
+<tr class="table-header">
<td colspan="2"><?php echo _("MPD Play Control"); ?></td>
- </tr>
- <tr class="even"><td>
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td>
- <?php ${$myMpd->state} = "'selected_button'"; ?>
-
-<?php
-if (true) /* rigged to do AJAX for now; change to conf('AJAX') later*/ {
-?>
-<!-- <input type="button" class="unselected_button" value="times" onclick="timestuff();"/> -->
- <input type="button" class="unselected_button" value="|&lt; " onclick="startRequest('action=Prev');"/>
- <input type="button" class=<?php echo ($stop ? "'selected_button'" : "'unselected_button'") ?> id="stop_button" value=" X " onclick="startRequest('action=stop');"/>
- <input type="button" class=<?php echo ($play ? "'selected_button'" : "'unselected_button'") ?> id="play_button" value=" &gt; " onclick="startRequest('action=play');"/>
- <input type="button" class=<?php echo ($pause ? "'selected_button'" : "'unselected_button'") ?> id="pause_button" value=" | | " onclick="startRequest('action=pause');"/>
- <input type="button" class="unselected_button" value=" &gt;|" onclick="startRequest('action=Next');"/>
-<?php
-}
-else {
-?>
- <form action="<?php echo $web_path; ?>/amp-mpd.php" method="post" name="playcontrol" style="display:inline; white-space: nowrap">
- <!-- these used to have class="button" -->
- <input type="submit" title="<?php echo _("Prev"); ?>" name="action" value="|&lt; " />
- <input type="submit" title="<?php echo _("Stop"); ?>" name="action" value=" X " <?php echo $stop; ?> />
- <input type="submit" title="<?php echo _("Play"); ?>" name="action" value=" &gt; " <?php echo $play; ?> />
- <input type="submit" title="<?php echo _("Pause"); ?>" name="action" value=" | | " <?php echo $pause; ?> />
- <input type="submit" title="<?php echo _("Next"); ?>" name="action" value= " &gt;|" />
- </form>
-<?php } ?>
- </td>
- </tr>
- <tr><td class="content"> Volume: <b><span id='volume'><?php echo $myMpd->volume ?></span>%</b>
- </td>
- </tr>
-
- <tr><td class="content" align="center">
-<?php
-if (true) /* rigged to do AJAX for now; change to conf('AJAX') later */ {
-?>
-<input type="button" value="0" onclick="startRequest('action=setvol&amp;param1=0');"/>
-<input type="button" value="-25" onclick="startRequest('action=adjvol&amp;param1=-25');"/>
-<input type="button" value="-10" onclick="startRequest('action=adjvol&amp;param1=-10');"/>
-<input type="button" value="+10" onclick="startRequest('action=adjvol&amp;param1=10');"/>
-<input type="button" value="+25" onclick="startRequest('action=adjvol&amp;param1=25');"/>
-<?php
-}
-else {
-?>
- [<a href="<?php echo $web_path; ?>/amp-mpd.php?action=setvol&amp;val=0">mute</a>
- <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=-25">-25</a>
- <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=-10">-10</a>
- <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=+10">+10</a>
- <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=+25">+25</a>] ';
-<?php
-}
-?>
- </td>
- </tr>
- <tr>
- <td>
- <?php echo _("Loop"); ?>:
- <form action="<?php echo $web_path; ?>/amp-mpd.php?action=loop" method="post" name="repeatcontrol" style="display:inline;">
- <?php
- $repeat_name = "repeat_" . intval($myMpd->repeat);
- ${$repeat_name} = "style=\"background-color: black;color:white;\"";
- ?>
- &nbsp;&nbsp;&nbsp;&nbsp;
- <input class="button" type="submit" title="<?php echo _("On"); ?>" name="val" value="On" <?php echo $repeat_1; ?> />
- <input class="button" type="submit" title="<?php echo _("Off"); ?>" name="val" value="Off" <?php echo $repeat_0; ?> />
- </form>
- </td>
- </tr>
- <tr>
- <td>
- <?php echo _("Random"); ?>:
- <form action="<?php echo $web_path; ?>/amp-mpd.php?action=random" method="post" name="randomcontrol" style="display:inline;">
- <?php
- $random_name = "random_" . intval($myMpd->random);
- ${$random_name} = "style=\"background-color: black;color:white;\"";
- ?>
- <input class="button" type="submit" title="<?php echo _("On"); ?>" name="val" value="On" <?php echo $random_1; ?> />
- <input class="button" type="submit" title="<?php echo _("Off"); ?>" name="val" value="Off" <?php echo $random_0; ?> />
- </form>
- </td>
- </tr>
- <tr><td class="content">&nbsp;</td></tr>
- </table>
- </td></tr>
-
-
- <tr><td>
- <table id="mpd_np" <?php if ( $myMpd->state == "stop" or $myMpd->state == "pause" ) {echo 'class="nodisplay"'; } ?>
- border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr>
- <td class="npsong"><b><?php echo _("Now Playing :")?></b></td>
- </tr>
- <tr>
- <td align="center" class="npsong"><?php
- if (!$myMpd->playlist[($myMpd->current_track_id)]['Title']) {
- list($tmp, $id, $tmp) = preg_split("/(song=|&)/", $myMpd->playlist[($myMpd->current_track_id)]['file']);
- $r = new Song($id);
- $myMpd->playlist[($myMpd->current_track_id)]['Title'] = $r->title;
- $myMpd->playlist[($myMpd->current_track_id)]['Artist'] = $r->get_artist_name();
- $myMpd->playlist[($myMpd->current_track_id)]['Album'] = $r->get_album_name();
- }
- echo "<span id='mpd_npinfo'>";
- echo ($myMpd->current_track_id+1).
- ". ".$myMpd->playlist[$myMpd->current_track_id]['Artist'].
- " - ".$myMpd->playlist[$myMpd->current_track_id]['Title'].
- " - ".$myMpd->playlist[$myMpd->current_track_id]['Album'].
- " - ".fmt_time($myMpd->playlist[$myMpd->current_track_id]['Time']);
- echo "</span>";
- ?>
- </td>
- </tr>
- <tr>
- <td align="center" class="npsong">
- <span id="mpd_cur_track_pos"><?php echo fmt_time($myMpd->current_track_position)?></span>
- (<span id="mpd_pctplayed"><?php echo (round(($myMpd->current_track_position/$myMpd->current_track_length),2)*100)."</span>%) played" ?>
- </td>
- </tr>
-
- <tr>
- <td><b><?php echo _("On Deck ")?><?php echo _("(in ").
- "<span id = 'mpd_on_deck_in'>".fmt_time($myMpd->current_track_length - $myMpd->current_track_position)."</span>)"?>
- </b>
- </td>
- </tr>
-
- <tr>
- <td align="center"><?php
- if (!$myMpd->playlist[($myMpd->current_track_id+1)]['Title']) {
- list($tmp, $id, $tmp) = preg_split("/(song=|&)/", $myMpd->playlist[($myMpd->current_track_id+1)]['file']);
- $r = new Song($id);
- $myMpd->playlist[($myMpd->current_track_id+1)]['Title'] = $r->title;
- $myMpd->playlist[($myMpd->current_track_id+1)]['Artist'] = $r->get_artist_name();
- $myMpd->playlist[($myMpd->current_track_id+1)]['Album'] = $r->get_album_name();
- }
-
- echo ($myMpd->current_track_id+2).
- ". ".$myMpd->playlist[($myMpd->current_track_id+1)]['Artist'].
- " - ".$myMpd->playlist[($myMpd->current_track_id+1)]['Title'].
- " - ".$myMpd->playlist[($myMpd->current_track_id+1)]['Album'].
- " - ".fmt_time($myMpd->playlist[($myMpd->current_track_id+1)]['Time']);
- ?></td>
- </tr>
- </table>
- </td></tr>
+</tr>
+<tr class="even">
+<td>
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td>
+ <?php ${$myMpd->state} = "'selected_button'";
+ if (true) /* rigged to do AJAX for now; change to conf('AJAX') later*/ { ?>
+ <!-- <input type="button" class="unselected_button" value="times" onclick="timestuff();"/> -->
+ <input type="button" class="unselected_button" value="|&lt; " onclick="startRequest('action=Prev');"/>
+ <input type="button" class=<?php echo ($stop ? "'selected_button'" : "'unselected_button'") ?> id="stop_button" value=" X " onclick="startRequest('action=stop');"/>
+ <input type="button" class=<?php echo ($play ? "'selected_button'" : "'unselected_button'") ?> id="play_button" value=" &gt; " onclick="startRequest('action=play');"/>
+ <input type="button" class=<?php echo ($pause ? "'selected_button'" : "'unselected_button'") ?> id="pause_button" value=" | | " onclick="startRequest('action=pause');"/>
+ <input type="button" class="unselected_button" value=" &gt;|" onclick="startRequest('action=Next');"/>
+ <?php
+ }
+ else { ?>
+ <form action="<?php echo $web_path; ?>/amp-mpd.php" method="post" name="playcontrol" style="display:inline; white-space: nowrap">
+ <!-- these used to have class="button" -->
+ <input type="submit" title="<?php echo _("Prev"); ?>" name="action" value="|&lt; " />
+ <input type="submit" title="<?php echo _("Stop"); ?>" name="action" value=" X " <?php echo $stop; ?> />
+ <input type="submit" title="<?php echo _("Play"); ?>" name="action" value=" &gt; " <?php echo $play; ?> />
+ <input type="submit" title="<?php echo _("Pause"); ?>" name="action" value=" | | " <?php echo $pause; ?> />
+ <input type="submit" title="<?php echo _("Next"); ?>" name="action" value= " &gt;|" />
+ </form>
+ <?php } ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="content"> Volume: <b><span id='volume'><?php echo $myMpd->volume ?></span>%</b></td>
+ </tr>
+ <tr>
+ <td class="content" align="center">
+ <?php
+ if (true) /* rigged to do AJAX for now; change to conf('AJAX') later */ { ?>
+ <input type="button" value="0" onclick="startRequest('action=setvol&amp;param1=0');"/>
+ <input type="button" value="-25" onclick="startRequest('action=adjvol&amp;param1=-25');"/>
+ <input type="button" value="-10" onclick="startRequest('action=adjvol&amp;param1=-10');"/>
+ <input type="button" value="+10" onclick="startRequest('action=adjvol&amp;param1=10');"/>
+ <input type="button" value="+25" onclick="startRequest('action=adjvol&amp;param1=25');"/>
+ <?php
+ }
+ else { ?>
+ [<a href="<?php echo $web_path; ?>/amp-mpd.php?action=setvol&amp;val=0">mute</a>
+ <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=-25">-25</a>
+ <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=-10">-10</a>
+ <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=+10">+10</a>
+ <a href="<?php echo $web_path; ?>/amp-mpd.php?action=adjvol&amp;val=+25">+25</a>] ';
+ <?php } ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php echo _("Loop"); ?>:
+ <form action="<?php echo $web_path; ?>/amp-mpd.php?action=loop" method="post" name="repeatcontrol" style="display:inline;">
+ <?php
+ $repeat_name = "repeat_" . intval($myMpd->repeat);
+ ${$repeat_name} = "style=\"background-color: black;color:white;\"";
+ ?>
+ &nbsp;&nbsp;&nbsp;&nbsp;
+ <input class="button" type="submit" title="<?php echo _("On"); ?>" name="val" value="On" <?php echo $repeat_1; ?> />
+ <input class="button" type="submit" title="<?php echo _("Off"); ?>" name="val" value="Off" <?php echo $repeat_0; ?> />
+ </form>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php echo _("Random"); ?>:
+ <form action="<?php echo $web_path; ?>/amp-mpd.php?action=random" method="post" name="randomcontrol" style="display:inline;">
+ <?php
+ $random_name = "random_" . intval($myMpd->random);
+ ${$random_name} = "style=\"background-color: black;color:white;\""; ?>
+ <input class="button" type="submit" title="<?php echo _("On"); ?>" name="val" value="On" <?php echo $random_1; ?> />
+ <input class="button" type="submit" title="<?php echo _("Off"); ?>" name="val" value="Off" <?php echo $random_0; ?> />
+ </form>
+ </td>
+ </tr>
+ <tr>
+ <td class="content">&nbsp;</td>
+ </tr>
+ </table>
+</td>
+</tr>
+<tr>
+<td>
+ <table id="mpd_np" <?php if (($myMpd->state == "stop") or ($myMpd->state == "pause")) { echo 'class="nodisplay"'; } ?> border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr>
+ <td class="npsong"><b><?php echo _("Now Playing :")?></b></td>
+ </tr>
+ <tr>
+ <td align="center" class="npsong"><?php
+ if (!$myMpd->playlist[($myMpd->current_track_id)]['Title']) {
+ list($tmp, $id, $tmp) = preg_split("/(song=|&)/", $myMpd->playlist[($myMpd->current_track_id)]['file']);
+ $r = new Song($id);
+ $myMpd->playlist[($myMpd->current_track_id)]['Title'] = $r->title;
+ $myMpd->playlist[($myMpd->current_track_id)]['Artist'] = $r->get_artist_name();
+ $myMpd->playlist[($myMpd->current_track_id)]['Album'] = $r->get_album_name();
+ }
+ echo "<span id='mpd_npinfo'>";
+ echo ($myMpd->current_track_id+1).
+ ". ".$myMpd->playlist[$myMpd->current_track_id]['Artist'].
+ " - ".$myMpd->playlist[$myMpd->current_track_id]['Title'].
+ " - ".$myMpd->playlist[$myMpd->current_track_id]['Album'].
+ " - ".fmt_time($myMpd->playlist[$myMpd->current_track_id]['Time']);
+ echo "</span>"; ?>
+ </td>
+ </tr>
+ <tr>
+ <td align="center" class="npsong">
+ <span id="mpd_cur_track_pos"><?php echo fmt_time($myMpd->current_track_position)?></span>
+ (<span id="mpd_pctplayed"><?php echo (round(($myMpd->current_track_position/$myMpd->current_track_length),2)*100)."</span>%) played" ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><?php echo _("On Deck ")?><?php echo _("(in ").
+ "<span id = 'mpd_on_deck_in'>".fmt_time($myMpd->current_track_length - $myMpd->current_track_position)."</span>)"?>
+ </b>
+ </td>
+ </tr>
+ <tr>
+ <td align="center"><?php
+ if (!$myMpd->playlist[($myMpd->current_track_id+1)]['Title']) {
+ list($tmp, $id, $tmp) = preg_split("/(song=|&)/", $myMpd->playlist[($myMpd->current_track_id+1)]['file']);
+ $r = new Song($id);
+ $myMpd->playlist[($myMpd->current_track_id+1)]['Title'] = $r->title;
+ $myMpd->playlist[($myMpd->current_track_id+1)]['Artist'] = $r->get_artist_name();
+ $myMpd->playlist[($myMpd->current_track_id+1)]['Album'] = $r->get_album_name();
+ }
+ echo ($myMpd->current_track_id+2).
+ ". ".$myMpd->playlist[($myMpd->current_track_id+1)]['Artist'].
+ " - ".$myMpd->playlist[($myMpd->current_track_id+1)]['Title'].
+ " - ".$myMpd->playlist[($myMpd->current_track_id+1)]['Album'].
+ " - ".fmt_time($myMpd->playlist[($myMpd->current_track_id+1)]['Time']);?>
+ </td>
+ </tr>
+ </table>
+</td>
+</tr>
</table>
<?php
/***** moving this into javascript_refresh.js
@@ -198,5 +186,4 @@ echo '<script language="JavaScript" type="text/javascript"> var mpd_elapsed = '.
******/
?>
-
</div>
diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc
index 0569257d..e294510b 100644
--- a/templates/show_now_playing.inc
+++ b/templates/show_now_playing.inc
@@ -22,51 +22,44 @@
?>
<?php if (count($results)) { ?>
<table class="border" cellspacing="1" cellpadding="3" border="0" width="100%">
- <tr class="table-header">
- <td colspan="4"><?php echo _('Now Playing'); ?></td>
- </tr>
+<tr class="table-header">
+ <td colspan="4"><?php echo _('Now Playing'); ?></td>
+</tr>
<?php
- $user = $GLOBALS['user'];
- foreach($results as $item) {
- $song = $item['song'];
- $np_user = $item['user'];
- if (is_object($song)) {
- $artist = $song->f_artist;
- $album = $song->get_album_name();
- $text = "$song->f_title";
- if (!$np_user->fullname) { $np_user->fullname = "Unknown User"; }
- if ($GLOBALS['user']->username == $np_user->username)
- {
- $sql = "SELECT start_time FROM now_playing WHERE user ='".$user->username."'";
- $db_results = mysql_query($sql, dbh());
- while ($r = mysql_fetch_assoc($db_results)) {
- echo '<script language="JavaScript" type="text/javascript"> var mpd_elapsed = '.(time() - $r['start_time']).' </script>';
- echo '<script language="JavaScript" type="text/javascript"> var mpd_song_length = '. $song->time .' </script>';
- echo '<script language="JavaScript" type="text/javascript"> var mpd_state = "'. "play" .'" </script>';
- } // end while
- echo "<tr class=\"even\">\n"; }
- else
- { echo "<tr class=\"even\">\n"; }
- if (conf('use_auth')) {
- echo "\t<td valign=\"middle\">$np_user->fullname</td>\n";
- }
- echo "\t<td><a title=\"" . scrub_out($song->title) . "\" href=\"$web_path/song.php?action=m3u&amp;song=$song->id\">$text</a></td>\n";
- echo "\t<td><a title=\"" . scrub_out($song->f_artist) . "\" href=\"$web_path/artists.php?action=show&amp;artist=$song->artist\">$song->f_artist</a> / ";
- echo "\t<a title=\"" . scrub_out($album) . "\" href=\"$web_path/albums.php?action=show&amp;album=$song->album\">$song->f_album</a></td>";
- if (conf('play_album_art')) {
- echo "\t<td align=\"center\">";
- $aa_url = conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;type=popup";
- echo "<a target=\"_blank\" href=\"$aa_url\" onclick=\"popup_art('$aa_url'); return false;\">";
- echo "<img align=\"middle\" border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;fast=1&amp;thumb=1\" alt=\"Album Art\" height=\"75\" />";
- echo "</a>\n";
- echo "\t</td>\n";
- echo "</tr>\n";
- } // if album art on now playing
- else {
- echo "\n</tr>";
- }
- } // if it's a song
- } // while we're getting songs
+$user = $GLOBALS['user'];
+foreach($results as $item) {
+ $song = $item['song'];
+ $np_user = $item['user'];
+ if (is_object($song)) {
+ $artist = $song->f_artist;
+ $album = $song->get_album_name();
+ $text = "$song->f_title";
+ if (!$np_user->fullname) { $np_user->fullname = "Unknown User"; }
+ if ($GLOBALS['user']->username == $np_user->username) {
+ $sql = "SELECT start_time FROM now_playing WHERE user ='".$user->username."'";
+ $db_results = mysql_query($sql, dbh());
+ echo "<tr class=\"even\">\n";
+ } else {
+ echo "<tr class=\"even\">\n";
+ }
+ if (conf('use_auth')) {
+ echo "\t<td valign=\"middle\">$np_user->fullname</td>\n";
+ }
+ echo "\t<td><a title=\"" . scrub_out($song->title) . "\" href=\"$web_path/song.php?action=m3u&amp;song=$song->id\">$text</a></td>\n";
+ echo "\t<td><a title=\"" . scrub_out($song->f_artist) . "\" href=\"$web_path/artists.php?action=show&amp;artist=$song->artist\">$song->f_artist</a> / ";
+ echo "\t<a title=\"" . scrub_out($album) . "\" href=\"$web_path/albums.php?action=show&amp;album=$song->album\">$song->f_album</a></td>";
+ if (conf('play_album_art')) {
+ echo "\t<td align=\"center\">";
+ $aa_url = $web_path . "/albumart.php?id=$song->album&amp;type=popup";
+ echo "<a target=\"_blank\" href=\"$aa_url\" onclick=\"popup_art('$aa_url'); return false;\">";
+ echo "<img align=\"middle\" border=\"0\" src=\"$web_path/albumart.php?id=$song->album&amp;fast=1&amp;thumb=1\" alt=\"Album Art\" height=\"75\" />";
+ echo "</a>\n";
+ echo "\t</td>\n";
+ echo "</tr>\n";
+ } // if album art on now playing
+ else { echo "\n</tr>"; }
+ } // if it's a song
+} // while we're getting songs
?>
</table>
<?php } ?>
diff --git a/templates/show_object_rating.inc.php b/templates/show_object_rating.inc.php
index 16dff78e..831b6b40 100644
--- a/templates/show_object_rating.inc.php
+++ b/templates/show_object_rating.inc.php
@@ -1,6 +1,5 @@
<?php
/*
-
Copyright 2001 - 2006 Ampache.org
All Rights Reserved
@@ -19,45 +18,43 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
-
if ($type != 'song') {
echo "<strong>" . _("Rating") . ":</strong>";
}
/* Create some variables we are going to need */
-$base_url = conf('web_path') . '/ratings.php?action=set_rating&amp;mode=' . conf('flash') . '&amp;rating_type=' . $rating->type . '&amp;object_id=' . $rating->id . '&amp;username=' . $GLOBALS['user']->username;
-$score = '0';
-
+$web_path = conf('web_path');
+$base_url = $web_path . '/ratings.php?action=set_rating&amp;mode=' . conf('flash') . '&amp;rating_type=' . $rating->type . '&amp;object_id=' . $rating->id . '&amp;username=' . $GLOBALS['user']->username;
+$score = '0';
/* count up to 6 */
while ($score < 6) {
/* Handle the "Not rated" possibility */
if ($score == '0' AND $rating->rating == '-1') {
- echo "<img src=\"" . conf('web_path') . "/images/ratings/x.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
+ echo "<img src=\"" . $web_path . "/images/ratings/x.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
$found_on = true;
}
elseif ($score == '0' AND $rating->rating == '0') {
- echo "<img src=\"" . conf('web_path') . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
+ echo "<img src=\"" . $web_path . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
$found_on = true;
}
elseif ($score == '0') {
echo "<a href=\"" . $base_url . "&amp;rating=$score\">\n\t";
- echo "<img src=\"" . conf('web_path') . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
+ echo "<img src=\"" . $web_path . "/images/ratings/x_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
echo "</a>";
}
elseif ($score == $rating->rating) {
- echo "<img src=\"" . conf('web_path') . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
+ echo "<img src=\"" . $web_path . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n";
$found_on = true;
}
elseif (!$found_on) {
- echo "<a href=\"" . $base_url . "&amp;rating=$score\">\n\t<img src=\"" . conf('web_path') . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n</a>\n";
+ echo "<a href=\"" . $base_url . "&amp;rating=$score\">\n\t<img src=\"" . $web_path . "/images/ratings/star.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n</a>\n";
}
else {
- echo "<a href=\"" . $base_url . "&amp;rating=$score\">\n\t<img src=\"" . conf('web_path') . "/images/ratings/star_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n</a>\n";
+ echo "<a href=\"" . $base_url . "&amp;rating=$score\">\n\t<img src=\"" . $web_path . "/images/ratings/star_off.gif\" border=\"0\" alt=\"" . get_rating_name($score) . "\" />\n</a>\n";
}
/* Next! */
$score++;
} // end while
-
?>
+
diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php
index d85997d6..5b5bd334 100644
--- a/templates/show_play_selected.inc.php
+++ b/templates/show_play_selected.inc.php
@@ -45,34 +45,36 @@ function ToBatch(action)
</script>
<table border="0" cellpadding="14" cellspacing="0" class="text-box">
<tr align="left">
- <td>
- <input class="button" type="button" name="super_action" value="<?php echo _("Play Selected"); ?>" onclick="return ToSong('play_selected');" />
+ <td>
+ <input class="button" type="button" name="super_action" value="<?php echo _("Play Selected"); ?>" onclick="return ToSong('play_selected');" />
<?php if (batch_ok()) { ?>
- &nbsp;&nbsp;
- <input class="button" type="button" name="super_action" value="<?php echo _("Download Selected"); ?>" onclick="return ToBatch('download_selected');" />
+ &nbsp;&nbsp;
+ <input class="button" type="button" name="super_action" value="<?php echo _("Download Selected"); ?>" onclick="return ToBatch('download_selected');" />
<?php } ?>
<!--
<input class="button" type="button" name="super_action" value="<?php echo _("Flag Selected"); ?>" />
<input class="button" type="button" name="super_action" value="<?php echo _("Edit Selected"); ?>" />
-->
- </td>
+ </td>
</tr>
-<?php if (is_object($GLOBALS['playlist'])) { ?>
+<?php
+if (is_object($GLOBALS['playlist'])) { ?>
<tr>
- <td>
+ <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>
+ <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 } else { ?>
+<?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');" />
- <?php show_playlist_dropdown($GLOBALS['playlist_id']); ?>
- <input class="button" type="button" name="super_action" value="<?php echo _("View"); ?>" onclick="return ToPlaylist('view');" />
- <input class="button" type="button" name="super_action" value="<?php echo _("Edit"); ?>" onclick="return ToPlaylist('edit');" />
- </td>
+ <td colspan="2">
+ <?php echo _("Playlist"); ?>: <input type="button" name="super_action" value="<?php echo _("Add to"); ?>" onclick="return ToPlaylist('add_to');" />
+ <?php show_playlist_dropdown($GLOBALS['playlist_id']); ?>
+ <input class="button" type="button" name="super_action" value="<?php echo _("View"); ?>" onclick="return ToPlaylist('view');" />
+ <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_playlist_box.inc.php b/templates/show_playlist_box.inc.php
index cc67bd6a..e1ed7715 100644
--- a/templates/show_playlist_box.inc.php
+++ b/templates/show_playlist_box.inc.php
@@ -28,16 +28,18 @@
$web_path = conf('web_path');
?>
-<table class="text-box">
-<tr><td>
- <span class="header1"><?php echo _('Playlist Actions'); ?></span><br /><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=new"><?php echo _('Create New Playlist'); ?></a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php"><?php echo _('View All Playlists'); ?></a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=show_import_playlist"><?php echo _('Import From File'); ?></a><br />
- <?php if ($_REQUEST['playlist_id']) { ?>
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=normalize_tracks"><?php echo _('Normalize Tracks'); ?></a><br />
- &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/song.php?action=play_selected&amp;playlist_id=<?php echo $_REQUEST['playlist_id']; ?>"><?php echo _('Play This Playlist'); ?></a><br />
- <?php } ?>
-</td></tr>
-</table>
+<table class="text-box"> <!-- Playlist Table -->
+<tr>
+ <td>
+ <span class="header1"><?php echo _('Playlist Actions'); ?></span><br /><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=new"><?php echo _('Create New Playlist'); ?></a><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php"><?php echo _('View All Playlists'); ?></a><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=show_import_playlist"><?php echo _('Import From File'); ?></a><br />
+ <?php if ($_REQUEST['playlist_id']) { ?>
+ &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/playlist.php?action=normalize_tracks"><?php echo _('Normalize Tracks'); ?></a><br />
+ &nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $web_path; ?>/song.php?action=play_selected&amp;playlist_id=<?php echo $_REQUEST['playlist_id']; ?>"><?php echo _('Play This Playlist'); ?></a><br />
+ <?php } ?>
+ </td>
+</tr>
+</table><!-- End Playlist Table -->
<br />
diff --git a/templates/show_playlists.inc.php b/templates/show_playlists.inc.php
index 77f132f5..9c251b8b 100644
--- a/templates/show_playlists.inc.php
+++ b/templates/show_playlists.inc.php
@@ -24,9 +24,11 @@
* This takes an array of playlists and displays them for the default view of
* /playlists.php $type is always passed
*/
+$web_path = conf('web_path');
+
?>
<h3><?php echo $type . ' ' . _('Playlists'); ?></h3>
-<table class="tabledata" cellspacing="0" cellpadding="0" border="0">
+<table class="tabledata" cellspacing="0" cellpadding="0" border="0"> <!-- Playlist Table -->
<tr class="table-header">
<th><?php echo _('Playlist Name'); ?></th>
<th><?php echo _('# Songs'); ?></th>
@@ -34,45 +36,44 @@
<th><?php echo _('Actions'); ?></th>
</tr>
<?php
- foreach ($playlists as $playlist) {
- $playlist_user = new User($playlist->user);
- $count = $playlist->get_song_count();
-?>
-<tr class="<?php echo flip_class(); ?>">
- <td>
- <a href="<?php echo conf('web_path'); ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo scrub_out($playlist->name); ?>
- </a>
- </td>
- <td><?php echo $count; ?></td>
- <td><?php echo scrub_out($playlist_user->fullname); ?></td>
- <td>
- | <a href="<?php echo conf('web_path'); ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo _('View'); ?>
- </a>
- <?php if ($GLOBALS['user']->username == $playlist->user || $GLOBALS['user']->has_access(100)) { ?>
- | <a href="<?php echo conf('web_path'); ?>/playlist.php?action=edit&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo _('Edit'); ?>
- </a>
- | <a href="<?php echo conf('web_path'); ?>/playlist.php?action=show_delete_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo _('Delete'); ?>
- </a>
- <?php } ?>
- <?php if ($count > 0) { ?>
- | <a href="<?php echo conf('web_path'); ?>/song.php?action=playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo _('Play'); ?>
+foreach ($playlists as $playlist) {
+ $playlist_user = new User($playlist->user);
+ $count = $playlist->get_song_count(); ?>
+ <tr class="<?php echo flip_class(); ?>">
+ <td>
+ <a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo scrub_out($playlist->name); ?>
</a>
- | <a href="<?php echo conf('web_path'); ?>/song.php?action=playlist_random&amp;playlist_id=<?php echo $playlist->id; ?>">
- <?php echo _('Random'); ?>
- </a>
- <?php } ?>
- <?php if (batch_ok()) { ?>
- | <a href="<?php echo conf('web_path'); ?>/batch.php?action=pl&amp;id=<?php echo $playlist->id; ?>">
- <?php echo _('Download'); ?>
- </a>
- <?php } ?>
- |
- </td>
-</tr>
-<?php } ?>
-</table>
+ </td>
+ <td><?php echo $count; ?></td>
+ <td><?php echo scrub_out($playlist_user->fullname); ?></td>
+ <td>
+ | <a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo _('View'); ?>
+ </a>
+ <?php if (($GLOBALS['user']->username == $playlist->user) || ($GLOBALS['user']->has_access(100))) { ?>
+ | <a href="<?php echo $web_path; ?>/playlist.php?action=edit&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo _('Edit'); ?>
+ </a>
+ | <a href="<?php echo $web_path; ?>/playlist.php?action=show_delete_playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo _('Delete'); ?>
+ </a>
+ <?php } ?>
+ <?php if ($count > 0) { ?>
+ | <a href="<?php echo $web_path; ?>/song.php?action=playlist&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo _('Play'); ?>
+ </a>
+ | <a href="<?php echo $web_path; ?>/song.php?action=playlist_random&amp;playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo _('Random'); ?>
+ </a>
+ <?php } ?>
+ <?php if (batch_ok()) { ?>
+ | <a href="<?php echo $web_path; ?>/batch.php?action=pl&amp;id=<?php echo $playlist->id; ?>">
+ <?php echo _('Download'); ?>
+ </a>
+ <?php } ?>
+ |
+ </td>
+ </tr>
+<?php } // end foreach ($playlists as $playlist) ?>
+</table> <!-- End Playlist Table -->
diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php
index 3435f2ac..45e86d6c 100644
--- a/templates/show_preference_box.inc.php
+++ b/templates/show_preference_box.inc.php
@@ -48,31 +48,30 @@ if ($GLOBALS['user']->has_access(100) AND conf('use_auth')) {
<?php } ?>
</tr>
<?php
- foreach ($preferences['prefs'] as $pref) {
-?>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _($pref['description']); ?></td>
- <td><table>
- <tr>
- <td><?php create_preference_input($pref['name'],$pref['value']); ?></td>
- <?php if(preg_match('/Color/',$pref['description'])) { ?>
- <td>
- <table width="40" border="3" style="border-collapse: collapse;" bgcolor="<?php echo $pref['value'];?>">
- <tr style="height:20px;">
+foreach ($preferences['prefs'] as $pref) { ?>
+ <tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _($pref['description']); ?></td>
+ <td>
+ <table>
+ <tr>
+ <td><?php create_preference_input($pref['name'], $pref['value']); ?></td>
+ <?php if (preg_match('/Color/', $pref['description'])) { ?>
+ <td>
+ <table width="40" border="3" style="border-collapse: collapse;" bgcolor="<?php echo $pref['value'];?>">
+ <tr style="height:20px;">
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ <?php } else { ?>
<td></td>
- </tr>
- </table>
- </td>
- <?php } else { ?>
- <td></td>
- <?php } ?>
- </tr>
- </table>
- </td>
-
- <?php if ($show_apply_to_all) { ?>
- <td align="center"><input type="checkbox" name="check_<?php echo $pref['name']; ?>" value="1" /></td>
- <?php } ?>
-</tr>
-<?php } ?>
+ <?php } ?>
+ </tr>
+ </table>
+ </td>
+ <?php if ($show_apply_to_all) { ?>
+ <td align="center"><input type="checkbox" name="check_<?php echo $pref['name']; ?>" value="1" /></td>
+ <?php } ?>
+ </tr>
+<?php } // End foreach ($preferences['prefs'] as $pref) ?>
</table>
diff --git a/templates/show_preferences.inc b/templates/show_preferences.inc
index d3277db2..9cbf9a15 100644
--- a/templates/show_preferences.inc
+++ b/templates/show_preferences.inc
@@ -29,53 +29,47 @@
/* I'm cheating a little here, check to see if we want to show the
* Apply to All button on this page
*/
-if ($GLOBALS['user']->has_access(100) AND $user_id == '-1' AND conf('use_auth')) {
+if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth'))) {
$show_apply_to_all = true;
}
-
?>
-
-
<table class="text-box">
-<tr><td>
-<span class="header1">
- <?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?>
- <?php if ($GLOBALS['user']->has_access(100)) { ?>
- [<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&amp;user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>]
- <?php } ?>
-</span>
-
-
-<form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data">
-<table cellspacing="10">
-<tr>
- <td valign="top"><?php show_preference_box($preferences['theme']); ?></td>
- <?php if (isset($preferences['system'])) { ?>
- <td valign="top"><?php show_preference_box($preferences['system']); ?></td>
- <?php } else { ?>
- <td valign="top">&nbsp;</td>
- <?php } ?>
-</tr>
<tr>
- <td valign="top"><?php show_preference_box($preferences['streaming']); ?></td>
- <td>&nbsp;</td>
+ <td>
+ <span class="header1">
+ <?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?>
+ <?php if ($GLOBALS['user']->has_access(100)) { ?>
+ [<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&amp;user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>]
+ <?php } ?>
+ </span>
+ <form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data">
+ <table cellspacing="10">
+ <tr>
+ <td valign="top"><?php show_preference_box($preferences['theme']); ?></td>
+ <?php if (isset($preferences['system'])) { ?>
+ <td valign="top"><?php show_preference_box($preferences['system']); ?></td>
+ <?php } else { ?>
+ <td valign="top">&nbsp;</td>
+ <?php } ?>
+ </tr>
+ <tr>
+ <td valign="top"><?php show_preference_box($preferences['streaming']); ?></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top"><?php show_preference_box($preferences['interface']); ?></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td valign="top"><?php show_preference_box($preferences['options']); ?></td>
+ <td>&nbsp;</td>
+ </tr>
+ </table>
+ <input class="button" type="submit" value="<?php echo _("Update Preferences"); ?>" />
+ <input type="hidden" name="action" value="update_preferences" />
+ <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />&nbsp;&nbsp;
+ <input class="button" type="submit" name="action" value="<?php echo _("Cancel"); ?>" />
+ </form>
+ </td>
</tr>
-<tr>
- <td valign="top"><?php show_preference_box($preferences['interface']); ?></td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td valign="top"><?php show_preference_box($preferences['options']); ?></td>
- <td>&nbsp;</td>
-</tr>
-</table>
-
- <input class="button" type="submit" value="<?php echo _("Update Preferences"); ?>" />
- <input type="hidden" name="action" value="update_preferences" />
- <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" />
- &nbsp;&nbsp;
- <input class="button" type="submit" name="action" value="<?php echo _("Cancel"); ?>" />
-
- </form>
-</td></tr>
</table>
diff --git a/templates/show_random_play.inc b/templates/show_random_play.inc
index 1e7979b3..5388dd8f 100644
--- a/templates/show_random_play.inc
+++ b/templates/show_random_play.inc
@@ -23,36 +23,36 @@
?>
<form name="random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php">
-<table class="border" border="0" cellpadding="3" cellspacing="1">
+<table class="border" border="0" cellpadding="3" cellspacing="1"><!-- Random Play Table -->
<tr class="table-header">
<td colspan="4"><?php echo _("Play Random Selection"); ?></td>
</tr>
<tr class="even">
- <td>
- <table border="0">
- <tr class="even">
- <td><?php echo _("Item count"); ?></td>
- <td>
- <select name="random">
- <option value="1">1</option>
- <option value="5">5</option>
- <option value="10">10</option>
- <option value="20">20</option>
- <option value="30">30</option>
- <option value="50">50</option>
- <option value="100">100</option>
- <option value="500">500</option>
- <option value="1000">1000</option>
- <option value="-1"><?php echo _("All"); ?></option>
- </select>
+<td>
+ <table border="0">
+ <tr class="even">
+ <td><?php echo _("Item count"); ?></td>
+ <td>
+ <select name="random">
+ <option value="1">1</option>
+ <option value="5">5</option>
+ <option value="10">10</option>
+ <option value="20">20</option>
+ <option value="30">30</option>
+ <option value="50">50</option>
+ <option value="100">100</option>
+ <option value="500">500</option>
+ <option value="1000">1000</option>
+ <option value="-1"><?php echo _("All"); ?></option>
+ </select>
</td>
- <td rowspan="3" valign="top"><?php echo _("From genre"); ?></td>
- <td rowspan="3">
+ <td rowspan="3" valign="top"><?php echo _("From genre"); ?></td>
+ <td rowspan="3">
<?php show_genre_pulldown('genre','','5'); ?>
- </td>
+ </td>
</tr>
<tr class="even">
- <td colspan="2">
+ <td colspan="2">
Type:
<select name="random_type">
<option value="normal"><?php echo _("Standard"); ?></option>
@@ -61,22 +61,22 @@
<option value="full_artist"><?php echo _("Full Artist"); ?></option>
</select>
</td>
- </tr>
+ </tr>
<tr class="even">
- <td nowrap="nowrap"><?php echo _("from catalog"); ?></td>
+ <td nowrap="nowrap"><?php echo _("from catalog"); ?></td>
<td>
<?php show_catalog_pulldown('catalog',''); ?>
- </td>
+ </td>
</tr>
<tr>
- <td colspan="4">
- <input type="hidden" name="aaction" value="Play!" />
+ <td colspan="4">
+ <input type="hidden" name="aaction" value="Play!" />
<input type="hidden" name="action" value="m3u" />
- <input class="button" type="submit" name="aaction" value="<?php echo _("Play Random Songs"); ?>" />
- </td>
+ <input class="button" type="submit" name="aaction" value="<?php echo _("Play Random Songs"); ?>" />
+ </td>
</tr>
- </table>
- </td>
+ </table>
+</td>
</tr>
-</table>
+</table><!-- End Random Play Table -->
</form>
diff --git a/templates/show_random_play_bar.inc.php b/templates/show_random_play_bar.inc.php
index 440e362c..ce9bfa62 100644
--- a/templates/show_random_play_bar.inc.php
+++ b/templates/show_random_play_bar.inc.php
@@ -28,36 +28,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<input type="hidden" name="action" value="m3u" />
<table class="border" width="100%" cellspacing="1" cellpadding="3" border="0">
<tr class="table-header">
- <td><?php echo _("Play Random Selection"); ?></td>
+ <td><?php echo _("Play Random Selection"); ?></td>
</tr>
<tr class="even">
- <td>
- <select name="random">
- <option value="1">1</option>
- <option value="5">5</option>
- <option value="10">10</option>
- <option value="20">20</option>
- <option value="30">30</option>
- <option value="50">50</option>
- <option value="100">100</option>
- <option value="500">500</option>
- <option value="1000">1000</option>
- <option value="-1"><?php echo _("All"); ?></option>
- </select> &nbsp; &nbsp;
- <?php show_genre_pulldown('genre'); ?>
- <select name="Quantifier">
- <option value="Songs"><?php echo _("Songs"); ?></option>
- <option value="Minutes"><?php echo _("Minutes"); ?></option>
- <option value="Full Artists"><?php echo _("Full Artists"); ?></option>
- <option value="Full Albums"><?php echo _("Full Albums"); ?></option>
- <option value="Less Played"><?php echo _("Less Played"); ?></option>
- </select>
- <?php echo _("from"); ?>
- <?php show_catalog_pulldown( -1, 0); ?>
- <input type="hidden" name="aaction" value="Play!" />
- <input class="button" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" />
- &nbsp; <a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _("Advanced"); ?></a>
- </td>
+ <td>
+ <select name="random">
+ <option value="1">1</option>
+ <option value="5">5</option>
+ <option value="10">10</option>
+ <option value="20">20</option>
+ <option value="30">30</option>
+ <option value="50">50</option>
+ <option value="100">100</option>
+ <option value="500">500</option>
+ <option value="1000">1000</option>
+ <option value="-1"><?php echo _("All"); ?></option>
+ </select> &nbsp; &nbsp;
+ <?php show_genre_pulldown('genre'); ?>
+ <select name="Quantifier">
+ <option value="Songs"><?php echo _("Songs"); ?></option>
+ <option value="Minutes"><?php echo _("Minutes"); ?></option>
+ <option value="Full Artists"><?php echo _("Full Artists"); ?></option>
+ <option value="Full Albums"><?php echo _("Full Albums"); ?></option>
+ <option value="Less Played"><?php echo _("Less Played"); ?></option>
+ </select>
+ <?php echo _("from"); ?>
+ <?php show_catalog_pulldown( -1, 0); ?>
+ <input type="hidden" name="aaction" value="Play!" />
+ <input class="button" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" />
+ &nbsp; <a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _("Advanced"); ?></a>
+ </td>
</tr>
</table>
</form>
diff --git a/templates/show_rename_artist.inc.php b/templates/show_rename_artist.inc.php
index ffa5b83f..929c54c2 100644
--- a/templates/show_rename_artist.inc.php
+++ b/templates/show_rename_artist.inc.php
@@ -21,9 +21,10 @@
*/
?>
<script language='javascript'>
- function insert () {
- document.getElementById('artist_name').value = '<?php echo $artist->name; ?>';
- }
+function insert()
+{
+ document.getElementById('artist_name').value = '<?php echo $artist->name; ?>';
+}
</script>
<form name="rename_artist" method="post" action="<?php echo conf('web_path'); ?>/artists.php?action=rename&amp;artist=<?php echo $artist->id; ?>" style="Display:inline;">
@@ -35,7 +36,7 @@
</tr>
<tr>
<td>
- <?php show_artist_pulldown($artist->id,"artist_id",4); ?>
+ <?php show_artist_pulldown($artist->id, "artist_id", 4); ?>
<br />
<?php echo _("OR"); ?><br />
<input type="text" name="artist_name" size="30" value="<?php echo scrub_out($_REQUEST['artist_name']); ?>" id="artist_name" />
diff --git a/templates/show_search.inc b/templates/show_search.inc
index 0b11639d..7450d260 100644
--- a/templates/show_search.inc
+++ b/templates/show_search.inc
@@ -28,11 +28,11 @@ foreach ($_REQUEST['search_object'] as $key) {
$field_name = $key . "_string";
${$name} = "checked=\"checked\"";
$final_javascript .= "flipField('$field_name'); \n";
- if($i++ == 0) /* Focus the first checked field */
+ if ($i++ == 0) { /* Focus the first checked field */
$final_javascript .= "selectField('$field_name'); \n";
-}
-if($i == 0) /* Select the artist/title/album one by default */
-{
+ }
+} /* end foreach ($_REQUEST['search_object'] as $key) */
+if ($i == 0) { /* Select the artist/title/album one by default */
$final_javascript .= "flipField('all_string'); \n";
$final_javascript .= "selectField('all_string'); \n";
$check_all = "checked=\"checked\"";
@@ -182,7 +182,7 @@ $final_javascript .= " // END-->\n </script>";
<br />
<form method="post" action="<?php echo conf('web_path'); ?>/playlist.php?action=add_dyn_song">
<?php echo _('Save Search As Track on'); ?>:
-<?php show_playlist_dropdown('',true); ?>
+<?php show_playlist_dropdown('', true); ?>
<input type="submit" value="<?php echo _('Save'); ?>" /></form>
<?php } ?>
<br />
diff --git a/templates/show_songs.inc b/templates/show_songs.inc
index 7e0eee8b..e8078231 100644
--- a/templates/show_songs.inc
+++ b/templates/show_songs.inc
@@ -35,146 +35,143 @@ if (is_object($playlist) && ($GLOBALS['user']->username == $playlist->user || $G
<table class="border" cellspacing="0" cellpadding="0" border="0">
<tr class="table-header">
<th>&nbsp;&nbsp;<a href="#" onclick="check_songs(); return false;">Select</a></th>
- <?php if ($playlist_owner) { ?>
+ <?php if ($playlist_owner) { ?>
<th><?php echo _("Track"); ?></th>
<?php } ?>
<th><?php echo _("Song title"); ?></th>
- <th><?php echo _("Artist"); ?></th>
- <th><?php echo _("Album"); ?></th>
- <th><?php echo _("Track"); ?></th>
- <th><?php echo _("Time"); ?></th>
- <th><?php echo _("Size"); ?></th>
- <th><?php echo _("Bitrate"); ?></th>
- <th><?php echo _("Genre"); ?></th>
- <th><?php echo _("Flag"); ?></th>
- <th><?php echo _("Action"); ?></th>
+ <th><?php echo _("Artist"); ?></th>
+ <th><?php echo _("Album"); ?></th>
+ <th><?php echo _("Track"); ?></th>
+ <th><?php echo _("Time"); ?></th>
+ <th><?php echo _("Size"); ?></th>
+ <th><?php echo _("Bitrate"); ?></th>
+ <th><?php echo _("Genre"); ?></th>
+ <th><?php echo _("Flag"); ?></th>
+ <th><?php echo _("Action"); ?></th>
<?php if (conf('ratings') || conf('ratings')=="false") { ?>
- <th><?php echo _("Rating"); ?></th>
- <? } ?>
+ <th><?php echo _("Rating"); ?></th>
+ <? } ?>
</tr>
<?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 (is_object($playlist)) {
- if ($song_id['song']) {
- $song = new Song($song_id['song']);
- $track_id = $song_id['id'];
- }
- else {
- $song = new Song();
- $song->title = 'Dynamic Song';
- $track_id = $song_id['id'];
- }
- } // end if playlist
- elseif (!is_object($song_id)) {
- unset($text_class);
- $song = new Song($song_id);
- $track_id = $song->id;
+/* 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 (is_object($playlist)) {
+ if ($song_id['song']) {
+ $song = new Song($song_id['song']);
+ $track_id = $song_id['id'];
}
else {
- $song = $song_id;
- $track_id = $song->id;
+ $song = new Song();
+ $song->title = 'Dynamic Song';
+ $track_id = $song_id['id'];
}
-
-
- $song->format_song();
- // Still needed crap
- $totalsize += $song->size;
- $totaltime += $song->time;
- /* If it's disabled */
- if ($song->status == "disabled") { $text_class = "class=\"disabled\""; }
+ } // end if playlist
+ elseif (!is_object($song_id)) {
+ unset($text_class);
+ $song = new Song($song_id);
+ $track_id = $song->id;
+ }
+ else {
+ $song = $song_id;
+ $track_id = $song->id;
+ }
+ $song->format_song();
+ // Still needed crap
+ $totalsize += $song->size;
+ $totaltime += $song->time;
+ /* If it's disabled */
+ if ($song->status == "disabled") { $text_class = "class=\"disabled\""; }
?>
<tr class="<?php echo flip_class(); ?>">
<td align="center">
- <input type="checkbox" name="song[]" value="<?php echo $track_id; ?>" id="song_<?php echo $track_id; ?>" />
- </td>
+ <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_" . $track_id; ?>" value="<?php echo $tracknum; ?>" onchange="<?php echo "document.getElementById('song_" . $track_id . "').checked='checked';"; ?>" />
- </td>
- <?php $tab++; } ?>
- <td>
- <a href="<?php echo $web_path; ?>/song.php?action=m3u&amp;song=<?php echo $song->id; ?>" title="<?php echo scrub_out($song->title); ?>" <?php echo $text_class; ?>><?php echo scrub_out($song->f_title); ?></a>
- </td>
- <td>
- <a href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo htmlspecialchars($song->artist); ?>" title="<?php echo htmlspecialchars($song->f_artist_full); ?>" <?php echo $text_class; ?>><?php echo htmlspecialchars($song->f_artist); ?></a>
- </td>
- <td>
- <a href="<?php echo $web_path; ?>/albums.php?album=<?php echo htmlspecialchars($song->album); ?>" title="<?php echo htmlspecialchars($song->f_album_full); ?>" <?php echo $text_class; ?>><?php echo htmlspecialchars($song->f_album); ?></a>
- </td>
- <td align="right">
- <?php echo $song->track; ?>
- </td>
- <td align="right">
- <?php echo $song->f_time; ?>
- </td>
- <td align="right" nowrap="nowrap">
- <?php echo $song->f_size; ?> MB
- </td>
- <td align="right">
- <?php echo $song->f_bitrate; ?>
- </td>
- <td>
- <?php echo $song->f_genre; ?>
- </td>
- <td <?php echo $song->f_style; ?> title="<?php echo $song->flagcomment; ?>">
- <?php echo $song->flagtype; ?>
- </td>
- <td>
- <?php if ($user->has_access('100')) { ?>
- <a href="<?php echo $web_path; ?>/admin/song.php?action=edit&amp;song=<?php echo $song->id; ?>">Edit</a> | <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a> |
- <?php if ($song->enabled) { ?>
- <a href="<?php echo $web_path; ?>/admin/song.php?action=disable&amp;song_ids=<?php echo $song->id; ?>">Disable</a>
- <?php } else { ?>
- <a href="<?php echo $web_path; ?>/admin/song.php?action=enabled&amp;song_ids=<?php echo $song->id; ?>">Enable</a>
- <?php } //status ?>
- <?php } else { ?>
- <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a>
- <?php } //access ?>
+ $tracknum = $playlist->get_track($track_id); ?>
+ <td>
+ <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>
+ <a href="<?php echo $web_path; ?>/song.php?action=m3u&amp;song=<?php echo $song->id; ?>" title="<?php echo scrub_out($song->title); ?>" <?php echo $text_class; ?>><?php echo scrub_out($song->f_title); ?></a>
+ </td>
+ <td>
+ <a href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo htmlspecialchars($song->artist); ?>" title="<?php echo htmlspecialchars($song->f_artist_full); ?>" <?php echo $text_class; ?>><?php echo htmlspecialchars($song->f_artist); ?></a>
+ </td>
+ <td>
+ <a href="<?php echo $web_path; ?>/albums.php?album=<?php echo htmlspecialchars($song->album); ?>" title="<?php echo htmlspecialchars($song->f_album_full); ?>" <?php echo $text_class; ?>><?php echo htmlspecialchars($song->f_album); ?></a>
+ </td>
+ <td align="right">
+ <?php echo $song->track; ?>
+ </td>
+ <td align="right">
+ <?php echo $song->f_time; ?>
+ </td>
+ <td align="right" nowrap="nowrap">
+ <?php echo $song->f_size; ?> MB
+ </td>
+ <td align="right">
+ <?php echo $song->f_bitrate; ?>
+ </td>
+ <td>
+ <?php echo $song->f_genre; ?>
+ </td>
+ <td <?php echo $song->f_style; ?> title="<?php echo $song->flagcomment; ?>">
+ <?php echo $song->flagtype; ?>
+ </td>
+ <td>
+ <?php if ($user->has_access('100')) { ?>
+ <a href="<?php echo $web_path; ?>/admin/song.php?action=edit&amp;song=<?php echo $song->id; ?>">Edit</a> | <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a> |
+ <?php if ($song->enabled) { ?>
+ <a href="<?php echo $web_path; ?>/admin/song.php?action=disable&amp;song_ids=<?php echo $song->id; ?>">Disable</a>
+ <?php } else { ?>
+ <a href="<?php echo $web_path; ?>/admin/song.php?action=enabled&amp;song_ids=<?php echo $song->id; ?>">Enable</a>
+ <?php } //status ?>
+ <?php } else { ?>
+ <a href="<?php echo $web_path; ?>/flag.php?song=<?php echo $song->id; ?>&amp;action=flag">Flag</a>
+ <?php } //access ?>
<?php if ($user->prefs['download']) { ?>
- | <a href="<?php echo $web_path; ?>/download/index.php?action=download&amp;song_id=<?php echo $song->id; ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Download"); ?></a>
+ | <a href="<?php echo $web_path; ?>/download/index.php?action=download&amp;song_id=<?php echo $song->id; ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Download"); ?></a>
<?php } ?>
<?php if ($user->prefs['direct_link']) { ?>
- | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&amp;uid=<?php echo $user->username . "&amp;sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Direct Link"); ?></a>
+ | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&amp;uid=<?php echo $user->username . "&amp;sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Direct Link"); ?></a>
<?php } ?>
- </td>
- <?php if(conf('ratings')) { ?>
- <td>
- <?php show_rating($song->id,'song'); ?>
- </td>
- <? } ?>
- </tr>
- <?php
- }// foreach loop
-
- //
- // Another here doc
- //
- $time = floor($totaltime/60) . ":" . sprintf("%02d", ($totaltime%60) );
- $megs = sprintf("%.2f", ($totalsize/1048576));
- $num = count($song_ids);
+ </td>
+ <?php if(conf('ratings')) { ?>
+ <td>
+ <?php show_rating($song->id,'song'); ?>
+ </td>
+ <?php } ?>
+</tr>
+<?php
+}// foreach loop
- ?>
- <tr class="table-header">
- <td></td>
- <?php if (is_object($playlist)) { ?> <td></td> <?php } ?>
- <td><?php echo _("Total"); ?>:</td>
- <td nowrap="nowrap"><?php echo $num; ?> song(s)</td>
- <td></td>
- <td></td>
- <td align="right" nowrap="nowrap"><?php echo $time; ?></td>
- <td align="right" nowrap="nowrap"><?php echo $megs; ?> MB</td>
- <td></td>
- <td></td>
- <td></td>
- <td colspan="2"></td>
- </tr>
- </table>
+//
+// Another here doc
+//
+$time = floor($totaltime/60) . ":" . sprintf("%02d", ($totaltime%60) );
+$megs = sprintf("%.2f", ($totalsize/1048576));
+$num = count($song_ids);
+?>
+<tr class="table-header">
+ <td></td>
+ <?php if (is_object($playlist)) { ?> <td></td> <?php } ?>
+ <td><?php echo _("Total"); ?>:</td>
+ <td nowrap="nowrap"><?php echo $num; ?> song(s)</td>
+ <td></td>
+ <td></td>
+ <td align="right" nowrap="nowrap"><?php echo $time; ?></td>
+ <td align="right" nowrap="nowrap"><?php echo $megs; ?> MB</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td colspan="2"></td>
+</tr>
+</table>
<br />
<?php show_play_selected(); ?>
</form>
diff --git a/templates/show_upload.inc b/templates/show_upload.inc
index 04d4f2ed..029e6c5c 100644
--- a/templates/show_upload.inc
+++ b/templates/show_upload.inc
@@ -15,12 +15,12 @@
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.
-
-*/
+
+*/
?>
<form action="<?php echo conf('web_path'); ?>/upload.php?" method="post" name="upload_form" enctype="multipart/form-data" id="upload_form">
@@ -44,35 +44,35 @@
</tr>
<tr>
<td>
- <input size="40" type="file" name="ul_path1" id="ul_path1" />
- <?php $GLOBALS['error']->print_error('ul_path1'); ?>
- </td>
-</tr>
+ <input size="40" type="file" name="ul_path1" id="ul_path1" />
+ <?php $GLOBALS['error']->print_error('ul_path1'); ?>
+ </td>
+</tr>
<tr>
<td>
- <input size="40" type="file" name="ul_path2" id="ul_path2" />
+ <input size="40" type="file" name="ul_path2" id="ul_path2" />
<?php $GLOBALS['error']->print_error('ul_path2'); ?>
- </td>
-</tr>
+ </td>
+</tr>
<tr>
- <td>
- <input size="40" type="file" name="ul_path3" id="ul_path3" />
+ <td>
+ <input size="40" type="file" name="ul_path3" id="ul_path3" />
<?php $GLOBALS['error']->print_error('ul_path3'); ?>
</td>
-</tr>
+</tr>
<tr>
- <td>
- <input size="40" type="file" name="ul_path4" id="ul_path4" />
+ <td>
+ <input size="40" type="file" name="ul_path4" id="ul_path4" />
<?php $GLOBALS['error']->print_error('ul_path3'); ?>
- </td>
-</tr>
+ </td>
+</tr>
<tr>
- <td>
+ <td>
<input type="hidden" name="action" value="upload" />
- <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo _("max_upload_size"); ?>" />
- <input class='button' type="submit" value="<?php echo _("Upload"); ?>" />
- </td>
-</tr>
+ <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo _("max_upload_size"); ?>" />
+ <input class='button' type="submit" value="<?php echo _("Upload"); ?>" />
+ </td>
+</tr>
</table>
</form>
diff --git a/templates/show_uploads.inc b/templates/show_uploads.inc
index e43d365e..d0f444d4 100644
--- a/templates/show_uploads.inc
+++ b/templates/show_uploads.inc
@@ -45,12 +45,12 @@ if (count($uploads)) {
<?php foreach ($uploads as $upload) { ?>
<tr class="<?php echo flip_class(); ?>">
<?php if($GLOBALS['user']->has_access(100)) { ?>
- <td>
- <a href="<?php echo conf('web_path'); ?>/upload.php?action=add&id=<?php echo $upload['id']; ?>"><?php echo _('Add'); ?></a>&nbsp;|&nbsp;
- <a href="<?php echo conf('web_path'); ?>/upload.php?action=delete&id=<?php echo $upload['id']; ?>"><?php echo _('Delete'); ?></a>
- </td>
+ <td>
+ <a href="<?php echo conf('web_path'); ?>/upload.php?action=add&amp;id=<?php echo $upload['id']; ?>"><?php echo _('Add'); ?></a>&nbsp;|&nbsp;
+ <a href="<?php echo conf('web_path'); ?>/upload.php?action=delete&amp;id=<?php echo $upload['id']; ?>"><?php echo _('Delete'); ?></a>
+ </td>
<?php } else { ?>
- <td>N/A</td>
+ <td>N/A</td>
<?php } ?>
<td><?php echo ucfirst($upload['action']); ?></td>
<td><?php echo $upload['title']; ?></td>
diff --git a/templates/show_user.inc.php b/templates/show_user.inc.php
index 52cb860c..9d59d5ea 100644
--- a/templates/show_user.inc.php
+++ b/templates/show_user.inc.php
@@ -23,35 +23,34 @@
<br /><br />
<div class="text-box">
<form name="update_user" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=update_user" enctype="multipart/form-data" >
-<p class="header2"><?php echo _("Changing User Information for") . " " . $this_user->fullname; ?></p>
-<table>
-
-<tr>
- <td>
- <?php echo _("Name"); ?>:
- </td>
- <td>
- <input type="text" name="fullname" size="30" value="<?php echo $this_user->fullname; ?>" />
- </td>
- </tr>
-
-<tr>
- <td>
- <?php echo _("E-mail"); ?>:
- </td>
- <td>
- <input type="text" name="email" size="30" value="<?php echo $this_user->email; ?>" />
- </td>
-</tr>
-<tr>
- <td>
- <?php echo _("Results Per Page"); ?>:
- </td>
- <td>
- <input type="text" name="offset_limit" size="5" value="<?php echo $this_user->offset_limit; ?>" />
- </td>
-</tr>
-</table>
+ <p class="header2"><?php echo _("Changing User Information for") . " " . $this_user->fullname; ?></p>
+ <table>
+ <tr>
+ <td>
+ <?php echo _("Name"); ?>:
+ </td>
+ <td>
+ <input type="text" name="fullname" size="30" value="<?php echo $this_user->fullname; ?>" />
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <?php echo _("E-mail"); ?>:
+ </td>
+ <td>
+ <input type="text" name="email" size="30" value="<?php echo $this_user->email; ?>" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php echo _("Results Per Page"); ?>:
+ </td>
+ <td>
+ <input type="text" name="offset_limit" size="5" value="<?php echo $this_user->offset_limit; ?>" />
+ </td>
+ </tr>
+ </table>
<input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" />
<input type="submit" name="action" value="<?php echo _("Update Profile"); ?>" />
</form>
@@ -59,35 +58,35 @@
<br />
<div class="text-box">
<form name="change_password" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=change_password" enctype="multipart/form-data" >
-<span class="header2">Changing User Password</span>
-<?php $GLOBALS['error']->print_error('password'); ?>
-<table border="0" cellpadding="5" cellspacing="0">
-<tr>
- <td>
- <?php echo _("Enter password"); ?>:
- </td>
- <td>
- <input type="password" name="password" size="30" />
- </td>
-</tr>
-<tr>
- <td>
- <?php echo _("Confirm Password"); ?>:
- </td>
- <td>
- <input type="password" name="confirm_password" size="30" />
- </td>
-</tr>
-</table>
- <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" />
- <input type="submit" name="action" value="<?php echo _("Change Password"); ?>" />
+ <span class="header2">Changing User Password</span>
+ <?php $GLOBALS['error']->print_error('password'); ?>
+ <table border="0" cellpadding="5" cellspacing="0">
+ <tr>
+ <td>
+ <?php echo _("Enter password"); ?>:
+ </td>
+ <td>
+ <input type="password" name="password" size="30" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php echo _("Confirm Password"); ?>:
+ </td>
+ <td>
+ <input type="password" name="confirm_password" size="30" />
+ </td>
+ </tr>
+ </table>
+ <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" />
+ <input type="submit" name="action" value="<?php echo _("Change Password"); ?>" />
</form>
</div>
<br />
<div class="text-box">
<form name="clear_statistics" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=clear_stats" enctype="multipart/form-data">
-<span class="header2"><?php echo _("Delete Your Personal Statistics"); ?></span><br />
-<input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" />
-<input type="submit" value="<?php echo _("Clear Stats"); ?>" />
+ <span class="header2"><?php echo _("Delete Your Personal Statistics"); ?></span><br />
+ <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" />
+ <input type="submit" value="<?php echo _("Clear Stats"); ?>" />
</form>
</div>
diff --git a/templates/show_user_registration.inc.php b/templates/show_user_registration.inc.php
index d5c0da45..f75bb3d0 100644
--- a/templates/show_user_registration.inc.php
+++ b/templates/show_user_registration.inc.php
@@ -53,124 +53,124 @@ $email = scrub_in($_REQUEST['email']);
<div align="center">
<form name="update_user" method="post" action="<?php echo conf('web_path'); ?>/register.php" enctype="multipart/form-data">
- <table class="border" width='700' cellpadding='0' cellspacing='0' border='0'>
- <tr class="table-header">
- <td>
- <font size="2"><b><u><?php echo _("Ampache New User Registration"); ?></u></b></font>
- </td>
- </tr>
- <?php
- /* If we should show the user agreement */
- if(conf('user_agreement')){ ?>
- <tr>
- <td height='15' bgcolor="<?php print conf('base_color2'); ?>">
- </td>
- </tr>
- <tr>
- <td bgcolor="<?php print conf('base_color2'); ?>" align='center' valign='top'>
- <table width='100%' border='0' cellpadding='0' cellspacing='0'>
- <tr class="table-header">
- <td align='center'>
- <font size="1"><b><u><?php echo _('User Agreement'); ?></u></b></font>
- </td>
- </tr>
- <tr>
- <td>
- <?php show_registration_agreement(); ?>
- </td>
- </tr>
- <tr>
- <td align='center' height='35' valign='center'>
- <input type='checkbox' name='accept_agreement'> <?php echo _('I Accept'); ?>
- <?php $GLOBALS['error']->print_error('user_agreement'); ?>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <? } ?>
+<table class="border" width='700' cellpadding='0' cellspacing='0' border='0'>
+<tr class="table-header">
+ <td>
+ <font size="2"><b><u><?php echo _("Ampache New User Registration"); ?></u></b></font>
+ </td>
+</tr>
+<?php
+/* If we should show the user agreement */
+if(conf('user_agreement')){ ?>
<tr>
<td height='15' bgcolor="<?php print conf('base_color2'); ?>">
</td>
</tr>
<tr>
- <td bgcolor="<?php print conf('base_color2'); ?>" align="center" valign="top">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr class="table-header">
- <td align='center'>
- <font size="1"><b><u><?php echo _('User Information'); ?></u></b></font>
- </td>
- </tr>
- </table>
- <br />
- <table width='99%' cellpadding='0' cellspacing='0' border='0'>
- <tr>
- <td align='right'>
- <?php echo _("Username"); ?>:
- </td>
- <td>
- <font color='red'>*</font> <input type='text' name='username' id='username' value='<?php echo scrub_out($username); ?>' />
- <?php $GLOBALS['error']->print_error('username'); ?>
- <?php $GLOBALS['error']->print_error('duplicate_user'); ?>
- </td>
- </tr>
- <tr>
- <td align='right'>
- <?php echo _("Full Name"); ?>:
- </td>
- <td>
- <font color='red'>*</font> <input type='text' name='fullname' id='fullname' value='<?php echo scrub_out($fullname); ?>' />
- <?php $GLOBALS['error']->print_error('fullname'); ?>
- </td>
- </tr>
- <tr>
- <td align='right'>
- <?php echo _("E-mail"); ?>:
- </td>
- <td>
- <font color='red'>*</font> <input type='text' name='email' id='email' value='<?php echo scrub_out($email); ?>' />
- <?php $GLOBALS['error']->print_error('email'); ?>
- </td>
- </tr>
- <tr>
- <td align='right'>
- <?php echo _("Password"); ?>:
- </td>
- <td>
- <font color='red'>*</font> <input type='password' name='password_1' id='password_1' />
- <?php $GLOBALS['error']->print_error('password'); ?>
- </td>
- </tr>
- <tr>
- <td align='right'>
- <?php echo _("Confirm Password"); ?>:
- </td>
- <td>
- <font color='red'>*</font> <input type='password' name='password_2' id='password_2' />
- </td>
- </tr>
- <?php if (conf('captcha_public_reg')) { ?>
- <tr>
- <?php echo captcha::form(); ?>
- <?php $GLOBALS['error']->print_error('captcha'); ?>
- </tr>
- <?php } ?>
- <tr>
- <td colspan='2' bgcolor="<?php print conf('base_color2'); ?>" align='center' height='20'>
- <font color='red'>*</font>Required fields
- </td>
- </tr>
- <tr>
- <td colspan='2' bgcolor="<?php print conf('base_color2'); ?>" align='center' height='50'>
- <input type="hidden" name="action" value="add_user" />
- <input type='reset' name='clear_info' id='clear_info' value='<?php echo _('Clear Info'); ?>' />
- <input type='submit' name='submit_registration' id='submit_registration' value='<?php echo _("Register User"); ?>' />
- </td>
- </tr>
+ <td bgcolor="<?php print conf('base_color2'); ?>" align='center' valign='top'>
+ <table width='100%' border='0' cellpadding='0' cellspacing='0'>
+ <tr class="table-header">
+ <td align='center'>
+ <font size="1"><b><u><?php echo _('User Agreement'); ?></u></b></font>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <?php show_registration_agreement(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td align='center' height='35' valign='center'>
+ <input type='checkbox' name='accept_agreement'> <?php echo _('I Accept'); ?>
+ <?php $GLOBALS['error']->print_error('user_agreement'); ?>
+ </td>
+ </tr>
</table>
</td>
- </tr>
- </table>
+ </tr>
+<? } // end if(conf('user_agreement')) ?>
+<tr>
+ <td height='15' bgcolor="<?php print conf('base_color2'); ?>">
+ </td>
+</tr>
+<tr>
+ <td bgcolor="<?php print conf('base_color2'); ?>" align="center" valign="top">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr class="table-header">
+ <td align='center'>
+ <font size="1"><b><u><?php echo _('User Information'); ?></u></b></font>
+ </td>
+ </tr>
+ </table>
+ <br />
+ <table width='99%' cellpadding='0' cellspacing='0' border='0'>
+ <tr>
+ <td align='right'>
+ <?php echo _("Username"); ?>:
+ </td>
+ <td>
+ <font color='red'>*</font> <input type='text' name='username' id='username' value='<?php echo scrub_out($username); ?>' />
+ <?php $GLOBALS['error']->print_error('username'); ?>
+ <?php $GLOBALS['error']->print_error('duplicate_user'); ?>
+ </td>
+ </tr>
+ <tr>
+ <td align='right'>
+ <?php echo _("Full Name"); ?>:
+ </td>
+ <td>
+ <font color='red'>*</font> <input type='text' name='fullname' id='fullname' value='<?php echo scrub_out($fullname); ?>' />
+ <?php $GLOBALS['error']->print_error('fullname'); ?>
+ </td>
+ </tr>
+ <tr>
+ <td align='right'>
+ <?php echo _("E-mail"); ?>:
+ </td>
+ <td>
+ <font color='red'>*</font> <input type='text' name='email' id='email' value='<?php echo scrub_out($email); ?>' />
+ <?php $GLOBALS['error']->print_error('email'); ?>
+ </td>
+ </tr>
+ <tr>
+ <td align='right'>
+ <?php echo _("Password"); ?>:
+ </td>
+ <td>
+ <font color='red'>*</font> <input type='password' name='password_1' id='password_1' />
+ <?php $GLOBALS['error']->print_error('password'); ?>
+ </td>
+ </tr>
+ <tr>
+ <td align='right'>
+ <?php echo _("Confirm Password"); ?>:
+ </td>
+ <td>
+ <font color='red'>*</font> <input type='password' name='password_2' id='password_2' />
+ </td>
+ </tr>
+ <?php if (conf('captcha_public_reg')) { ?>
+ <tr>
+ <?php echo captcha::form(); ?>
+ <?php $GLOBALS['error']->print_error('captcha'); ?>
+ </tr>
+ <?php } ?>
+ <tr>
+ <td colspan='2' bgcolor="<?php print conf('base_color2'); ?>" align='center' height='20'>
+ <font color='red'>*</font>Required fields
+ </td>
+ </tr>
+ <tr>
+ <td colspan='2' bgcolor="<?php print conf('base_color2'); ?>" align='center' height='50'>
+ <input type="hidden" name="action" value="add_user" />
+ <input type='reset' name='clear_info' id='clear_info' value='<?php echo _('Clear Info'); ?>' />
+ <input type='submit' name='submit_registration' id='submit_registration' value='<?php echo _("Register User"); ?>' />
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
</form>
</div>
</div><!--end <div>id="maincontainer-->
diff --git a/templates/show_users.inc b/templates/show_users.inc
index f8677da1..143c87bb 100644
--- a/templates/show_users.inc
+++ b/templates/show_users.inc
@@ -23,6 +23,7 @@
@header Show Users (admin section)
*/
+$web_path = conf('web_path');
$total_items = $view->total_items;
$admin_menu = "admin/";
?>
@@ -36,20 +37,20 @@ $admin_menu = "admin/";
</tr>
<tr class="table-header">
<td align="center">
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=fullname&amp;sort_order=0">
+ <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=fullname&amp;sort_order=0">
<b><?php echo _("Fullname"); ?></b>
</a>
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=username&amp;sort_order=0">
+ <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=username&amp;sort_order=0">
<b>(<?php echo _("Username"); ?>)</b>
</a>
</td>
<td align="center">
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=last_seen&amp;sort_order=0">
+ <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=last_seen&amp;sort_order=0">
<b><?php echo _("Last Seen"); ?></b>
</a>
</td>
<td align="center">
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=last_seen&amp;sort_order=0">
+ <a href="<?php echo $web_path; ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=last_seen&amp;sort_order=0">
<b><?php echo _("Registration Date"); ?></b>
</a>
</td>
@@ -74,19 +75,17 @@ $admin_menu = "admin/";
</td>
</tr>
<?php
-
-while ( $results = mysql_fetch_object($db_result) ) {
+while ($results = mysql_fetch_object($db_result)) {
$user = new User($results->username);
$last_seen = date("m\/d\/Y - H:i",$user->last_seen);
if (!$user->last_seen) { $last_seen = "Never"; }
-
$create_date = date("m\/d\/Y - H:i",$user->create_date);
if (!$user->create_date) { $create_date = "Unknown"; }
-
?>
+
<tr class="even">
<td>
- <a href="<?php echo conf('web_path'); ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
<?php echo $user->fullname; ?> (<?php echo $user->username; ?>)
</a>
</td>
@@ -98,43 +97,43 @@ while ( $results = mysql_fetch_object($db_result) ) {
</td>
<td>
- <a href="<?php echo conf('web_path'); ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
<?php echo _("Edit"); ?>
</a>
</td>
<td>
- <a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=user&amp;user_id=<?php echo $user->username; ?>">
+ <a href="<?php echo $web_path; ?>/admin/preferences.php?action=user&amp;user_id=<?php echo $user->username; ?>">
<?php echo _("Prefs"); ?>
</a>
</td>
<td>
- <a href="<?php echo conf('web_path'); ?>/stats.php?user_id=<?php echo $user->username; ?>">
+ <a href="<?php echo $web_path; ?>/stats.php?user_id=<?php echo $user->username; ?>">
<?php echo _("Stats"); ?>
</a>
</td>
<?php
- //FIXME: Fix this for the extra permission levels
- if ($user->disabled == '1') {
- echo "<td><a href=\"".conf('web_path')."/admin/users.php?action=update&amp;user=$user->username&amp;level=enabled\">" . _("Enable") . "</a></td>";
- }
- else {
- echo "<td><a href=\"".conf('web_path')."/admin/users.php?action=update&amp;user=$user->username&amp;level=disabled\">" . _("Disable") ."</a></td>";
- }
-?>
-<td>
- <a href="<?php echo conf('web_path'); ?>/admin/users.php?action=delete&amp;user=<?php echo $user->username; ?>">
- <?php echo _("delete"); ?>
- </a>
-</td>
+ //FIXME: Fix this for the extra permission levels
+ if ($user->disabled == '1') {
+ echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=enabled\">" . _("Enable") . "</a></td>";
+ }
+ else {
+ echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=disabled\">" . _("Disable") ."</a></td>";
+ }
+ ?>
+ <td>
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=delete&amp;user=<?php echo $user->username; ?>">
+ <?php echo _("delete"); ?>
+ </a>
+ </td>
<?php
- if ( $user->is_logged_in() and $user->is_online() ) {
- echo "<td bgcolor=\"green\"> &nbsp; </td>";
- } elseif ( $user->disabled == 1) {
- echo "<td bgcolor=\"gray\"> &nbsp; </td>";
- } else {
- echo "<td bgcolor=\"#7f0000\"> &nbsp; </td>";
- }
+ if (($user->is_logged_in()) and ($user->is_online())) {
+ echo "<td bgcolor=\"green\"> &nbsp; </td>";
+ } elseif ($user->disabled == 1) {
+ echo "<td bgcolor=\"gray\"> &nbsp; </td>";
+ } else {
+ echo "<td bgcolor=\"#7f0000\"> &nbsp; </td>";
+ }
?>
</tr>
-<?php } ?>
+<?php } //end while ($results = mysql_fetch_object($db_result)) ?>
</table>
diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php
index 2388d35f..423c5133 100644
--- a/templates/sidebar.inc.php
+++ b/templates/sidebar.inc.php
@@ -38,113 +38,113 @@ $browse_items[] = array('title'=>_("Genre"),'url'=>'browse.php?action=genre','ac
$browse_items[] = array('title'=>_("Lists"),'url'=>'browse.php','active'=>'');
//$browse_items[] = array('title'=>'File','url'=>'files.php','active'=>'');
+$web_path = conf('web_path');
?>
<!-- <div id="navcontainer"> --> <!--sigger: appears this div is not neccesary and duplicates #sidebar -->
- <ul id="navlist">
- <li id="active">
- <a href="<?php echo conf('web_path'); ?>/index.php" id="current"><?php echo _("Home"); ?></a>
- </li>
- <?php if ($GLOBALS['user']->has_access(100)) { ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/admin/index.php"><?php echo _("Admin"); ?></a>
- <?php
- if ($GLOBALS['theme']['submenu'] != 'simple') {
- show_submenu($admin_items);
+<ul id="navlist">
+ <li id="active">
+ <a href="<?php echo $web_path; ?>/index.php" id="current"><?php echo _("Home"); ?></a>
+ </li>
+<?php if ($GLOBALS['user']->has_access(100)) { ?>
+ <li>
+ <a href="<?php echo $web_path; ?>/admin/index.php"><?php echo _("Admin"); ?></a>
+ <?php
+ if ($GLOBALS['theme']['submenu'] != 'simple') {
+ show_submenu($admin_items);
+ echo "\t</li>\n";
+ }
+ else {
+ if ($location['section'] == 'admin') {
echo "\t</li>\n";
+ show_submenu($admin_items);
}
- else {
- if ($location['section'] == 'admin') {
- echo "\t</li>\n";
- show_submenu($admin_items);
- }
- } // end if browse sub menu
-
- } // end if access
- ?>
-
- <li>
- <a href="<?php echo conf('web_path'); ?>/preferences.php"><?php echo _("Preferences"); ?></a>
- </li>
- <li>
- <a href="<?php echo conf('web_path'); ?>/browse.php"><?php echo _("Browse"); ?></a>
+ } // end if browse sub menu
+} // end if access
+ ?>
+
+ <li>
+ <a href="<?php echo $web_path; ?>/preferences.php"><?php echo _("Preferences"); ?></a>
+ </li>
+ <li>
+ <a href="<?php echo $web_path; ?>/browse.php"><?php echo _("Browse"); ?></a>
<?php
- if ($GLOBALS['theme']['submenu'] != 'simple') {
- show_submenu($browse_items);
+ if ($GLOBALS['theme']['submenu'] != 'simple') {
+ show_submenu($browse_items);
+ echo "\t</li>\n";
+ }
+ else {
+ if ($location['section'] == 'browse') {
echo "\t</li>\n";
+ show_submenu($browse_items);
}
- else {
- if ($location['section'] == 'browse') {
- echo "\t</li>\n";
- show_submenu($browse_items);
- }
- }
+ }
?>
-
- <?php if ($GLOBALS['user']->prefs['upload']) { ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/upload.php"><?php echo _("Upload"); ?></a>
- </li>
- <?php } ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/playlist.php"><?php echo _("Playlists"); ?></a>
- </li>
- <?php if ($GLOBALS['user']->prefs['play_type'] == 'mpd') { ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/mpd.php"><?php echo _("Local Play"); ?></a>
- </li>
- <?php } ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/search.php"><?php echo _("Search"); ?></a>
- </li>
- <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?>
- <li>
- <form name="sub_search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline">
- <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="5" />
- <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" />
- <input type="hidden" name="action" value="quick_search" />
- <input type="hidden" name="method" value="fuzzy" />
- <input type="hidden" name="object_type" value="song" />
- <input type="hidden" name="search_object[]" value="all" />
- </form>
- </li>
- <?php } ?>
- <li>
- <a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _('Random'); ?></a>
- </li>
- <?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?>
- <li>
- <form name="sub_random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php" style="Display:inline">
- <input type="hidden" name="action" value="m3u" />
- <select name="random" style="width:9em;">
- <option value="1">1</option>
- <option value="5">5</option>
- <option value="10">10</option>
- <option value="20">20</option>
- <option value="30">30</option>
- <option value="50">50</option>
- <option value="100">100</option>
- <option value="500">500</option>
- <option value="1000">1000</option>
- <option value="-1"><?php echo _("All"); ?></option>
- </select>
- <?php show_genre_pulldown('genre','','','13','width:9em;'); ?>
- <br />
- <select name="random_type" style="width:9em;">
- <option value="Songs"><?php echo _("Songs"); ?></option>
- <option value="Minutes"><?php echo _("Minutes"); ?></option>
- <option value="Artists"><?php echo _("Artists"); ?></option>
- <option value="Albums"><?php echo _("Albums"); ?></option>
- <option value="Less Played"><?php echo _("Less Played"); ?></option>
- </select>
- <br />
- <input type="hidden" name="aaction" value="Play!" />
- <input class="smallbutton" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" />
- </form>
- </li>
- <?php } ?>
- <?php if (conf('use_auth')) { ?>
- <li><a href="<?php echo conf('web_path'); ?>/logout.php"><?php echo _("Logout"); ?></a></li>
- <?php } ?>
- </ul>
+
+<?php if ($GLOBALS['user']->prefs['upload']) { ?>
+ <li>
+ <a href="<?php echo $web_path; ?>/upload.php"><?php echo _("Upload"); ?></a>
+ </li>
+<?php } // end if ($GLOBALS['user']->prefs['upload']) ?>
+ <li>
+ <a href="<?php echo $web_path; ?>/playlist.php"><?php echo _("Playlists"); ?></a>
+ </li>
+<?php if ($GLOBALS['user']->prefs['play_type'] == 'mpd') { ?>
+ <li>
+ <a href="<?php echo $web_path; ?>/mpd.php"><?php echo _("Local Play"); ?></a>
+ </li>
+<?php } // end if ($GLOBALS['user']->prefs['play_type'] == 'mpd') ?>
+ <li>
+ <a href="<?php echo $web_path; ?>/search.php"><?php echo _("Search"); ?></a>
+ </li>
+<?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?>
+ <li>
+ <form name="sub_search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline">
+ <input type="text" name="search_string" value="<?php echo scrub_out($_REQUEST['search_string']); ?>" size="5" />
+ <input class="smallbutton" type="submit" value="<?php echo _("Search"); ?>" />
+ <input type="hidden" name="action" value="quick_search" />
+ <input type="hidden" name="method" value="fuzzy" />
+ <input type="hidden" name="object_type" value="song" />
+ <input type="hidden" name="search_object[]" value="all" />
+ </form>
+ </li>
+<?php } // end if ($GLOBALS['theme']['orientation'] != 'horizontal')?>
+ <li>
+ <a href="<?php echo $web_path; ?>/randomplay.php"><?php echo _('Random'); ?></a>
+ </li>
+<?php if ($GLOBALS['theme']['orientation'] != 'horizontal') { ?>
+ <li>
+ <form name="sub_random" method="post" enctype="multipart/form-data" action="<?php echo $web_path; ?>/song.php" style="Display:inline">
+ <input type="hidden" name="action" value="m3u" />
+ <select name="random" style="width:9em;">
+ <option value="1">1</option>
+ <option value="5">5</option>
+ <option value="10">10</option>
+ <option value="20">20</option>
+ <option value="30">30</option>
+ <option value="50">50</option>
+ <option value="100">100</option>
+ <option value="500">500</option>
+ <option value="1000">1000</option>
+ <option value="-1"><?php echo _("All"); ?></option>
+ </select>
+ <?php show_genre_pulldown('genre','','','13','width:9em;'); ?>
+ <br />
+ <select name="random_type" style="width:9em;">
+ <option value="Songs"><?php echo _("Songs"); ?></option>
+ <option value="Minutes"><?php echo _("Minutes"); ?></option>
+ <option value="Artists"><?php echo _("Artists"); ?></option>
+ <option value="Albums"><?php echo _("Albums"); ?></option>
+ <option value="Less Played"><?php echo _("Less Played"); ?></option>
+ </select>
+ <br />
+ <input type="hidden" name="aaction" value="Play!" />
+ <input class="smallbutton" type="submit" name="aaction" value="<?php echo _("Enqueue"); ?>" />
+ </form>
+ </li>
+<?php } // end if ($GLOBALS['theme']['orientation'] != 'horizontal') ?>
+<?php if (conf('use_auth')) { ?>
+ <li><a href="<?php echo $web_path; ?>/logout.php"><?php echo _("Logout"); ?></a></li>
+<?php } // end (conf('use_auth'))?>
+</ul>
<!-- </div> -->
diff --git a/templates/song_edit.inc b/templates/song_edit.inc
index eb6179d7..cc93c7a5 100644
--- a/templates/song_edit.inc
+++ b/templates/song_edit.inc
@@ -25,64 +25,55 @@ $target = conf('web_path').'/admin/flags.php';
?>
<form name="update_song" method="post" action="<?php echo $target; ?>">
-
<table class="tabledata" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td>File:</td>
- <td colspan="2"><?php echo $filename; ?></td>
- </tr>
-
- <tr>
- <td>Title:</td>
- <td> <input type="text" name="title" size="60" value="<?php echo $song->title; ?>"></input></td>
- </tr>
-
- <tr>
- <td>Artist:</td>
- <td> <?php show_artist_pulldown($song->artist); ?> </td>
- <td>or <input type="text" name="new_artist" size="30" value=""></input></td>
- </tr>
-
- <tr>
- <td>Album:</td>
- <td> <?php show_album_pulldown($song->album); ?> </td>
- <td>or <input type="text" name="new_album" size="30" value=""></input></td>
- </tr>
-
- <tr>
- <td>Track:</td>
- <td> <input type="text" size="4" maxlength="4" name="track" value="<?php echo $song->track;?>"></input> </td>
- </tr>
-
- <tr>
- <td>Genre:</td>
- <td> <?php show_genre_pulldown('genre',$song-genre); ?> </td>
- </tr>
-
- <tr>
- <td> <input type="text" size="4" maxlength="4" name="year" value="<?php echo $song->year;?>"></input> </td>
- </tr>
-
- <tr>
- <td>&nbsp;</td>
- <td> <input type="checkbox" name="update_id3" value="yes" checked="checked">&nbsp;Update id3 tags</input> </td>
- <td>&nbsp;</td>
- </tr>
-
- <tr>
- <td> &nbsp; </td>
- <td> <input type="hidden" name="song" value="<?php echo $song->id;?>"></input>
- <input type="hidden" name="flag" value="<?php echo $flagid;?>"></input>
- <input type="hidden" name="current_artist_id" value="<?php echo $song->artist;?>"></input>
-
-<?php if(count($_SESSION['edit_queue'])){ ?>
- <input type="submit" name="action" value="Next"></input>
- <input type="submit" name="action" value="Skip"></input>
- <input type="submit" name="action" value="Clear Edit List"></input></td>
-<?php } else { ?>
- <input type="submit" name="action" value="Done"></input></td>
-<?php } ?>
- </tr>
+<tr>
+ <td>File:</td>
+ <td colspan="2"><?php echo $filename; ?></td>
+</tr>
+<tr>
+ <td>Title:</td>
+ <td><input type="text" name="title" size="60" value="<?php echo $song->title; ?>"></input></td>
+</tr>
+<tr>
+ <td>Artist:</td>
+ <td><?php show_artist_pulldown($song->artist); ?></td>
+ <td>or <input type="text" name="new_artist" size="30" value=""></input></td>
+</tr>
+<tr>
+ <td>Album:</td>
+ <td><?php show_album_pulldown($song->album); ?></td>
+ <td>or <input type="text" name="new_album" size="30" value=""></input></td>
+</tr>
+<tr>
+ <td>Track:</td>
+ <td><input type="text" size="4" maxlength="4" name="track" value="<?php echo $song->track;?>"></input></td>
+</tr>
+<tr>
+ <td>Genre:</td>
+ <td><?php show_genre_pulldown('genre',$song-genre); ?></td>
+</tr>
+<tr>
+ <td><input type="text" size="4" maxlength="4" name="year" value="<?php echo $song->year;?>"></input></td>
+</tr>
+<tr>
+ <td>&nbsp;</td>
+ <td><input type="checkbox" name="update_id3" value="yes" checked="checked">&nbsp;Update id3 tags</input></td>
+ <td>&nbsp;</td>
+</tr>
+<tr>
+ <td> &nbsp; </td>
+ <td>
+ <input type="hidden" name="song" value="<?php echo $song->id;?>"></input>
+ <input type="hidden" name="flag" value="<?php echo $flagid;?>"></input>
+ <input type="hidden" name="current_artist_id" value="<?php echo $song->artist;?>"></input>
+ <?php if (count($_SESSION['edit_queue'])){ ?>
+ <input type="submit" name="action" value="Next"></input>
+ <input type="submit" name="action" value="Skip"></input>
+ <input type="submit" name="action" value="Clear Edit List"></input></td>
+ <?php } else { ?>
+ <input type="submit" name="action" value="Done"></input></td>
+ <?php } ?>
+</tr>
</table>
</form>
diff --git a/templates/subnavbar.inc.php b/templates/subnavbar.inc.php
index 396fa97c..2f36704d 100644
--- a/templates/subnavbar.inc.php
+++ b/templates/subnavbar.inc.php
@@ -26,14 +26,13 @@
*/
?>
- <ul class="subnavside">
+<ul class="subnavside">
<?php
foreach ($items as $item) {
if ($item['active']) {
$li_id = "id=\"subactive\"";
$a_id = "id=\"subcurrent\"";
- }
-?>
+ } ?>
<li <?php echo $li_id; ?>><a href="<?php echo conf('web_path') . "/" . $item['url']; ?>" <?php echo $a_id; ?>><?php echo $item['title']; ?></a></li>
-<?php unset($li_id,$a_id); } ?>
- </ul>
+ <?php unset($li_id,$a_id); } // END foreach ($items as $item) ?>
+</ul>
diff --git a/templates/tool_box.inc b/templates/tool_box.inc
index 2f0f5fe6..02f6dd13 100644
--- a/templates/tool_box.inc
+++ b/templates/tool_box.inc
@@ -28,16 +28,16 @@
?>
<table class="border" cellspacing="1" cellpadding="3" >
- <tr class="table-header" align="center">
- <th><?php echo $title; ?></th>
- </tr>
- <tr>
- <td class="even">
- <?php
- foreach (array_keys($items) as $item) {
- print("\t\t\t&gt;&gt; <a href=\"$items[$item]\"> $item</a><br />\n");
- }
- ?>
- </td>
- </tr>
+<tr class="table-header" align="center">
+ <th><?php echo $title; ?></th>
+</tr>
+<tr>
+ <td class="even">
+ <?php
+ foreach (array_keys($items) as $item) {
+ print("\t\t\t&gt;&gt; <a href=\"$items[$item]\"> $item</a><br />\n");
+ }
+ ?>
+ </td>
+</tr>
</table>
diff --git a/templates/userform.inc b/templates/userform.inc
index 8d168d16..fbde9f5a 100644
--- a/templates/userform.inc
+++ b/templates/userform.inc
@@ -46,7 +46,7 @@ else {
</tr>
<tr>
<td><?php echo _("Full Name"); ; ?>:</td>
- <td>
+ <td>
<input type="text" name="new_fullname" size="30" value="<?php echo $fullname; ?>" />
</td>
</tr>
@@ -81,26 +81,22 @@ else {
</td>
<td>
<select name="user_access">
- <option value="1" <?php if($access==='1') echo "selected=\"selected\""; ?>>Guest</option>
- <option value="user" <?php if($access==='user') echo "selected=\"selected\""; ?>>User</option>
- <option value="admin" <?php if($access==='admin') echo "selected=\"selected\""; ?>>Admin</option>
- </select>
+ <option value="1" <?php if($access==='1') echo "selected=\"selected\""; ?>>Guest</option>
+ <option value="user" <?php if($access==='user') echo "selected=\"selected\""; ?>>User</option>
+ <option value="admin" <?php if($access==='admin') echo "selected=\"selected\""; ?>>Admin</option>
+ </select>
</td>
</tr>
</table>
<?php
-
- if ( $type == 'new_user' )
- {
- echo "<input type=\"hidden\" name=\"action\" value=\"add_user\" />";
- echo "<input type=\"submit\" value=\"" . _("Add User") . "\" />";
- }
- else
- {
- echo "<input type=\"hidden\" name=\"action\" value=\"update_user\" />\n";
- echo "<input type=\"submit\" value=\"" . _("Update User") . "\" />\n";
- echo "<input type=\"hidden\" name=\"new_username\" value=\"$username\" />";
- }
-
+if ($type == 'new_user') {
+ echo "<input type=\"hidden\" name=\"action\" value=\"add_user\" />";
+ echo "<input type=\"submit\" value=\"" . _("Add User") . "\" />";
+}
+else {
+ echo "<input type=\"hidden\" name=\"action\" value=\"update_user\" />\n";
+ echo "<input type=\"submit\" value=\"" . _("Update User") . "\" />\n";
+ echo "<input type=\"hidden\" name=\"new_username\" value=\"$username\" />";
+}
?>
</form>