웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
조회수 클릭때마다 올라가기(1.4.5.7 버전에서 되네요)
2011.06.20 16:09
조회수 클릭때 마다 올라가기
./modules/document/ 에 있는 document.controller.php
파일을 열어 572번줄쯤에 조회수 증가코드를 아래코드로 대체 하시면 됩니다.
아래 파일첨부해드려요~ document.controller.php(1.4.5.7)원본파일과
document.controller.php 수정된 파일입니다.
-----------------------------------------------------------------------
/**
* @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;
}
-----------------------------------------------------------------------
./modules/document/ 에 있는 document.controller.php
파일을 열어 572번줄쯤에 조회수 증가코드를 아래코드로 대체 하시면 됩니다.
아래 파일첨부해드려요~ document.controller.php(1.4.5.7)원본파일과
document.controller.php 수정된 파일입니다.
-----------------------------------------------------------------------
/**
* @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;
}
-----------------------------------------------------------------------
댓글 2
-
때린데 또때려
2012.04.07 18:07
-
때린데 또때려
2012.04.07 20:34
송동우님 게서 주신 답변입니다.
==========================
xe - modules - document - document.controller.php 열고
line 663 쯤에
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;
}
이 부분을 모두 주석처리 혹은 삭제
제목 | 글쓴이 | 날짜 |
---|---|---|
외부로그인을 어떻게 생성 하나요? [3] | 엄경선 | 2011.02.08 |
다운로드 필요 포인트가 0 인 모듈에서의 비회원 다운로드 권한 부여 [2] | 키네시스 | 2011.02.09 |
XE공식레이아웃(xe_official_v2)에서 소셜XE로그인창 연동 | ehdgkr97 | 2011.02.13 |
우분투 10.04 LTS, SSH 사용자 접속 제한 | fsfsdas | 2011.02.20 |
글쓴이의 정보 추출해서 게시판 출력하기 [9] | 야호z | 2011.02.24 |
xe_member 테이블에서 extra_vars 필드 분리하기... [1] | 맘편한넘 | 2011.02.26 |
외부페이지 로그인 연동 [10] | 응삼 | 2011.02.28 |
사진링크가 깨져서 엉망이네요 [1] | 김성회 | 2011.03.11 |
블루호스트(Bluehost)에서 XE 제로보드 및 텍스타일 블로그 서브도메인에 설치하기 [4] | TELSTER | 2011.03.25 |
1.4.5 업데이트후 로그인 안되시는 분들 [3] | BlogJh | 2011.04.03 |
내 PC에서 XE 빠르게 설치하는 방법 [7] | 차오이 | 2011.04.10 |
레이아웃 위젯 권한 넣기 [14] | 해피해킹 | 2011.04.12 |
XE 업데이트 이후 로그인 에러 및 첨부파일 증발에 대한 해결 팁 모음 [5] | ksdwm72 | 2011.04.20 |
회원 관리자 두기.. | DaKi | 2011.05.09 |
로그인풀림방지 - 주소 고정하기 [27] | ezi | 2011.05.28 |
조회수 클릭때마다 올라가기(1.4.5.7 버전에서 되네요) [2] | 아네모네 | 2011.06.20 |
비로그인시 본문대신 지정문구 보이기 [1] | 도라란 | 2011.07.11 |
로그인 정보 폼에 읽지 않은 쪽지 개수 보이기. [21] | 무얼까 | 2011.07.23 |
조회수 제한 풀고, 조회수 증가값을 더 크게 하는 소스 [7] | sejin7940 | 2011.08.21 |
글읽기 권한 없을때 회원가입창으로 유도하는 방법 (XE1.5수정) [10] | sejin7940 | 2011.08.23 |
1.5.2.1 버전에서도 적용이 되는건가요?