Commit bb505253 authored by mattl's avatar mattl

fixes

parent 9a5b9b5f
......@@ -27,79 +27,9 @@ require_once('data/RemoteUser.php');
require_once('data/TagCloud.php');
require_once('data/Server.php');
if (!isset($_GET['user']) && $logged_in == false) {
displayError("Error", "User not set. You shouldn't be here.");
}
try {
if(strstr($_GET['user'], '@')) {
$user = new RemoteUser($_GET['user']);
} else {
$user = new User($_GET['user']);
}
} catch (Exception $e) {
$user = null;
}
if (isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
try {
$aUserScrobbles = $user->getScrobbles(10);
$smarty->assign('scrobbles', $aUserScrobbles);
} catch (Exception $e) {}
try {
$aUserNowPlaying = $user->getNowPlaying(10);
$smarty->assign('nowplaying', $aUserNowPlaying);
} catch (Exception $e) {}
if ($user->hasLoved()) {
$recommendedArtists = $user->getRecommended(10);
$smarty->assign('recommendedArtists', $recommendedArtists);
if($user->remote) {
// Just get the 10 most recently loved artists from a remote user
$lovedArtists = $user->getLovedArtists(10);
$smarty->assign('lovedArtists', $lovedArtists);
} else {
$lovedArtists = TagCloud::generateTagCloud('loved', 'artist', 10, 'userid', $user->uniqueid);
$smarty->assign('lovedArtists', $lovedArtists);
}
}
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('pagetitle', $user->name);
$smarty->assign('awesomenumber', $user->uniqueid);
$smarty->assign('extra_head_links', array(
array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Recent plays)',
'href' => $base_url . '/rdf.php?fmt=rss&page=' . rawurlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
),
array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Journal)',
'href' => $user->journal_rss
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . rawurlencode(str_replace($base_url, '', $user->getURL()))
)
));
$neighbours = $user->getNeighbours(9);
if (!empty($neighbours)) {
$smarty->assign('neighbours', $neighbours);
$smarty->assign('sideblocks', array('sidebar-neighbours.tpl'));
}
$submenu = user_menu($user, 'Overview');
$smarty->assign('submenu', $submenu);
$smarty->display('user-profile.tpl');
} else {
displayError("User not found", "User not found, shall I call in a missing persons report?");
}
......@@ -27,79 +27,8 @@ require_once('data/RemoteUser.php');
require_once('data/TagCloud.php');
require_once('data/Server.php');
if (!isset($_GET['user']) && $logged_in == false) {
displayError("Error", "User not set. You shouldn't be here.");
}
try {
if(strstr($_GET['user'], '@')) {
$user = new RemoteUser($_GET['user']);
} else {
$user = new User($_GET['user']);
}
} catch (Exception $e) {
$user = null;
}
if (isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
try {
$aUserScrobbles = $user->getScrobbles(10);
$smarty->assign('scrobbles', $aUserScrobbles);
} catch (Exception $e) {}
try {
$aUserNowPlaying = $user->getNowPlaying(10);
$smarty->assign('nowplaying', $aUserNowPlaying);
} catch (Exception $e) {}
if ($user->hasLoved()) {
$recommendedArtists = $user->getRecommended(10);
$smarty->assign('recommendedArtists', $recommendedArtists);
if($user->remote) {
// Just get the 10 most recently loved artists from a remote user
$lovedArtists = $user->getLovedArtists(10);
$smarty->assign('lovedArtists', $lovedArtists);
} else {
$lovedArtists = TagCloud::generateTagCloud('loved', 'artist', 10, 'userid', $user->uniqueid);
$smarty->assign('lovedArtists', $lovedArtists);
}
}
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('pagetitle', $user->name);
$smarty->assign('awesomenumber', $user->uniqueid);
$smarty->assign('extra_head_links', array(
array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Recent plays)',
'href' => $base_url . '/rdf.php?fmt=rss&page=' . rawurlencode(str_replace($base_url, '', $user->getURL('recent-tracks')))
),
array(
'rel' => 'alternate',
'type' => 'application/rss+xml',
'title' => 'RSS 1.0 Feed (Journal)',
'href' => $user->journal_rss
),
array(
'rel' => 'meta',
'type' => 'application/rdf+xml',
'title' => 'FOAF',
'href' => $base_url . '/rdf.php?fmt=xml&page=' . rawurlencode(str_replace($base_url, '', $user->getURL()))
)
));
$neighbours = $user->getNeighbours(9);
if (!empty($neighbours)) {
$smarty->assign('neighbours', $neighbours);
$smarty->assign('sideblocks', array('sidebar-neighbours.tpl'));
}
$submenu = user_menu($user, 'Overview');
$smarty->assign('submenu', $submenu);
$smarty->display('user-profile.tpl');
} else {
displayError("User not found", "User not found, shall I call in a missing persons report?");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment