summaryrefslogtreecommitdiffstats
path: root/song.php
diff options
context:
space:
mode:
authordipsol <dipsol@ampache>2009-05-26 13:24:58 +0000
committerdipsol <dipsol@ampache>2009-05-26 13:24:58 +0000
commit25fab47331e88113d81db6afd2777d230ba02f64 (patch)
treec86ac92d6ab00d8873da65756a9ef0d248ab0d11 /song.php
parent2130244323f7a79a6fbaadac04a14c741d88fab3 (diff)
downloadampache-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.php42
1 files changed, 30 insertions, 12 deletions
diff --git a/song.php b/song.php
index 96182eba..b92ba09c 100644
--- a/song.php
+++ b/song.php
@@ -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();
?>