本文整理汇总了PHP中Browse::get_saved方法的典型用法代码示例。如果您正苦于以下问题:PHP Browse::get_saved方法的具体用法?PHP Browse::get_saved怎么用?PHP Browse::get_saved使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browse
的用法示例。
在下文中一共展示了Browse::get_saved方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
$browse->set_filter('catalog_enabled', '1');
}
$browse->set_sort('name', 'ASC');
$browse->update_browse_from_session();
// Update current index depending on what is in session.
$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');
示例2: array
$object_type = $_REQUEST['type'];
$object_id = $_REQUEST['id'];
if (Core::is_playable_item($object_type)) {
if (!is_array($object_id)) {
$object_id = array($object_id);
}
foreach ($object_id as $id) {
$item = new $object_type($id);
$medias = $item->get_medias();
$GLOBALS['user']->playlist->add_medias($medias);
}
} else {
switch ($_REQUEST['type']) {
case 'browse_set':
$browse = new Browse($_REQUEST['browse_id']);
$objects = $browse->get_saved();
foreach ($objects as $object_id) {
$GLOBALS['user']->playlist->add_object($object_id, 'song');
}
break;
case 'album_random':
$data = explode('_', $_REQUEST['type']);
$type = $data['0'];
foreach ($_REQUEST['id'] as $i) {
$object = new $type($i);
$songs = $object->get_random_songs();
foreach ($songs as $song_id) {
$GLOBALS['user']->playlist->add_object($song_id, 'song');
}
}
break;
示例3: switch
if ($libitem->id) {
$libitem->format();
$name = $libitem->get_fullname();
$media_ids = array_merge($media_ids, $libitem->get_medias());
}
}
} else {
switch ($_REQUEST['action']) {
case 'tmp_playlist':
$media_ids = $GLOBALS['user']->playlist->get_items();
$name = $GLOBALS['user']->username . ' - Playlist';
break;
case 'browse':
$id = intval(scrub_in($_REQUEST['browse_id']));
$browse = new Browse($id);
$browse_media_ids = $browse->get_saved();
foreach ($browse_media_ids as $media_id) {
switch ($object_type) {
case 'album':
$album = new Album($media_id);
$media_ids = array_merge($media_ids, $album->get_songs());
break;
case 'song':
$media_ids[] = $media_id;
break;
case 'video':
$media_ids[] = array('object_type' => 'Video', 'object_id' => $media_id);
break;
}
// switch on type
}