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

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