summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-12 07:16:40 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-12 07:16:40 +0000
commitc837dd5752ec436333fe246ce88a90ccfe6eae93 (patch)
tree0c32b7ef31d251d965843d83641d808a81a9deb9 /templates
parent2c4d64602dd0dbfdefccb116d0d4fb4e49ff7488 (diff)
downloadampache-c837dd5752ec436333fe246ce88a90ccfe6eae93.tar.gz
ampache-c837dd5752ec436333fe246ce88a90ccfe6eae93.tar.bz2
ampache-c837dd5752ec436333fe246ce88a90ccfe6eae93.zip
more mpd fixes and xmlrpc fixes and simplified chinese
Diffstat (limited to 'templates')
-rw-r--r--templates/show_mpdpl.inc20
-rw-r--r--templates/show_mpdplay.inc24
2 files changed, 35 insertions, 9 deletions
diff --git a/templates/show_mpdpl.inc b/templates/show_mpdpl.inc
index 71ef575b..ff8cede1 100644
--- a/templates/show_mpdpl.inc
+++ b/templates/show_mpdpl.inc
@@ -56,8 +56,8 @@ $minpad = "style='padding: 0px 2px 0px 2px'";
<form action="<?php echo conf('web_path')."/amp-mpd.php"; ?>" method="post" enctype="multipart/form-data">
-<table class="border" border="0" cellpadding="0" cellspacing="1" width="100%">
-<tr><td align="center" class="headrow"><b>MPD Server Playlist</b><br />
+<table class="border" border="0" cellpadding="0" cellspacing="1" width="100%" class="tabledata">
+<tr><td align="center" class="table-header"><b>MPD Server Playlist</b><br />
<i>[<a title="<?php echo _("Refresh the Playlist Window"); ?>" href="<?php echo conf('web_path'); ?>">refresh</a>]
<?php if ( $myMpd->playlist_count > 0 ) {
$un = (conf('condPL')) ? "un" : ""; ?>
@@ -114,10 +114,18 @@ $minpad = "style='padding: 0px 2px 0px 2px'";
else {$tdstyle = $minpad;} ?>
<?php
$mpddir = conf('mpd_dir')."/";
-$sql = "SELECT genre.name, song.genre, song.id, song.album, song.artist FROM song, genre WHERE file = \"".$mpddir.$entry['file']."\" AND song.genre=genre.id";
-$db_results = @mysql_query($sql,dbh());
-$count=0;
-$r = @mysql_fetch_object ($db_results);
+if ($entry['Title']) {
+ $sql = "SELECT genre.name, song.genre, song.id, song.album, song.artist FROM song, genre WHERE file = \"".$mpddir.$entry['file']."\" AND song.genre=genre.id";
+ $db_results = @mysql_query($sql,dbh());
+ $r = @mysql_fetch_object ($db_results);
+} else {
+ list($tmp, $id, $tmp) = preg_split("/(song=|&)/", $entry['file']);
+ $r = new Song($id);
+ $entry['Title'] = $r->title;
+ $entry['Artist'] = $r->get_artist_name();
+ $entry['Album'] = $r->get_album_name();
+}
+$count=0; // Didn't move this because I wasn't sure what it was for...
?>
<td align="center" <?php echo $minpad ?>> <input type="checkbox" name="song[<?php echo $entry['Pos']?>]" value="1" id="song_<?php echo $entry['Pos']; ?>"></input></td>
<td align="left" <?php echo $tdstyle ?>> <?php echo $track.". ";?><a href="<?php echo $web_path; ?>/amp-mpd.php?action=skipto&amp;val=<?php echo $entry['Pos']; ?>" title=" <?php echo htmlspecialchars($entry['Title']); ?>"<?php echo $text_class; ?>><?php echo htmlspecialchars($entry['Title']); ?> </a></td>
diff --git a/templates/show_mpdplay.inc b/templates/show_mpdplay.inc
index 0bc93027..188d0756 100644
--- a/templates/show_mpdplay.inc
+++ b/templates/show_mpdplay.inc
@@ -33,7 +33,7 @@ global $condPL;
?>
<div align="center">
-<table border="0" cellpadding="3" cellspacing="0">
+<table border="0" cellpadding="3" cellspacing="0" class="tabledata">
<tr class="table-header">
<td colspan="2"><?php echo _("MPD Play Control"); ?></td>
</tr>
@@ -107,7 +107,16 @@ global $condPL;
<td><b><?php echo _("Now Playing :")?></b></td>
</tr>
<tr>
- <td align="center"><?php echo ($myMpd->current_track_id+1).
+ <td align="center"><?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 ($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'].
@@ -124,7 +133,16 @@ global $condPL;
</td>
</tr>
<tr>
- <td align="center"><?php echo ($myMpd->current_track_id+2).
+ <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'].