summaryrefslogtreecommitdiffstats
path: root/templates/show_now_playing.inc
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-06-21 16:38:27 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-06-21 16:38:27 +0000
commitfbab0ebea531927baf98e6144599057db464c49b (patch)
tree94d18a10ad3f4cb2b6a7f5416524191f0bb378a5 /templates/show_now_playing.inc
parent280ee86ed799fbc39139c46b49d43cfc150ddae4 (diff)
downloadampache-fbab0ebea531927baf98e6144599057db464c49b.tar.gz
ampache-fbab0ebea531927baf98e6144599057db464c49b.tar.bz2
ampache-fbab0ebea531927baf98e6144599057db464c49b.zip
fixed nowplaying refresh issues and switched it to div layout
Diffstat (limited to 'templates/show_now_playing.inc')
-rw-r--r--templates/show_now_playing.inc111
1 files changed, 22 insertions, 89 deletions
diff --git a/templates/show_now_playing.inc b/templates/show_now_playing.inc
index 9aff071c..98fd71eb 100644
--- a/templates/show_now_playing.inc
+++ b/templates/show_now_playing.inc
@@ -19,101 +19,34 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/*!
-@header Show Now Playing Ajax
-*/
+/**
+ * This is the now playing container, it holds the master div for now playing
+ * and loops through what's current playing as passed and includes
+ * the now_playing_row's This will display regardless, but potentially
+ * goes all ajaxie if you've got javascript on
+ */
-// would change this to input some with the current now playing data.
-// so this same script can be used even if the ajax doesnt refresh it.
-$c=0;
if (count($results)) {
+?>
+ <div id="nowplaying">
+ <div id="np_title">
+ <h1><?php echo _('Now Playing'); ?></h1>
+ </div>
+<?php
foreach ($results as $item) {
$song = $item['song'];
$np_user = $item['user'];
- if (is_object($song)) {
- $result = $result.'<song>';
- if (!$np_user->fullname) { $np_user->fullname = "Unknown User"; }
- if (conf('use_auth')) { $result = $result.'<fullname>'.$np_user->fullname.'</fullname>';}
- else { $result = $result.'<fullname></fullname>'; }
-?>
- <div id='np_container_<?php echo $c; ?>' style="width:43.5em; display: block; z-index: -10000;">
- <?php if ($c==0) { ?>
- <table class="border" cellspacing="1" cellpadding="3" border="0" width="100%">
- <tr class="table-header">
- <td><?php echo _('Now Playing'); ?></td>
- </tr>
- </table>
- <?php } ?>
- <table class="border" cellspacing="1" cellpadding="3" border="0" width="100%">
- <tr class="even">
- <td width="20%">
- <div id="np_songid_<?php echo $c; ?>_holder" style="visibility: hidden; position:absolute; z-index: 10000;">
- <?php echo $song->id; ?>
- </div>
- <div id="np_fullname_<?php echo $c; ?>">
- <?php if (conf('use_auth')) { echo $np_user->fullname; } ?>
- </div>
- </td>
- <td width="30%">
- <div id="np_song_<?php echo $c; ?>">
- <a title="<?php echo scrub_out($song->f_title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&amp;song_id=<?php echo $song->id; ?>">
- <?php echo $song->f_title; ?>
- </a>
- </div>
- </td>
- <td width="30%">
- <div id="np_albumartist_<?php echo $c; ?>">
- <a title="<?php echo scrub_out($song->f_album); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&amp;album=<?php echo $song->album; ?>">
- <?php echo $song->f_album; ?>
- </a> /
- <a title="<?php echo scrub_out($song->f_artist); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo $song->artist; ?>">
- <?php echo $song->f_artist; ?>
- </a>
- </div>
- </td>
- <?php if (conf('play_album_art')) { ?>
- <td width="20%">
- <div id="np_img_<?php echo $c; ?>">
- <a target="_blank" href="<?php echo $web_path; ?>/albumart.php?id=<?php echo $song->album; ?>&amp;type=popup" onclick="popup_art('<?php echo $web_path; ?>/albumart.php?id=<?php echo $song->album; ?>&amp;type=popup'); return false;">
- <img align="middle" border="0" src="<?php echo $web_path; ?>/albumart.php?id=<?php echo $song->album; ?>&amp;fast=1&amp;thumb=1" alt="Album Art" height="75" />
- </a>
- </div>
- </td>
- <?php } ?>
- </tr>
- </table>
- </div>
-<?php
- $c++;
- } // end if (is_object($song))
-} // end foreach($results as $item)
-} // end if (count($results))
-for ($x=$c; $x<5; $x++) {
+
+ /* If we've gotten a non-song object just skip this row */
+ if (!is_object($song)) { continue; }
+ if (!$np_user->fullname) { $np_user->fullname = "Unknown User"; }
+
+ require(conf('prefix') . '/templates/show_now_playing_row.inc.php');
+
+} // end foreach
?>
- <div id='np_container_<?php echo $x; ?>' style="display: none; z-index: -10000;">
- <?php
- if ($x==0) { ?>
- <table class="border" cellspacing="1" cellpadding="3" border="0" width="100%">
- <tr class="table-header">
- <td><?php echo _('Now Playing'); ?></td>
- </tr>
- </table>
- <?php } // end if ($x==0)?>
- <table class="border" cellspacing="1" cellpadding="3" border="0" width="100%">
- <tr class="even">
- <td width="20%">
- <div id="np_songid_<?php echo $x; ?>_holder" style="visibility: hidden; position:absolute; z-index: 10000;"></div>
- <div id="np_fullname_<?php echo $x; ?>"></div>
- </td>
- <td width="30%"><div id="np_song_<?php echo $x; ?>"></div></td>
- <td width="30%"><div id="np_albumartist_<?php echo $x; ?>"></div></td>
- <td width="20%"><div id="np_img_<?php echo $x; ?>"></div></td>
- </tr>
- </table>
+ <!-- End Now Playing -->
</div>
-<?php
-} //end for ($x=$c; $x<5; $x++)
-?>
<br />
-
+<?php } // end if count results ?>