summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-17 05:26:11 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-12-17 05:26:11 +0000
commit8448a0fc84ba25e6fd949b8162e3d1c96948d808 (patch)
treef25ba419b76412d0d072e9e9c9ffa7cbbfb36885 /templates
parentd23122dffafa40415b1496c240ebd0b27619ef0f (diff)
downloadampache-8448a0fc84ba25e6fd949b8162e3d1c96948d808.tar.gz
ampache-8448a0fc84ba25e6fd949b8162e3d1c96948d808.tar.bz2
ampache-8448a0fc84ba25e6fd949b8162e3d1c96948d808.zip
added shoutbox functionality, only linked from song and album right now also interface for adding could use some improvement and also needs some management stuff to remove stickies etc
Diffstat (limited to 'templates')
-rw-r--r--templates/show_add_shout.inc.php46
-rw-r--r--templates/show_album_row.inc.php7
-rw-r--r--templates/show_index.inc.php14
-rw-r--r--templates/show_recently_played.inc.php1
-rw-r--r--templates/show_shoutbox.inc.php44
-rw-r--r--templates/show_song_row.inc.php10
6 files changed, 117 insertions, 5 deletions
diff --git a/templates/show_add_shout.inc.php b/templates/show_add_shout.inc.php
new file mode 100644
index 00000000..9d1ead88
--- /dev/null
+++ b/templates/show_add_shout.inc.php
@@ -0,0 +1,46 @@
+<?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(_('Post to Shoutbox')); ?>
+<form method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/shout.php?action=add_shout">
+<table class="tabledata" cellpadding="0" cellspacing="0">
+<tr>
+ <td><strong>Comment:</strong>
+</tr>
+<tr>
+ <td><textarea rows="5" cols="70" name="comment"></textarea></td>
+</tr>
+<?php if (Access::check('interface','50')) { ?>
+<tr>
+ <td><input type="checkbox" name="sticky" value="0" /> <strong><?php echo _('Make Sticky'); ?></strong></td>
+</tr>
+<?php } ?>
+<tr>
+ <td>
+ <input type="hidden" name="object_id" value="<?php echo $object->id; ?>" />
+ <input type="hidden" name="object_type" value="<?php echo strtolower(get_class($object)); ?>" />
+ <input type="submit" value="<?php echo _('Create'); ?>" />
+ </td>
+</tr>
+</table>
+</form>
+<?php show_box_bottom(); ?>
diff --git a/templates/show_album_row.inc.php b/templates/show_album_row.inc.php
index 791f7b8a..338ebf01 100644
--- a/templates/show_album_row.inc.php
+++ b/templates/show_album_row.inc.php
@@ -35,12 +35,17 @@
<td class="cel_songs"><?php echo $album->song_count; ?></td>
<td class="cel_year"><?php echo $album->year; ?></td>
<td class="cel_action">
+ <?php if (Config::get('shoutbox')) { ?>
+ <a href="<?php echo Config::get('web_path'); ?>/shout.php?action=show_add_shout&amp;type=album&amp;id=<?php echo $album->id; ?>">
+ <?php echo get_user_icon('comment',_('Post Shout')); ?>
+ </a>
+ <?php } ?>
<?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>">
<?php echo get_user_icon('batch_download',_('Batch Download')); ?>
</a>
<?php } ?>
- <?php if ($GLOBALS['user']->has_access('50')) { ?>
+ <?php if (Access::check('interface','50')) { ?>
<?php echo Ajax::button('?action=show_edit_object&type=album&id=' . $album->id,'edit',_('Edit'),'edit_album_' . $album->id); ?>
<?php } ?>
</td>
diff --git a/templates/show_index.inc.php b/templates/show_index.inc.php
index 3e656024..5dbdf08b 100644
--- a/templates/show_index.inc.php
+++ b/templates/show_index.inc.php
@@ -28,13 +28,25 @@ if (isset($_REQUEST['xspf']) && isset ($_REQUEST['play_info'])){
<div id="now_playing">
<?php show_now_playing(); ?>
</div> <!-- Close Now Playing Div -->
-<!-- Recently Played -->
+<!-- Sticky Objects, if sticky is enabled -->
+<?php if (Config::get('shoutbox')) { ?>
+<div id="shout_objects">
+ <?php
+ $shouts = shoutBox::get_top('5');
+ if (count($shouts)) {
+ require_once Config::get('prefix') . '/templates/show_shoutbox.inc.php';
+ }
+ ?>
+</div>
+<?php } ?>
+<!-- Randomly selected albums of the moment -->
<div id="random_selection">
<?php
$albums = get_random_albums('6');
if (count($albums)) { require_once Config::get('prefix') . '/templates/show_random_albums.inc.php'; }
?>
</div>
+<!-- Recently Played -->
<div id="recently_played">
<?php
$data = get_recently_played();
diff --git a/templates/show_recently_played.inc.php b/templates/show_recently_played.inc.php
index f35f64cf..b3b91020 100644
--- a/templates/show_recently_played.inc.php
+++ b/templates/show_recently_played.inc.php
@@ -86,6 +86,7 @@ $time_unit = array('',_('seconds ago'),_('minutes ago'),_('hours ago'),_('days a
</tr>
<?php } ?>
<tr class="th-bottom">
+ <th class="cel_add"><?php echo _('Add'); ?></th>
<th class="cel_username"><?php echo _('Username'); ?></th>
<th class="cel_song"><?php echo _('Song'); ?></th>
<th class="cel_album"><?php echo _('Album'); ?></th>
diff --git a/templates/show_shoutbox.inc.php b/templates/show_shoutbox.inc.php
new file mode 100644
index 00000000..8274f716
--- /dev/null
+++ b/templates/show_shoutbox.inc.php
@@ -0,0 +1,44 @@
+<?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.
+
+*/
+?>
+<?php show_box_top(_('Shoutbox')); ?>
+<table class="tabledata" cellpadding="0" cellspacing="0">
+<?php foreach ($shouts as $shout_id) {
+ $shout = new shoutBox($shout_id);
+ $object = shoutBox::get_object($shout->object_type,$shout->object_id);
+ $object->format();
+ $client = new User($shout->user);
+ $client->format();
+?>
+<tr>
+ <td class="cel_image">
+ <?php echo $shout->get_image(); ?><br />
+ <strong><?php echo ucfirst($shout->object_type); ?>:</strong> <?php echo $object->f_link; ?><br />
+ </td>
+ <td valign="top" class="cel_comment">
+ <?php echo scrub_out($shout->text); ?>
+ <br />
+ <span class="information">- <?php echo $client->f_link; ?> <?php echo date("d/m/Y H:i",$shout->date); ?></span>
+ </td>
+</tr>
+<?php } ?>
+</table>
+<?php show_box_bottom(); ?>
diff --git a/templates/show_song_row.inc.php b/templates/show_song_row.inc.php
index fb3b69ae..1cf863e9 100644
--- a/templates/show_song_row.inc.php
+++ b/templates/show_song_row.inc.php
@@ -32,13 +32,17 @@
<td class="cel_rating" id="rating_<?php echo $song->id; ?>_song"><?php Rating::show($song->id,'song'); ?></td>
<?php } ?>
<td class="cel_action">
+ <?php if (Config::get('shoutbox')) { ?>
+ <a href="<?php echo Config::get('web_path'); ?>/shout.php?action=show_add_shout&amp;type=song&amp;id=<?php echo $song->id; ?>">
+ <?php echo get_user_icon('comment',_('Post Shout')); ?>
+ </a>
+ <?php } ?>
<?php if ($GLOBALS['user']->prefs['download']) { ?>
<a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
<?php echo get_user_icon('download',_('Download')); ?>
</a>
<?php } ?>
-
- <?php if ($GLOBALS['user']->has_access(100)) { ?>
- <?php echo Ajax::button('?action=show_edit_object&type=song&id=' . $song->id,'edit',_('Edit'),'edit_song_' . $song->id); ?>
+ <?php if (Access::check('interface','75')) { ?>
+ <?php echo Ajax::button('?action=show_edit_object&type=song&id=' . $song->id,'edit',_('Edit'),'edit_song_' . $song->id); ?>
<?php } ?>
</td>