diff options
author | dipsol <dipsol@ampache> | 2009-05-26 13:24:58 +0000 |
---|---|---|
committer | dipsol <dipsol@ampache> | 2009-05-26 13:24:58 +0000 |
commit | 25fab47331e88113d81db6afd2777d230ba02f64 (patch) | |
tree | c86ac92d6ab00d8873da65756a9ef0d248ab0d11 /song.php | |
parent | 2130244323f7a79a6fbaadac04a14c741d88fab3 (diff) | |
download | ampache-25fab47331e88113d81db6afd2777d230ba02f64.tar.gz ampache-25fab47331e88113d81db6afd2777d230ba02f64.tar.bz2 ampache-25fab47331e88113d81db6afd2777d230ba02f64.zip |
added link from now playing to the lyrics
Diffstat (limited to 'song.php')
-rw-r--r-- | song.php | 42 |
1 files changed, 30 insertions, 12 deletions
@@ -21,18 +21,19 @@ require 'lib/init.php'; -show_header(); +show_header(); + +$show_lyrics = Config::get('show_lyrics'); // Switch on Action -switch ($_REQUEST['action']) { - default: - case 'show_song': - $song = new Song($_REQUEST['song_id']); - $song->format(); - $song->fill_ext_info(); - require_once Config::get('prefix') . '/templates/show_song.inc.php'; +switch ($_REQUEST['action']) { + default: + case 'show_song': + $song = new Song($_REQUEST['song_id']); + $song->format(); + $song->fill_ext_info(); + require_once Config::get('prefix') . '/templates/show_song.inc.php'; // does user want to display lyrics? - $show_lyrics = Config::get('show_lyrics'); if($show_lyrics == 1) { $lyric = new Artist(); $return = $lyric->get_song_lyrics($song->id, ucwords($song->f_artist), ucwords($song->title)); @@ -42,9 +43,26 @@ switch ($_REQUEST['action']) { $link .= "</a><br /><br />"; require_once Config::get('prefix') . '/templates/show_lyrics.inc.php'; } - break; -} // end data collection + break; + case 'show_lyrics': + if($show_lyrics == 1) { + $song = new Song($_REQUEST['song_id']); + $song->format(); + $song->fill_ext_info(); + require_once Config::get('prefix') . '/templates/show_lyrics_song.inc.php'; + + // get the lyrics + $show_lyrics = Config::get('show_lyrics'); + $lyric = new Artist(); + $return = $lyric->get_song_lyrics($song->id, ucwords($song->f_artist), ucwords($song->title)); + $link = '<a href="http://lyricwiki.org/' . rawurlencode(ucwords($song->f_artist)) . ':' . rawurlencode(ucwords($song->title)) . '" target="_blank">'; + /* HINT: Artist, Song Title */ + $link .= sprintf(_('%1$s - %2$s Lyrics Detail'), ucwords($song->f_artist), ucwords($song->title)); + $link .= "</a><br /><br />"; + require_once Config::get('prefix') . '/templates/show_lyrics.inc.php'; + } +} // end data collection -show_footer(); +show_footer(); ?> |