Changeset 113

Show
Ignore:
Timestamp:
31/05/05 22:24:18 (4 years ago)
Author:
dez
Message:

Delete button added next to Edit button.
A couple of spelling errors corrected.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.lib.php

    r112 r113  
    312312                        error(4,"If you dont give me a post how do you expect me to delete it"); 
    313313                } 
    314                 //no errors, so continue.. 
    315                 if (!$this->inputError) { 
    316                         //check to see this post exists 
    317                         $sql = db_query("SELECT id from entries where shortsubject = '".$id."' AND user_id='".$this->id."';"); 
    318                         $sqlNum = db_num_rows($sql); 
    319                         //yes?, we can delete it then.. 
    320                         if ($sqlNum == 1) {  
    321                                 $sql = db_query("DELETE FROM entries WHERE shortsubject = '{$id}' AND user_id = '".$this->id."';");                      
    322                                 if (!$sql) { 
    323                                         error(2,"Entry deletion failed - ".db_error()); 
    324                                 }  
    325                                 else { 
    326                                         $this->inputError = _("Entry deleted."); 
    327                                         $this->updateForm($id); 
    328                                 } 
    329                         } 
    330                         //cant update non-existant entrys 
    331                         else { 
    332                                  error(2,_("Cannot delete entry, as it does not exist.".db_error())); 
    333                         } 
    334                 } 
    335                 //redisplay entry form if there are errors 
    336                 else { 
    337                         $this->updateForm($id); 
     314                //check to see this post exists 
     315                $sql = db_query("SELECT id from entries where shortsubject = '".$id."' AND user_id='".$this->id."';"); 
     316                $sqlNum = db_num_rows($sql); 
     317                //yes?, we can delete it then.. 
     318                if ($sqlNum == 1) {  
     319                        db_query("DELETE FROM entries WHERE shortsubject = '{$id}' AND user_id = '".$this->id."';");                     
     320                        echo "<p>"._("Entry deleted.")."</p>"; 
     321                } 
     322                //can't delete non-existant entrys 
     323                else { 
     324                         error(2,_("Cannot delete entry, as it does not exist.".db_error())); 
    338325                } 
    339326        } 
  • blog.lib.php

    r110 r113  
    9797                echo " | Cat: <a href=\"".$this->blogPath."category/{$row['category']}\">".$this->categoryName($row['category'])."</a> "; 
    9898                if($this->checkSessionOwner()){ 
    99                         echo "| <a href=\"".$this->httpPath."admin.php/update/{$row['shortsubject']}\">"._("Edit this")."</a>"; 
     99                        echo "| <a href=\"".$this->httpPath."admin.php/update/{$row['shortsubject']}\">"._("Edit")."</a> "; 
     100                        echo "| <a href=\"".$this->httpPath."admin.php/deleteentry/{$row['shortsubject']}\">"._("Delete")."</a>"; 
    100101                } 
    101102                echo " ]</p>\n"; 
     
    312313                        } 
    313314                        else { 
    314                                 echo "<p class=\"invalid\">*** "._("Your comment has been added, but before it apears here it must be accepted by the blog owner.")." ***</p>"; 
     315                                echo "<p class=\"invalid\">*** "._("Your comment has been added, but before it appears here it must be accepted by the blog owner.")." ***</p>"; 
    315316                        } 
    316317                }