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