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