当前位置: 首页>>代码示例>>PHP>>正文


PHP Browse::get_saved方法代码示例

本文整理汇总了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');
开发者ID:bl00m,项目名称:ampache,代码行数:31,代码来源:browse.php

示例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;
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:ajax.server.php

示例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
            }
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:batch.php


注:本文中的Browse::get_saved方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。