From da2be81260ced6503e5e51d9dcf9990efa69ebba Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 2 Mar 2017 16:30:57 +0900 Subject: [PATCH] Add and subtract points for comment attachments --- modules/point/point.controller.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/point/point.controller.php b/modules/point/point.controller.php index 7c5fbdcb0..c30285771 100644 --- a/modules/point/point.controller.php +++ b/modules/point/point.controller.php @@ -313,6 +313,13 @@ class pointController extends point $comment_point = $this->_getModulePointConfig($module_srl, 'insert_comment'); $cur_point += $comment_point; + // Add points for attached files. + if ($obj->uploaded_count > 0) + { + $attached_files_point = $this->_getModulePointConfig($module_srl, 'upload_file'); + $cur_point += $attached_files_point * $obj->uploaded_count; + } + // Increase the point. $this->setPoint($member_srl, $cur_point); return new Object(); @@ -351,6 +358,16 @@ class pointController extends point $comment_point = $this->_getModulePointConfig($module_srl, 'insert_comment'); $cur_point -= $comment_point; + // Subtract points for attached files. + if ($obj->uploaded_count > 0) + { + $attached_files_point = $this->_getModulePointConfig($module_srl, 'upload_file'); + if ($attached_files_point > 0) + { + $cur_point -= $attached_files_point * $obj->uploaded_count; + } + } + // Increase the point. $this->setPoint($member_srl, $cur_point); return new Object();