웹마스터 팁
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;
}
이 부분을 모두 주석처리 혹은 삭제
제목 | 글쓴이 | 날짜 |
---|---|---|
2차 메뉴가 없을 경우 왼쪽 메뉴 숨기기 [5] | 엔시아- | 2009.07.16 |
트리메뉴(dtree) 대충 정리 [11] | 한이73 | 2009.07.19 |
까오천사님의 만기일 팁을 1.2.4에 맞게 수정했어요. [15] | 도파 | 2009.08.27 |
http://www.도메인주소/~as/xe/ 로 로그인 접속후~ [3] | wjnam | 2009.09.07 |
특정그룹회원에게 서비스 제공하기 [4] | 똑디 | 2009.09.12 |
XE 서버 이전할 때 통채로 압축해서 옮기는 완벽한 방법-로그인, 첨부파일문제 해결 [5] | 웰빙샵 지영 | 2009.09.15 |
로그인이 안되거나 첨부파일이 등록이 안될때. [9] | 똑디 | 2009.09.30 |
-추가- 당신의 XE 기반 홈페이지를 훅가게 하는 방법 4가지 [26] | 老姜君 | 2009.10.08 |
로그인 폼에 관리자는 [Admin] 나타나게 하기 [4] | 오스카 | 2009.10.10 |
게시판 리스트에서 확장변수를 카테고리처럼 보여주기 [11] | 고진감래 | 2009.11.05 |
ZB4로 현재까지 사이트를 운영하는분들 긴급 상황안내 (???) [2] | DuRi | 2009.11.20 |
메인 레이아웃에서 로그인이 안보이는 경우. | 김찬회425 | 2009.12.06 |
회원과 비회원 구분하여 출력하기 [6] | NEARSTORY | 2009.12.26 |
Flash swf 플래쉬 때문에 로그인이나 메뉴가 감추어졌을때에... [5] | 태림씨야! | 2010.01.23 |
로그인페이지와 새페이지 연결법 [2] | poko | 2010.01.30 |
쉬운 설치 - unexpected error 메시지창이 뜰 때 [9] | 현의느낌 | 2010.01.30 |
외부프로그램에서 제로보드 xe 및 그누보드 회원 연동(로그인) 하기 - 초간단 [1] | 한이73 | 2010.02.03 |
로그인 후 특정 그룹 페이지 가기 다른버전 [9] | 눈물많은OrOi | 2010.02.22 |
초보자를 위한 제로보드에 애드온 프로그램 설치하기 강좌 | 이하늘690 | 2010.02.23 |
플래시 뒤로 로그인창 숨는 문제 [5] | 김지훈295 | 2010.02.25 |
1.5.2.1 버전에서도 적용이 되는건가요?