/**
  * Removes an article from the database
  *
  * If forever == true, the article is physically removed from the database.
  * Otherwise, the 'status' field is set to 'deleted'
  *
  * Problem is, that MySQL will automatically update the 'date' field because he feels
  * like it... even if we explicitely say date = old_date... grrreat :P
  *
  * Valid article identifier, blog identifier and user identifier are required to remove an
  * article. It was done for security reasons and to make perfectly clear that we are removing
  * an article (so that we wouldn't be deleting the wrong one if there was any bug!)
  *
  * @param artId A valid article identifier
  * @param userid A valid user identifier
  * @param blogId A valid blog identifier
  * @param forever A boolean meaning whether the post should be removed forever or simply its status
  * should be set to 'deleted'
  * @return Returns true if successful or false otherwise.
  */
 function deleteArticle($artId, $userId, $blogId, $forever = false)
 {
     if ($forever) {
         $query = "DELETE FROM " . $this->getPrefix() . "articles WHERE id = " . $artId . " AND user_id = " . $userId . " AND blog_id = " . $blogId . ";";
         // -- text --
         $this->deleteArticleText($artId);
         // we also have to remove its comments and trackbacks if the article is being deleted forever
         // -- comments --
         $comments = new ArticleComments();
         $comments->deletePostComments($artId);
         // -- trackbacks --
         $trackbacks = new Trackbacks();
         $trackbacks->deletePostTrackbacks($artId);
         // -- post-to-categories mappings --
         $this->deletePostCategoriesLink($artId);
         // -- custom fields --
         $customFields = new CustomFieldsValues();
         $customFields->removeArticleCustomFields($artId);
     } else {
         $query = "UPDATE " . $this->getPrefix() . "articles SET date = date, status = 3 WHERE id = " . $artId . " AND user_id = " . $userId . " AND blog_id = " . $blogId . ";";
     }
     $result = $this->Execute($query);
     if (!$result) {
         return false;
     }
     if ($this->_db->Affected_Rows() == 0) {
         return false;
     }
     return true;
 }