mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
#401 게시글 조회시 포인트 적용 루틴 변경하여 정상 동작 확인
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3685 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
92253dcd1a
commit
ef9060dcf8
3 changed files with 16 additions and 29 deletions
|
|
@ -324,6 +324,9 @@
|
|||
$member_srl = $oDocument->get('member_srl');
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
// 조회수 업데이트가 되면 trigger 호출 (after)
|
||||
$output = ModuleHandler::triggerCall('document.updateReadedCount', 'after', $oDocument);
|
||||
if(!$output->toBool()) return $output;
|
||||
// session에 정보로 조회수를 증가하였다고 생각하면 패스
|
||||
if($_SESSION['readed_document'][$document_srl]) return false;
|
||||
|
||||
|
|
@ -345,34 +348,6 @@
|
|||
|
||||
// 세션 등록
|
||||
$_SESSION['readed_document'][$document_srl] = true;
|
||||
|
||||
/**
|
||||
* DB를 이용한 조회수 체크는 부하 문제로 일단 제거
|
||||
// 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단
|
||||
if($logged_info->member_srl) {
|
||||
$args->member_srl = $logged_info->member_srl;
|
||||
} else {
|
||||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
$args->document_srl = $document_srl;
|
||||
$output = executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
|
||||
// 로그 정보에 조회 로그가 있으면 세션 등록후 패스
|
||||
if($output->data->count) return $_SESSION['readed_document'][$document_srl] = true;
|
||||
|
||||
// 조회수 업데이트
|
||||
$output = executeQuery('document.updateReadedCount', $args);
|
||||
|
||||
// 로그 남기기
|
||||
$output = executeQuery('document.insertDocumentReadedLog', $args);
|
||||
|
||||
// 조회수 업데이트가 되면 trigger 호출 (after)
|
||||
$output = ModuleHandler::triggerCall('document.updateReadedCount', 'after', $oDocument);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 세션 정보에 남김
|
||||
return $_SESSION['readed_document'][$document_srl] = true;
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -331,6 +331,18 @@
|
|||
// 포인트를 구해옴
|
||||
$point = $config->module_point[$obj->get('module_srl')]['read_document'];
|
||||
if(!isset($point)) $point = $config->read_document;
|
||||
|
||||
// 조회 포인트가 없으면 패스
|
||||
if(!$point) return new Object();
|
||||
|
||||
// 읽은 기록이 있는지 확인
|
||||
$args->member_srl = $member_srl;
|
||||
$args->document_srl = $obj->document_srl;
|
||||
$output = executeQuery('document.getDocumentReadedLogInfo', $args);
|
||||
if($output->data->count) return new Object();
|
||||
|
||||
// 읽은 기록이 없으면 기록 남김
|
||||
$output = executeQuery('document.insertDocumentReadedLog', $args);
|
||||
|
||||
// 포인트 증감
|
||||
$cur_point += $point;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!--%import("filter/insert_point_module_config.xml")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_point_module_config);" id="fo_point">
|
||||
<input type="hidden" name="target_module_srl" value="{$module_config['module_srl']?$module_srl['module_srl']:$module_srls}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_config['module_srl']?$module_config['module_srl']:$module_srls}" />
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="200" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue