bookmark_delete.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. require_once ("./header.php");
  3. logged_in_only ();
  4. $bmlist = set_get_num_list ('bmlist');
  5. if (count ($bmlist) == 0){
  6. echo "No Bookmarks selected";
  7. }
  8. else if (!$settings['confirm_delete'] || set_get_noconfirm ()){
  9. $bmlist = implode (",", $bmlist);
  10. $query = sprintf ("DELETE FROM bookmark WHERE id IN (%s) AND user='%s'",
  11. $mysql->escape ($bmlist),
  12. $mysql->escape ($username));
  13. if ($mysql->query ($query)) {
  14. echo "Bookmarks successfully deleted<br>\n";
  15. echo '<script language="JavaScript">reloadclose();</script>';
  16. }
  17. else {
  18. message ($mysql->error);
  19. }
  20. }
  21. else {
  22. $bmlistq = implode (",", $bmlist);
  23. $query = sprintf ("SELECT title, id, favicon FROM bookmark WHERE id IN (%s) AND user='%s' ORDER BY title",
  24. $mysql->escape ($bmlistq),
  25. $mysql->escape ($username));
  26. if ($mysql->query ($query)) {
  27. require_once (ABSOLUTE_PATH . "bookmarks.php");
  28. $query_string = "?bmlist=" . implode ("_", $bmlist) . "&noconfirm=1";
  29. ?>
  30. <h2 class="title">Delete these Bookmarks?</h2>
  31. <div style="width:100%; height:330px; overflow:auto;">
  32. <?php
  33. $bookmarks = array ();
  34. while ($row = mysqli_fetch_assoc ($mysql->result)) {
  35. array_push ($bookmarks, $row);
  36. }
  37. list_bookmarks ($bookmarks,
  38. false,
  39. false,
  40. $settings['show_bookmark_icon'],
  41. false,
  42. false,
  43. false,
  44. false,
  45. false,
  46. false,
  47. false,
  48. false);
  49. ?>
  50. </div>
  51. <br>
  52. <form action="<?php echo $_SERVER['SCRIPT_NAME'] . $query_string; ?>" method="POST" name="bmdelete">
  53. <input type="submit" value=" OK ">
  54. <input type="button" value=" Cancel " onClick="self.close()">
  55. </form>
  56. <?php
  57. }
  58. else {
  59. message ($mysql->error);
  60. }
  61. }
  62. require_once (ABSOLUTE_PATH . "footer.php");
  63. ?>