summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
commit216e691dfa53a28af8beca7aad2bf0ffb71dba2c (patch)
tree8b371e856d8107832a724f1ee0ad42f270435d0a /templates
parent84eca6a3d59fc591a7e28b3d7e0c11746dc837fc (diff)
downloadampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.gz
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.bz2
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.zip
- Added Live Stream (Internet Radio) support
- New Database Update corrects some issues and makes internet radio possible - Fixed ratings - Added new Transcode preference, doesn't do anything yet - New "Radio Stations" browse type
Diffstat (limited to 'templates')
-rw-r--r--templates/rightbar.inc.php12
-rw-r--r--templates/show_add_live_stream.inc.php79
-rw-r--r--templates/show_genres.inc.php2
-rw-r--r--templates/show_live_stream_row.inc.php33
-rw-r--r--templates/show_live_streams.inc.php52
-rw-r--r--templates/show_now_playing_row.inc.php35
-rw-r--r--templates/sidebar_browse.inc.php1
-rw-r--r--templates/sidebar_home.inc.php1
8 files changed, 193 insertions, 22 deletions
diff --git a/templates/rightbar.inc.php b/templates/rightbar.inc.php
index 444db2ed..ad5ef726 100644
--- a/templates/rightbar.inc.php
+++ b/templates/rightbar.inc.php
@@ -37,18 +37,16 @@
<table cellpadding="0" cellspacing="0">
<?php
$objects = $GLOBALS['user']->playlist->get_items();
- foreach ($objects as $song_id) {
- $song = new Song($song_id);
- $song->format();
+ foreach ($objects as $uid=>$object_data) {
+ $object = new $object_data['1']($object_data['0']);
+ $object->format();
?>
<tr class="<?php echo flip_class(); ?>">
<td>
- <?php echo $song->f_link; ?>
+ <?php echo $object->f_link; ?>
</td>
<td>
- <span onclick="ajaxPut('<?php echo Config::get('ajax_url'); ?>?action=current_playlist&amp;type=delete&amp;id=<?php echo $song_id; ?>');return true;">
- <?php echo get_user_icon('delete','',_('Delete')); ?>
- </span>
+ <?php echo Ajax::button('?action=current_playlist&type=delete&id=' . $uid,'delete',_('Delete'),'rightbar_delete_' . $uid); ?>
</td>
</tr>
<?php } if (!count($objects)) { ?>
diff --git a/templates/show_add_live_stream.inc.php b/templates/show_add_live_stream.inc.php
new file mode 100644
index 00000000..2533e777
--- /dev/null
+++ b/templates/show_add_live_stream.inc.php
@@ -0,0 +1,79 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; version 2
+ of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+
+?>
+<?php show_box_top(_('Add Radio Station')); ?>
+<form name="radio" method="post" action="<?php echo Config::get('web_path'); ?>/radio.php?action=create">
+<table>
+<tr>
+ <td><?php echo _('Name'); ?></td>
+ <td>
+ <input type="text" name="name" size="20" value="<?php echo scrub_out($_REQUEST['name']); ?>" />
+ <?php Error::display('name'); ?>
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Station Homepage'); ?></td>
+ <td>
+ <input type="text" name="site_url" value="<?php echo scrub_out($_REQUEST['site_url']); ?>" />
+ <?php Error::display('site_url'); ?>
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Station URL'); ?></td>
+ <td>
+ <input type="text" name="url" value="<?php echo scrub_out($_REQUEST['url']); ?>" />
+ <?php Error::display('url'); ?>
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Station Frequency'); ?></td>
+ <td>
+ <input type="text" name="frequency" value="<?php echo scrub_out($_REQUEST['frequency']); ?>" />
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Station call-sign'); ?></td>
+ <td>
+ <input type="text" name="call_sign" value="<?Php echo scrub_out($_REQUEST['call_sign']); ?>" />
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Genre'); ?></td>
+ <td>
+ <?php echo show_genre_select('genre',intval($_REQUEST['genre'])); ?>
+ </td>
+</tr>
+<tr>
+ <td><?php echo _('Catalog'); ?></td>
+ <td>
+ <?php echo show_catalog_select('catalog',intval($_REQUEST['catalog'])); ?>
+ </td>
+</tr>
+<tr>
+ <td colspan="2">
+ <input class="button" type="submit" value="<?php echo _('Add'); ?>" />
+ </td>
+</tr>
+</table>
+</form>
+<?php show_box_bottom(); ?>
diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php
index bd7b0a3d..c170f7bb 100644
--- a/templates/show_genres.inc.php
+++ b/templates/show_genres.inc.php
@@ -50,7 +50,7 @@ foreach ($object_ids as $genre_id) {
<?php echo get_user_icon('random'); ?>
</span>
</td>
- <td><?php echo $genre->link; ?></td>
+ <td><?php echo $genre->f_link; ?></td>
<td><?php echo $genre->get_song_count(); ?></td>
<td>
<?php if (Access::check_function('batch_download')) { ?>
diff --git a/templates/show_live_stream_row.inc.php b/templates/show_live_stream_row.inc.php
new file mode 100644
index 00000000..77003371
--- /dev/null
+++ b/templates/show_live_stream_row.inc.php
@@ -0,0 +1,33 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ 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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<td>
+ <?php echo Ajax::button('?action=basket&type=live_stream&id=' . $radio->id,'add',_('Add'),'add_radio_' . $radio->id); ?>
+</td>
+<td><?php echo $radio->f_name_link; ?></td>
+<td><?php echo $radio->f_callsign; ?></td>
+<td><?php echo $radio->f_frequency; ?></td>
+<td><?php echo $radio->f_genre; ?></td>
+<td>
+ <?php if ($GLOBALS['user']->has_access('50')) { ?>
+ <?php echo Ajax::button('?action=show_edit_object&type=live_stream&id=' . $radio->id,'edit',_('Edit'),'edit_radio_' . $radio->id); ?>
+ <?php } ?>
+</td>
diff --git a/templates/show_live_streams.inc.php b/templates/show_live_streams.inc.php
new file mode 100644
index 00000000..5aa5be5e
--- /dev/null
+++ b/templates/show_live_streams.inc.php
@@ -0,0 +1,52 @@
+<?php
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ 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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+$web_path = Config::get('web_path');
+
+?>
+<table class="tabledata" cellspacing="0" cellpadding="0" border="0">
+<tr class="table-header" align="center">
+ <td colspan="5">
+ <?php if ($GLOBALS['view']->offset_limit) { require Config::get('prefix') . '/templates/list_header.inc'; } ?>
+ </td>
+</tr>
+<tr class="table-header">
+ <th><?php echo _('Add'); ?></th>
+ <th><?php echo _('Name'); ?></th>
+ <th><?php echo _('Callsign'); ?></th>
+ <th><?php echo _('Frequency'); ?></th>
+ <th><?php echo _('Genre'); ?></th>
+ <th><?php echo _('Action'); ?> </th>
+</tr>
+<?php
+foreach ($object_ids as $radio_id) {
+ $radio = new Radio($radio_id);
+ $radio->format();
+?>
+<tr id="radio_<?php echo $radio->id; ?>" class="<?php echo flip_class(); ?>">
+ <?php require Config::get('prefix') . '/templates/show_live_stream_row.inc.php'; ?>
+</tr>
+<?php } //end foreach ($artists as $artist) ?>
+<tr class="even" align="center">
+ <td colspan="4">
+ <?php if ($view->offset_limit) { require (conf('prefix') . "/templates/list_header.inc"); } ?>
+ </td>
+</tr>
+</table>
diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php
index 79998aee..54aac9bc 100644
--- a/templates/show_now_playing_row.inc.php
+++ b/templates/show_now_playing_row.inc.php
@@ -20,24 +20,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* Prepare the variables */
-$title = scrub_out(truncate_with_ellipse($song->title,'25'));
-$album = scrub_out(truncate_with_ellipse($song->f_album_full,'25'));
-$artist = scrub_out(truncate_with_ellipse($song->f_artist_full,'25'));
+$title = scrub_out(truncate_with_ellipsis($song->title,'25'));
+$album = scrub_out(truncate_with_ellipsis($song->f_album_full,'25'));
+$artist = scrub_out(truncate_with_ellipsis($song->f_artist_full,'25'));
?>
-<td class="np_cell_left"><b><?php echo _('Username'); ?></b>:<br /><?php echo scrub_out($np_user->fullname); ?><br /><br /><!-- ## modified ##-->
- <b><?php echo _('Song'); ?></b><br /><a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&amp;song_id=<?php echo $song->id; ?>">
+<td class="np_cell_left"><b><?php echo _('Username'); ?></b>:<br />
+ <a href="<?php echo $web_path; ?>/stats.php?action=show_user&amp;user_id=<?php echo $np_user->id; ?>"><?php echo scrub_out($np_user->fullname); ?></a><br /><br />
+ <!-- ## modified ##-->
+ <strong><?php echo _('Song'); ?></strong><br />
+ <a title="<?php echo scrub_out($song->title); ?>" href="<?php echo $web_path; ?>/song.php?action=single_song&amp;song_id=<?php echo $song->id; ?>">
<?php echo $title; ?>
- </a>
- <?php if(Config::get('ratings')) { ?>
- <br /><?php show_rating($song->id,'song'); ?>
- <?php } ?>
+ </a>
+ <div id="rating_<?php echo $song->id; ?>_song">
+ <?php Rating::show($song->id,'song'); ?>
+ </div>
</td>
<td class="np_cell_m">
- <b><?php echo _('Artist'); ?></b><br /><a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo $song->artist; ?>">
- <?php echo $artist; ?>
- </a><br /><br />
- <b><?php echo _('Album'); ?></b><br /><a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&amp;album=<?php echo $song->album; ?>">
- <?php echo $album; ?></a>
+ <strong><?php echo _('Artist'); ?></strong><br />
+ <a title="<?php echo scrub_out($song->f_artist_full); ?>" href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo $song->artist; ?>">
+ <?php echo $artist; ?>
+ </a>
+ <br /><br />
+ <strong><?php echo _('Album'); ?></strong><br />
+ <a title="<?php echo scrub_out($song->f_album_full); ?>" href="<?php echo $web_path; ?>/albums.php?action=show&amp;album=<?php echo $song->album; ?>">
+ <?php echo $album; ?>
+ </a>
</td>
<?php if (Config::get('show_album_art')) { ?>
<td class="np_cell_right">
diff --git a/templates/sidebar_browse.inc.php b/templates/sidebar_browse.inc.php
index c808be46..44938ccc 100644
--- a/templates/sidebar_browse.inc.php
+++ b/templates/sidebar_browse.inc.php
@@ -9,6 +9,7 @@
<span><a href="<?php echo $web_path; ?>/browse.php?action=album"><?php echo _('Albums'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/browse.php?action=artist"><?php echo _('Artist'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/browse.php?action=genre"><?php echo _('Genre'); ?></a></span>
+<span><a href="<?php echo $web_path; ?>/browse.php?action=live_stream"><?php echo _('Radio Stations'); ?></a></span>
<hr />
<h4><?php echo _('Filters'); ?></h4>
<?php show_alphabet_list($_REQUEST['alpha_match'],$_REQUEST['action']); ?>
diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php
index 135b1d8a..0e546595 100644
--- a/templates/sidebar_home.inc.php
+++ b/templates/sidebar_home.inc.php
@@ -1,6 +1,7 @@
<h4><?php echo _('Information'); ?></h4>
<span><a href="<?php echo $web_path; ?>/index.php"><?php echo _('Currently Playing'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/stats.php"><?php echo _('Statistics'); ?></a></span>
+<span><a href="<?php echo $web_path; ?>/radio.php?action=show_create"><?php echo _('Add Radio Station'); ?></a></span>
<hr />
<!-- RANDOM, Hidden for now cause its broken
<h4><?php echo _('Search'); ?></h4>