本文整理匯總了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;
}