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


PHP Playlist::get_song_count方法代码示例

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


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

示例1: Album

     require AmpConfig::get('prefix') . '/templates/show_song_row.inc.php';
     break;
 case 'refresh_album':
     $album = new Album($_REQUEST['id']);
     $album->format();
     require AmpConfig::get('prefix') . '/templates/show_album_row.inc.php';
     break;
 case 'refresh_artist':
     $artist = new Artist($_REQUEST['id'], $_SESSION['catalog']);
     $artist->format();
     require AmpConfig::get('prefix') . '/templates/show_artist_row.inc.php';
     break;
 case 'refresh_playlist':
     $playlist = new Playlist($_REQUEST['id']);
     $playlist->format();
     $count = $playlist->get_song_count();
     require AmpConfig::get('prefix') . '/templates/show_playlist_row.inc.php';
     break;
 case 'refresh_smartplaylist':
     $playlist = new Search('song', $_REQUEST['id']);
     $playlist->format();
     require AmpConfig::get('prefix') . '/templates/show_smartplaylist_row.inc.php';
     break;
 case 'refresh_livestream':
     $radio = new Radio($_REQUEST['id']);
     $radio->format();
     require AmpConfig::get('prefix') . '/templates/show_live_stream_row.inc.php';
     break;
 case 'refresh_channel':
     $channel = new Channel($_REQUEST['id']);
     $channel->format();
开发者ID:axelsimon,项目名称:ampache,代码行数:31,代码来源:refresh_updated.server.php

示例2: playlists

 /**
  * playlists
  *
  * This takes an array of playlist ids and then returns a nice pretty XML document
  *
  * @param    array    $playlists    (description here...)
  * @return    string    return xml
  */
 public static function playlists($playlists)
 {
     if (count($playlists) > self::$limit or self::$offset > 0) {
         $playlists = array_slice($playlists, self::$offset, self::$limit);
     }
     $string = '';
     // Foreach the playlist ids
     foreach ($playlists as $playlist_id) {
         $playlist = new Playlist($playlist_id);
         $playlist->format();
         $item_total = $playlist->get_song_count();
         // Build this element
         $string .= "<playlist id=\"{$playlist->id}\">\n" . "\t<name><![CDATA[{$playlist->name}]]></name>\n" . "\t<owner><![CDATA[{$playlist->f_user}]]></owner>\n" . "\t<items>{$item_total}</items>\n" . "\t<type>{$playlist->type}</type>\n" . "</playlist>\n";
     }
     // end foreach
     // Build the final and then send her off
     $final = self::_header() . $string . self::_footer();
     return $final;
 }
开发者ID:cheese1,项目名称:ampache,代码行数:27,代码来源:xml_data.class.php


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