/** * display_home * This display the module in home page */ public function display_home() { if (AmpConfig::get('userflags')) { $userflags = Userflag::get_latest(null, -1, $this->maxitems); $i = 0; echo '<div class="home_plugin"><table class="tabledata">'; foreach ($userflags as $userflag) { $item = new $userflag['type']($userflag['id']); $item->format(); $user = new User($userflag['user']); $user->format(); if ($item->id) { echo '<tr class="' . ($i % 2 == 0 ? 'even' : 'odd') . '"><td>'; echo '<div>'; echo '<div style="float: left;">'; echo '<span style="font-weight: bold;">' . $item->f_link . '</span> '; echo '<span style="margin-right: 10px;">'; if (AmpConfig::get('directplay')) { echo Ajax::button('?page=stream&action=directplay&object_type=' . $userflag['type'] . '&object_id=' . $userflag['id'], 'play', T_('Play'), 'play_' . $userflag['type'] . '_' . $userflag['id']); if (Stream_Playlist::check_autoplay_append()) { echo Ajax::button('?page=stream&action=directplay&object_type=' . $userflag['type'] . '&object_id=' . $userflag['id'] . '&append=true', 'play_add', T_('Play last'), 'addplay_' . $userflag['type'] . '_' . $userflag['id']); } } echo Ajax::button('?action=basket&type=' . $userflag['type'] . '&id=' . $userflag['id'], 'add', T_('Add to temporary playlist'), 'play_full_' . $userflag['id']); echo '</span>'; echo '</div>'; echo '<div style="float: right; opacity: 0.5;">' . T_('recommended by') . ' ' . $user->f_link . '</div>'; echo '</div><br />'; echo '<div style="margin-left: 30px;">'; echo '<div style="float: left; margin-right: 20px;">'; $thumb = UI::is_grid_view('album') ? 2 : 11; $item->display_art($thumb); echo '</div>'; echo '<div style="white-space: normal;">' . $item->get_description() . '</div>'; echo '</div>'; echo '</td></tr>'; $i++; } } echo '</table></div>'; } }
*/ $web_path = AmpConfig::get('web_path'); $button = Ajax::button('?page=index&action=random_albums', 'random', T_('Refresh'), 'random_refresh'); UI::show_box_top(T_('Albums of the Moment') . ' ' . $button, 'box box_random_albums'); if ($albums) { foreach ($albums as $album_id) { $album = new Album($album_id); $album->format(); $show_play = true; ?> <div class="random_album"> <div class="art_album"> <?php if (Art::is_enabled()) { $thumb = 1; if (!UI::is_grid_view('album')) { $thumb = 11; $show_play = false; } Art::display_item($album, $thumb, $album->link); } else { ?> <a href="<?php $album->link; ?> "> <?php echo '[' . $album->f_artist . '] ' . $album->f_name; ?> </a> <?php
</a> <a href="http://www.last.fm/search?q=%22<?php echo rawurlencode($album->f_artist); ?> %22+%22<?php echo rawurlencode($album->f_name); ?> %22&type=album" target="_blank"><?php echo UI::get_icon('lastfm', T_('Search on Last.fm ...')); ?> </a> </div> <?php if ($album->name != T_('Unknown (Orphaned)')) { $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name); $thumb = UI::is_grid_view('album') ? 2 : 11; Art::display('album', $album->id, $name, $thumb); } ?> </div> <div id="information_actions"> <h3><?php echo T_('Actions'); ?> :</h3> <ul> <?php if ($show_direct_play) { ?> <li> <?php
* * 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ ?> <div class="item_info"> <?php if ($biography['id']) { $thumb = UI::is_grid_view('artist') ? 2 : 11; Art::display('artist', $biography['id'], $artist->f_name, $thumb); } else { ?> <div class="item_art"> <?php if ($biography && is_array($biography)) { ?> <a href="<?php echo $biography['megaphoto']; ?> " rel="prettyPhoto"><img src="<?php echo $biography['largephoto']; ?> " alt="<?php echo $artist->f_name;
* 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ $browse = new Browse(); $browse->set_type($object_type); UI::show_box_top($podcast->f_title, 'info-box'); ?> <div class="item_right_info"> <?php $thumb = UI::is_grid_view('podcast') ? 2 : 11; Art::display('podcast', $podcast->id, $podcast->f_title, $thumb); ?> <?php if ($podcast->description) { ?> <div id="item_summary"> <?php echo $podcast->description; ?> </div> <?php } ?> </div> <?php
* */ $web_path = AmpConfig::get('web_path'); $button = Ajax::button('?page=index&action=random_videos', 'random', T_('Refresh'), 'random_video_refresh'); UI::show_box_top(T_('Videos of the Moment') . ' ' . $button, 'box box_random_videos'); if ($videos) { foreach ($videos as $video_id) { $video = Video::create_from_id($video_id); $video->format(); ?> <div class="random_video"> <div class="art_album"> <?php if (Art::is_enabled()) { $release_art = $video->get_release_item_art(); $thumb = UI::is_grid_view('video') ? 6 : 7; Art::display($release_art['object_type'], $release_art['object_id'], $video->get_fullname(), $thumb, $video->link); } else { ?> <?php echo $video->get_fullname(); ?> <?php } ?> </div> <div class="play_video"> <?php if (AmpConfig::get('directplay')) { ?> <?php