Add point exception for reading notices #1124

This commit is contained in:
Kijin Sung 2018-12-14 12:15:58 +09:00
parent 26b494f1e5
commit bc14eecd50
5 changed files with 48 additions and 23 deletions

View file

@ -469,7 +469,7 @@ class pointController extends point
}
// Give no points if the document is older than a configured limit.
$regdate = ztime(getModel('document')->getDocument($obj->document_srl)->get('regdate'));
$regdate = ztime($obj->get('regdate'));
$config = $this->getConfig();
if ($config->read_document_limit > 0 && $regdate < RX_TIME - ($config->read_document_limit * 86400))
{
@ -480,6 +480,19 @@ class pointController extends point
$author_point = 0;
}
// Give no points if the document is a notice and an exception has been configured.
if ($obj->get('is_notice') === 'Y')
{
if ($config->read_document_except_notice)
{
$reader_point = 0;
}
if ($config->read_document_author_except_notice)
{
$author_point = 0;
}
}
// Adjust points of the reader.
if ($reader_point)
{