本文整理匯總了PHP中Browse::get_type方法的典型用法代碼示例。如果您正苦於以下問題:PHP Browse::get_type方法的具體用法?PHP Browse::get_type怎麽用?PHP Browse::get_type使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Browse
的用法示例。
在下文中一共展示了Browse::get_type方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isset
$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;
case 'song':
$browse->set_filter('catalog', $_SESSION['catalog']);
if (AmpConfig::get('catalog_disable')) {
$browse->set_filter('catalog_enabled', '1');
示例2: elseif
$browse->set_catalog($_SESSION['catalog']);
}
if ($_REQUEST['sort']) {
// Set the new sort value
$browse->set_sort($_REQUEST['sort']);
}
if ($_REQUEST['catalog_key'] || $_SESSION['catalog'] != 0) {
$browse->set_filter('catalog', $_REQUEST['catalog_key']);
$_SESSION['catalog'] = $_REQUEST['catalog_key'];
} elseif ($_REQUEST['catalog_key'] == 0) {
$browse->set_filter('catalog', null);
unset($_SESSION['catalog']);
}
ob_start();
$browse->show_objects();
$results['browse_content_' . $browse->get_type()] = 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();
$results['browse_content_' . $browse->get_type()] = ob_get_clean();
break;
case 'toggle_tag':
$type = $_SESSION['tagcloud_type'] ? $_SESSION['tagcloud_type'] : 'song';
$browse->set_type($type);