1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-28 20:45:00 +03:00

фикс бага с черновиками

This commit is contained in:
Mzhelskiy Maxim 2009-02-15 08:10:07 +00:00
parent 143030e342
commit 1b81d3aa39
6 changed files with 39 additions and 15 deletions

View file

@ -314,8 +314,10 @@ class ActionLink extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
$oTopic->setPublishDraft(1);
} else {
$oTopic->setPublish(0);
$oTopic->setPublishDraft(0);
}
/**
* Принудительный вывод на главную
@ -422,6 +424,10 @@ class ActionLink extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
if ($oTopic->getPublishDraft()==0) {
$oTopic->setPublishDraft(1);
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
}
} else {
$oTopic->setPublish(0);
}

View file

@ -287,8 +287,10 @@ class ActionQuestion extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
$oTopic->setPublishDraft(1);
} else {
$oTopic->setPublish(0);
$oTopic->setPublishDraft(0);
}
/**
* Принудительный вывод на главную
@ -404,6 +406,10 @@ class ActionQuestion extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
if ($oTopic->getPublishDraft()==0) {
$oTopic->setPublishDraft(1);
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
}
} else {
$oTopic->setPublish(0);
}

View file

@ -399,8 +399,10 @@ class ActionTopic extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
$oTopic->setPublishDraft(1);
} else {
$oTopic->setPublish(0);
$oTopic->setPublishDraft(0);
}
/**
* Принудительный вывод на главную
@ -527,6 +529,10 @@ class ActionTopic extends Action {
*/
if (isset($_REQUEST['submit_topic_publish'])) {
$oTopic->setPublish(1);
if ($oTopic->getPublishDraft()==0) {
$oTopic->setPublishDraft(1);
$oTopic->setDateAdd(date("Y-m-d H:i:s"));
}
} else {
$oTopic->setPublish(0);
}

View file

@ -69,6 +69,9 @@ class TopicEntity_Topic extends Entity
public function getPublish() {
return $this->_aData['topic_publish'];
}
public function getPublishDraft() {
return $this->_aData['topic_publish_draft'];
}
public function getPublishIndex() {
return $this->_aData['topic_publish_index'];
}
@ -359,6 +362,9 @@ class TopicEntity_Topic extends Entity
public function setPublish($data) {
$this->_aData['topic_publish']=$data;
}
public function setPublishDraft($data) {
$this->_aData['topic_publish_draft']=$data;
}
public function setPublishIndex($data) {
$this->_aData['topic_publish_index']=$data;
}

View file

@ -32,14 +32,15 @@ class Mapper_Topic extends Mapper {
topic_date_add,
topic_user_ip,
topic_publish,
topic_publish_draft,
topic_publish_index,
topic_cut_text,
topic_forbid_comment
)
VALUES(?d, ?d, ?, ?, ?, ?, ?, ?d, ?d, ?, ?)
VALUES(?d, ?d, ?, ?, ?, ?, ?, ?d, ?d, ?d, ?, ?)
";
if ($iId=$this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getUserId(),$oTopic->getType(),$oTopic->getTitle(),
$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishIndex(),$oTopic->getCutText(),$oTopic->getForbidComment()))
$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishDraft(),$oTopic->getPublishIndex(),$oTopic->getCutText(),$oTopic->getForbidComment()))
{
$oTopic->setId($iId);
$this->AddTopicContent($oTopic);
@ -760,10 +761,12 @@ class Mapper_Topic extends Mapper {
blog_id= ?d,
topic_title= ?,
topic_tags= ?,
topic_date_add = ?,
topic_date_edit = ?,
topic_user_ip= ?,
topic_publish= ? ,
topic_publish_index= ?,
topic_publish= ?d ,
topic_publish_draft= ?d ,
topic_publish_index= ?d,
topic_rating= ?f,
topic_count_vote= ?d,
topic_count_read= ?d,
@ -773,7 +776,7 @@ class Mapper_Topic extends Mapper {
WHERE
topic_id = ?d
";
if ($this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateEdit(),$oTopic->getUserIp(),$oTopic->getPublish(),$oTopic->getPublishIndex(),$oTopic->getRating(),$oTopic->getCountVote(),$oTopic->getCountRead(),$oTopic->getCountComment(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getId())) {
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->getCountRead(),$oTopic->getCountComment(),$oTopic->getCutText(),$oTopic->getForbidComment(),$oTopic->getId())) {
$this->UpdateTopicContent($oTopic);
return true;
}

View file

@ -2,9 +2,8 @@
------------------Changeset [96]-----------------
-------------------------------------------------
--
-- Ñòðóêòóðà òàáëèöû `prefix_reminder`
--
CREATE TABLE IF NOT EXISTS `prefix_reminder` (
`reminder_code` varchar(32) NOT NULL,
@ -17,13 +16,9 @@ CREATE TABLE IF NOT EXISTS `prefix_reminder` (
UNIQUE KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Îãðàíè÷åíèÿ âíåøíåãî êëþ÷à ñîõðàíåííûõ òàáëèö
--
--
-- Îãðàíè÷åíèÿ âíåøíåãî êëþ÷à òàáëèöû `prefix_reminder`
--
ALTER TABLE `prefix_reminder`
ADD CONSTRAINT `prefix_reminder_fk` FOREIGN KEY (`user_id`) REFERENCES `prefix_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
@ -36,4 +31,6 @@ ALTER TABLE `prefix_user` ADD `user_profile_foto` VARCHAR( 250 ) NULL AFTER `use
ALTER TABLE `prefix_topic_read` ADD `comment_id_last` INT( 11 ) NOT NULL DEFAULT '0' AFTER `comment_count_last` ;
ALTER TABLE `prefix_talk` ADD `talk_date_last` DATETIME NOT NULL AFTER `talk_date` ;
ALTER TABLE `prefix_talk` ADD `talk_date_last` DATETIME NOT NULL AFTER `talk_date` ;
ALTER TABLE `prefix_topic` ADD `topic_publish_draft` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `topic_publish` ;