[XE] 새로고침할 때마다 조회수 증가시키는 방법
함께 설치하면 좋은 모듈
sejin7940_readed_count - 조회수 기능 확장 애드온 ver. 1.6
click 할때 마다 조회수 증가하기
xe - modules - document - document.controller.php
=================================================
xe - modules - document - document.controller.php 열고
line 846쯤에
// Pass if read count is increaded on the session information
if($_SESSION['readed_document'][$document_srl]) return false;
// Pass if the author's IP address is as same as visitor's.
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
{
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
이 부분을 모두 주석처리 혹은 삭제(자기가 쓴글은 제외입니다.)
==================================================
만약 자기가 쓴 글을 자기가 클릭할때도 조회수가 올라가게 할려면
위 부분 바로 아래에
// Pass ater registering sesscion if the author is a member and has same information as the currently logged-in user.
if($member_srl && $logged_info->member_srl == $member_srl) {
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
이부분까지 주석처리하거나 삭제하시면 됩니다.
xe\modules\document\document.controller.php
802라인 부근에서 아래 부분을 주석 처리
/**
if($_SESSION['readed_document'][$document_srl]) return false;
// Pass if the author's IP address is as same as visitor's.
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR'])
{
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
**/
자기사 쓴 글에 대해서도 조회수가 올라가게 수정하려면
// Pass ater registering sesscion if the author is a member and has same information as the currently logged-in user.
if($member_srl && $logged_info->member_srl == $member_srl) {
$_SESSION['readed_document'][$document_srl] = true;
return false;
}
여기까지 주석 처리 해주시거나 삭제
무료 자료
XE → 라이믹스 이전 체크리스트
옮기기 전에 확인할 것, 이전 중 자주 터지는 오류, 옮긴 뒤 손봐야 하는 것을 순서대로 정리했습니다.
댓글 0
댓글을 작성하려면 로그인이 필요합니다.
아직 댓글이 없어요
이 글에 대한 생각을 가장 먼저 남겨보세요.