summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/show_embed_xspf.inc.php73
-rw-r--r--templates/show_index.inc.php129
2 files changed, 30 insertions, 172 deletions
diff --git a/templates/show_embed_xspf.inc.php b/templates/show_embed_xspf.inc.php
deleted file mode 100644
index f29ae959..00000000
--- a/templates/show_embed_xspf.inc.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
-
-*/
-?>
-<script language=JavaScript>
-<!--
-//Disable right mouse click Script to hide the source url for the flash player it prevents ripping music a bit.
-//When used together with locked songs this will help just a bit more.
-function clickIE4(){
-if (event.button==2){
-return false;
-}
-}
-
-function clickNS4(e){
-if (document.layers||document.getElementById&&!document.all){
-if (e.which==2||e.which==3){
-return false;
-}
-}
-}
-
-if (document.layers){
-document.captureEvents(Event.MOUSEDOWN);
-document.onmousedown=clickNS4;
-}
-else if (document.all&&!document.getElementById){
-document.onmousedown=clickIE4;
-}
-
-document.oncontextmenu=new Function("return false")
-
-// -->
-</script>
-
-<?php
-show_box_top(_('XSPF Player'));
-$play_url = Config::get('web_path') . '/modules/flash/xspf_player.php?tmp_id=' . scrub_out($_REQUEST['tmpplaylist_id']);
-$player_url = sprintf("%s/modules/flash/xspf_jukebox.swf?autoplay=true&repeat_playlist=false&crossFade=false&shuffle=false&skin_url=%s/modules/flash/Original/&playlist_url=%s",Config::get('web_path'),Config::get('web_path'),$play_url);
-?>
-<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="400" height="170" id="xspf_player" align="middle">
- <param name="pluginspage" value="http://www.macromedia.com/go/getflashplayer" />
- <param name="allowScriptAccess" value="sameDomain" />
- <param name="movie" value="<?php echo $player_url; ?>" />
- <param name="quality" value="high" />
- <param name="bgcolor" value="#ffffff" />
- <param name="type" value="application/x-shockwave-flash" />
- <param name="width" value="400" />
- <param name="height" value="170" />
- <param name="name" value="xspf_player" />
- <param name="align" value="middle" />
- <embed src="<?php echo $player_url; ?>" quality="high" bgcolor="#ffffff" width="400" height="170" name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
-</object>
-<?php
-show_box_bottom();
-?>
diff --git a/templates/show_index.inc.php b/templates/show_index.inc.php
index 12c7aae8..e9ac789f 100644
--- a/templates/show_index.inc.php
+++ b/templates/show_index.inc.php
@@ -19,103 +19,34 @@
*/
?>
-<div id="xspf_player"><!-- Start XSPF Player -->
-<?php
- if (isset($_REQUEST['xspf']) && isset ($_REQUEST['tmpplaylist_id'])){
- require_once Config::get('prefix') . '/templates/show_embed_xspf.inc.php';
- }
+<div id="now_playing">
+ <?php show_now_playing(); ?>
+</div> <!-- Close Now Playing Div -->
+<!-- Randomly selected albums of the moment -->
+<?php
+if (Browse::is_enabled('show_art')) {
+ echo Ajax::observe('window','load',Ajax::action('?page=index&action=random_albums','random_albums'));
?>
-</div><!-- End XSPF Player -->
-
-
-<?
-
-// Various settings for the 'bandwidth' option
-$feature_sets = array
- (
- BANDWIDTH_LOW => array('now', 'played'),
- BANDWIDTH_MEDIUM => array('now', 'random', 'played'),
- BANDWIDTH_HIGH => array('now', 'random', 'shout', 'played', 'added')
- );
-
-$feature_limits = array (
- BANDWIDTH_LOW => array
- (
- 'shout' => 7,
- 'played' => 7,
- 'added' => 7
- ),
- BANDWIDTH_MEDIUM => array
- (
- 'shout' => 10,
- 'played' => 10,
- 'added' => 10
- ),
- BANDWIDTH_HIGH => array
- (
- 'shout' => 10,
- 'played' => 20,
- 'added' => 20
- )
- );
-
-$features = $feature_sets[Config::get('bandwidth')];
-
-foreach ($features as $feature) {
- switch ($feature) {
- case 'shout':
- ?><div id="shout_objects"><?
-
- $shouts = shoutBox::get_top($feature_limits[Config::get('bandwidth')][$feature]);
-
- if (count($shouts)) require_once Config::get('prefix') . '/templates/show_shoutbox.inc.php';
-
- ?></div><?
-
- break;
- case 'played':
- ?><div id="recently_played"><?
-
- $data = Song::get_recently_played('', $feature_limits[Config::get('bandwidth')][$feature]);
-
- Song::build_cache(array_keys($data));
-
- require_once Config::get('prefix') . '/templates/show_recently_played.inc.php';
-
- ?></div><?
-
- break;
- case 'added':
- show_box_top("Recently Added Albums");
-
- $object_ids = Stats::get_newest('album', $feature_limits[Config::get('bandwidth')][$feature]);
-
- echo _('Newest Albums');
-
- require_once Config::get('prefix') . '/templates/show_albums.inc.php';
-
- show_box_bottom();
-
- break;
- case 'now':
- ?><div id="now_playing"><?
-
- show_now_playing();
-
- ?></div><?
-
- break;
- case 'random':
- echo Ajax::observe('window','load',Ajax::action('?page=index&action=random_albums','random_albums'));
-
- ?><div id="random_selection"><?
-
- show_box_top(_('Albums of the Moment')); echo _('Loading...'); show_box_bottom();
-
- ?></div><?
-
- break;
- }
-}
-?>
-
+<div id="random_selection">
+ <?php show_box_top(_('Albums of the Moment')); echo _('Loading...'); show_box_bottom(); ?>
+</div>
+<?php } ?>
+<!-- Recently Played -->
+<div id="recently_played">
+ <?php
+ $data = Song::get_recently_played();
+ Song::build_cache(array_keys($data));
+ require_once Config::get('prefix') . '/templates/show_recently_played.inc.php';
+ ?>
+</div>
+<!-- Shoutbox Objects, if shoutbox is enabled -->
+<?php if (Config::get('sociable')) { ?>
+<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 } ?>