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


PHP Playlist::get_songs方法代码示例

本文整理汇总了PHP中Playlist::get_songs方法的典型用法代码示例。如果您正苦于以下问题:PHP Playlist::get_songs方法的具体用法?PHP Playlist::get_songs怎么用?PHP Playlist::get_songs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Playlist的用法示例。


在下文中一共展示了Playlist::get_songs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: album

     $media_ids = $album->get_random_songs();
     break;
 case 'album':
     debug_event('stream.php', 'Playing/Adding all songs of album(s) {' . $_REQUEST['album_id'] . '}...', '5');
     $albums_array = explode(',', $_REQUEST['album_id']);
     foreach ($albums_array as $a) {
         $album = new Album($a);
         $songs = $album->get_songs();
         foreach ($songs as $song) {
             $media_ids[] = array('object_type' => 'song', 'object_id' => $song);
         }
     }
     break;
 case 'playlist':
     $playlist = new Playlist($_REQUEST['playlist_id']);
     $songs = $playlist->get_songs();
     foreach ($songs as $song) {
         $media_ids[] = array('object_type' => 'song', 'object_id' => $song);
     }
     break;
 case 'smartplaylist':
     $playlist = new Search('song', $_REQUEST['playlist_id']);
     $items = $playlist->get_items();
     foreach ($items as $item) {
         $media_ids[] = array('object_type' => $item['object_type'], 'object_id' => $item['object_id']);
     }
     break;
 case 'playlist_random':
     $playlist = new Playlist($_REQUEST['playlist_id']);
     $media_ids = $playlist->get_random_items();
     break;
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:stream.php

示例2: addShare

 public static function addShare($xml, $share)
 {
     $xshare = $xml->addChild('share');
     $xshare->addAttribute('id', $share->id);
     $xshare->addAttribute('url', $share->public_url);
     $xshare->addAttribute('description', $share->description);
     $user = new User($share->user);
     $xshare->addAttribute('username', $user->username);
     $xshare->addAttribute('created', date("c", $share->creation_date));
     if ($share->lastvisit_date > 0) {
         $xshare->addAttribute('lastVisited', date("c", $share->lastvisit_date));
     }
     if ($share->expire_days > 0) {
         $xshare->addAttribute('expires', date("c", $share->creation_date + $share->expire_days * 86400));
     }
     $xshare->addAttribute('visitCount', $share->counter);
     if ($share->object_type == 'song') {
         $song = new Song($share->object_id);
         self::addSong($xshare, $song, "entry");
     } elseif ($share->object_type == 'playlist') {
         $playlist = new Playlist($share->object_id);
         $songs = $playlist->get_songs();
         foreach ($songs as $id) {
             $song = new Song($id);
             self::addSong($xshare, $song, "entry");
         }
     } elseif ($share->object_type == 'album') {
         $album = new Album($share->object_id);
         $songs = $album->get_songs();
         foreach ($songs as $id) {
             $song = new Song($id);
             self::addSong($xshare, $song, "entry");
         }
     }
 }
开发者ID:nioc,项目名称:ampache,代码行数:35,代码来源:subsonic_xml_data.class.php

示例3: Artist

             }
         }
         break;
     case 'artist':
         debug_event('playlist', 'Adding all songs of artist {' . $item_id . '}...', '5');
         $artist = new Artist($item_id);
         $songs[] = $artist->get_songs();
         break;
     case 'song_preview':
     case 'song':
         debug_event('playlist', 'Adding song {' . $item_id . '}...', '5');
         $songs = explode(',', $item_id);
         break;
     case 'playlist':
         $pl = new Playlist($item_id);
         $songs = $pl->get_songs();
         break;
     default:
         debug_event('playlist', 'Adding all songs of current playlist...', '5');
         $objects = $GLOBALS['user']->playlist->get_items();
         foreach ($objects as $object_data) {
             $type = array_shift($object_data);
             if ($type == 'song') {
                 $songs[] = array_shift($object_data);
             }
         }
         break;
 }
 if (count($songs) > 0) {
     Ajax::set_include_override(true);
     $playlist->add_songs($songs, true);
开发者ID:cheese1,项目名称:ampache,代码行数:31,代码来源:playlist.ajax.php

示例4: array

if (!defined('NO_SESSION') && !Access::check_function('batch_download')) {
    UI::access_denied();
    exit;
}
/* Drop the normal Time limit constraints, this can take a while */
set_time_limit(0);
$media_ids = array();
$name = "Unknown.zip";
switch ($_REQUEST['action']) {
    case 'tmp_playlist':
        $media_ids = $GLOBALS['user']->playlist->get_items();
        $name = $GLOBALS['user']->username . ' - Playlist';
        break;
    case 'playlist':
        $playlist = new Playlist($_REQUEST['id']);
        $media_ids = $playlist->get_songs();
        $name = $playlist->name;
        break;
    case 'smartplaylist':
        $search = new Search('song', $_REQUEST['id']);
        $sql = $search->to_sql();
        $sql = $sql['base'] . ' ' . $sql['table_sql'] . ' WHERE ' . $sql['where_sql'];
        $db_results = Dba::read($sql);
        while ($row = Dba::fetch_assoc($db_results)) {
            $media_ids[] = $row['id'];
        }
        $name = $search->name;
        break;
    case 'album':
        foreach ($_REQUEST['id'] as $a) {
            $album = new Album($a);
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:batch.php


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