1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

fix #240 - Дата редактирования только при редактировании

This commit is contained in:
Mzhelskiy Maxim 2014-07-22 14:53:33 +07:00
parent 816af8da4e
commit e3f7be3b72
4 changed files with 26 additions and 1 deletions

View file

@ -272,6 +272,10 @@ class ActionContent extends Action {
if (isset($_REQUEST['topic']['topic_forbid_comment'])) {
$oTopic->setForbidComment(1);
}
/**
* Дата редактирования контента
*/
$oTopic->setDateEditContent(date('Y-m-d H:i:s'));
if ($oTopic->_Validate()) {
$oBlog=$oTopic->getBlog();

View file

@ -224,6 +224,14 @@ class ModuleTopic_EntityTopic extends Entity {
public function getDateEdit() {
return $this->_getDataOne('topic_date_edit');
}
/**
* Возвращает дату редактирования контента топика
*
* @return string|null
*/
public function getDateEditContent() {
return $this->_getDataOne('topic_date_edit_content');
}
/**
* Возвращает IP пользователя
*
@ -683,6 +691,14 @@ class ModuleTopic_EntityTopic extends Entity {
public function setDateEdit($data) {
$this->_aData['topic_date_edit']=$data;
}
/**
* Устанавливает дату редактирования контента топика
*
* @param string $data
*/
public function setDateEditContent($data) {
$this->_aData['topic_date_edit_content']=$data;
}
/**
* Устанавливает IP пользователя
*

View file

@ -470,6 +470,7 @@ class ModuleTopic_MapperTopic extends Mapper {
topic_tags= ?,
topic_date_add = ?,
topic_date_edit = ?,
topic_date_edit_content = ?,
topic_user_ip= ?,
topic_publish= ?d ,
topic_publish_draft= ?d ,
@ -488,7 +489,7 @@ class ModuleTopic_MapperTopic extends Mapper {
WHERE
topic_id = ?d
";
$res=$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());
$res=$this->oDb->query($sql,$oTopic->getBlogId(),$oTopic->getTitle(),$oTopic->getTags(),$oTopic->getDateAdd(),$oTopic->getDateEdit(),$oTopic->getDateEditContent(),$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());
if ($res!==false and !is_null($res)) {
$this->UpdateTopicContent($oTopic);
return true;

View file

@ -604,3 +604,7 @@ VALUES (
NULL , 'blog', 'Блоги', '1', '2014-07-14 00:00:00', NULL , ''
);
-- 22.07.2014
ALTER TABLE `prefix_topic` ADD `topic_date_edit_content` DATETIME NULL DEFAULT NULL AFTER `topic_date_edit` ,
ADD INDEX ( `topic_date_edit_content` ) ;