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.

index.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. #declare(strict_types=1);
  3. enforce_login();
  4. // Number of users per page
  5. define('BOOKMARKS_PER_PAGE', '20');
  6. if (empty($_REQUEST['action'])) {
  7. $_REQUEST['action'] = 'view';
  8. }
  9. switch ($_REQUEST['action']) {
  10. case 'add':
  11. require SERVER_ROOT.'/sections/bookmarks/add.php';
  12. break;
  13. case 'remove':
  14. require SERVER_ROOT.'/sections/bookmarks/remove.php';
  15. break;
  16. case 'mass_edit':
  17. require SERVER_ROOT.'/sections/bookmarks/mass_edit.php';
  18. break;
  19. case 'remove_snatched':
  20. authorize();
  21. $DB->query("
  22. CREATE TEMPORARY TABLE snatched_groups_temp
  23. (GroupID int PRIMARY KEY)");
  24. $DB->query("
  25. INSERT INTO snatched_groups_temp
  26. SELECT DISTINCT GroupID
  27. FROM torrents AS t
  28. JOIN xbt_snatched AS s ON s.fid = t.ID
  29. WHERE s.uid = '$LoggedUser[ID]'");
  30. $DB->query("
  31. DELETE b
  32. FROM bookmarks_torrents AS b
  33. JOIN snatched_groups_temp AS s
  34. USING(GroupID)
  35. WHERE b.UserID = '$LoggedUser[ID]'");
  36. $Cache->delete_value("bookmarks_group_ids_$UserID");
  37. header('Location: bookmarks.php');
  38. error();
  39. break;
  40. case 'edit':
  41. if (empty($_REQUEST['type'])) {
  42. $_REQUEST['type'] = false;
  43. }
  44. switch ($_REQUEST['type']) {
  45. case 'torrents':
  46. require SERVER_ROOT.'/sections/bookmarks/edit_torrents.php';
  47. break;
  48. default:
  49. error(404);
  50. }
  51. break;
  52. case 'view':
  53. if (empty($_REQUEST['type'])) {
  54. $_REQUEST['type'] = 'torrents';
  55. }
  56. switch ($_REQUEST['type']) {
  57. case 'torrents':
  58. require SERVER_ROOT.'/sections/bookmarks/torrents.php';
  59. break;
  60. case 'artists':
  61. require SERVER_ROOT.'/sections/bookmarks/artists.php';
  62. break;
  63. case 'collages':
  64. $_GET['bookmarks'] = '1';
  65. require SERVER_ROOT.'/sections/collages/browse.php';
  66. break;
  67. case 'requests':
  68. $_GET['type'] = 'bookmarks';
  69. require SERVER_ROOT.'/sections/requests/requests.php';
  70. break;
  71. default:
  72. error(404);
  73. }
  74. break;
  75. default:
  76. error(404);
  77. }