mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Add point exception for reading notices #1124
This commit is contained in:
parent
26b494f1e5
commit
bc14eecd50
5 changed files with 48 additions and 23 deletions
|
|
@ -23,6 +23,7 @@ $lang->expression = 'Please input Javascript formula by using level variable <b>
|
|||
$lang->cmd_exp_calc = 'Calculate';
|
||||
$lang->cmd_exp_reset = 'Reset';
|
||||
$lang->cmd_point_recal = 'Reset Point';
|
||||
$lang->cmd_point_except_notice = 'Except Notice';
|
||||
$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';
|
||||
|
|
@ -60,8 +61,8 @@ $lang->msg_disallow_by_point = 'You need more points to read the article (You ne
|
|||
$lang->point_recal_message = 'Adjusting Point. (%d / %d)';
|
||||
$lang->point_recal_finished = 'Point recalculation is finished.';
|
||||
$lang->point_update_desc = 'Insert + in front of the number to increase the point or - to decrease, and update the point. If you don\'t insert + or -, the point will be set as the value you entered.';
|
||||
$lang->give_point = 'Give the point';
|
||||
$lang->point_given_prefix = 'give';
|
||||
$lang->give_point = 'Give or Take Points';
|
||||
$lang->point_given_prefix = '';
|
||||
$lang->point_given_suffix = 'points';
|
||||
$lang->point_time_limit_prefix = 'until';
|
||||
$lang->point_time_limit_suffix = 'days after submission';
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ $lang->expression = '레벨 변수 <b>i</b>를 사용하여 자바스크립트
|
|||
$lang->cmd_exp_calc = '계산';
|
||||
$lang->cmd_exp_reset = '초기화';
|
||||
$lang->cmd_point_recal = '포인트 초기화';
|
||||
$lang->cmd_point_except_notice = '공지 제외';
|
||||
$lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화합니다. 회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다. 데이터 이전 등을 하여 포인트를 완전히 초기화해야 할 경우에만 사용하세요.';
|
||||
$lang->default_group = '기본 그룹';
|
||||
$lang->point_link_group = '그룹 연동';
|
||||
|
|
@ -62,9 +63,9 @@ $lang->msg_disallow_by_point = '로그인하지 않았거나 포인트가 부족
|
|||
$lang->point_recal_message = '포인트 적용 중입니다. (%d / %d)';
|
||||
$lang->point_recal_finished = '포인트 재계산이 완료되었습니다.';
|
||||
$lang->point_update_desc = '포인트를 증가시키려면 +를 감소시키려면 -를 숫자앞에 표기한 후 업데이트해 주세요. + 또는 - 표시가 없으면 입력한 값으로 설정됩니다.';
|
||||
$lang->give_point = '포인트 부여';
|
||||
$lang->give_point = '포인트 부여/차감';
|
||||
$lang->point_given_prefix = '';
|
||||
$lang->point_given_suffix = '포인트 부여';
|
||||
$lang->point_given_suffix = '포인트';
|
||||
$lang->point_time_limit_prefix = '작성 후';
|
||||
$lang->point_time_limit_suffix = '일까지';
|
||||
$lang->search_target_list['nick_name'] = '닉네임';
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ class pointAdminController extends point
|
|||
$config->blamer_comment = (int)$args->blamer_comment;
|
||||
$config->voted_comment = (int)$args->voted_comment;
|
||||
$config->blamed_comment = (int)$args->blamed_comment;
|
||||
|
||||
// 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 time limits
|
||||
$config->insert_comment_limit = $config->no_point_date = (int)$args->insert_comment_limit;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -63,25 +63,25 @@
|
|||
</section>
|
||||
|
||||
<section class="section">
|
||||
<h1>{$lang->point_given_suffix}</h1>
|
||||
<h1>{$lang->give_point}</h1>
|
||||
{@ $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' => 0,
|
||||
'insert_comment' => 1,
|
||||
'upload_file' => 0,
|
||||
'download_file' => 0,
|
||||
'read_document' => 1,
|
||||
'voter' => 1,
|
||||
'blamer' => 1,
|
||||
'voter_comment' => 1,
|
||||
'blamer_comment' => 1,
|
||||
'download_file_author' => 0,
|
||||
'read_document_author' => 1,
|
||||
'voted' => 1,
|
||||
'blamed' => 1,
|
||||
'voted_comment' => 1,
|
||||
'blamed_comment' => 1,
|
||||
'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],
|
||||
)}
|
||||
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
|
|
@ -104,16 +104,22 @@
|
|||
</td>
|
||||
<td class="nowr"></td>
|
||||
</tr>
|
||||
<!--@foreach($action_types as $action_type => $time_limit)-->
|
||||
<!--@foreach($action_types as $action_type => $action_config)-->
|
||||
<tr>
|
||||
<th class="nowr">{lang('point_' . $action_type)}</td>
|
||||
<td class="nowr">
|
||||
{$lang->point_given_prefix}
|
||||
<input type="number" value="{$config_array[$action_type] ?: '0'}" name="{$action_type}" id="{$action_type}" />
|
||||
{$lang->point_given_suffix}
|
||||
<block cond="$action_config['except_notice']">
|
||||
<label class="x_inline" for="{$action_type}_except_notice" style="margin-left:10px">
|
||||
<input type="checkbox" value="Y" name="{$action_type}_except_notice" id="{$action_type}_except_notice" checked="checked"|cond="$config_array[$action_type . '_except_notice']" />
|
||||
{$lang->cmd_point_except_notice}
|
||||
</label>
|
||||
</block>
|
||||
</td>
|
||||
<td class="nowr">
|
||||
<block cond="$time_limit">
|
||||
<block cond="$action_config['time_limit']">
|
||||
{$lang->point_time_limit_prefix}
|
||||
<input type="number" value="{$config_array[$action_type . '_limit'] ?: ''}" name="{$action_type}_limit" id="{$action_type}_limit" />
|
||||
{$lang->point_time_limit_suffix}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue