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 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. #declare(strict_types=1);
  3. if (!empty($_GET['userid'])) {
  4. if (!check_perms('users_override_paranoia')) {
  5. error(403);
  6. }
  7. $UserID = $_GET['userid'];
  8. $Sneaky = $UserID !== $LoggedUser['ID'];
  9. if (!is_number($UserID)) {
  10. error(404);
  11. }
  12. $DB->prepared_query("
  13. SELECT Username
  14. FROM users_main
  15. WHERE ID = '$UserID'");
  16. list($Username) = $DB->next_record();
  17. } else {
  18. $UserID = $LoggedUser['ID'];
  19. }
  20. $Sneaky = $UserID !== $LoggedUser['ID'];
  21. //$ArtistList = Bookmarks::all_bookmarks('artist', $UserID);
  22. $DB->prepared_query("
  23. SELECT ag.ArtistID, ag.Name
  24. FROM bookmarks_artists AS ba
  25. INNER JOIN artists_group AS ag ON ba.ArtistID = ag.ArtistID
  26. WHERE ba.UserID = $UserID
  27. ORDER BY ag.Name");
  28. $ArtistList = $DB->to_array();
  29. $Title = $Sneaky ? "$Username's bookmarked artists" : 'Your bookmarked artists';
  30. View::show_header($Title, 'browse');
  31. ?>
  32. <div>
  33. <div class="header">
  34. <h2>
  35. <?=$Title?>
  36. </h2>
  37. <div class="linkbox">
  38. <a href="bookmarks.php?type=torrents" class="brackets">Torrents</a>
  39. <a href="bookmarks.php?type=artists" class="brackets">Artists</a>
  40. <a href="bookmarks.php?type=collages" class="brackets">Collections</a>
  41. <a href="bookmarks.php?type=requests" class="brackets">Requests</a>
  42. </div>
  43. </div>
  44. <div class="box pad" align="center">
  45. <?php if (count($ArtistList) === 0) { ?>
  46. <h2>
  47. You have not bookmarked any artists
  48. </h2>
  49. </div>
  50. </div>
  51. <!--content-->
  52. <?php
  53. View::show_footer();
  54. error();
  55. } ?>
  56. <table width="100%" class="artist_table">
  57. <tr class="colhead">
  58. <td>Artist</td>
  59. </tr>
  60. <?php
  61. foreach ($ArtistList as $Artist) {
  62. list($ArtistID, $Name) = $Artist; ?>
  63. <tr class="row bookmark_<?=$ArtistID?>">
  64. <td>
  65. <a href="artist.php?id=<?=$ArtistID?>"><?=$Name?></a>
  66. <span class="float_right">
  67. <?php
  68. if (check_perms('site_torrents_notify')) {
  69. if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
  70. $DB->prepared_query("
  71. SELECT ID, Artists
  72. FROM users_notify_filters
  73. WHERE UserID = '$LoggedUser[ID]'
  74. AND Label = 'Artist notifications'
  75. LIMIT 1");
  76. $Notify = $DB->next_record(MYSQLI_ASSOC);
  77. $Cache->cache_value('notify_artists_'.$LoggedUser['ID'], $Notify, 0);
  78. }
  79. if (stripos($Notify['Artists'], "|$Name|") === false) { ?>
  80. <a href="artist.php?action=notify&amp;artistid=<?=$ArtistID?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
  81. class="brackets">Notify of new uploads</a>
  82. <?php
  83. } else { ?>
  84. <a href="artist.php?action=notifyremove&amp;artistid=<?=$ArtistID?>&amp;auth=<?=$LoggedUser['AuthKey']?>"
  85. class="brackets">Do not notify of new uploads</a>
  86. <?php
  87. }
  88. } ?>
  89. <a href="#" id="bookmarklink_artist_<?=$ArtistID?>"
  90. onclick="Unbookmark('artist', <?=$ArtistID?>, 'Bookmark'); return false;"
  91. class="brackets">Remove bookmark</a>
  92. </span>
  93. </td>
  94. </tr>
  95. <?php
  96. } ?>
  97. </table>
  98. </div>
  99. </div>
  100. <?php
  101. View::show_footer();
  102. $Cache->cache_value('bookmarks_'.$UserID, serialize(array(array($Username, $TorrentList, $CollageDataList))), 3600);