2012-01-19 08:00:18 +00:00
|
|
|
<?
|
|
|
|
|
|
|
|
if(!empty($_GET['userid'])) {
|
|
|
|
if(!check_perms('users_override_paranoia')) {
|
2013-02-22 08:00:24 +00:00
|
|
|
print
|
2012-01-19 08:00:18 +00:00
|
|
|
json_encode(
|
|
|
|
array(
|
|
|
|
'status' => 'failure'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
$UserID = $_GET['userid'];
|
|
|
|
$Sneaky = ($UserID != $LoggedUser['ID']);
|
|
|
|
if(!is_number($UserID)) {
|
2013-02-22 08:00:24 +00:00
|
|
|
print
|
2012-01-19 08:00:18 +00:00
|
|
|
json_encode(
|
|
|
|
array(
|
|
|
|
'status' => 'failure'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
$DB->query("SELECT Username FROM users_main WHERE ID='$UserID'");
|
|
|
|
list($Username) = $DB->next_record();
|
|
|
|
} else {
|
|
|
|
$UserID = $LoggedUser['ID'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$Sneaky = ($UserID != $LoggedUser['ID']);
|
|
|
|
|
2013-03-29 08:00:08 +00:00
|
|
|
//$ArtistList = Bookmarks::all_bookmarks('artist', $UserID);
|
2012-01-19 08:00:18 +00:00
|
|
|
|
|
|
|
$DB->query('SELECT ag.ArtistID, ag.Name
|
|
|
|
FROM bookmarks_artists AS ba
|
|
|
|
INNER JOIN artists_group AS ag ON ba.ArtistID = ag.ArtistID
|
|
|
|
WHERE ba.UserID = '.$UserID);
|
|
|
|
|
|
|
|
$ArtistList = $DB->to_array();
|
|
|
|
|
|
|
|
$JsonArtists = array();
|
|
|
|
foreach($ArtistList as $Artist) {
|
|
|
|
list($ArtistID, $Name) = $Artist;
|
|
|
|
$JsonArtists[] = array(
|
|
|
|
'artistId' => (int) $ArtistID,
|
|
|
|
'artistName' => $Name
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
print
|
|
|
|
json_encode(
|
|
|
|
array(
|
|
|
|
'status' => 'success',
|
|
|
|
'response' => array(
|
|
|
|
'artists' => $JsonArtists
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
?>
|