本文整理汇总了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();
示例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;
}