summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-06-19 18:05:40 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-06-19 18:05:40 +0000
commit0c0262b8a7326d1e2effbce5d422fd672300d114 (patch)
treee84c501cccbb2e7d3d9655685020fd7a266a7170
parent49f48af532c2d3196d94b444c3514bdb1a499436 (diff)
downloadampache-0c0262b8a7326d1e2effbce5d422fd672300d114.tar.gz
ampache-0c0262b8a7326d1e2effbce5d422fd672300d114.tar.bz2
ampache-0c0262b8a7326d1e2effbce5d422fd672300d114.zip
mother of all commits...
-rw-r--r--admin/mail.php6
-rw-r--r--admin/orphan.php2
-rw-r--r--admin/preferences.php3
-rw-r--r--admin/song.php20
-rw-r--r--artists.php2
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--index.php1
-rw-r--r--lib/artist.php2
-rw-r--r--lib/batch.php2
-rw-r--r--lib/duplicates.php11
-rw-r--r--lib/ui.php2
-rw-r--r--login.php2
-rw-r--r--modules/admin.php2
-rw-r--r--modules/class/album.php8
-rw-r--r--modules/class/artist.php8
-rw-r--r--modules/class/song.php2
-rw-r--r--modules/class/stream.php3
-rw-r--r--modules/id3/getid3/module.audio.mpc.php2
-rw-r--r--modules/lib.php58
-rw-r--r--playlist.php8
-rw-r--r--preferences.php2
-rw-r--r--templates/admin_menu.inc1
-rw-r--r--templates/header.inc2
-rw-r--r--templates/list_duplicates.inc10
-rw-r--r--templates/list_flagged.inc2
-rw-r--r--templates/menu.inc4
-rw-r--r--templates/show_add_access.inc14
-rw-r--r--templates/show_admin_index.inc4
-rw-r--r--templates/show_album.inc18
-rw-r--r--templates/show_albums.inc14
-rw-r--r--templates/show_artist.inc8
-rw-r--r--templates/show_artists.inc6
-rw-r--r--templates/show_box.inc4
-rw-r--r--templates/show_import_playlist.inc.php4
-rw-r--r--templates/show_mpdplay.inc18
-rw-r--r--templates/show_now_playing.inc9
-rw-r--r--templates/show_play_selected.inc.php2
-rw-r--r--templates/show_preferences.inc6
-rw-r--r--templates/show_search.inc22
-rw-r--r--templates/show_songs.inc26
-rw-r--r--templates/show_users.inc5
-rw-r--r--templates/song_edit.inc48
-rw-r--r--templates/tool_box.inc4
43 files changed, 200 insertions, 180 deletions
diff --git a/admin/mail.php b/admin/mail.php
index 8c656896..4701d298 100644
--- a/admin/mail.php
+++ b/admin/mail.php
@@ -98,9 +98,9 @@ show_clear();
<td><?php echo _("Mail to"); ?>:</td>
<td>
<select name="to">
- <option value="all" <?php if ($to == 'all') { echo "SELECTED"; } ?>>All</option>
- <option value="users" <?php if ($to == 'user') { echo "SELECTED"; } ?>>Users</option>
- <option value="admins" <?php if ($to == 'admin') { echo "SELECTED"; } ?>>Admins</option>
+ <option value="all" <?php if ($to == 'all') { echo "selected=\"selected\""; } ?>>All</option>
+ <option value="users" <?php if ($to == 'user') { echo "selected=\"selected\""; } ?>>Users</option>
+ <option value="admins" <?php if ($to == 'admin') { echo "selected=\"selected\""; } ?>>Admins</option>
</select>
</td>
</tr>
diff --git a/admin/orphan.php b/admin/orphan.php
index dfeee13b..500b6dbf 100644
--- a/admin/orphan.php
+++ b/admin/orphan.php
@@ -65,7 +65,7 @@ elseif ( $action == 'show_orphan_albums' ) {
?>
-<hr>
+<hr />
</body>
</html>
diff --git a/admin/preferences.php b/admin/preferences.php
index ba381f44..973fddb0 100644
--- a/admin/preferences.php
+++ b/admin/preferences.php
@@ -88,3 +88,6 @@ require (conf('prefix') . "/templates/show_preferences.inc");
// FOOTER
show_page_footer ('Admin', 'Admin Preferences',$user->prefs['display_menu']);
?>
+
+</body>
+</html>
diff --git a/admin/song.php b/admin/song.php
index cf38a14f..639f1c1c 100644
--- a/admin/song.php
+++ b/admin/song.php
@@ -107,14 +107,17 @@ echo <<<EDIT_SONG_1
<tr class="table-header">
<td colspan="3"><b>Editing $info->title</b></td>
</tr>
+
<tr class="odd">
<td>File:</td>
<td colspan="2">$filename $oggwarn</td>
</tr>
+
<tr class="odd">
<td>Title:</td>
- <td colspan="2"><input type="text" name="title" size="60" value="$info->title"></td>
+ <td colspan="2"><input type="text" name="title" size="60" value="$info->title" /></td>
</tr>
+
<tr class="even">
<td>Artist:</td>
<td>
@@ -122,7 +125,7 @@ EDIT_SONG_1;
show_artist_pulldown($info->artist);
echo <<<EDIT_SONG_2
</td>
- <td>or <input type="text" name="new_artist" size="30" value=""></td>
+ <td>or <input type="text" name="new_artist" size="30" value="" /></td>
</tr>
<tr class="odd">
@@ -132,18 +135,22 @@ EDIT_SONG_2;
show_album_pulldown($info->album);
echo <<<EDIT_SONG_3
</td>
- <td>or <input type="text" name="new_album" size="30" value=""></td>
+ <td>or <input type="text" name="new_album" size="30" value="" /></td>
</tr>
+
<tr class="even">
<td>Track:</td>
<td colspan="2"><input type="text" size="4" maxlength="4" name="track" value="$info->track"></input></td>
</tr>
+
<tr class="odd">
<td>Genre:</td>
<td colspan="2">
EDIT_SONG_3;
show_genre_pulldown($info->genre, 1);
echo <<<EDIT_SONG_4
+ </td>
+</tr>
<tr class="even">
<td>Year</td>
<td colspan="2"><input type="text" size="4" maxlength="4" name="year" value="$info->year"></input></td>
@@ -152,10 +159,10 @@ echo <<<EDIT_SONG_4
EDIT_SONG_4;
if(!$ogg)
{
- echo <<<EDIT_SONG_5
+echo <<<EDIT_SONG_5
<tr class="even">
<td>&nbsp;</td>
- <td><input type="checkbox" name="update_id3" value="yes">&nbsp;Update id3 tags</input></td>
+ <td><input type="checkbox" name="update_id3" value="yes"></input>&nbsp; Update id3 tags </td>
<td>&nbsp;</td>
</tr>
EDIT_SONG_5;
@@ -176,7 +183,8 @@ EDIT_SONG_6;
}
?>
-<hr>
+
+<hr />
</body>
</html>
diff --git a/artists.php b/artists.php
index b4978412..3511c1f9 100644
--- a/artists.php
+++ b/artists.php
@@ -59,7 +59,7 @@ switch($action) {
$catalog->update_single_item('artist',$_REQUEST['artist']);
echo "<br /><b>" . _("Update From Tags Complete") . "</b> &nbsp;&nbsp;";
- echo "<a href=\"" . conf('web_path') . "/artists.php?action=show&artist=" . $_REQUEST['artist'] . "\">[" . _("Return") . "]</a>";
+ echo "<a href=\"" . conf('web_path') . "/artists.php?action=show&amp;artist=" . $_REQUEST['artist'] . "\">[" . _("Return") . "]</a>";
break;
case 'match':
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 7fb4636a..712f9f7d 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -22,6 +22,9 @@
- Fixed Adding to playlist from Album (Thx rperkins)
- Fixed problem where attempting to view multi-artist albums would
only show one artists songs (exception for Unknown albums)
+ - Fixed refresh link if Local Play is on it's own page (Thx XGizzmo)
+ - Fixed a ton of HTML, and CSS errors (Thx XGizzmo)
+ - Fixed MPD so that adding songs also starts playback
--------------------------------------------------------------------------
diff --git a/index.php b/index.php
index 4b4c7e46..88431963 100644
--- a/index.php
+++ b/index.php
@@ -33,6 +33,7 @@ $action = scrub_in($_REQUEST['action']);
if (conf('refresh_limit') > 0) { show_template('javascript_refresh'); }
?>
+
<p style="font-size: 8pt; font-weight: bold;">
<?php echo _("Welcome to"); ?> <a href="http://www.ampache.org/index.php">Ampache v.<?php echo conf('version'); ?></a>
<?php if (conf('use_auth')) { ?>
diff --git a/lib/artist.php b/lib/artist.php
index 5ccd200a..38a93c75 100644
--- a/lib/artist.php
+++ b/lib/artist.php
@@ -50,7 +50,7 @@ function get_artists($sql, $action=0) {
function format_artist($artist) {
$web_path = conf('web_path');
- $artist['name'] = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $artist['id'] . "\">" . $artist['prefix'] . " " . $artist['name'] . "</a>";
+ $artist['name'] = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $artist['id'] . "\">" . htmlspecialchars($artist['prefix']) . " " . htmlspecialchars($artist['name']) . "</a>";
return $artist;
diff --git a/lib/batch.php b/lib/batch.php
index a3a3aba3..508564c1 100644
--- a/lib/batch.php
+++ b/lib/batch.php
@@ -32,7 +32,7 @@ function get_song_files( $song_ids ) {
/* Don't archive disabled songs */
if ($song->status != 'disabled') {
$user->update_stats( $song_id );
- $total_size += sprintf("%.2f",($song->size/1048576));;
+ $total_size += sprintf("%.2f",($song->size/1048576));
array_push( $song_files, $song->file );
} // if song isn't disabled
}
diff --git a/lib/duplicates.php b/lib/duplicates.php
index 94f3deda..202f1185 100644
--- a/lib/duplicates.php
+++ b/lib/duplicates.php
@@ -88,30 +88,31 @@ function show_duplicate_searchbox($search_type) {
$checked = "checked=\"checked\"";
else
$checked = "";
- echo "<input type=\"radio\" name=\"search_type\" value=\"title\" ".$checked." >" . _("Title") . "<br />";
+ echo "<input type=\"radio\" name=\"search_type\" value=\"title\" ".$checked." />" . _("Title") . "<br />";
if ($search_type=="artist_title")
$checked = "checked=\"checked\"";
else
$checked = "";
- echo "<input type=\"radio\" name=\"search_type\" value=\"artist_title\" ".$checked." >" . _("Artist and Title") . "<br />";
+ echo "<input type=\"radio\" name=\"search_type\" value=\"artist_title\" ".$checked." />" . _("Artist and Title") . "<br />";
if ($search_type=="artist_album_title"OR $search_type=="")
$checked = "checked=\"checked\"";
else
$checked = "";
- echo "<input type=\"radio\" name=\"search_type\" value=\"artist_album_title\"".$checked." >" . _("Artist, Album and Title") . "<br />";
+ echo "<input type=\"radio\" name=\"search_type\" value=\"artist_album_title\"".$checked." />" . _("Artist, Album and Title") . "<br />";
?>
</td>
</tr>
<tr class="odd">
<td></td>
<td>
- <input type="hidden" name="action" value="search">
+ <input type="hidden" name="action" value="search" />
<input type="submit" value="<?php echo _("Search"); ?>" />
</td>
</tr>
</table>
-<br>
+</form>
+<br />
<?
} // show_duplicate_searchbox
?>
diff --git a/lib/ui.php b/lib/ui.php
index 4d1e7671..fbbdcf8b 100644
--- a/lib/ui.php
+++ b/lib/ui.php
@@ -334,7 +334,7 @@ function truncate_with_ellipse($text, $max=27) {
*/
function show_footer() {
$class = "table-header";
- echo "<br /><br /><br /><div class=\"$class\" style=\"border: solid thin black;\">&nbsp</div>";
+ echo "<br /><br /><br /><div class=\"$class\" style=\"border: solid thin black;\">&nbsp;</div>";
} // show_footer
/*!
diff --git a/login.php b/login.php
index eb27071f..22d50a86 100644
--- a/login.php
+++ b/login.php
@@ -89,7 +89,7 @@ if ( ($auth['success'] == 1)) {
<?php show_template('style'); ?>
-<script language="javascript">
+<script type="text/javascript" language="javascript">
function focus(){ document.login.username.focus(); }
</script>
diff --git a/modules/admin.php b/modules/admin.php
index 6eb9da04..5ce7bf6d 100644
--- a/modules/admin.php
+++ b/modules/admin.php
@@ -45,7 +45,7 @@ function show_manage_users () {
echo "<table class=\"text-box\">\n<tr><td>\n";
echo "<span class=\"header2\">" . _("Manage Users") . "</span><br />\n";
echo "<p>Use the following tools to manage the users that access your site.</p>\n";
- echo "<ul>\n\t<li><a href=\"".conf('web_path') . "/admin/users.php?action=show_add_user\">" . _("Add a new user") . "</a></li\n</dl>\n";
+ echo "<ul>\n\t<li><a href=\"".conf('web_path') . "/admin/users.php?action=show_add_user\">" . _("Add a new user") . "</a></li>\n</ul>\n";
echo "</td></tr></table>";
show_users();
diff --git a/modules/class/album.php b/modules/class/album.php
index c95a8ff6..17befbd9 100644
--- a/modules/class/album.php
+++ b/modules/class/album.php
@@ -115,12 +115,12 @@ class Album {
$web_path = conf('web_path');
/* Truncate the string if it's to long */
- $name = truncate_with_ellipse($this->name,conf('ellipse_threshold_album'));
-
- $this->f_name = "<a href=\"$web_path/albums.php?action=show&amp;album=" . $this->id . "\" title=\"" . $this->name . "\">" . $name . "</a>";
+ $name = htmlspecialchars(truncate_with_ellipse($this->name,conf('ellipse_threshold_album')));
+ $artist = htmlspecialchars($this->artist);
+ $this->f_name = "<a href=\"$web_path/albums.php?action=show&amp;album=" . $this->id . "\" title=\"" . $name . "\">" . $name . "</a>";
$this->f_songs = "<div align=\"center\">" . $this->songs . "</div>";
if ($this->artist_count == '1') {
- $this->f_artist = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $this->artist . "</a>";
+ $this->f_artist = "<a href=\"$web_path/artists.php?action=show&amp;artist=" . $this->artist_id . "\">" . $artist . "</a>";
}
else {
$this->f_artist = _("Various");
diff --git a/modules/class/artist.php b/modules/class/artist.php
index a0b4caa7..2a6e3308 100644
--- a/modules/class/artist.php
+++ b/modules/class/artist.php
@@ -170,13 +170,11 @@ class Artist {
function format_artist() {
/* Combine prefix and name, trim then add ... if needed */
- $name = truncate_with_ellipse(trim($this->prefix . " " . $this->name));
-
+ $name = htmlspecialchars(truncate_with_ellipse(trim($this->prefix . " " . $this->name)));
$this->f_name = $this->name;
- $this->full_name = trim($this->prefix . " " . $this->name);
+ $this->full_name = htmlspecialchars(trim($this->prefix . " " . $this->name));
//FIXME: This shouldn't be set like this, f_name should be like this
- $this->link = "<a href=\"" . conf('web_path') . "/artists.php?action=show&amp;artist=" . $this->id . "\" title=\"" . $this->full_name . "\">" .
- $name . "</a>";
+ $this->link = "<a href=\"" . conf('web_path') . "/artists.php?action=show&amp;artist=" . $this->id . "\" title=\"" . $this->full_name . "\">" . $name . "</a>";
$this->name = $this->link;
return $artist;
diff --git a/modules/class/song.php b/modules/class/song.php
index cd1cfe8a..47600ee5 100644
--- a/modules/class/song.php
+++ b/modules/class/song.php
@@ -556,7 +556,7 @@ class Song {
$this->f_title = truncate_with_ellipse($this->title,conf('ellipse_threshold_title'));
// Create A link inclduing the title
- $this->f_link = "<a href=\"" . conf('web_path') . "/song.php?action=m3u&song=" . $this->id . "\">$this->f_title</a>";
+ $this->f_link = "<a href=\"" . conf('web_path') . "/song.php?action=m3u&amp;song=" . $this->id . "\">$this->f_title</a>";
// Format the Bitrate
$this->f_bitrate = intval($this->bitrate/1000) . "-" . strtoupper($this->mode);
diff --git a/modules/class/stream.php b/modules/class/stream.php
index 3472127a..999dcbca 100644
--- a/modules/class/stream.php
+++ b/modules/class/stream.php
@@ -267,6 +267,9 @@ class Stream {
/* Add the files to the MPD playlist */
addToPlaylist($myMpd,$this->songs);
+ /* If we've added songs we should start playing */
+ $myMpd->Play();
+
header ("Location: " . return_referer());
} // create_mpd
diff --git a/modules/id3/getid3/module.audio.mpc.php b/modules/id3/getid3/module.audio.mpc.php
index d0a7202f..7d5d33c5 100644
--- a/modules/id3/getid3/module.audio.mpc.php
+++ b/modules/id3/getid3/module.audio.mpc.php
@@ -201,7 +201,7 @@ class getid3_mpc
if ($thisfile_mpc_header['raw']['album_gain'] < 0) {
$thisfile_mpc_header['album_gain_db'] = (float) (32768 + $thisfile_mpc_header['raw']['album_gain']) / -100;
} else {
- $thisfile_mpc_header['album_gain_db'] = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;;
+ $thisfile_mpc_header['album_gain_db'] = (float) $thisfile_mpc_header['raw']['album_gain'] / 100;
}
$thisfile_mpc_header['encoder_version'] = $this->MPCencoderVersionLookup($thisfile_mpc_header['raw']['encoder_version']);
diff --git a/modules/lib.php b/modules/lib.php
index 735f579a..585e9612 100644
--- a/modules/lib.php
+++ b/modules/lib.php
@@ -190,14 +190,14 @@ function show_random_play() {
</td>
</tr>
<tr class="even">
- <td nowrap> ' . _("from catalog") . '</td>
+ <td nowrap="nowrap"> ' . _("from catalog") . '</td>
<td>
';
show_catalog_pulldown( -1, 0);
print '
- </tr>
+ </td></tr>
<tr>
<td colspan="4">
<input type="hidden" name="aaction" value="Play!" />
@@ -227,15 +227,15 @@ function show_artist_pulldown ($artist) {
$query = "SELECT id,name FROM artist ORDER BY name";
$db_result = mysql_query($query, $dbh);
- echo "<select name=\"artist\">\n";
+ echo "\n<select name=\"artist\">\n";
while ( $r = mysql_fetch_row($db_result) ) {
// $r[0] = id, $r[1] = name
if ( $artist == $r[0] ) {
- echo "<option value=\"$r[0]\" selected=\"selected\">$r[1]</option>\n";
+ echo "<option value=\"$r[0]\" selected=\"selected\">". htmlspecialchars($r[1]) ."</option>\n";
}
else {
- echo "<option value=\"$r[0]\">$r[1]</option>\n";
+ echo "<option value=\"$r[0]\">". htmlspecialchars($r[1]) ."</option>\n";
}
}
@@ -256,7 +256,7 @@ function show_album_pulldown ($album) {
$sql = "SELECT id,name FROM album ORDER BY name";
$db_result = mysql_query($sql, $dbh);
- echo "<select name=\"album\">\n";
+ echo "\n<select name=\"album\">\n";
while ( $r = mysql_fetch_row($db_result) ) {
// $r[0] = id, $r[1] = name
@@ -268,7 +268,7 @@ function show_album_pulldown ($album) {
}
}//while
- echo "</select>\n";
+ echo "\n</select>\n";
} // show_album_pulldown()
@@ -292,19 +292,19 @@ function show_flagged_popup($reason,$label='value', $name='flagged_type', $other
}
$db_result = mysql_query($query, $dbh);
- echo "<select name=\"$name\" $other>\n";
+ echo "\n<select name=\"$name\" $other>\n";
while ( $r = mysql_fetch_array($db_result) ) {
// $r[0] = id, $r[1] = type
if ( $reason === $r['type'] ) {
- echo "\t<option value=\"".$r['type']."\" selected=\"selected\">".$r[$label]."</option>\n";
+ echo "\t<option value=\"".$r['type']."\" selected=\"selected\">".htmlspecialchars($r[$label])."</option>\n";
}
else {
- echo "\t<option value=\"".$r['type']."\">".$r[$label]."</option>\n";
+ echo "\t<option value=\"".$r['type']."\">".htmlspecialchars($r[$label])."</option>\n";
}
}
- echo "</select>\n";
+ echo "\n</select>\n";
} // show_flagged_popup()
@@ -331,7 +331,7 @@ function show_genre_pulldown ($genre, $complete) {
$db_result = mysql_query($sql, $dbh);
- echo "<select name=\"genre[]\" MULTIPLE size=\"7\">\n";
+ echo "\n<select name=\"genre\" multiple=\"multiple\" size=\"7\">\n";
if ( ! $complete ) {
$genre_info = get_genre_info( -1 );
@@ -355,8 +355,8 @@ function show_genre_pulldown ($genre, $complete) {
echo " <option value=\"${r[0]}\">$genre_name - ($genre_count)</option>\n";
}
}
+ echo " </select>\n";
- echo "</select>";
} // show_genre_pulldown()
/*
@@ -373,7 +373,7 @@ function show_catalog_pulldown ($catalog, $complete) {
$db_result = mysql_query($sql, dbh());
- echo "<select name=\"catalog\">\n";
+ echo "\n<select name=\"catalog\">\n";
echo " <option value=\"-1\" selected=\"selected\">All</option>\n";
@@ -391,7 +391,7 @@ function show_catalog_pulldown ($catalog, $complete) {
echo " <option value=\"${r[0]}\">$catalog_name</option>\n";
}
}
- echo "</select>";
+ echo "\n</select>\n";
} // show_catalog_pulldown()
@@ -989,14 +989,14 @@ ECHO;
list($count) = mysql_fetch_row($count_result);
$class = flip_class();
echo " <tr class=\"$class\">\n";
- echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&action=view_list\">$plname</a></td>\n";
+ echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&amp;action=view_list\">$plname</a></td>\n";
echo " <td>$count</td>\n";
echo " <td>$plfullname</td>\n";
- echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&action=view_list\">" . _("View") . "</a></td>\n";
+ echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&amp;action=view_list\">" . _("View") . "</a></td>\n";
if ($user->id == $pluser->id || $user->access === 'admin') {
- echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&action=edit\">" . _("Edit") . "</a></td>\n";
- echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&action=delete_playlist\">" . _("Delete") . "</a></td>\n";
+ echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&amp;action=edit\">" . _("Edit") . "</a></td>\n";
+ echo " <td><a href=\"$web_path/playlist.php?playlist_id=$plid&amp;action=delete_playlist\">" . _("Delete") . "</a></td>\n";
}
else {
echo " <td>&nbsp;</td>\n";
@@ -1004,21 +1004,21 @@ ECHO;
}
if ( $count[0] ) {
- echo " <td><a href=\"$web_path/song.php?action=m3u&playlist_id=$plid\">" . _("Play") . "</a> | " .
- "<a href=\"$web_path/song.php?action=random&playlist_id=$plid\">" . _("Random") . "</a></td>\n";
+ echo " <td><a href=\"$web_path/song.php?action=m3u&amp;playlist_id=$plid\">" . _("Play") . "</a> | " .
+ "<a href=\"$web_path/song.php?action=random&amp;playlist_id=$plid\">" . _("Random") . "</a></td>\n";
}
else {
echo " <td>&nbsp;</td>\n";
}
if( batch_ok() ) {
- echo" <td><a href=\"$web_path/batch.php?action=pl&id=$plid\">" . _("Download") . "</a></td>\n";
+ echo" <td><a href=\"$web_path/batch.php?action=pl&amp;id=$plid\">" . _("Download") . "</a></td>\n";
} else {
echo" <td>&nbsp;</td>\n";
}
echo " </tr>\n";
}
- echo "</ul>\n";
+ echo "\n";
} //if rows in result
else {
echo " <tr class=\"even\">\n";
@@ -1027,7 +1027,7 @@ ECHO;
}
echo "</table>\n";
- echo "<br>\n";
+ echo "<br />\n";
}
@@ -1294,20 +1294,20 @@ function get_global_popular($type) {
$artist = $song->get_artist_name();
$text = "$artist - $song->title";
/* Add to array */
- $items[] = "<li> <a href=\"$web_path/song.php?action=m3u&song=$song->id\" title=\"$text\">" . truncate_with_ellipse($text, conf('ellipse_threshold_title')+3) . "&nbsp;($r->count)</a> </li>";
+ $items[] = "<li> <a href=\"$web_path/song.php?action=m3u&amp;song=$song->id\" title=\"". htmlspecialchars($text) ."\">" . htmlspecialchars(truncate_with_ellipse($text, conf('ellipse_threshold_title')+3)) . "&nbsp;($r->count)</a> </li>";
} // if it's a song
elseif ( $type == 'artist' ) {
$artist = get_artist_name($r->object_id);
if ($artist) {
- $items[] = "<li> <a href=\"$web_path/artists.php?action=show&amp;artist=$r->object_id\" title=\"$artist\">" . truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3) . "&nbsp;($r->count)</a> </li>";
+ $items[] = "<li> <a href=\"$web_path/artists.php?action=show&amp;artist=$r->object_id\" title=\"". htmlspecialchars($artist) ."\">" . htmlspecialchars(truncate_with_ellipse($artist, conf('ellipse_threshold_artist')+3)) . "&nbsp;($r->count)</a> </li>";
} // if no artist found
} // if type isn't artist
elseif ( $type == 'album' ) {
$album = new Album($r->object_id);
if ($album) {
- $items[] = "<li> <a href=\"$web_path/albums.php?action=show&amp;album=$r->object_id\" title=\"$album->name\">" . truncate_with_ellipse($album->name,conf('ellipse_threshold_album')+3) . "&nbsp;($r->count)</a> </li>";
+ $items[] = "<li> <a href=\"$web_path/albums.php?action=show&amp;album=$r->object_id\" title=\"". htmlspecialchars($album->name) ."\">" . htmlspecialchars(truncate_with_ellipse($album->name,conf('ellipse_threshold_album')+3)) . "&nbsp;($r->count)</a> </li>";
}
}
} // end while
@@ -1356,10 +1356,10 @@ function show_info_box ($title, $type, $items) {
if ($type == 'your_song') {
- echo "<td>$title - <a href=\"$web_path/song.php?action=m3u&your_popular_songs=$popular_threshold\">Play</a></td>\n";
+ echo "<td>$title - <a href=\"$web_path/song.php?action=m3u&amp;your_popular_songs=$popular_threshold\">Play</a></td>\n";
}
elseif ($type == 'song') {
- echo "<td>$title - <a href=\"$web_path/song.php?action=m3u&popular_songs=$popular_threshold\">Play</a></td>\n";
+ echo "<td>$title - <a href=\"$web_path/song.php?action=m3u&amp;popular_songs=$popular_threshold\">Play</a></td>\n";
}
else {
echo "<td>$title</td>\n";
diff --git a/playlist.php b/playlist.php
index f8a03f4a..34393f21 100644
--- a/playlist.php
+++ b/playlist.php
@@ -115,11 +115,11 @@ if ( isset($playlist_id) && ($playlist_id != 0) && $_REQUEST['action'] != 'delet
echo "&nbsp;&nbsp;&nbsp;" . _("owned by") . " $pluser->fullname ($pluser->username)<br />";
echo "<ul>";
if ($pluser->id == $user->id || $user->access === 'admin') {
- echo "<li><a href=\"" . conf('web_path') . "/playlist.php?action=edit&playlist_id=$playlist->id\">" . _("Edit Playlist") . "</a></li>\n";
+ echo "<li><a href=\"" . conf('web_path') . "/playlist.php?action=edit&amp;playlist_id=$playlist->id\">" . _("Edit Playlist") . "</a></li>\n";
}
if (count($playlist->get_songs()) > 0) {
- echo "<li><a href=\"" . conf('web_path') . "/song.php?action=m3u&playlist_id=$playlist->id\">" . _("Play Full Playlist") . "</a></li>\n";
- echo "<li><a href=\"" . conf('web_path') . "/song.php?action=random&playlist_id=$playlist->id\">" . _("Play Random") . "</a></li>\n";
+ echo "<li><a href=\"" . conf('web_path') . "/song.php?action=m3u&amp;playlist_id=$playlist->id\">" . _("Play Full Playlist") . "</a></li>\n";
+ echo "<li><a href=\"" . conf('web_path') . "/song.php?action=random&amp;playlist_id=$playlist->id\">" . _("Play Random") . "</a></li>\n";
}
echo "</ul>";
echo "</div>";
@@ -167,7 +167,7 @@ switch($action) {
else {
show_confirm_action("Are you sure you want to delete '$playlist->name' playlist?",
"playlist.php",
- "action=delete_playlist&playlist_id=$playlist_id");
+ "action=delete_playlist&amp;playlist_id=$playlist_id");
}
break;
diff --git a/preferences.php b/preferences.php
index f1974efa..77e03d89 100644
--- a/preferences.php
+++ b/preferences.php
@@ -69,3 +69,5 @@ require (conf('prefix') . "/templates/show_preferences.inc");
// FOOTER
show_page_footer ('Preferences', '',$user->prefs['display_menu']);
?>
+</body>
+</html>
diff --git a/templates/admin_menu.inc b/templates/admin_menu.inc
index 0d875e70..9b14f238 100644
--- a/templates/admin_menu.inc
+++ b/templates/admin_menu.inc
@@ -52,3 +52,4 @@ $items = array(
?>
</ul>
+<br /> \ No newline at end of file
diff --git a/templates/header.inc b/templates/header.inc
index a6610532..04efb4fc 100644
--- a/templates/header.inc
+++ b/templates/header.inc
@@ -27,7 +27,7 @@ $htmllang = str_replace("_","-",conf('lang'));
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html lang="<?php echo $htmllang; ?>">
<head>
-<link rel="shortcut icon" href="<?php echo conf('web_path'); ?>/favicon.ico">
+<link rel="shortcut icon" href="<?php echo conf('web_path'); ?>/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo conf('site_charset'); ?>" />
<?php show_template('style'); ?>
<title><?php echo conf('site_title'); ?></title>
diff --git a/templates/list_duplicates.inc b/templates/list_duplicates.inc
index ec1a8632..d86df351 100644
--- a/templates/list_duplicates.inc
+++ b/templates/list_duplicates.inc
@@ -30,10 +30,10 @@
<?php show_duplicate_searchbox($search_type) ?>
<?php if ( $flags ) { ?>
-</form>
+
<form method="post" enctype="multipart/form-data" action="<?php echo conf('web_path') . "/admin/song.php?action=disable"; ?>">
<p style="font-size: 10pt; font-weight: bold;">Duplicate Songs</p>
-<table class="tabledata" cellspacing="0" cellpadding="0" border="1">
+<table class="tabledata" cellspacing="0" cellpadding="0" >
<tr class="table-header">
<td>Disable</td>
<td>Song</td>
@@ -60,8 +60,8 @@
foreach ($dinfolist as $dinfo)
{
echo "<tr class=\"".$class."\">".
- "<td><input type=\"checkbox\" name=\"song_ids[]\" value=\"" . $dinfo['songid'] . "\">".
- "<td><a href=\"".conf('web_path')."/song.php?action=m3u&song=$song->id\">$formated_title</td>".
+ "<td><input type=\"checkbox\" name=\"song_ids[]\" value=\"" . $dinfo['songid'] . "\" />".
+ "<td><a href=\"".conf('web_path')."/song.php?action=m3u&amp;song=$song->id\">$formated_title</td>".
"<td><a href=\"".conf('web_path')."/artists.php?action=show&amp;artist=".$dinfo['artistid']."\" title=\"".$dinfo['artist']."\">".$dinfo['artist']."</a> </td>".
"<td><a href=\"".conf('web_path')."/albums.php?action=show&amp;album=".$dinfo['albumid']."\" title=\"".$dinfo['album']."\">".$dinfo['album']."</a> </td>".
"<td>".floor($dinfo['time']/60).":".sprintf("%02d", ($dinfo['time']%60) )."</td>".
@@ -82,6 +82,6 @@
<?php } else { ?>
<p> You don't have any duplicate songs. </p>
-
+</form>
<?php } ?>
diff --git a/templates/list_flagged.inc b/templates/list_flagged.inc
index 607206b5..2a09e7e1 100644
--- a/templates/list_flagged.inc
+++ b/templates/list_flagged.inc
@@ -33,7 +33,7 @@
this list to determine what songs you need to re-rip or tags you need to update.</p>
<?php if ( $flags ) { ?>
-<form name="songs" action="<?php echo $_SERVER['PHP_SELF'];; ?>" method="post">
+<form name="songs" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table class="tabledata" cellspacing="0" cellpadding="0" border="1">
<tr class="table-header">
diff --git a/templates/menu.inc b/templates/menu.inc
index 5ca40c9e..ce5608f9 100644
--- a/templates/menu.inc
+++ b/templates/menu.inc
@@ -81,9 +81,9 @@ if ($GLOBALS['user']->prefs['upload']) {
} // else
} // if use_auth
elseif ( $GLOBALS['user']->id != '0') {
- print("\t\t<li bgcolor=\"" . conf('primary_color') . "\" align=\"center\">".
- "<a href=\"".conf('web_path')."/logout.php\">" . _("Logout") . "</a> </li>\n");
+ print("\t\t<li><a href=\"".conf('web_path')."/logout.php\">" . _("Logout") . "</a> </li>\n");
} // else no user
?>
</ul>
+<br /> \ No newline at end of file
diff --git a/templates/show_add_access.inc b/templates/show_add_access.inc
index 89ea79e5..2d9f1074 100644
--- a/templates/show_add_access.inc
+++ b/templates/show_add_access.inc
@@ -32,33 +32,33 @@
<p><?php print _("Use the form below to add a host that you want to have access to your Ampache catalog."); ?></p>
-<p>
+
<form name="update_catalog" method="post" enctype="multipart/form-data" action="<?= conf('web_path'); ?>/admin/access.php">
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td><?php print _("Name"); ?>: </td>
<td>
- <input type="text" name="name" value="<?= $_REQUEST['name']; ?>" size="30">
+ <input type="text" name="name" value="<?= $_REQUEST['name']; ?>" size="30" />
</td>
</tr>
<tr>
<td><?php print _("Start IP Address"); ?>:</td>
<td>
- <input type="text" name="start" value="<?= $_REQUEST['start']; ?>" size="20" maxlength="15">
+ <input type="text" name="start" value="<?= $_REQUEST['start']; ?>" size="20" maxlength="15" />
</td>
</tr>
<tr>
<td><?php print _("End IP Address"); ?>:</td>
<td>
- <input type="text" name="end" value="<?= $_REQUEST['end']; ?>" size="20" maxlength="15">
+ <input type="text" name="end" value="<?= $_REQUEST['end']; ?>" size="20" maxlength="15" />
</td>
</tr>
<tr>
<td><?php print _("Level"); ?>:</td>
<td>
<select name="level">
- <option value="5" SELECTED>Demo</option>
+ <option selected="selected" value="5" >Demo</option>
<option value="25">Stream</option>
<option value="50">Stream/Download</option>
<option value="75">XML-RPC</option>
@@ -68,8 +68,8 @@
<tr>
<td>&nbsp;</td>
<td>
- <input type="hidden" name="action" value="add_host">
- <input type="submit" value="<?php print _("Add Host"); ?>">
+ <input type="hidden" name="action" value="add_host" />
+ <input type="submit" value="<?php print _("Add Host"); ?>" />
</td>
</tr>
</table>
diff --git a/templates/show_admin_index.inc b/templates/show_admin_index.inc
index edf39b5b..e5fa6a9c 100644
--- a/templates/show_admin_index.inc
+++ b/templates/show_admin_index.inc
@@ -25,11 +25,11 @@
*/
?>
<p><font size="+1"><?php print _("Admin Section"); ?>:</font></p>
-<dl>
+<ul>
<li><a href="<?php echo conf('web_path'); ?>/admin/users.php"><?php print _("Users"); ?></a> - <?php print _("Create/Modify User Accounts for Ampache"); ?></li>
<li><a href="<?php echo conf('web_path'); ?>/admin/mail.php"><?php print _("Mail"); ?></a> - <?php print _("Mail your users to notfiy them of changes"); ?></li>
<li><a href="<?php echo conf('web_path'); ?>/admin/catalog.php"><?php print _("Catalog"); ?></a> - <?php print _("Create/Update/Clean your catalog here"); ?></li>
<li><a href="<?php echo conf('web_path'); ?>/admin/preferences.php"><?php print _("Admin Preferences"); ?></a> - <?php print _("Modify Site-wide preferences"); ?></li>
<li><a href="<?php echo conf('web_path'); ?>/admin/access.php"><?php print _("Access Lists"); ?></a> - <?php print _("Modify Access List Permissions"); ?> (<?php print _("Must have access_control=true in ampache.cfg") ?>)</li>
-</dl>
+</ul>
diff --git a/templates/show_album.inc b/templates/show_album.inc
index e5934c05..425aacff 100644
--- a/templates/show_album.inc
+++ b/templates/show_album.inc
@@ -34,8 +34,8 @@ $user = new User($_SESSION['userdata']['username']);
<table class="border" cellspacing="1" cellpadding="3" border="0">
<tr class="table-header">
<td colspan="2">
- <font size="+1"><?php echo $album->name; ; ?> --
- <?php echo $album->f_artist; ; ?></font>
+ <font size="+1"><?php echo htmlspecialchars($album->name); ?> --
+ <?php echo $album->f_artist; ?></font>
</td>
</tr>
<tr class="even">
@@ -43,22 +43,22 @@ $user = new User($_SESSION['userdata']['username']);
<?php
if ($album_name != "Unknown (Orphaned)") {
echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "\">";
- echo "<img border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "\" alt=\"Album Art\" height=\"128\">";
+ echo "<img border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $album->id . "\" alt=\"Album Art\" height=\"128\" />";
echo "</a>\n";
}
?>
</td>
<td valign="top">
<b>Actions:</b><br />
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/song.php?action=m3u&album=<?php echo $album->id; ; ?>"><?php echo _("Play Album"); ; ?></a><br />
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/song.php?action=m3u&album_random=<?php echo $album->id; ; ?>"><?php echo _("Play Random from Album"); ; ?></a><br />
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=clear_art&album_id=<?php echo $album->id; ; ?>"><?php echo _("Reset Album Art"); ; ?></a><br />
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=find_art&album_id=<?php echo $album->id; ; ?>"><?php echo _("Find Album Art"); ; ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/song.php?action=m3u&amp;album=<?php echo $album->id; ; ?>"><?php echo _("Play Album"); ; ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/song.php?action=m3u&amp;album_random=<?php echo $album->id; ; ?>"><?php echo _("Play Random from Album"); ; ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=clear_art&amp;album_id=<?php echo $album->id; ; ?>"><?php echo _("Reset Album Art"); ; ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=find_art&amp;album_id=<?php echo $album->id; ; ?>"><?php echo _("Find Album Art"); ; ?></a><br />
<?php if ($user->has_access('100') || !conf('use_auth')) { ?>
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=update_from_tags&album_id=<?php echo $album->id; ; ?>"><?php echo _("Update from tags"); ; ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/albums.php?action=update_from_tags&amp;album_id=<?php echo $album->id; ; ?>"><?php echo _("Update from tags"); ; ?></a><br />
<?php } ?>
<?php if( batch_ok() ) { ?>
- &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/batch.php?action=alb&id=<?php echo $album->id; ; ?>"><?php echo _("Download"); ?></a><br />
+ &nbsp;&nbsp;<a href="<?php echo conf('web_path'); ; ?>/batch.php?action=alb&amp;id=<?php echo $album->id; ; ?>"><?php echo _("Download"); ?></a><br />
<?php } ?>
</td>
diff --git a/templates/show_albums.inc b/templates/show_albums.inc
index 24cc4497..9a259e3d 100644
--- a/templates/show_albums.inc
+++ b/templates/show_albums.inc
@@ -40,7 +40,7 @@ $total_items = $view->total_items;
<td> <?php echo _("Artist"); ?> </td>
<td> <?php echo _("Songs"); ?> </td>
<td>
- <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=album.year&amp;sort_order=0"><?php echo _("Year"); ?></>
+ <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=album.year&amp;sort_order=0"><?php echo _("Year"); ?></a>
</td>
<td> <?php echo _("Action"); ?> </td>
@@ -54,11 +54,11 @@ foreach ($albums as $album) {
<td><?php echo $album->f_artist; ?></td>
<td><?php echo $album->songs; ?></td>
<td><?php echo $album->year; ?></td>
- <td nowrap> <?php echo _("Play"); ?> :
- <a href="<?php echo conf('web_path'); ?>/song.php?action=m3u&album=<?php echo $album->id; ?>"><?php echo _("All"); ?></a> |
- <a href="<?php echo conf('web_path'); ?>/song.php?action=m3u&album_random=<?php echo $album->id; ?>"><?php echo _("Random"); ?></a>
+ <td nowrap="nowrap"> <?php echo _("Play"); ?> :
+ <a href="<?php echo conf('web_path'); ?>/song.php?action=m3u&amp;album=<?php echo $album->id; ?>"><?php echo _("All"); ?></a> |
+ <a href="<?php echo conf('web_path'); ?>/song.php?action=m3u&amp;album_random=<?php echo $album->id; ?>"><?php echo _("Random"); ?></a>
<?php if( batch_ok() ) { ?>
- | <a href="<?php echo conf('web_path'); ?>/batch.php?action=alb&id=<?php echo $album->id; ?>"><?php echo _("Download"); ?></a>
+ | <a href="<?php echo conf('web_path'); ?>/batch.php?action=alb&amp;id=<?php echo $album->id; ?>"><?php echo _("Download"); ?></a>
<?php } ?>
</td>
</tr>
@@ -69,7 +69,9 @@ foreach ($albums as $album) {
</td>
<td> <?php echo _("Artist"); ?> </td>
<td> <?php echo _("Songs"); ?> </td>
- <td> <?php echo _("Year"); ?> </td>
+ <td>
+ <a href="<?php echo conf('web_path'); ?>/<?php echo $_SESSION['view_script']; ?>?action=<?php echo $_REQUEST['action']; ?>&amp;keep_view=true&amp;sort_type=album.year&amp;sort_order=0"><?php echo _("Year"); ?></a>
+ </td>
<td> <?php echo _("Action"); ?> </td>
</tr>
diff --git a/templates/show_artist.inc b/templates/show_artist.inc
index aab2f48b..6d8570c8 100644
--- a/templates/show_artist.inc
+++ b/templates/show_artist.inc
@@ -30,11 +30,11 @@ $artist_id = $artist->id;
<td>
<span class="header1"><?php print _("Albums by") . " " . $artist->full_name; ?></span>
<ul>
- <li><a href="<?php print $web_path; ?>/artists.php?action=show_all_songs&artist=<?php print $artist_id; ?>"><?php print _("Show All Songs By") . " " . $artist->full_name; ?></a></li>
- <li><a href="<?php print $web_path; ?>/song.php?action=m3u&artist=<?php print $artist_id; ?>"><?php print _("Play All Songs By") . " " . $artist->full_name; ?></a></li>
- <li><a href="<?php print $web_path; ?>/song.php?action=m3u&artist_random=<?php print $artist_id; ?>"><?php print _("Play Random Songs By") . " " . $artist->full_name; ?></a></li>
+ <li><a href="<?php print $web_path; ?>/artists.php?action=show_all_songs&amp;artist=<?php print $artist_id; ?>"><?php print _("Show All Songs By") . " " . $artist->full_name; ?></a></li>
+ <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist=<?php print $artist_id; ?>"><?php print _("Play All Songs By") . " " . $artist->full_name; ?></a></li>
+ <li><a href="<?php print $web_path; ?>/song.php?action=m3u&amp;artist_random=<?php print $artist_id; ?>"><?php print _("Play Random Songs By") . " " . $artist->full_name; ?></a></li>
<?php if ($user->has_access('100')) { ?>
- <li><a href="<?php print $web_path; ?>/artists.php?action=update_from_tags&artist=<?php print $artist_id; ?>"><?php print _("Update from tags"); ?></a></li>
+ <li><a href="<?php print $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php print $artist_id; ?>"><?php print _("Update from tags"); ?></a></li>
<?php } ?>
</ul>
</td>
diff --git a/templates/show_artists.inc b/templates/show_artists.inc
index 068f1655..5641c101 100644
--- a/templates/show_artists.inc
+++ b/templates/show_artists.inc
@@ -51,9 +51,9 @@ foreach ($artists as $artist) {
<td><?php print $artist['name']; ?></td>
<td><?php print $artist['songs']; ?></td>
<td><?php print $artist['albums']; ?></td>
- <td nowrap> <?php print _("Play"); ?> :
- <a href="<?php print conf('web_path'); ?>/song.php?action=m3u&artist=<?php print $artist['id']; ?>"><?php print _("All"); ?></a> |
- <a href="<?php print conf('web_path'); ?>/song.php?action=m3u&artist_random=<?php print $artist['id']; ?>"><?php print _("Random"); ?></a>
+ <td nowrap="nowrap"> <?php print _("Play"); ?> :
+ <a href="<?php print conf('web_path'); ?>/song.php?action=m3u&amp;artist=<?php print $artist['id']; ?>"><?php print _("All"); ?></a> |
+ <a href="<?php print conf('web_path'); ?>/song.php?action=m3u&amp;artist_random=<?php print $artist['id']; ?>"><?php print _("Random"); ?></a>
</td>
</tr>
<?php } ?>
diff --git a/templates/show_box.inc b/templates/show_box.inc
index c3c1dfa3..ea071e93 100644
--- a/templates/show_box.inc
+++ b/templates/show_box.inc
@@ -27,8 +27,8 @@
?>
-<table class="border" cellspacing=1 cellpadding=3>
- <tr align=center>
+<table class="border" cellspacing="1" cellpadding="3">
+ <tr align="center">
<td background="<?= conf('web_path'); ?>/images/ampache-light-bg.gif" bgcolor="#c0c0c0"><?= $title ?></td>
</tr>
<tr>
diff --git a/templates/show_import_playlist.inc.php b/templates/show_import_playlist.inc.php
index b8ea3a94..3ea6c8fb 100644
--- a/templates/show_import_playlist.inc.php
+++ b/templates/show_import_playlist.inc.php
@@ -29,7 +29,7 @@
<?php echo _("Filename"); ?>:
<?php $GLOBALS['error']->print_error('filename'); ?>
</td>
- <td><input type="textbox" name="filename" value="<?php echo $_REQUEST['filename']; ?>" size="45" /></td>
+ <td><input type="text" name="filename" value="<?php echo $_REQUEST['filename']; ?>" size="45" /></td>
</tr>
<tr class="<?php echo flip_class(); ?>">
<td>
@@ -37,7 +37,7 @@
</td>
<td>
<select name="playlist_type">
- <option name="m3u">M3U</option>
+ <option value="m3u">M3U</option>
<!-- <option name="pls">PLS</option> -->
</select>
</td>
diff --git a/templates/show_mpdplay.inc b/templates/show_mpdplay.inc
index a6e90b1f..aa390067 100644
--- a/templates/show_mpdplay.inc
+++ b/templates/show_mpdplay.inc
@@ -32,7 +32,7 @@ $web_path = conf('web_path');
<tr class="table-header">
<td colspan="2"><?php echo _("MPD Play Control"); ?></td>
</tr>
-<tr class="even"><td>
+<tr class="even"> <td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
@@ -81,8 +81,8 @@ $web_path = conf('web_path');
</td>
</tr>
</table>
-</tr>
- </td>
+</td>
+ </tr>
<?php if ( $myMpd->state == MPD_STATE_PLAYING or $myMpd->state == MPD_STATE_PAUSED ) { ?>
<tr><td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
@@ -100,14 +100,14 @@ $web_path = conf('web_path');
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
- <td align="center">[ <a title="<?php echo _("Refresh the Playlist Window"); ?>" href="<?php echo conf('web_path'); ?>"><?php echo _("refresh now"); ?></a> ]</td>
+ <td align="center">[ <a title="<?php echo _("Refresh the Playlist Window"); ?>" href="<?php echo conf('web_path'); if ($GLOBALS['user']->prefs['play_type'] == 'mpd' && conf('localplay_menu')) {echo "/mpd.php";} ?>"><?php echo _("refresh now"); ?></a> ]</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
-<table border="0" cellpadding="0" cellspacing="0" WIDTH=<?php echo $PG_WIDTH ?>>
+<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td align="center"><b><?php echo _("Server Playlist"); ?></b></td></tr>
<tr><td>
<?php
@@ -130,8 +130,8 @@ $web_path = conf('web_path');
$song_name = truncate_with_ellipse($entry['Artist'],conf('ellipse_threshold_artist')-3) . " - " . truncate_with_ellipse($entry['Title'],conf('ellipse_threshold_title')-3);
echo "\t";
- echo "<a title=\"Click to remove'".$entry['Title']." '\" href=\"".conf('web_path')."/amp-mpd.php?action=rem&id=".$id."\">[" . $track . "]</a>";
- echo " <a title=\"Click to jump to '".$entry['Title']."'\" href='".conf('web_path')."/amp-mpd.php?action=skipto&val=".$id."'>$song_name</a>";
+ echo " <a title=\"Click to remove ".htmlspecialchars($entry['Title'])."\" href=\"".conf('web_path')."/amp-mpd.php?action=rem&amp;id=".$id."\">[" . $track . "]</a>";
+ echo " <a title=\"Click to jump to ".htmlspecialchars($entry['Title'])."\" href=\"".conf('web_path')."/amp-mpd.php?action=skipto&amp;val=".$id."\">$song_name</a>";
echo "<br />\n";
}
}
@@ -141,8 +141,8 @@ $web_path = conf('web_path');
?>
</td></tr>
<?php if ( $myMpd->playlist_count > 0 ) { ?>
-<tr height="20">
- <td align="center">
+<tr>
+ <td align="center" height="20">
[<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 the clear the playlist"); ?>" href="<?php echo conf('web_path'); ?>/amp-mpd.php?action=clear"><?php echo _("clear"); ?></a>]
</td>
diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc
index 875b1771..c4c39be2 100644
--- a/templates/show_now_playing.inc
+++ b/templates/show_now_playing.inc
@@ -43,13 +43,13 @@
if (conf('use_auth')) {
echo "\t<td valign=\"center\">$np_user->fullname</td>\n";
}
- echo "\t<td><a title=\"$song->title\" href=\"$web_path/song.php?action=m3u&song=$song->id\">$text</a></td>\n";
- echo "\t<td><a title=\"$song->f_artist\" href=\"$web_path/artists.php?action=show&artist=$song->artist\">$song->f_artist</a> / ";
- echo "\t<a title=\"$album\" href=\"$web_path/albums.php?action=show&album=$song->album\">$song->f_album</a></td>";
+ echo "\t<td><a title=\"" . htmlspecialchars($song->title) . "\" href=\"$web_path/song.php?action=m3u&amp;song=$song->id\">$text</a></td>\n";
+ echo "\t<td><a title=\"" . htmlspecialchars($song->f_artist) . "\" href=\"$web_path/artists.php?action=show&amp;artist=$song->artist\">$song->f_artist</a> / ";
+ echo "\t<a title=\"" . htmlspecialchars($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\">";
echo "<a target=\"_blank\" href=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "\">";
- echo "<img align=\"center\" border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;fast=1\" alt=\"Album Art\" height=\"75\">";
+ echo "<img align=\"middle\" border=\"0\" src=\"" . conf('web_path') . "/albumart.php?id=" . $song->album . "&amp;fast=1\" alt=\"Album Art\" height=\"75\" />";
echo "</a>\n";
echo "\t</td>\n";
echo "</tr>\n";
@@ -60,6 +60,5 @@
} // if it's a song
} // while we're getting songs
?>
- </tr>
</table>
<? } ?>
diff --git a/templates/show_play_selected.inc.php b/templates/show_play_selected.inc.php
index 7c3107fb..38d4c62d 100644
--- a/templates/show_play_selected.inc.php
+++ b/templates/show_play_selected.inc.php
@@ -20,7 +20,7 @@
*/
?>
-<script language=javascript>
+<script type="text/javascript" language="javascript">
<!--
function ToPlaylist(action)
{
diff --git a/templates/show_preferences.inc b/templates/show_preferences.inc
index 35982178..b4a83176 100644
--- a/templates/show_preferences.inc
+++ b/templates/show_preferences.inc
@@ -30,7 +30,7 @@
<div class="header1">
<?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?>
<?php if ($user->has_access(100)) { ?>
- [<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>]
+ [<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>]
<? } ?>
</div>
<form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data">
@@ -64,9 +64,9 @@
<tr>
<td><?php create_preference_input($pref->name,$pref->value); ?></td>
<?php if(preg_match('/Color/',$pref->description)) { ?>
- <td><table width="40" height="20" border=3 bgcolor="<?php echo $pref->value;?>"><tr><td></td></tr></table></td>
+ <td><table width="40" height="20" border="3" bgcolor="<?php echo $pref->value;?>"><tr><td></td></tr></table></td>
<?php } else { ?>
- <td><table></table></td>
+ <td></td>
<?php } ?>
</tr>
</table>
diff --git a/templates/show_search.inc b/templates/show_search.inc
index 78433854..0e4d3532 100644
--- a/templates/show_search.inc
+++ b/templates/show_search.inc
@@ -40,7 +40,7 @@
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Object Type"); ?>:</td>
<td>
- <?php
+ <?php
$search_type = $_REQUEST['search_field'];
if (isset($_REQUEST['search_field'])) {
$search_field = $_REQUEST['search_field'];
@@ -59,22 +59,22 @@
}
?>
<select name="search_field">
- <option value="artist" <?php if ($artist) { echo "SELECTED"; } ?>>Artist</option>
- <option value="album" <?php if ($album) { echo "SELECTED"; } ?>>Album</option>
- <option value="song_title" <?php if ($song_title) { echo "SELECTED"; } ?>>Song Title</option>
- <option value="song_genre" <?php if ($song_genre) { echo "SELECTED"; } ?>>Song Genre</option>
- <option value="song_year" <?php if ($song_year) { echo "SELECTED"; } ?>>Song Year</option>
- <option value="song_bitrate" <?php if ($song_bitrate) { echo "SELECTED"; } ?>>Song Bitrate</option>
- <option value="song_min_bitrate" <?php if ($song_min_bitrate) { echo "SELECTED"; } ?>>Minimum Bitrate</option>
- <option value="song_filename" <?php if ($song_filename) { echo "SELECTED"; } ?>>Song Filename</option>
+ <option <?php if ($artist) { echo "selected=\"selected\""; } ?> value="artist" > Artist</option>
+ <option <?php if ($album) { echo "selected=\"selected\""; } ?> value="album" > Album</option>
+ <option <?php if ($song_title) { echo "selected=\"selected\""; } ?> value="song_title" > Song Title</option>
+ <option <?php if ($song_genre) { echo "selected=\"selected\""; } ?> value="song_genre" > Song Genre</option>
+ <option <?php if ($song_year) { echo "selected=\"selected\""; } ?> value="song_year" > Song Year</option>
+ <option <?php if ($song_bitrate) { echo "selected=\"selected\""; } ?> value="song_bitrate" > Song Bitrate</option>
+ <option <?php if ($song_min_bitrate) { echo "selected=\"selected\""; } ?> value="song_min_bitrate" > Minimum Bitrate</option>
+ <option <?php if ($song_filename) { echo "selected=\"selected\""; } ?> value="song_filename" > Song Filename</option>
</select>
</td>
</tr>
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Search Type"); ?>:</td>
<td>
- <input type="radio" name="search_type" value="exact" <?php if ($_REQUEST['search_type'] === 'exact') { echo "CHECKED"; } ?>>Exact<br />
- <input type="radio" name="search_type" value="fuzzy" <?php if ($_REQUEST['search_type'] !== 'exact') { echo "CHECKED"; } ?>>Fuzzy<br />
+ <input type="radio" name="search_type" value="exact" <?php if ($_REQUEST['search_type'] === 'exact') { echo "checked=\"checked\"";}?> /> Exact<br />
+ <input type="radio" name="search_type" value="fuzzy" <?php if ($_REQUEST['search_type'] !== 'exact') { echo "checked=\"checked\"";}?> /> Fuzzy<br />
</td>
</tr>
<tr class="<?php echo flip_class(); ?>">
diff --git a/templates/show_songs.inc b/templates/show_songs.inc
index 13819f3e..447956e8 100644
--- a/templates/show_songs.inc
+++ b/templates/show_songs.inc
@@ -23,7 +23,7 @@ $web_path = conf('web_path');
?>
-<form name="songs" method="post" enctype="multipart/form-data">
+<form name="songs" method="post" enctype="multipart/form-data" action="">
<table border="0">
<tr><td colspan="2">
<table class="border" cellspacing="0" cellpadding="0" border="0">
@@ -33,7 +33,7 @@ $web_path = conf('web_path');
<th><?php echo _("Song title"); ?></th>
<th><?php echo _("Artist"); ?></th>
<th><?php echo _("Album"); ?></th>
- <th><?php echo _("Track"); ?></td>
+ <th><?php echo _("Track"); ?></th>
<th><?php echo _("Time"); ?></th>
<th><?php echo _("Size"); ?></th>
<th><?php echo _("Bitrate"); ?></th>
@@ -69,13 +69,13 @@ $web_path = conf('web_path');
}
?>
<td>
- <a href="<?php echo $web_path; ?>/song.php?action=m3u&song=<?php echo $song->id; ?>" title="<?php echo $song->title; ?>" <?php echo $text_class; ?>> <?php echo $song->f_title; ?> </a>
+ <a href="<?php echo $web_path; ?>/song.php?action=m3u&amp;song=<?php echo $song->id; ?>" title="<?php echo htmlspecialchars($song->title); ?>" <?php echo $text_class; ?>> <?php echo htmlspecialchars($song->f_title); ?> </a>
</td>
<td>
- <a href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo $song->artist; ?>" title="<?php echo $song->f_artist_full; ?>" <?php echo $text_class; ?>> <?php echo $song->f_artist; ?> </a>
+ <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 $song->album; ?>" title="<?php echo $song->f_album_full; ?>" <?php echo $text_class; ?>> <?php echo $song->f_album; ?> </a>
+ <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; ?>
@@ -83,7 +83,7 @@ $web_path = conf('web_path');
<td align="right">
<?php echo $song->f_time; ?>
</td>
- <td align="right" nowrap>
+ <td align="right" nowrap="nowrap">
<?php echo $song->f_size; ?> MB
</td>
<td align="right">
@@ -99,9 +99,9 @@ $web_path = conf('web_path');
<?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->status === 'enabled') { ?>
- <a href="<?php echo $web_path; ?>/admin/song.php?action=disable&song_ids=<?php echo $song->id; ?>">Disable</a>
+ <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&song_ids=<?php echo $song->id; ?>">Enable</a>
+ <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>
@@ -110,10 +110,8 @@ $web_path = conf('web_path');
| <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; ?>&uid=<?php echo $user->id . "&sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>">
- <?php echo _("Direct Link"); ?>
+ | <a href="<?php echo $web_path; ?>/play/index.php?song=<?php echo $song->id; ?>&amp;uid=<?php echo $user->id . "&amp;sid=" . session_id(); ?>&amp;fn=<?php echo rawurlencode($song->f_artist_full . " - " . $song->title . "." . $song->type); ?>"><?php echo _("Direct Link"); ?></a>
<?php } ?>
- </a>
</td>
</tr>
<?
@@ -131,11 +129,11 @@ $web_path = conf('web_path');
<td></td>
<?php if (isset($playlist_id) && $playlist_id != 0 && ($user->id == $pluser->id || $user->access === 'admin')) { ?> <td></td> <?php } ?>
<td><?php echo _("Total"); ?>:</td>
- <td nowrap><?php echo $num; ?> song(s)</td>
+ <td nowrap="nowrap"><?php echo $num; ?> song(s)</td>
<td></td>
<td></td>
- <td align="right" nowrap><?php echo $time; ?></td>
- <td align="right" nowrap><?php echo $megs; ?> MB</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>
diff --git a/templates/show_users.inc b/templates/show_users.inc
index 3822947d..3108b079 100644
--- a/templates/show_users.inc
+++ b/templates/show_users.inc
@@ -39,7 +39,7 @@ $admin_menu = "admin/";
<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">
<b><?php echo _("Username"); ?></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=fullname&amp;sort_order=0"
+ <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">
<b>(<?php echo _("Fullname"); ?>)</b>
</a>
</td>
@@ -123,8 +123,7 @@ while ( $results = mysql_fetch_object($db_result) ) {
else {
echo "<td bgcolor=\"red\"> &nbsp; </td>";
}
-} // end while
?>
- </td>
</tr>
+<?php } ?>
</table>
diff --git a/templates/song_edit.inc b/templates/song_edit.inc
index c4eab4a7..f3becdea 100644
--- a/templates/song_edit.inc
+++ b/templates/song_edit.inc
@@ -24,61 +24,63 @@ $filename = htmlspecialchars($short[1]);
$target = conf('web_path').'/admin/flags.php';
?>
-<form name="update_song" method="post" action="<?= $target; ?>">
+<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"><?= $filename; ?></td>
+ <td colspan="2"><?php echo $filename; ?></td>
</tr>
+
<tr>
<td>Title:</td>
- <td><input type="text" name="title" size="60" value="<?= $song->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=""></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=""></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="<?=$song->track?>"></input></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($song->genre, 1); ?>
+ <td> <?php show_genre_pulldown($song->genre, 1); ?> </td>
+ </tr>
+
<tr>
- <td>Year</td>
- <td><input type="text" size="4" maxlength="4" name="year" value="<?=$song->year?>"></input></td>
+ <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> <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="<?=$song->id?>">
- <input type=hidden name="flag" value="<?=$flagid?>">
- <input type=hidden name="current_artist_id" value="<?=$song->artist?>">
+ <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="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"> </td>
+ <input type="submit" name="action" value="Done"></input></td>
<?php } ?>
</tr>
</table>
diff --git a/templates/tool_box.inc b/templates/tool_box.inc
index a81e6b15..36df59c4 100644
--- a/templates/tool_box.inc
+++ b/templates/tool_box.inc
@@ -27,8 +27,8 @@
?>
-<table class="border" cellspacing=1 cellpadding=3>
- <tr class="table-header" align=center>
+<table class="border" cellspacing="1" cellpadding="3">
+ <tr class="table-header" align="center">
<td><?php echo $title; ?></td>
</tr>
<tr>