Add option to control taking points when a post is deleted

This commit is contained in:
Kijin Sung 2019-07-27 22:49:08 +09:00
parent 72577ce6bb
commit 0a9d34c37f
5 changed files with 49 additions and 16 deletions

View file

@ -191,6 +191,13 @@ class pointController extends point
return;
}
// Return if disabled
$config = $this->getConfig();
if ($config->insert_document_revert_on_delete === false)
{
return;
}
// The fix to disable giving points for saving the document temporarily
if ($module_srl == $member_srl)
{
@ -292,6 +299,13 @@ class pointController extends point
return;
}
// Return if disabled
$config = $this->getConfig();
if ($config->insert_comment_revert_on_delete === false)
{
return;
}
// Abort if the comment and the document have the same author.
$oDocument = getModel('document')->getDocument($obj->document_srl);
if (!$oDocument->isExists() || abs($oDocument->get('member_srl')) == $member_srl)
@ -300,7 +314,6 @@ class pointController extends point
}
// Abort if the document is older than a configured limit.
$config = $this->getConfig();
$time_limit = $config->insert_comment_limit ?: $config->no_point_date;
if ($time_limit > 0 && ztime($oDocument->get('regdate')) < RX_TIME - ($time_limit * 86400))
{
@ -351,6 +364,13 @@ class pointController extends point
return;
}
// Return if disabled
$config = $this->getConfig();
if ($config->upload_file_revert_on_delete === false)
{
return;
}
// Get the points of the member
$cur_point = getModel('point')->getPoint($member_srl);