本文整理匯總了PHP中Song::get_lyrics方法的典型用法代碼示例。如果您正苦於以下問題:PHP Song::get_lyrics方法的具體用法?PHP Song::get_lyrics怎麽用?PHP Song::get_lyrics使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Song
的用法示例。
在下文中一共展示了Song::get_lyrics方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Song
break;
}
$song = new Song($_REQUEST['song_id']);
if (!Catalog::can_remove($song)) {
debug_event('song', 'Unauthorized to remove the song `.' . $song->id . '`.', 1);
UI::access_denied();
exit;
}
if ($song->remove_from_disk()) {
show_confirmation(T_('Song Deletion'), T_('Song has been deleted.'), AmpConfig::get('web_path'));
} else {
show_confirmation(T_('Song Deletion'), T_('Cannot delete this song.'), AmpConfig::get('web_path'));
}
break;
case 'show_lyrics':
$song = new Song($_REQUEST['song_id']);
$song->format();
$song->fill_ext_info();
$lyrics = $song->get_lyrics();
require_once AmpConfig::get('prefix') . UI::find_template('show_lyrics.inc.php');
break;
case 'show_song':
default:
$song = new Song($_REQUEST['song_id']);
$song->format();
$song->fill_ext_info();
require_once AmpConfig::get('prefix') . UI::find_template('show_song.inc.php');
break;
}
// end data collection
UI::show_footer();
示例2: addLyrics
public static function addLyrics($xml, $artist, $title, $song_id)
{
$song = new Song($song_id);
$song->format();
$song->fill_ext_info();
$lyrics = $song->get_lyrics();
if ($lyrics && $lyrics['text']) {
$text = preg_replace('/\\<br(\\s*)?\\/?\\>/i', "\n", $lyrics['text']);
$text = str_replace("\r", '', $text);
$xlyrics = $xml->addChild("lyrics", $text);
if ($artist) {
$xlyrics->addAttribute("artist", $artist);
}
if ($title) {
$xlyrics->addAttribute("title", $title);
}
}
}