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.1KB

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