Changeset 119
- Timestamp:
- 02/06/05 01:02:01 (4 years ago)
- Files:
-
- admin.lib.php (modified) (2 diffs)
- admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin.lib.php
r118 r119 71 71 session_unset(); 72 72 $this->sessionError =_("Session Expired"); 73 startSession();73 $this->startSession(); 74 74 } 75 75 /* //close the session if its move IP … … 481 481 echo "<div class=\"entry\"><h2>"._("Edit Entries")."</h2>\n"; 482 482 } 483 echo "<table class=\"td\">\n\t<tr>\n\t\t<th>Date</th>\n\t\t<th>Title</th>\n\t</tr>\n"; 483 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"; 484 $rownum = 0; 484 485 while($row = db_getrow($result)){ 485 echo "\t<tr>\n\t\t<td>".strftime('%c', strtotime($row['timestamp']))."</td>\n\t\t<td><a href=\"".$this->adminPath."update/".$row['shortsubject']."\">".$row['subject']."</a></td>\n\t</tr>\n"; 486 } 487 echo "</table\n"; 486 echo "\t<tr>\n"; 487 echo "\t\t<td>".strftime('%c', strtotime($row['timestamp']))."</td>\n"; 488 echo "\t\t<td><a href=\"".$this->adminPath."update/".$row['shortsubject']."\">".$row['subject']."</a></td>\n"; 489 echo "\t\t<td><input type=\"checkbox\" name=\"entry[".$rownum++."]\" value=\"{$row['shortsubject']}\" /></td>\n"; 490 echo "\t</tr>\n"; 491 } 492 echo "\t<tr>\n"; 493 echo "\t\t<td></td><td></td><td><input type=\"submit\" name=\"submit\" value=\""._("Delete Selected")."\" /></td>\n"; 494 echo "\t</tr>\n"; 495 echo "</table>\n"; 496 echo "</form>\n"; 488 497 if($title) { 489 498 echo "</div>\n"; 490 499 } 500 } 501 } 502 503 function deleteEntries() 504 { 505 if (count($_POST['entry'])==0) { 506 error(4, _("No entries marked for deletion.")); 507 } else { 508 $sql = "DELETE FROM entries WHERE ("; 509 foreach($_POST['entry'] as $id) { 510 $sql .= "shortsubject = '".$this->blog->makeCleanString($id)."' OR "; 511 } 512 $sql = substr($sql, 0, -4); 513 $sql .= ") AND user_id = {$this->id};"; 514 515 db_query($sql); 516 echo count($_POST['entry'])._(" post(s) deleted"); 491 517 } 492 518 } admin.php
r112 r119 63 63 $admin->deleteEntry(array_shift($request)) ; 64 64 break; 65 case "deleteentries": 66 $admin->deleteEntries(); 67 break; 65 68 default: 66 69 //Should display blog entries here
