BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

artists.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. if (!empty($_GET['userid'])) {
  3. if (!check_perms('users_override_paranoia')) {
  4. json_die('failure');
  5. }
  6. $UserID = $_GET['userid'];
  7. $Sneaky = ($UserID !== $LoggedUser['ID']);
  8. if (!is_number($UserID)) {
  9. json_die('failure');
  10. }
  11. $DB->query("
  12. SELECT
  13. `Username`
  14. FROM
  15. `users_main`
  16. WHERE
  17. `ID` = '$UserID'
  18. ");
  19. list($Username) = $DB->next_record();
  20. } else {
  21. $UserID = $LoggedUser['ID'];
  22. }
  23. //$ArtistList = Bookmarks::all_bookmarks('artist', $UserID);
  24. $DB->query("
  25. SELECT
  26. ag.`ArtistID`,
  27. ag.`Name`
  28. FROM
  29. `bookmarks_artists` AS ba
  30. INNER JOIN `artists_group` AS ag
  31. ON
  32. ba.`ArtistID` = ag.`ArtistID`
  33. WHERE
  34. ba.`UserID` = $UserID
  35. ");
  36. $ArtistList = $DB->to_array();
  37. $JsonArtists = [];
  38. foreach ($ArtistList as $Artist) {
  39. list($ArtistID, $Name) = $Artist;
  40. $JsonArtists[] = array(
  41. 'artistId' => (int) $ArtistID,
  42. 'artistName' => $Name
  43. );
  44. }
  45. print
  46. json_encode(
  47. array(
  48. 'status' => 'success',
  49. 'response' => array(
  50. 'artists' => $JsonArtists
  51. )
  52. )
  53. );