웹마스터 팁
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;
}
-----------------------------------------------------------------------
![조회수2.JPG](/files/attach/images/121/280/820/019/4669ab0e08a277e75b8b3049fd56eaa1.JPG)
./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
제목 | 글쓴이 | 날짜 |
---|---|---|
[HTML 초보자] 테이블 태그에 색상 넣기!! 퍼펙트1 [2] | ZipShin | 2002.09.19 |
[Tip]한글 97로 홈페이지 틀 짜기
[8]
![]() | Alunar | 2002.09.21 |
소스 보는 방법 몇가지 [13] | 태영이 | 2002.09.24 |
테이블 크기 더 이상 안넘어가게 하기.. [12] | dEathrock | 2002.09.24 |
(허접 팁)레이어를 브라우저 크기에 상관없이 위치지정하기 [6] | 오영민 | 2002.09.25 |
벅스에서 음악주소 얻어내기 총정리!!! [11] | 세DlCIZLOI너 | 2002.09.25 |
CSS,HTML,DHTML 및 기타 최신레퍼런스를 구하는 방법 [2] | -크크크- | 2002.09.28 |
스크롤바를 이용하지 않고 페이지내에서 원하는 위치로 이동하기 [10] | 유지호 | 2002.09.28 |
HTML 이란? [5] | 조현원 | 2002.09.28 |
[HTML 초보자] 테이블 태그에 색상 넣기!! 퍼펙트2 [5] | ZipShin | 2002.10.01 |
HTML의 4가지 요소 [2] | ZipShin | 2002.10.01 |
프레임셋 응용 [8] | 심플리즘 | 2002.10.08 |
[HTML 초보자]- marquee태그 (글자 움직이기)-1 [6] | ZipShin | 2002.10.11 |
부모-자식 레이어의 활용(레이어 위치 고정) [8] | clo | 2002.10.12 |
[HTML 초보자]- marquee태그 (글자 움직이기)-2 [5] | ZipShin | 2002.10.12 |
[HTML 초보자] 마퀴태그로 움직이되, 마우를 가져다 되면 멈추고, 시작되고.. [6] | ZipShin | 2002.10.17 |
[HTML 초보자]-marquee 마퀴태그의 움직이는 속도 [5] | ZipShin | 2002.10.20 |
[HTML 초보자]- 글자가 움직이는 배경색깔 [1] | ZipShin | 2002.10.22 |
오른쪽마우스, 드래그 금지하는 태그.. [4] | xtersh | 2002.10.24 |
뽀유의 스타일시트 특별강좌 [28] | 뽀유♡ | 2002.10.25 |