From 25fab47331e88113d81db6afd2777d230ba02f64 Mon Sep 17 00:00:00 2001 From: dipsol Date: Tue, 26 May 2009 13:24:58 +0000 Subject: [PATCH] added link from now playing to the lyrics --- song.php | 42 ++++++++++++----- templates/show_lyrics_song.inc.php | 65 ++++++++++++++++++++++++++ templates/show_now_playing_row.inc.php | 11 ++++- 3 files changed, 105 insertions(+), 13 deletions(-) create mode 100644 templates/show_lyrics_song.inc.php 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 .= "

"; 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'; -show_footer(); + // 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 = ''; + /* HINT: Artist, Song Title */ + $link .= sprintf(_('%1$s - %2$s Lyrics Detail'), ucwords($song->f_artist), ucwords($song->title)); + $link .= "

"; + require_once Config::get('prefix') . '/templates/show_lyrics.inc.php'; + } +} // end data collection + +show_footer(); ?> diff --git a/templates/show_lyrics_song.inc.php b/templates/show_lyrics_song.inc.php new file mode 100644 index 00000000..4a6fc52a --- /dev/null +++ b/templates/show_lyrics_song.inc.php @@ -0,0 +1,65 @@ +title); + +/* Prepare the variables */ +$title = scrub_out(truncate_with_ellipsis($song->title)); +$album = scrub_out(truncate_with_ellipsis($song->f_album_full)); +$artist = scrub_out(truncate_with_ellipsis($song->f_artist_full)); +?> +
+ +
+ + <?php echo scrub_out($song->f_album_full); ?> + +
+ + +
+ +
+
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + \ No newline at end of file diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index f3cfc842..bd1f95cc 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -31,13 +31,22 @@ $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full)); fullname); ?> - +
id,'song'); ?>
+ + +
+ + + + +
+