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

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