mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Improving do not count the deleted comments.
This commit is contained in:
parent
5e036bf586
commit
fb4ff53a6f
3 changed files with 26 additions and 1 deletions
|
|
@ -939,6 +939,24 @@ class commentController extends comment
|
||||||
// call a trigger by delete (after)
|
// call a trigger by delete (after)
|
||||||
ModuleHandler::triggerCall('comment.updateCommentByDelete', 'after', $obj);
|
ModuleHandler::triggerCall('comment.updateCommentByDelete', 'after', $obj);
|
||||||
|
|
||||||
|
// update the number of comments
|
||||||
|
$oCommentModel = getModel('comment');
|
||||||
|
$comment_count = $oCommentModel->getCommentCount($obj->document_srl);
|
||||||
|
// only document is exists
|
||||||
|
if(isset($comment_count))
|
||||||
|
{
|
||||||
|
// create the controller object of the document
|
||||||
|
$oDocumentController = getController('document');
|
||||||
|
|
||||||
|
// update comment count of the article posting
|
||||||
|
$output = $oDocumentController->updateCommentCount($obj->document_srl, $comment_count, NULL, FALSE);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
$oDB->rollback();
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
$output->add('document_srl', $obj->document_srl);
|
$output->add('document_srl', $obj->document_srl);
|
||||||
|
|
|
||||||
|
|
@ -248,12 +248,18 @@ class commentModel extends comment
|
||||||
|
|
||||||
//check if module is using validation system
|
//check if module is using validation system
|
||||||
$oCommentController = getController('comment');
|
$oCommentController = getController('comment');
|
||||||
|
|
||||||
$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
|
$using_validation = $oCommentController->isModuleUsingPublishValidation($module_srl);
|
||||||
|
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
|
||||||
|
$use_comment_massage = $module_info->comment_delete_message;
|
||||||
|
|
||||||
if($using_validation)
|
if($using_validation)
|
||||||
{
|
{
|
||||||
$args->status = 1;
|
$args->status = 1;
|
||||||
}
|
}
|
||||||
|
elseif($use_comment_massage == 'Y')
|
||||||
|
{
|
||||||
|
$args->status = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$output = executeQuery('comment.getCommentCount', $args, NULL, 'master');
|
$output = executeQuery('comment.getCommentCount', $args, NULL, 'master');
|
||||||
$total_count = $output->data->count;
|
$total_count = $output->data->count;
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,6 @@
|
||||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" pipe="and" />
|
<condition operation="equal" column="document_srl" var="document_srl" filter="number" pipe="and" />
|
||||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||||
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
<condition operation="like_prefix" column="regdate" var="regDate" pipe="and" />
|
||||||
|
<condition operation="equal" column="status" var="status" pipe="and" />
|
||||||
</conditions>
|
</conditions>
|
||||||
</query>
|
</query>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue