bookmark_move.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. require_once ("./header.php");
  3. logged_in_only ();
  4. $bmlist = set_post_num_list ('bmlist');
  5. if (count ($bmlist) == 0) {
  6. ?>
  7. <h2 class="title">Move bookmarks to:</h2>
  8. <form action="<?php echo $_SERVER['SCRIPT_NAME'] . "?folderid=" . $folderid; ?>" method="POST" name="bookmarksmove">
  9. <div style="width:100%; height:330px; overflow:auto;">
  10. <?php
  11. require_once (ABSOLUTE_PATH . "folders.php");
  12. $tree = new folder;
  13. $tree->make_tree (0);
  14. $tree->print_tree ();
  15. ?>
  16. </div>
  17. <br>
  18. <input type="hidden" name="bmlist">
  19. <input type="submit" value=" OK ">
  20. <input type="button" value=" Cancel " onClick="self.close()">
  21. <input type="button" value=" New Folder " onClick="self.location.href='javascript:foldernew(<?php echo $folderid; ?>)'">
  22. </form>
  23. <script type="text/javascript">
  24. document.bookmarksmove.bmlist.value = self.name;
  25. </script>
  26. <?php
  27. }
  28. else if ($folderid == '') {
  29. message ('No destination Folder selected.');
  30. }
  31. else {
  32. $query = sprintf ("UPDATE bookmark SET childof='%d' WHERE id IN (%s) AND user='%s'",
  33. $mysql->escape ($folderid),
  34. $mysql->escape (implode (",", $bmlist)),
  35. $mysql->escape ($username));
  36. if ($mysql->query ($query)) {
  37. echo "Bookmarks moved<br>\n";
  38. echo '<script language="JavaScript">reloadclose();</script>';
  39. }
  40. else {
  41. message ($mysql->error);
  42. }
  43. }
  44. require_once (ABSOLUTE_PATH . "footer.php");
  45. ?>