artist.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /* GNU FM -- a free network service for sharing your music listening habits
  3. Copyright (C) 2009 Free Software Foundation, Inc
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU Affero General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. require_once('database.php');
  16. require_once('templating.php');
  17. require_once('data/sanitize.php');
  18. require_once('data/Server.php');
  19. require_once('data/TagCloud.php');
  20. require_once('artist-menu.php');
  21. $station = 'librefm://artist/' . $artist->name;
  22. if (isset($this_user)) {
  23. $smarty->assign('station', $station);
  24. } else {
  25. $radio_session = Server::getRadioSession($station);
  26. $smarty->assign('radio_session', $radio_session);
  27. }
  28. $smarty->assign('name', $artist->name);
  29. $smarty->assign('id', $artist->id);
  30. $smarty->assign('bio_summary', $artist->bio_summary);
  31. $smarty->assign('bio_content', $artist->bio_content);
  32. $smarty->assign('homepage', $artist->homepage);
  33. $smarty->assign('streamable', $artist->isStreamable());
  34. $smarty->assign('image', $artist->image_medium ? $artist->image_medium : $artist->image_small);
  35. $smarty->assign('hashtag', $artist->hashtag);
  36. $smarty->assign('flattr_uid', $artist->flattr_uid);
  37. $smarty->assign('url', $artist->getURL());
  38. $smarty->assign('similarArtists', $artist->getSimilar());
  39. $aArtistAlbums = $artist->getAlbums();
  40. if ($aArtistAlbums) {
  41. $smarty->assign('albums', $aArtistAlbums);
  42. }
  43. try {
  44. $tagCloud = TagCloud::generateTagCloud('tags', 'tag', 10, 'artist', $artist->name);
  45. $smarty->assign('tagcloud', $tagCloud);
  46. } catch (Exception $ex) {
  47. $tagCloud = array();
  48. }
  49. $submenu = artist_menu($artist, 'Overview');
  50. $smarty->assign('submenu', $submenu);
  51. $smarty->display('artist.tpl');