Пример #1
0
 /**
  * Обновляет топик
  *
  * @param ModuleTopic_EntityTopic $oTopic    Объект топика
  *
  * @return bool
  */
 public function UpdateTopic(ModuleTopic_EntityTopic $oTopic)
 {
     $sql = "UPDATE ?_topic\n\t\t\tSET \n\t\t\t\tblog_id = ?d,\n\t\t\t\ttopic_title = ?,\n\t\t\t\ttopic_tags = ?,\n\t\t\t\ttopic_date_add = ?,\n\t\t\t\ttopic_date_edit = ?,\n\t\t\t\ttopic_date_show = ?,\n\t\t\t\ttopic_user_ip = ?,\n\t\t\t\ttopic_publish = ?d ,\n\t\t\t\ttopic_publish_draft = ?d ,\n\t\t\t\ttopic_publish_index = ?d,\n\t\t\t\ttopic_rating = ?f,\n\t\t\t\ttopic_count_vote = ?d,\n\t\t\t\ttopic_count_vote_up = ?d,\n\t\t\t\ttopic_count_vote_down = ?d,\n\t\t\t\ttopic_count_vote_abstain = ?d,\n\t\t\t\ttopic_count_read = ?d,\n\t\t\t\ttopic_count_comment = ?d,\n\t\t\t\ttopic_count_favourite = ?d,\n\t\t\t\ttopic_cut_text = ? ,\n\t\t\t\ttopic_forbid_comment = ? ,\n\t\t\t\ttopic_text_hash = ?,\n\t\t\t\ttopic_url = ?,\n\t\t\t\ttopic_index_ignore = ?d\n\t\t\tWHERE\n\t\t\t\ttopic_id = ?d\n\t\t";
     $bResult = $this->oDb->query($sql, $oTopic->getBlogId(), $oTopic->getTitle(), $oTopic->getTags(), $oTopic->getDateAdd(), $oTopic->getDateEdit(), $oTopic->getDateShow(), $oTopic->getUserIp(), $oTopic->getPublish() ? 1 : 0, $oTopic->getPublishDraft() ? 1 : 0, $oTopic->getPublishIndex() ? 1 : 0, $oTopic->getRating(), $oTopic->getCountVote(), $oTopic->getCountVoteUp(), $oTopic->getCountVoteDown(), $oTopic->getCountVoteAbstain(), $oTopic->getCountRead(), $oTopic->getCountComment(), $oTopic->getCountFavourite(), $oTopic->getCutText(), $oTopic->getForbidComment(), $oTopic->getTextHash(), $oTopic->getTopicUrl(), $oTopic->getTopicIndexIgnore(), $oTopic->getId());
     if ($bResult !== false) {
         $this->UpdateTopicContent($oTopic);
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * Обновляет топик
  *
  * @param ModuleTopic_EntityTopic $oTopic Объект топика
  * @return bool
  */
 public function UpdateTopic(ModuleTopic_EntityTopic $oTopic)
 {
     $sql = "UPDATE " . Config::Get('db.table.topic') . "\n\t\t\tSET \n\t\t\t\tblog_id= ?d,\n\t\t\t\tblog_id2= ?d,\n\t\t\t\tblog_id3= ?d,\n\t\t\t\tblog_id4= ?d,\n\t\t\t\tblog_id5= ?d,\n\t\t\t\ttopic_title= ?,\n\t\t\t\ttopic_slug= ?,\n\t\t\t\ttopic_tags= ?,\n\t\t\t\ttopic_date_add = ?,\n\t\t\t\ttopic_date_edit = ?,\n\t\t\t\ttopic_date_edit_content = ?,\n\t\t\t\ttopic_date_publish = ?,\n\t\t\t\ttopic_user_ip= ?,\n\t\t\t\ttopic_publish= ?d ,\n\t\t\t\ttopic_publish_draft= ?d ,\n\t\t\t\ttopic_publish_index= ?d,\n\t\t\t\ttopic_skip_index= ?d,\n\t\t\t\ttopic_rating= ?f,\n\t\t\t\ttopic_count_vote= ?d,\n\t\t\t\ttopic_count_vote_up= ?d,\n\t\t\t\ttopic_count_vote_down= ?d,\n\t\t\t\ttopic_count_vote_abstain= ?d,\n\t\t\t\ttopic_count_read= ?d,\n\t\t\t\ttopic_count_comment= ?d, \n\t\t\t\ttopic_count_favourite= ?d,\n\t\t\t\ttopic_cut_text = ? ,\n\t\t\t\ttopic_forbid_comment = ? ,\n\t\t\t\ttopic_text_hash = ? \n\t\t\tWHERE\n\t\t\t\ttopic_id = ?d\n\t\t";
     $res = $this->oDb->query($sql, $oTopic->getBlogId(), $oTopic->getBlogId2(), $oTopic->getBlogId3(), $oTopic->getBlogId4(), $oTopic->getBlogId5(), $oTopic->getTitle(), $oTopic->getSlug(), $oTopic->getTags(), $oTopic->getDateAdd(), $oTopic->getDateEdit(), $oTopic->getDateEditContent(), $oTopic->getDatePublish(), $oTopic->getUserIp(), $oTopic->getPublish(), $oTopic->getPublishDraft(), $oTopic->getPublishIndex(), $oTopic->getSkipIndex(), $oTopic->getRating(), $oTopic->getCountVote(), $oTopic->getCountVoteUp(), $oTopic->getCountVoteDown(), $oTopic->getCountVoteAbstain(), $oTopic->getCountRead(), $oTopic->getCountComment(), $oTopic->getCountFavourite(), $oTopic->getCutText(), $oTopic->getForbidComment(), $oTopic->getTextHash(), $oTopic->getId());
     if ($res !== false and !is_null($res)) {
         $this->UpdateTopicContent($oTopic);
         return true;
     }
     return false;
 }
 /**
  * Обновляет топик
  *
  * @param ModuleTopic_EntityTopic $oTopic Объект топика
  * @return bool
  */
 public function UpdateTopic(ModuleTopic_EntityTopic $oTopic)
 {
     $sql = "UPDATE " . Config::Get('db.table.topic') . "\n      SET\n        blog_id= ?d,\n        topic_title= ?,\n        topic_tags= ?,\n        topic_date_add = ?,\n        topic_date_edit = ?,\n        topic_user_ip= ?,\n        topic_publish= ?d ,\n        topic_publish_draft= ?d ,\n        topic_publish_index= ?d,\n        topic_rating= ?f,\n        topic_count_vote= ?d,\n        topic_count_vote_up= ?d,\n        topic_count_vote_down= ?d,\n        topic_count_vote_abstain= ?d,\n        topic_count_read= ?d,\n        topic_count_comment= ?d,\n        topic_count_favourite= ?d,\n        topic_cut_text = ? ,\n        topic_forbid_comment = ? ,\n        topic_text_hash = ?\n      WHERE\n        topic_id = ?d\n    ";
     if ($this->oDb->query($sql, $oTopic->getBlogId(), $oTopic->getTitle(), $oTopic->getTags(), $oTopic->getDateAdd(), $oTopic->getDateEdit(), $oTopic->getUserIp(), $oTopic->getPublish(), $oTopic->getPublishDraft(), $oTopic->getPublishIndex(), $oTopic->getRating(), $oTopic->getCountVote(), $oTopic->getCountVoteUp(), $oTopic->getCountVoteDown(), $oTopic->getCountVoteAbstain(), $oTopic->getCountRead(), $oTopic->getCountComment(), $oTopic->getCountFavourite(), $oTopic->getCutText(), $oTopic->getForbidComment(), $oTopic->getTextHash(), $oTopic->getId())) {
         $this->UpdateTopicContent($oTopic);
         return true;
     }
     return false;
 }