We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

artist.php 1.73 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 22

   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
23 24 25 26 27
require_once('database.php');
require_once('templating.php');
require_once('data/sanitize.php');
require_once('data/Server.php');
require_once('data/TagCloud.php');
28

29
try {
30
	$artist = new Artist(urldecode($_GET['artist']));
31 32
} catch (exception $e) {
        $smarty->assign('error', 'Artist not found.');
clint's avatar
er  
clint committed
33
        $smarty->assign('details', 'The artist '.($_GET['artist']).' was not found in the database.');
Jørgen Bøhnsdalen's avatar
Jørgen Bøhnsdalen committed
34
	$smarty->display('error.tpl');
mattl's avatar
add die  
mattl committed
35
	die();
36
}
37

elleo's avatar
elleo committed
38 39 40
$smarty->assign('name', $artist->name);
$smarty->assign('id', $artist->id);
$smarty->assign('bio_summary', $artist->bio_summary);
41 42

$aArtistAlbums = $artist->getAlbums();
43
if ($aArtistAlbums) {
elleo's avatar
elleo committed
44
	$smarty->assign('albums', $aArtistAlbums);
45
}
46

47 48 49 50 51
$smarty->assign('extra_head_links', array(
		array(
			'rel' => 'meta',
			'type' => 'application/rdf+xml' ,
			'title' => 'FOAF',
tobyink's avatar
tobyink committed
52
			'href' => $base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '', $artist->getURL()))
53 54 55
			)
	));

56 57
$smarty->display("artist.tpl");
?>