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.

notifyremove.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. #declare(strict_types=1);
  3. authorize();
  4. if (!check_perms('site_torrents_notify')) {
  5. error(403);
  6. }
  7. $ArtistID = (int) $_GET['artistid'];
  8. Security::checkInt($ArtistID);
  9. if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
  10. $DB->prepared_query("
  11. SELECT ID, Artists
  12. FROM users_notify_filters
  13. WHERE Label = 'Artist notifications'
  14. AND UserID = '$LoggedUser[ID]'
  15. ORDER BY ID
  16. LIMIT 1");
  17. } else {
  18. $DB->prepared_query("
  19. SELECT ID, Artists
  20. FROM users_notify_filters
  21. WHERE ID = '$Notify[ID]'");
  22. }
  23. list($ID, $Artists) = $DB->next_record(MYSQLI_NUM, false);
  24. $DB->prepared_query("
  25. SELECT Name
  26. FROM artists_alias
  27. WHERE ArtistID = '$ArtistID'
  28. AND Redirect = 0");
  29. while (list($Alias) = $DB->next_record(MYSQLI_NUM, false)) {
  30. while (stripos($Artists, "|$Alias|") !== false) {
  31. $Artists = str_ireplace("|$Alias|", '|', $Artists);
  32. }
  33. }
  34. if ($Artists == '|') {
  35. $DB->prepared_query("
  36. DELETE FROM users_notify_filters
  37. WHERE ID = $ID");
  38. } else {
  39. $DB->prepared_query("
  40. UPDATE users_notify_filters
  41. SET Artists = '".db_string($Artists)."'
  42. WHERE ID = '$ID'");
  43. }
  44. $Cache->delete_value('notify_filters_'.$LoggedUser['ID']);
  45. $Cache->delete_value('notify_artists_'.$LoggedUser['ID']);
  46. header('Location: '.$_SERVER['HTTP_REFERER']);