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.

delete.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. /*
  3. /************************************************************************
  4. ||------------|| Delete artist ||--------------------------------------||
  5. This is a very powerful page - it deletes an artist, and all associated
  6. requests and torrents. It is called when $_GET['action'] == 'delete'.
  7. ************************************************************************
  8. authorize();
  9. $ArtistID = $_GET['artistid'];
  10. if (!is_number($ArtistID) || empty($ArtistID)) {
  11. error(0);
  12. }
  13. if (!check_perms('site_delete_artist') || !check_perms('torrents_delete')) {
  14. error(403);
  15. }
  16. View::show_header('Artist deleted');
  17. $DB->query("
  18. SELECT Name
  19. FROM artists_group
  20. WHERE ArtistID = $ArtistID");
  21. list($Name) = $DB->next_record();
  22. $DB->query("
  23. SELECT tg.Name, tg.ID
  24. FROM torrents_group AS tg
  25. LEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID
  26. WHERE ta.ArtistID = $ArtistID");
  27. $Count = $DB->record_count();
  28. if ($DB->has_results()) {
  29. ?>
  30. <div>
  31. There are still torrents that have <a
  32. href="artist.php?id=<?=$ArtistID?>" class="tooltip"
  33. title="View artist" dir="ltr"><?=$Name?></a> as an artist.<br />
  34. Please remove the artist from these torrents manually before attempting to delete.<br />
  35. <div class="box pad">
  36. <ul>
  37. <?
  38. while (list($GroupName, $GroupID) = $DB->next_record(MYSQLI_NUM, true)) {
  39. ?>
  40. <li>
  41. <a href="torrents.php?id=<?=$GroupID?>" class="tooltip"
  42. title="View torrent group" dir="ltr"><?=$GroupName?></a>
  43. </li>
  44. <?
  45. }
  46. ?>
  47. </ul>
  48. </div>
  49. </div>
  50. <?
  51. }
  52. $DB->query("
  53. SELECT r.Title, r.ID
  54. FROM requests AS r
  55. LEFT JOIN requests_artists AS ra ON ra.RequestID = r.ID
  56. WHERE ra.ArtistID = $ArtistID");
  57. $Count += $DB->record_count();
  58. if ($DB->has_results()) {
  59. ?>
  60. <div>
  61. There are still requests that have <a
  62. href="artist.php?id=<?=$ArtistID?>" class="tooltip"
  63. title="View artist" dir="ltr"><?=$Name?></a> as an artist.<br />
  64. Please remove the artist from these requests manually before attempting to delete.<br />
  65. <div class="box pad">
  66. <ul>
  67. <?
  68. while (list($RequestName, $RequestID) = $DB->next_record(MYSQLI_NUM, true)) {
  69. ?>
  70. <li>
  71. <a href="requests.php?action=view&amp;id=<?=$RequestID?>"
  72. class="tooltip" title="View request" dir="ltr"><?=$RequestName?></a>
  73. </li>
  74. <?
  75. }
  76. ?>
  77. </ul>
  78. </div>
  79. </div>
  80. <?
  81. }
  82. if ($Count == 0) {
  83. Artists::delete_artist($ArtistID);
  84. ?>
  85. <div class="box pad">
  86. Artist "<?=$Name?>" deleted!
  87. </div>
  88. <?
  89. }
  90. View::show_footer();?>
  91. */