XpressEngine - 팁 공유 게시판
자신이 생각하기에는 아주 사소한 내용이라도 누군가에게는 큰 도움이 될 수 있습니다.
제로보드4 버전의 팁을 공유하고 싶으시다면 여기로~
1.0.0 버전 이상
zbxe\modules\document에서 document.controller.php의 325번~357번 라인을 수정해주시면 됩니다.
/**
* @brief 해당 document의 조회수 증가
**/
function updateReadedCount($oDocument) {
$document_srl = $oDocument->document_srl;
$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; */
// 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스
if($document->ipaddress == $_SERVER['REMOTE_ADDR']) {
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
// document의 작성자가 회원일때 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 판단후 세션 등록하고 패스
if($member_srl && $logged_info->member_srl == $member_srl) {
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
// 조회수 업데이트
$args->document_srl = $document_srl;
$output = executeQuery('document.updateReadedCount', $args);
// 세션 등록
$_SESSION['readed_document'][$document_srl] = true;
}
http://umsc.co.cc
〔스카이포럼〕 유저 종합 커뮤니티.
네이버 검색창에 "스카이포럼" 을 쳐보세요!
저 같은 경우엔 리스트형태가 아닌 블로그 형태로 하니까 다른회원이 접속해서 읽어도 조회수 변화가 없습니다.
리스트로 변경해서 읽으면 변화가 계속 생기는데 말입니다.


