Changeset 93
- Timestamp:
- 30/05/05 09:53:42 (4 years ago)
- Files:
-
- TODO (modified) (1 diff)
- admin.lib.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
TODO
r89 r93 8 8 ------------ 9 9 * Posting of new entries [DONE] 10 * Edit existing entries 10 * Edit existing entries [DONE] 11 11 * Delete entries 12 12 * Manage comments (delete, approve and so forth) 13 13 * Edit user settings [form done] 14 * Nice listing of posts to edit, so you dont have to know what they are called 14 15 15 16 Wishlist admin.lib.php
r92 r93 225 225 $subject = ''; 226 226 $body = ''; 227 $id = $this->blog->makeCleanString($ subject);227 $id = $this->blog->makeCleanString($id); 228 228 if (!$id) { 229 229 error(4,"If you dont give me a post how do you expect me to update it"); … … 250 250 if (!$this->inputError) { 251 251 //check to see this post exists 252 $sql = db_query("SELECT id from entries where id =".$id."';");252 $sql = db_query("SELECT id from entries where shortsubject = '".$id."';"); 253 253 $sqlNum = db_num_rows($sql); 254 254 //yes?, we can update it then.. 255 255 if ($sqlNum == 1) { 256 $sql = db_query("UPDATE entries SET (category, subject, body) = ({$category},'{$subject}','{$body}') WHERE shortsubject = '{$id}';"); 257 echo ("UPDATE entries SET (category, subject, body) = ({$category},'{$subject}','{$body}') WHERE shortsubject = '{$id}';"); 256 $sql = db_query("UPDATE entries SET category = {$category}, subject = '{$subject}', body = '{$body}' WHERE shortsubject = '{$id}';"); 258 257 if (!$sql) { 259 258 error(2,"Database commit failed - ".db_error()); 260 259 } 261 260 else { 262 $ row = db_last($sql, "entries");263 $this-> blog->printEntry($row,false,false);261 $this->inputError = _("Updated!"); 262 $this->updateForm($id); 264 263 } 265 264 } … … 278 277 { 279 278 $id = $this->blog->makeCleanString($id); 280 $sql = db_query("SELECT subject, category, body from entries where shortsubject = '".$id."';");279 $sql = db_query("SELECT subject, category, body, shortsubject from entries where shortsubject = '".$id."';"); 281 280 $sqlNum = db_num_rows($sql); 282 281 //yes? we can update it then..
