diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2010-02-14 01:07:17 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2010-02-14 01:07:17 +0000 |
commit | a7869cad8f8c7290898255e2f8ed8927d42d5426 (patch) | |
tree | 8da2faeb3dff5fcc8271e5358a5fe2aedf64d669 /templates/show_index.inc.php | |
parent | 8bc17dd3f0ed4dc520bb64b20dac8a31e72e447f (diff) | |
download | ampache-a7869cad8f8c7290898255e2f8ed8927d42d5426.tar.gz ampache-a7869cad8f8c7290898255e2f8ed8927d42d5426.tar.bz2 ampache-a7869cad8f8c7290898255e2f8ed8927d42d5426.zip |
use new logic for index, simplify it for the time being.
Diffstat (limited to 'templates/show_index.inc.php')
-rw-r--r-- | templates/show_index.inc.php | 129 |
1 files changed, 30 insertions, 99 deletions
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 } ?> |