diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-08-17 20:59:16 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-08-17 20:59:16 +0000 |
commit | df80bd72432011010dc0e91ab564659ca6b2c500 (patch) | |
tree | c68f957da32a382bf3a542b7e7f3e54b886483ca /templates/show_now_playing_row.inc.php | |
parent | 34d1449660437c2ea24dd55989efebf4e01d485f (diff) | |
download | ampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.gz ampache-df80bd72432011010dc0e91ab564659ca6b2c500.tar.bz2 ampache-df80bd72432011010dc0e91ab564659ca6b2c500.zip |
Refactored Last.FM recommendations; drop new dependency on curl since
Snoopy works just as well for this application.
Diffstat (limited to 'templates/show_now_playing_row.inc.php')
-rw-r--r-- | templates/show_now_playing_row.inc.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index ad33429f..c6f4988f 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -82,3 +82,41 @@ $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full)); </div> </div> <?php } // end play album art ?> + +<?php if (Config::get('show_similar')) { ?> +<div class="np_group"> +<?php if ($artists = Recommendation::get_artists_like($media->artist, 3, false)) { ?> + <div class="np_cel cel_similar"> + <label><?php echo _('Similar Artists'); ?></label> + <?php foreach ($artists as $a) { ?> + <div class="np_cel cel_similar_artist"> + <?php + if (is_null($a['id'])) { + echo scrub_out(truncate_with_ellipsis($a['name']), Config::get('ellipse_threshold_artist')); + } + else { + $artist = new Artist($a['id']); + $artist->format(); + echo $artist->f_name_link; + } + ?> + </div> + <?php } // end foreach ?> + </div> +<?php } // end show similar artists ?> +<?php if ($songs = Recommendation::get_songs_like($media->id, 3)) { ?> + <div class="np_cel cel_similar"> + <label><?php echo _('Similar Songs'); ?></label> + <?php foreach ($songs as $s) { ?> + <div class="np_cel cel_similar_song"> + <?php + $song = new Song($s['id']); + $song->format(); + echo $song->f_link; + ?> + </div> + <?php } // end foreach ?> + </div> +<?php } // end show similar songs ?> +</div> +<?php } // end show similar things ?> |