mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Add option to allow robots to read documents
This commit is contained in:
parent
d946d75969
commit
9939b8b747
5 changed files with 24 additions and 13 deletions
|
|
@ -17,6 +17,7 @@ $lang->disable_download = 'Prohibit Downloads';
|
||||||
$lang->about_disable_download = 'This will prohibit downloads when there are not enough points. (Exclude image files)';
|
$lang->about_disable_download = 'This will prohibit downloads when there are not enough points. (Exclude image files)';
|
||||||
$lang->disable_read_document = 'Prohibit Readings';
|
$lang->disable_read_document = 'Prohibit Readings';
|
||||||
$lang->about_disable_read_document = 'Users will be unable to read articles when they do not have enough points';
|
$lang->about_disable_read_document = 'Users will be unable to read articles when they do not have enough points';
|
||||||
|
$lang->disable_read_document_except_robots = 'Except search robots';
|
||||||
$lang->level_point_calc = 'Point Calculation per Point';
|
$lang->level_point_calc = 'Point Calculation per Point';
|
||||||
$lang->expression = 'Please input Javascript formula by using level variable <b>i</b>. ex) Math.pow(i, 2) * 90';
|
$lang->expression = 'Please input Javascript formula by using level variable <b>i</b>. ex) Math.pow(i, 2) * 90';
|
||||||
$lang->cmd_exp_calc = 'Calculate';
|
$lang->cmd_exp_calc = 'Calculate';
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,10 @@ $lang->about_point_name = '포인트 이름이나 단위를 정할 수 있습니
|
||||||
$lang->level_point = '레벨 포인트';
|
$lang->level_point = '레벨 포인트';
|
||||||
$lang->about_level_point = '각 회원의 포인트가 아래 레벨별 포인트에 도달하거나 미달하게 되면 해당 회원의 레벨이 조절됩니다.';
|
$lang->about_level_point = '각 회원의 포인트가 아래 레벨별 포인트에 도달하거나 미달하게 되면 해당 회원의 레벨이 조절됩니다.';
|
||||||
$lang->disable_download = '다운로드 금지';
|
$lang->disable_download = '다운로드 금지';
|
||||||
$lang->about_disable_download = '포인트가 부족할 경우 다운로드를 금지 합니다. (이미지 파일, 동영상 파일등 직접 링크가 가능한 파일들은 예외입니다.)';
|
$lang->about_disable_download = '포인트가 부족할 경우 다운로드를 금지합니다. (이미지 파일, 동영상 파일등 직접 링크가 가능한 파일들은 예외입니다.)';
|
||||||
$lang->disable_read_document = '글 열람 금지';
|
$lang->disable_read_document = '글 열람 금지';
|
||||||
$lang->about_disable_read_document = '포인트가 부족할 경우 글 열람을 금지 합니다';
|
$lang->about_disable_read_document = '포인트가 부족할 경우 글 열람을 금지합니다.';
|
||||||
|
$lang->disable_read_document_except_robots = '검색엔진은 열람 허용';
|
||||||
$lang->level_point_calc = '레벨별 포인트 계산';
|
$lang->level_point_calc = '레벨별 포인트 계산';
|
||||||
$lang->expression = '레벨 변수 <b>i</b>를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90';
|
$lang->expression = '레벨 변수 <b>i</b>를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90';
|
||||||
$lang->cmd_exp_calc = '계산';
|
$lang->cmd_exp_calc = '계산';
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,10 @@ class pointAdminController extends point
|
||||||
// Set the level icon
|
// Set the level icon
|
||||||
$config->level_icon = $args->level_icon;
|
$config->level_icon = $args->level_icon;
|
||||||
// Check if downloads are not allowed
|
// Check if downloads are not allowed
|
||||||
if($args->disable_download == 'Y') $config->disable_download = 'Y';
|
$config->disable_download = ($args->disable_download === 'Y') ? 'Y' : 'N';
|
||||||
else $config->disable_download = 'N';
|
|
||||||
// Check if reading a document is not allowed
|
// Check if reading a document is not allowed
|
||||||
if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y';
|
$config->disable_read_document = ($args->disable_read_document === 'Y') ? 'Y' : 'N';
|
||||||
else $config->disable_read_document = 'N';
|
$config->disable_read_document_except_robots = ($args->disable_read_document_except_robots === 'Y') ? 'Y' : 'N';
|
||||||
|
|
||||||
//check is reading a document is not regdate setting
|
//check is reading a document is not regdate setting
|
||||||
$config->no_point_date = (int)$args->no_point_date;
|
$config->no_point_date = (int)$args->no_point_date;
|
||||||
|
|
|
||||||
|
|
@ -446,12 +446,20 @@ class pointController extends point
|
||||||
$cur_point = $logged_member_srl ? getModel('point')->getPoint($logged_member_srl) : 0;
|
$cur_point = $logged_member_srl ? getModel('point')->getPoint($logged_member_srl) : 0;
|
||||||
|
|
||||||
// If the reader does not have enough points, deny access.
|
// If the reader does not have enough points, deny access.
|
||||||
if ($cur_point + $reader_point < 0 && $this->getConfig()->disable_read_document == 'Y')
|
$config = $this->getConfig();
|
||||||
|
if ($cur_point + $reader_point < 0 && $config->disable_read_document == 'Y')
|
||||||
{
|
{
|
||||||
$message = sprintf(lang('msg_disallow_by_point'), abs($reader_point), $cur_point);
|
if (!$logged_member_srl && $config->disable_read_document_except_robots == 'Y' && isCrawler())
|
||||||
$obj->add('content', $message);
|
{
|
||||||
$_SESSION['banned_document'][$obj->document_srl] = true;
|
$_SESSION['banned_document'][$obj->document_srl] = false;
|
||||||
return new BaseObject(-1, $message);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = sprintf(lang('msg_disallow_by_point'), abs($reader_point), $cur_point);
|
||||||
|
$obj->add('content', $message);
|
||||||
|
$_SESSION['banned_document'][$obj->document_srl] = true;
|
||||||
|
return new BaseObject(-1, $message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -106,14 +106,16 @@
|
||||||
<label for="disable_read_document" class="x_control-label">{$lang->disable_read_document}</label>
|
<label for="disable_read_document" class="x_control-label">{$lang->disable_read_document}</label>
|
||||||
<div class="x_controls" style="padding-top:3px">
|
<div class="x_controls" style="padding-top:3px">
|
||||||
<input type="checkbox" name="disable_read_document" id="disable_read_document" value="Y" checked="checked"|cond="$config->disable_read_document=='Y'" />
|
<input type="checkbox" name="disable_read_document" id="disable_read_document" value="Y" checked="checked"|cond="$config->disable_read_document=='Y'" />
|
||||||
{$lang->about_disable_read_document}
|
{$lang->about_disable_read_document}
|
||||||
|
<input type="checkbox" name="disable_read_document_except_robots" id="disable_read_document_except_robots" value="Y" checked="checked"|cond="$config->disable_read_document_except_robots == 'Y'" />
|
||||||
|
{$lang->disable_read_document_except_robots}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_control-group">
|
<div class="x_control-group">
|
||||||
<label for="no_point_date" class="x_control-label">{$lang->no_point_date}</label>
|
<label for="no_point_date" class="x_control-label">{$lang->no_point_date}</label>
|
||||||
<div class="x_controls" style="padding-top:3px">
|
<div class="x_controls" style="padding-top:3px">
|
||||||
<input type="number" name="no_point_date" id="no_point_date" value="{$config->no_point_date}" style="width:50px;" />{$lang->day_ago}
|
<input type="number" name="no_point_date" id="no_point_date" value="{$config->no_point_date}" style="width:50px;" />{$lang->day_ago}
|
||||||
<p>{$lang->about_no_point_date}</p>
|
<p class="x_help-block">{$lang->about_no_point_date}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="x_clearfix btnArea">
|
<div class="x_clearfix btnArea">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue