웹마스터 팁
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;
}
이 부분을 모두 주석처리 혹은 삭제
제목 | 글쓴이 | 날짜 |
---|---|---|
[로그인] 자바스크립트로 여러개 로그인하기 [10] | ZipShin | 2002.08.13 |
간단한 쿠키 &세션 확인용 | M2Vis | 2002.07.01 |
자바스크립트로 메타태그 리프레쉬 효과를 보여주자. [5] | ZipShin | 2002.06.26 |
로그인창에서.... [1] | 이진수 | 2006.07.02 |
TabIndex를 이용하여 탭키 컨트롤하기 [5] | 손상모 | 2004.10.08 |
노프레임 홈만들기 (3) - 서브 페이지 만들고 제로보드에 적용하기 [27] | @kihwa | 2003.07.26 |
노프레임 홈만들기 (2) - 로그인, 최근게시물 설치 [31] | @kihwa | 2003.07.26 |
노프레임 홈만들기 (1) - 표로 레이아웃 만들고 그림 삽입하기 [45] | @kihwa | 2003.07.11 |
label태그 아십니까? [6] | ZipShin | 2003.04.27 |
웹페이지 대화상자 띄우기. [4] | 세죠위그이 | 2003.02.05 |
〔Tale〕테일이랑 같이 글상자 이쁘게 만들어요 [1] | TaleB˚ | 2002.11.17 |
뽀유의 스타일시트 특별강좌 [28] | 뽀유♡ | 2002.10.25 |
사용자의 윈도 화면배색을 쓰자.. [4] | 엔카일 | 2002.08.13 |
[1차패치] 내 msn 현재상태를 보여주자! + 캡처없앰 -ㅂ- [18] | 티르 | 2002.01.04 |
게시물 하단에 예쁜 추천,비추천 아이콘 버튼 추가하기~ [12] | xemall | 2010.11.28 |
XE 속도 0.0001초라도 올리는 소소한 팁들 (추가) [5] | 소렌트. | 2010.11.16 |
비밀번호 찾기 기능 조심하세요 [4] | 老姜君 | 2010.10.28 |
Mysql에서 큐브리드로 데이터이전 [3] | 카르마 | 2010.10.23 |
탈퇴한 회원이 재가입 못하게 막는 방법 & 탈퇴한 회원 정보 보전 방법 [9] | sejin7940 | 2010.09.17 |
로그인/로그아웃 시 그페이지에 그대로 남아있게하기. [4] | 롤리^^ | 2010.09.16 |
1.5.2.1 버전에서도 적용이 되는건가요?