123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- #declare(strict_types=1);
-
- if (!empty($_GET['userid'])) {
- if (!check_perms('users_override_paranoia')) {
- json_die('failure');
- }
-
- $UserID = $_GET['userid'];
- $Sneaky = ($UserID !== $LoggedUser['ID']);
-
- if (!is_number($UserID)) {
- json_die('failure');
- }
-
- $DB->query("
- SELECT
- `Username`
- FROM
- `users_main`
- WHERE
- `ID` = '$UserID'
- ");
- list($Username) = $DB->next_record();
- } else {
- $UserID = $LoggedUser['ID'];
- }
-
- //$ArtistList = Bookmarks::all_bookmarks('artist', $UserID);
-
- $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 = [];
-
- 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
- )
- )
- );
|