artist.php 2.17 KB
Newer Older
1 2
<?php

3
/* GNU FM -- a free network service for sharing your music listening habits
4

5
   Copyright (C) 2009 Free Software Foundation, Inc
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU Affero General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU Affero General Public License for more details.

   You should have received a copy of the GNU Affero General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

clint's avatar
clint committed
22 23 24 25 26
require_once('database.php');
require_once('templating.php');
require_once('data/sanitize.php');
require_once('data/Server.php');
require_once('data/TagCloud.php');
27
require_once('artist-menu.php');
28

29
$station = 'librefm://artist/' . $artist->name;
30
if (isset($this_user)) {
31
	$smarty->assign('station', $station);
32 33
} else {
	$radio_session = Server::getRadioSession($station);
34
	$smarty->assign('radio_session', $radio_session);
35 36
}

elleo's avatar
elleo committed
37 38 39
$smarty->assign('name', $artist->name);
$smarty->assign('id', $artist->id);
$smarty->assign('bio_summary', $artist->bio_summary);
40
$smarty->assign('bio_content', $artist->bio_content);
41
$smarty->assign('homepage', $artist->homepage);
42
$smarty->assign('streamable', $artist->isStreamable());
43
$smarty->assign('image', $artist->image_medium ? $artist->image_medium : $artist->image_small);
44
$smarty->assign('hashtag', $artist->hashtag);
45 46
$smarty->assign('flattr_uid', $artist->flattr_uid);
$smarty->assign('url', $artist->getURL());
47
$smarty->assign('similarArtists', $artist->getSimilar());
48

Matt Lee's avatar
Matt Lee committed
49
$aArtistAlbums = $artist->getAlbums();
50
if ($aArtistAlbums) {
elleo's avatar
elleo committed
51
	$smarty->assign('albums', $aArtistAlbums);
52
}
53

54
try {
55
	$tagCloud = TagCloud::generateTagCloud('tags', 'tag', 10, 'artist', $artist->name);
56
	$smarty->assign('tagcloud', $tagCloud);
57
} catch (Exception $ex) {
58 59 60
	$tagCloud = array();
}

61 62
$submenu = artist_menu($artist, 'Overview');
$smarty->assign('submenu', $submenu);
63

64
$smarty->display('artist.tpl');