本文整理汇总了PHP中Browse::set_type方法的典型用法代码示例。如果您正苦于以下问题:PHP Browse::set_type方法的具体用法?PHP Browse::set_type怎么用?PHP Browse::set_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browse
的用法示例。
在下文中一共展示了Browse::set_type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: videos
/**
* videos
* This returns video objects!
* @param array $input
*/
public static function videos($input)
{
self::$browse->reset_filters();
self::$browse->set_type('video');
self::$browse->set_sort('title', 'ASC');
$method = $input['exact'] ? 'exact_match' : 'alpha_match';
Api::set_filter($method, $input['filter']);
$video_ids = self::$browse->get_objects();
XML_Data::set_offset($input['offset']);
XML_Data::set_limit($input['limit']);
echo XML_Data::videos($video_ids);
}
示例2: Browse
* 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.
*
*/
require_once '../lib/init.php';
if (!Access::check('interface', 100)) {
UI::access_denied();
exit;
}
UI::show_header();
switch ($_REQUEST['action']) {
default:
// Show Catalogs
$catalog_ids = Catalog::get_catalogs();
$browse = new Browse();
$browse->set_type('catalog');
$browse->set_static_content(true);
$browse->save_objects($catalog_ids);
$browse->show_objects($catalog_ids);
$browse->store();
break;
}
UI::show_footer();
示例3: Browse
?>
<div id="following" class="tab_content">
<?php
$following_ids = $client->get_following();
$browse = new Browse();
$browse->set_type('user');
$browse->set_simple_browse(false);
$browse->show_objects($following_ids);
$browse->store();
?>
</div>
<div id="followers" class="tab_content">
<?php
$follower_ids = $client->get_followers();
$browse = new Browse();
$browse->set_type('user');
$browse->set_simple_browse(false);
$browse->show_objects($follower_ids);
$browse->store();
?>
</div>
<div id="timeline" class="tab_content">
<?php
if (Preference::get_by_user($client->id, 'allow_personal_info_recent')) {
$activities = Useractivity::get_activities($client->id);
Useractivity::build_cache($activities);
foreach ($activities as $aid) {
$activity = new Useractivity($aid);
$activity->show();
}
}
示例4: T_
<li>
<?php
echo T_('Wanted actions');
?>
:
<div id="wanted_action_<?php
echo $walbum->mbid;
?>
">
<?php
$walbum->show_action_buttons();
?>
</div>
</li>
</ul>
</div>
<?php
UI::show_box_bottom();
?>
<div id="additional_information">
</div>
<div>
<?php
$browse = new Browse();
$browse->set_type('song_preview');
$browse->set_static_content(true);
$browse->show_objects($walbum->songs);
?>
</div>
示例5: Browse
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* 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.
*
*/
$object_ids = Share::get_share_list();
$browse = new Browse();
$browse->set_type('share');
$browse->set_static_content(true);
$browse->save_objects($object_ids);
$browse->show_objects($object_ids);
$browse->store();
示例6: Browse
* 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.
*
*/
$sql = Stats::get_recent_sql('album', $user_id);
$browse = new Browse();
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_recent_sql('artist', $user_id);
$browse = new Browse();
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_recent_sql('song', $user_id);
$browse = new Browse();
$browse->set_type('song', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
示例7: switch
$results[$browse->get_content_div()] = ob_get_clean();
break;
case 'set_sort':
if ($_REQUEST['sort']) {
$browse->set_sort($_REQUEST['sort']);
}
if (!$browse->get_use_pages()) {
$browse->set_start(0);
}
ob_start();
$browse->show_objects(null, $argument);
$results[$browse->get_content_div()] = ob_get_clean();
break;
case 'toggle_tag':
$type = $_SESSION['tagcloud_type'] ? $_SESSION['tagcloud_type'] : 'song';
$browse->set_type($type);
break;
case 'delete_object':
switch ($_REQUEST['type']) {
case 'playlist':
// Check the perms we need to on this
$playlist = new Playlist($_REQUEST['id']);
if (!$playlist->has_access()) {
exit;
}
// Delete it!
$playlist->delete();
$key = 'playlist_row_' . $playlist->id;
break;
case 'smartplaylist':
$playlist = new Search($_REQUEST['id'], 'song');
示例8: Browse
* 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.
*
*/
$sql = Stats::get_recent_sql('album', $user_id);
$browse = new Browse();
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_recent_sql('artist', $user_id);
$browse = new Browse();
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_recent_sql('song', $user_id);
$browse = new Browse();
$browse->set_type('song', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
if (AmpConfig::get('allow_video')) {
$sql = Stats::get_recent_sql('video', $user_id);
$browse = new Browse();
$browse->set_type('video', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
}
示例9: Localplay
if (!Access::check('localplay', '50')) {
debug_event('DENIED', 'Attempted to delete track without access', '1');
exit;
}
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
$localplay->connect();
// Scrub in the delete request
$id = intval($_REQUEST['id']);
$localplay->delete_track($id);
// Wait in case we just deleted what we were playing
sleep(3);
$objects = $localplay->get();
$status = $localplay->status();
ob_start();
$browse = new Browse();
$browse->set_type('playlist_localplay');
$browse->set_static_content(true);
$browse->save_objects($objects);
$browse->show_objects($objects);
$browse->store();
$results[$browse->get_content_div()] = ob_get_contents();
ob_end_clean();
break;
case 'delete_instance':
// Make sure that you have access to do this...
if (!Access::check('localplay', '75')) {
debug_event('DENIED', 'Attempted to delete instance without access', '1');
exit;
}
// Scrub it in
$localplay = new Localplay(AmpConfig::get('localplay_controller'));
示例10: Browse
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* 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.
*
*/
$sql = Stats::get_newest_sql('album');
$browse = new Browse();
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_newest_sql('artist');
$browse = new Browse();
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
示例11: Shoutbox
switch ($_REQUEST['action']) {
case 'edit_shout':
$shout = new Shoutbox($_REQUEST['shout_id']);
if ($shout->id) {
$shout->update($_POST);
}
show_confirmation(T_('Shoutbox Post Updated'), '', AmpConfig::get('web_path') . '/admin/shout.php');
break;
case 'show_edit':
$shout = new Shoutbox($_REQUEST['shout_id']);
$object = Shoutbox::get_object($shout->object_type, $shout->object_id);
$object->format();
$client = new User($shout->user);
$client->format();
require_once AmpConfig::get('prefix') . '/templates/show_edit_shout.inc.php';
break;
case 'delete':
Shoutbox::delete($_REQUEST['shout_id']);
show_confirmation(T_('Shoutbox Post Deleted'), '', AmpConfig::get('web_path') . '/admin/shout.php');
break;
default:
$browse = new Browse();
$browse->set_type('shoutbox');
$browse->set_simple_browse(true);
$shoutbox_ids = $browse->get_objects();
$browse->show_objects($shoutbox_ids);
$browse->store();
break;
}
// end switch on action
UI::show_footer();
示例12: Browse
$browse = new Browse();
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Userflag::get_latest_sql('artist');
$browse = new Browse();
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Userflag::get_latest_sql('song');
$browse = new Browse();
$browse->set_type('song', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
if (AmpConfig::get('allow_video')) {
$sql = Userflag::get_latest_sql('video');
$browse = new Browse();
$browse->set_type('video', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
}
$sql = Userflag::get_latest_sql('playlist');
$browse = new Browse();
$browse->set_type('playlist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
示例13: Browse
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once 'lib/init.php';
UI::show_header();
/**
* action switch
*/
switch ($_REQUEST['action']) {
case 'search':
if ($_REQUEST['rule_1'] != 'missing_artist') {
$browse = new Browse();
require_once AmpConfig::get('prefix') . '/templates/show_search_form.inc.php';
require_once AmpConfig::get('prefix') . '/templates/show_search_options.inc.php';
$results = Search::run($_REQUEST);
$browse->set_type($_REQUEST['type']);
$browse->show_objects($results);
$browse->store();
} else {
$wartists = Wanted::search_missing_artists($_REQUEST['rule_1_input']);
require_once AmpConfig::get('prefix') . '/templates/show_missing_artists.inc.php';
echo '<a href="http://musicbrainz.org/search?query=' . rawurlencode($_REQUEST['rule_1_input']) . '&type=artist&method=indexed" target="_blank">' . T_('View on MusicBrainz') . '</a><br />';
}
break;
case 'save_as_smartplaylist':
if (!Access::check('interface', 25)) {
UI::access_denied();
exit;
}
$playlist = new Search();
$playlist->parse_rules(Search::clean_request($_REQUEST));
示例14: Browse
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2015 Ampache.org
*
* 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.
*
*/
$object_ids = Wanted::get_wanted_list();
$browse = new Browse();
$browse->set_type('wanted');
$browse->set_static_content(true);
$browse->save_objects($object_ids);
$browse->show_objects($object_ids);
$browse->store();
示例15: isset
$browse->show_objects();
break;
case 'tag':
//FIXME: This whole thing is ugly, even though it works.
$browse->set_sort('count', 'ASC');
// This one's a doozy
$browse_type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'artist';
$browse->set_simple_browse(false);
$browse->save_objects(Tag::get_tags($browse_type, 0, 'name'));
// Should add a pager?
$object_ids = $browse->get_saved();
$keys = array_keys($object_ids);
Tag::build_cache($keys);
UI::show_box_top(T_('Tag Cloud'), 'box box_tag_cloud');
$browse2 = new Browse();
$browse2->set_type($browse_type);
$browse2->store();
require_once AmpConfig::get('prefix') . UI::find_template('show_tagcloud.inc.php');
UI::show_box_bottom();
$type = $browse2->get_type();
require_once AmpConfig::get('prefix') . UI::find_template('browse_content.inc.php');
break;
case 'artist':
$browse->set_filter('catalog', $_SESSION['catalog']);
if (AmpConfig::get('catalog_disable')) {
$browse->set_filter('catalog_enabled', '1');
}
$browse->set_sort('name', 'ASC');
$browse->update_browse_from_session();
$browse->show_objects();
break;