Changeset 93

Show
Ignore:
Timestamp:
30/05/05 09:53:42 (4 years ago)
Author:
rollercow
Message:

Updating entrys works!

Re Bugzilla.. its a pita to use.. and ugly

Trac look good.. http://www.edgewall.com/trac/

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • TODO

    r89 r93  
    88------------ 
    99* Posting of new entries [DONE] 
    10 * Edit existing entries 
     10* Edit existing entries [DONE] 
    1111* Delete entries 
    1212* Manage comments (delete, approve and so forth) 
    1313* Edit user settings [form done] 
     14* Nice listing of posts to edit, so you dont have to know what they are called 
    1415 
    1516Wishlist 
  • admin.lib.php

    r92 r93  
    225225                $subject = ''; 
    226226                $body = ''; 
    227                 $id = $this->blog->makeCleanString($subject); 
     227                $id = $this->blog->makeCleanString($id); 
    228228                if (!$id) { 
    229229                        error(4,"If you dont give me a post how do you expect me to update it"); 
     
    250250                if (!$this->inputError) { 
    251251                        //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."';"); 
    253253                        $sqlNum = db_num_rows($sql); 
    254254                        //yes?, we can update it then.. 
    255255                        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}';");                    
    258257                                if (!$sql) { 
    259258                                        error(2,"Database commit failed - ".db_error()); 
    260259                                }  
    261260                                else { 
    262                                         $row = db_last($sql, "entries"); 
    263                                         $this->blog->printEntry($row,false,false); 
     261                                        $this->inputError = _("Updated!"); 
     262                                        $this->updateForm($id); 
    264263                                } 
    265264                        } 
     
    278277        { 
    279278                $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."';"); 
    281280                $sqlNum = db_num_rows($sql); 
    282281                //yes? we can update it then..