summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-16 05:46:29 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-16 05:46:29 +0000
commit16833b068e84ea37c18626f5163c17fe98090f14 (patch)
tree125af931ef94301b3ad28bd73f25e21dc6f67255 /templates
parent7c64ba9cc67a25f843a5942ca5a0265dce7060ff (diff)
downloadampache-16833b068e84ea37c18626f5163c17fe98090f14.tar.gz
ampache-16833b068e84ea37c18626f5163c17fe98090f14.tar.bz2
ampache-16833b068e84ea37c18626f5163c17fe98090f14.zip
tweak to stream based refreash thx sigger
Diffstat (limited to 'templates')
-rw-r--r--templates/javascript_refresh.inc2
-rw-r--r--templates/show_mpdplay.inc2
-rw-r--r--templates/show_now_playing.inc55
-rw-r--r--templates/show_random_play_bar.inc.php79
-rw-r--r--templates/show_search_bar.inc2
5 files changed, 74 insertions, 66 deletions
diff --git a/templates/javascript_refresh.inc b/templates/javascript_refresh.inc
index c15c8f24..3ef563aa 100644
--- a/templates/javascript_refresh.inc
+++ b/templates/javascript_refresh.inc
@@ -1,5 +1,7 @@
<script type="text/javascript" language="javascript">
<!-- Begin
+// JS variables mpd_elapsed, mpd_song_length and mpd_state set in show_mpdplay.inc
+
// Set refresh interval (in seconds)
var refreshinterval=<?php echo conf('refresh_limit'); ?>
diff --git a/templates/show_mpdplay.inc b/templates/show_mpdplay.inc
index ed770354..70cb44f9 100644
--- a/templates/show_mpdplay.inc
+++ b/templates/show_mpdplay.inc
@@ -44,7 +44,7 @@ global $condPL;
<?php
${$myMpd->state} = "style=\"background-color: black;color:white;\"";
?>
- <form action="<?php echo $web_path; ?>/amp-mpd.php" method="post" name="playcontrol" style="display:inline;">
+ <form action="<?php echo $web_path; ?>/amp-mpd.php" method="post" name="playcontrol" style="display:inline; white-space: nowrap">
<input class="button" type="submit" title="<?php echo _("Prev"); ?>" name="action" value="|&lt; " />
<input class="button" type="submit" title="<?php echo _("Stop"); ?>" name="action" value=" X " <?php echo $stop; ?> />
<input class="button" type="submit" title="<?php echo _("Play"); ?>" name="action" value=" &gt; " <?php echo $play; ?> />
diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc
index f44ecc16..9f4168f5 100644
--- a/templates/show_now_playing.inc
+++ b/templates/show_now_playing.inc
@@ -31,31 +31,44 @@
<td colspan="4"><?php echo _("Now Playing"); ?></td>
</tr>
<?php
+ $user = $GLOBALS['user'];
+ echo '<script language="JavaScript" type="text/javascript"> var mpd_state = "'. "stop" .'" </script>';
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"; }
- echo "<tr class=\"even\">\n";
- if (conf('use_auth')) {
- echo "\t<td valign=\"middle\">$np_user->fullname</td>\n";
- }
- 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=\"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>";
+ $artist = $song->f_artist;
+ $album = $song->get_album_name();
+ $text = "$song->f_title";
+ if (!$np_user->fullname) { $np_user->fullname = "Unknown User"; }
+ if ($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=\"npsong\">\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=\"" . 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=\"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
diff --git a/templates/show_random_play_bar.inc.php b/templates/show_random_play_bar.inc.php
index 28e41cec..d1c38842 100644
--- a/templates/show_random_play_bar.inc.php
+++ b/templates/show_random_play_bar.inc.php
@@ -24,46 +24,41 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* this is the simple random play bar, it is short sweet and to the point
*/
?>
- <form name="random" method="post" enctype="multipart/form-data" action="<?php echo conf('web_path'); ?>/song.php">
- <input type="hidden" name="action" value="m3u" />
- <table class="border" border="0" cellpadding="3" cellspacing="1" width="100%">
- <tr class="table-header">
- <td colspan="6"><?php echo _("Play Random Selection"); ?></td>
- </tr>
- <tr class="even">
- <td>
- <table border="0">
- <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( -1, 0, "'1'" ); ?>
- <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"); ?>" />
-</td>
-<td><a href="<?php echo conf('web_path'); ?>/randomplay.php"><?php echo _("Advanced"); ?></a></td>
- </tr>
- </table>
- </td></tr>
- </table>
- </form>
+<form name="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" />
+<table class="border" width="100%" cellspacing="1" cellpadding="3" border="0">
+<tr class="table-header">
+ <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( -1, 0, "'1'" ); ?>
+ <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_search_bar.inc b/templates/show_search_bar.inc
index 3429e0a0..24a4473c 100644
--- a/templates/show_search_bar.inc
+++ b/templates/show_search_bar.inc
@@ -47,8 +47,6 @@
<option value="minbitrate"><?php echo _("Minimum Bitrate"); ?></option>
<option value="filename"><?php echo _("Filename"); ?></option>
</select>
- </td>
- <td>
<input class="button" type="submit" value="<?php echo _("Search"); ; ?>" />&nbsp;&nbsp;
<input type="hidden" name="action" value="quick_search" />
<input type="hidden" name="method" value="fuzzy" />