mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Add option to control taking points when a post is deleted
This commit is contained in:
parent
72577ce6bb
commit
0a9d34c37f
5 changed files with 49 additions and 16 deletions
|
|
@ -24,6 +24,7 @@ $lang->cmd_exp_calc = 'Calculate';
|
|||
$lang->cmd_exp_reset = 'Reset';
|
||||
$lang->cmd_point_recal = 'Reset Point';
|
||||
$lang->cmd_point_except_notice = 'Except Notice';
|
||||
$lang->cmd_point_revert_on_delete = 'Revert on Delete';
|
||||
$lang->about_cmd_point_recal = 'All point will be initialized only with articles/comments/attachments/join points. Only members who do website activities will get signup points after reset. Please use this function when complete initialization is required in case of data transferring or other situations.';
|
||||
$lang->default_group = 'Default Group';
|
||||
$lang->point_link_group = 'Group Change by Level';
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ $lang->cmd_exp_calc = '계산';
|
|||
$lang->cmd_exp_reset = '초기화';
|
||||
$lang->cmd_point_recal = '포인트 초기화';
|
||||
$lang->cmd_point_except_notice = '공지 제외';
|
||||
$lang->cmd_point_revert_on_delete = '삭제시 회수';
|
||||
$lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화합니다. 회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다. 데이터 이전 등을 하여 포인트를 완전히 초기화해야 할 경우에만 사용하세요.';
|
||||
$lang->default_group = '기본 그룹';
|
||||
$lang->point_link_group = '그룹 연동';
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ class pointAdminController extends point
|
|||
// Specify notice exceptions
|
||||
$config->read_document_except_notice = ($args->read_document_except_notice === 'Y');
|
||||
$config->read_document_author_except_notice = ($args->read_document_author_except_notice === 'Y');
|
||||
|
||||
// Specify revert on delete
|
||||
$config->insert_document_revert_on_delete = ($args->insert_document_revert_on_delete === 'Y');
|
||||
$config->insert_comment_revert_on_delete = ($args->insert_comment_revert_on_delete === 'Y');
|
||||
$config->upload_file_revert_on_delete = ($args->upload_file_revert_on_delete === 'Y');
|
||||
|
||||
// Specify time limits
|
||||
$config->insert_comment_limit = $config->no_point_date = (int)$args->insert_comment_limit;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -67,21 +67,21 @@
|
|||
{@ $config_array = get_object_vars($config)}
|
||||
{@ $config_array['insert_comment_limit'] = $config_array['insert_comment_limit'] ?: $config_array['no_point_date']}
|
||||
{@ $action_types = array(
|
||||
'insert_document' => ['time_limit' => 0, 'except_notice' => 0],
|
||||
'insert_comment' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'upload_file' => ['time_limit' => 0, 'except_notice' => 0],
|
||||
'download_file' => ['time_limit' => 0, 'except_notice' => 0],
|
||||
'read_document' => ['time_limit' => 1, 'except_notice' => 1],
|
||||
'voter' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'blamer' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'voter_comment' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'blamer_comment' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'download_file_author' => ['time_limit' => 0, 'except_notice' => 0],
|
||||
'read_document_author' => ['time_limit' => 1, 'except_notice' => 1],
|
||||
'voted' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'blamed' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'voted_comment' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'blamed_comment' => ['time_limit' => 1, 'except_notice' => 0],
|
||||
'insert_document' => ['time_limit' => 0, 'except_notice' => 0, 'revert_on_delete' => 1],
|
||||
'insert_comment' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 1],
|
||||
'upload_file' => ['time_limit' => 0, 'except_notice' => 0, 'revert_on_delete' => 1],
|
||||
'download_file' => ['time_limit' => 0, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'read_document' => ['time_limit' => 1, 'except_notice' => 1, 'revert_on_delete' => 0],
|
||||
'voter' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'blamer' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'voter_comment' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'blamer_comment' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'download_file_author' => ['time_limit' => 0, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'read_document_author' => ['time_limit' => 1, 'except_notice' => 1, 'revert_on_delete' => 0],
|
||||
'voted' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'blamed' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'voted_comment' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
'blamed_comment' => ['time_limit' => 1, 'except_notice' => 0, 'revert_on_delete' => 0],
|
||||
)}
|
||||
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
|
|
@ -117,6 +117,12 @@
|
|||
{$lang->cmd_point_except_notice}
|
||||
</label>
|
||||
</block>
|
||||
<block cond="$action_config['revert_on_delete']">
|
||||
<label class="x_inline" for="{$action_type}_revert_on_delete" style="margin-left:10px">
|
||||
<input type="checkbox" value="Y" name="{$action_type}_revert_on_delete" id="{$action_type}_revert_on_delete" checked="checked"|cond="$config_array[$action_type . '_revert_on_delete'] !== false" />
|
||||
{$lang->cmd_point_revert_on_delete}
|
||||
</label>
|
||||
</block>
|
||||
</td>
|
||||
<td class="nowr">
|
||||
<block cond="$action_config['time_limit']">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue