웹마스터 팁
글을 읽을때 마다 조회수가 증가 하는 팁 (1.0.0↑)
2008.04.12 21:37
1.0.0 버전 이상
zbxe\modules\document에서 document.controller.php의 325번~357번 라인을 수정해주시면 됩니다.
/**
* @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;
}
댓글 5
-
font
2008.04.13 18:45
하이퍼링크 게시판의 "게시물리스트페이지" 링크에서 링크 ( 확장값에서 홈페이지 주소)를 클릭했을때에도 조회수가 올라가나요? -
SKYMARU
2008.04.13 20:27
페이지 로드가 다시 되지 않는 이상 조회수는 올라가지 않는걸로 알고 있습니다.
-
행복한일상
2008.04.28 06:52
블로그 형태에서도 올라가는지요...
저 같은 경우엔 리스트형태가 아닌 블로그 형태로 하니까 다른회원이 접속해서 읽어도 조회수 변화가 없습니다.
리스트로 변경해서 읽으면 변화가 계속 생기는데 말입니다. -
asdasd
2009.03.06 08:49
In winter, I haveRunescape Money in the indoorRunescape Power leveling comfort. My Runescape Gold apartment colleagues, friends, IFinal Fantasy XI gil worked day andffxi gil night. They are buy ffxi gil accustomed to behind dofus kamas the soul, the need kamas dofus for money was so official. I dofus kamas would like to spendkamas dofus the nightdofus kamas in strange house, with kamas dofus creaks of the wall, I do dofus kamas not know, and sitkamas dofus on the phone that ourdofus kamas landlord had been kamas dofus closed, and talk aboutbuy kamas the past, to the voice of my mother's ring, my best friend -
zxc
2009.03.06 08:54
In winter, I haveRunescape Money in the indoorRunescape Power leveling comfort. My Runescape Gold apartment colleagues, friends, IFinal Fantasy XI gil worked day andffxi gil night. They are buy ffxi gil accustomed to behind dofus kamas the soul, the need kamas dofus for money was so official. I dofus kamas would like to spendkamas dofus the nightdofus kamas in strange house, with kamas dofus creaks of the wall, I do dofus kamas not know, and sitkamas dofus on the phone that ourdofus kamas landlord had been kamas dofus closed, and talk aboutbuy kamas the past, to the voice of my mother's ring, my best friend
제목 | 글쓴이 | 날짜 |
---|---|---|
좌측 로그인 회원 리스트가 많아지면 스크롤 처리 [6] | 똑디 | 2008.01.29 |
본인외 회원정보 제어 [1] | edgarkim | 2008.02.03 |
왼쪽메뉴줄이고 오른쪽에 박스만들어 내용쉽게넣기 [15] | plruto | 2008.02.07 |
로그인후 보여줄 페이지 설정 [4] | 권인해 | 2008.02.11 |
제로보드용 플래시시계 위젯 설치방법 | 푸른커튼 | 2008.02.12 |
글을 읽을때 마다 조회수 증가시키기 (0.2.9수정#3) [1] | SKYMARU | 2008.02.20 |
우분투에서 rewrite 모드 사용하기 [2] | 용꿍 | 2008.03.06 |
로그인 풀림현상 원인 파악 [3] | 남국 | 2008.03.19 |
''권한이 없습니다'' 라는 문구를 조금 더 부드럽게 바꾸기 [3] | RainSky | 2008.03.21 |
로그인풀림방지 - 자동 www 붙이는 다른 방법 [23] | RainSky | 2008.03.28 |
레이아웃수정시 참고할 zbXe레이아웃스킨의 css와 layout 상관관계(1.0.0 기본스킨) [21] | 갯가 | 2008.04.08 |
글을 읽을때 마다 조회수가 증가 하는 팁 (1.0.0↑) [5] | SKYMARU | 2008.04.12 |
회원 가입 임시 제한 일자 버그 수정 방법 [2] | 껄껄껄 | 2008.04.13 |
상단로그인..? [10] | 빽짱구 | 2008.04.15 |
관리자 로그인시 원하는걸 보여주자 [5] | 빽짱구 | 2008.04.15 |
수정,삭제 버튼을 "이 게시물을.."에 넣기 [1] | hangoon | 2008.04.16 |
졸졸이 스토커 가두어보기 2탄(보드우측에 포함된 것처럼) [1] | 갯가 | 2008.04.26 |
링크가 걸린 글의 색을 무지개색으로 나타내기 | 재미니님 | 2008.04.29 |
windows Live writer로 게시글 쓰기 [3] | tindrum | 2008.04.29 |
주문형게시판 만들기 [22] | 팔공산 | 2008.05.04 |