Oppaitime'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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?
  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 class="thin">
  32. <div class="header">
  33. <h2><?=$Title?></h2>
  34. <div class="linkbox">
  35. <a href="bookmarks.php?type=torrents" class="brackets">Torrents</a>
  36. <a href="bookmarks.php?type=artists" class="brackets">Artists</a>
  37. <a href="bookmarks.php?type=collages" class="brackets">Collections</a>
  38. <a href="bookmarks.php?type=requests" class="brackets">Requests</a>
  39. </div>
  40. </div>
  41. <div class="box pad" align="center">
  42. <? if (count($ArtistList) === 0) { ?>
  43. <h2>You have not bookmarked any artists.</h2>
  44. </div>
  45. </div><!--content-->
  46. <?
  47. View::show_footer();
  48. die();
  49. } ?>
  50. <table width="100%" class="artist_table">
  51. <tr class="colhead">
  52. <td>Artist</td>
  53. </tr>
  54. <?
  55. foreach ($ArtistList as $Artist) {
  56. list($ArtistID, $Name) = $Artist;
  57. ?>
  58. <tr class="row bookmark_<?=$ArtistID?>">
  59. <td>
  60. <a href="artist.php?id=<?=$ArtistID?>"><?=$Name?></a>
  61. <span style="float: right;">
  62. <?
  63. if (check_perms('site_torrents_notify')) {
  64. if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
  65. $DB->query("
  66. SELECT ID, Artists
  67. FROM users_notify_filters
  68. WHERE UserID = '$LoggedUser[ID]'
  69. AND Label = 'Artist notifications'
  70. LIMIT 1");
  71. $Notify = $DB->next_record(MYSQLI_ASSOC);
  72. $Cache->cache_value('notify_artists_'.$LoggedUser['ID'], $Notify, 0);
  73. }
  74. if (stripos($Notify['Artists'], "|$Name|") === false) {
  75. ?>
  76. <a href="artist.php?action=notify&amp;artistid=<?=$ArtistID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Notify of new uploads</a>
  77. <?
  78. } else {
  79. ?>
  80. <a href="artist.php?action=notifyremove&amp;artistid=<?=$ArtistID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Do not notify of new uploads</a>
  81. <?
  82. }
  83. }
  84. ?>
  85. <a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Unbookmark('artist', <?=$ArtistID?>, 'Bookmark'); return false;" class="brackets">Remove bookmark</a>
  86. </span>
  87. </td>
  88. </tr>
  89. <?
  90. }
  91. ?>
  92. </table>
  93. </div>
  94. </div>
  95. <?
  96. View::show_footer();
  97. $Cache->cache_value('bookmarks_'.$UserID, serialize(array(array($Username, $TorrentList, $CollageDataList))), 3600);
  98. ?>