diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/default.css | 12 | ||||
-rw-r--r-- | templates/show_tv.inc.php | 33 | ||||
-rw-r--r-- | templates/show_tv_nowplaying.inc.php | 23 | ||||
-rw-r--r-- | templates/show_tv_playlist.inc.php | 27 |
4 files changed, 80 insertions, 15 deletions
diff --git a/templates/default.css b/templates/default.css index 663ced0b..d746e7f8 100644 --- a/templates/default.css +++ b/templates/default.css @@ -639,16 +639,14 @@ li.current-rating{ /* TV Page Related Styles */ -#tv_control { - float:left; -} - #tv_np { float:right; } - -#tv_playlist { - clear: both; +#tv_np .box { + aligh:right; +} +#tv_left { + float:left; } /* User Online/Offline style, used in users.php */ td.user_online { diff --git a/templates/show_tv.inc.php b/templates/show_tv.inc.php index fd29bff7..8ca3b075 100644 --- a/templates/show_tv.inc.php +++ b/templates/show_tv.inc.php @@ -36,6 +36,25 @@ $location = get_location(); <body> <script src="<?php echo $web_path; ?>/lib/javascript-base.js" language="javascript" type="text/javascript"></script> <script src="<?php echo $web_path; ?>/modules/kajax/ajax.js" language="javascript" type="text/javascript"></script> +<?php + +/** + * Check for the refresh mojo, if it's there then require the + * refresh_javascript include. Must be greater then 5, I'm not + * going to let them break their servers + */ +if (conf('refresh_limit') > 5) { + $ajax_url = conf('ajax_url') . '?action=reload_np_tv' . conf('ajax_info'); + /* Can't have the & stuff in the Javascript */ + $ajax_url = str_replace("&","&",$ajax_url); + require_once(conf('prefix') . '/templates/javascript_refresh.inc.php'); +} + +?> +<!-- Left Col --> +<div id="tv_left"> +<?php show_box_top(_('Controls')); ?> +<a href="<?php echo conf('web_path'); ?>/index.php"><?php echo _('Home'); ?></a> <!-- Control DIV --> <div id="tv_control"> <?php @@ -49,10 +68,16 @@ else { } ?> </div> -<!-- End Control Div --> -<div id="tv_np"> -<?php require_once(conf('prefix') . '/templates/show_tv_nowplaying.inc.php'); ?> -</div> +<?php show_box_bottom(); ?> +<?php show_box_top(_('Current Playlist')); ?> <div id="tv_playlist"> <?php require_once(conf('prefix') . '/templates/show_tv_playlist.inc.php'); ?> </div> +<?php show_box_bottom(); ?> +<!-- End of Left --> +</div> +<?php show_box_top(_('Now Playing')); ?> +<div id="tv_np"> +<?php require_once(conf('prefix') . '/templates/show_tv_nowplaying.inc.php'); ?> +</div> +<?php show_box_bottom(); ?> diff --git a/templates/show_tv_nowplaying.inc.php b/templates/show_tv_nowplaying.inc.php index 5823f537..930d5444 100644 --- a/templates/show_tv_nowplaying.inc.php +++ b/templates/show_tv_nowplaying.inc.php @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 - as published by the Free Software Foundation + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -18,4 +18,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* Pull the Now Playing Information */ +$results = get_now_playing(); ?> +<table cellpadding="0"> +<?php +foreach ($results as $row) { + $title = scrub_out(truncate_with_ellipse($row['song']->title,'25')); + $album = scrub_out(truncate_with_ellipse($row['song']->f_album_full,'25')); + $artist = scrub_out(truncate_with_ellipse($row['song']->f_artist_full,'25')); +?> +<tr> + <td> + <a target="_blank" href="<?php echo $web_path; ?>/albumart.php?id=<?php echo $row['song']->album; ?>&type=popup" onclick="popup_art('<?php echo $web_path; ?>/albumart.php?id=<?php echo $row['song']->album; ?>&type=popup'); return false;"> + <img align="middle" border="0" src="<?php echo $web_path; ?>/albumart.php?id=<?php echo $row['song']->album; ?>&fast=1" /> + </a> + </td> +</tr> +<tr> + <td><?php echo $title; ?> - (<?php echo $album; ?> / <?php echo $artist; ?> )</td> +</tr> +<?php } // end foreach ?> +</table> diff --git a/templates/show_tv_playlist.inc.php b/templates/show_tv_playlist.inc.php index 150b0b05..94bb1c7b 100644 --- a/templates/show_tv_playlist.inc.php +++ b/templates/show_tv_playlist.inc.php @@ -21,19 +21,37 @@ /* Some defaults */ $web_path = conf('web_path'); ?> -<h3><?php echo _('Current Playlist'); ?></h3> <table cellspacing="0"> +<?php +if (!count($songs)) { + $playlist = new Playlist($tmp_playlist->base_playlist); +?> +<tr> + <td> + <?php echo _('Playing from base Playlist'); ?>: + <a href="<?php echo $web_path; ?>/playlist.php?action=show_playlist&playlist_id=<?php echo $playlist->id; ?>"> + <?php echo scrub_out($playlist->name); ?> + </a> + </td> +</tr> +<?php +} // if no songs +/* Else we have songs */ +else { +?> <tr class="table-header"> <td><?php echo _('Action'); ?></td> <td><?php echo _('Votes'); ?></td> <td><?php echo _('Song'); ?></td> </tr> <?php + + foreach($songs as $row_id=>$song_id) { $song = new Song($song_id); $song->format_song(); ?> -<tr> +<tr class="<?php echo flip_class(); ?>"> <td> <?php if ($tmp_playlist->has_vote($song_id)) { ?> <input class="button" type="button" value="-" onclick="ajaxPut('<?php echo conf('ajax_url'); ?>?action=vote&object_id=<?php echo $song_id; ?>&vote=-1<?php echo conf('ajax_info'); ?>')" /> @@ -44,5 +62,8 @@ foreach($songs as $row_id=>$song_id) { <td><?php echo scrub_out($tmp_playlist->get_vote($row_id)); ?></td> <td><?php echo scrub_out($song->title . ' / ' . $song->get_album_name()); ?></td> </tr> -<?php } ?> +<?php + } // end foreach +} // end else +?> </table> |