Changeset 133
- Timestamp:
- 03/07/05 20:28:46 (4 years ago)
- Files:
-
- admin.lib.php (modified) (3 diffs)
- admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin.lib.php
r132 r133 674 674 echo "<div class=\"entry\"><h2>"._("Edit Entries")."</h2>\n"; 675 675 } 676 echo "<form action=\"{$this->adminPath} deleteentries/\" method=\"post\">\n<table class=\"td\">\n\t<tr>\n\t\t<th>Date</th>\n\t\t<th>Title</th>\n\t\t<th>Delete</th>\n\t</tr>\n";676 echo "<form action=\"{$this->adminPath}confirmdeleteentries/\" method=\"post\">\n<table class=\"td\">\n\t<tr>\n\t\t<th>Date</th>\n\t\t<th>Title</th>\n\t\t<th>Delete</th>\n\t</tr>\n"; 677 677 $rownum = 0; 678 678 while($row = db_getrow($result)){ … … 694 694 } 695 695 696 function confirmDeleteEntries() { 697 echo "<form action=\"{$this->adminPath}deleteentries/\" method=\"post\">\n"; 698 echo "<p>"._("Are you sure you want to delete the following entries?")."</p>\n<ul>\n"; 699 $rownum = 0; 700 foreach ($_REQUEST[entry] as $entry) { 701 echo "<input type=\"hidden\" name=\"entry[".$rownum++."]\" value=\"{$entry}\" />"; 702 echo "<li>".$entry."</li>\n"; 703 } 704 echo "</ul>\n"; 705 echo "<p><input type=\"submit\" name=\"submit\" value=\""._("Yes")."\" />\n<input type=\"submit\" name=\"submit\" value=\""._("No")."\" /></p>\n"; 706 echo "</form>\n"; 707 } 708 696 709 function deleteEntries() 697 710 { … … 699 712 error(4, _("No entries marked for deletion.")); 700 713 } else { 701 $sql = "DELETE FROM entries WHERE ("; 702 foreach($_POST['entry'] as $id) { 703 $sql .= "shortsubject = '".$this->blog->makeCleanString($id)."' OR "; 704 } 705 $sql = substr($sql, 0, -4); 706 $sql .= ") AND user_id = {$this->id};"; 714 if ($_REQUEST[submit]==_("Yes")) { 715 $sql = "DELETE FROM entries WHERE ("; 716 foreach($_POST['entry'] as $id) { 717 $sql .= "shortsubject = '".$this->blog->makeCleanString($id)."' OR "; 718 } 719 $sql = substr($sql, 0, -4); 720 $sql .= ") AND user_id = {$this->id};"; 707 721 708 db_query($sql); 709 echo count($_POST['entry'])._(" post(s) deleted"); 722 db_query($sql); 723 echo count($_POST['entry'])._(" post(s) deleted"); 724 } else { 725 error(4, _("Entries not deleted.")); 726 } 710 727 } 711 728 } admin.php
r130 r133 67 67 $admin->deleteEntry(array_shift($request)) ; 68 68 break; 69 case "confirmdeleteentries": 70 $admin->confirmDeleteEntries(); 71 break; 69 72 case "deleteentries": 70 73 $admin->deleteEntries();
