웹마스터 팁
글을 읽을때 마다 조회수가 증가 하는 팁 (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
제목 | 글쓴이 | 날짜 |
---|---|---|
웹호스팅 세팅기 1편 - 설치하기(2부) [3] | 임현 | 2002.08.22 |
FTP 에 사용자추가후 로그인부분 추가하기 - 로그인 부분 [2] | DearMai | 2002.08.12 |
FTP 에 사용자추가후 로그인부분 추가하기 - 사용자추가부분 [5] | DearMai | 2002.08.12 |
ASP + MS SQL 기반 게시판 설치하기 - 두번째 | 오픈소스 | 2002.07.12 |
ASP + MS SQL 기반 게시판 설치하기 - 첫번째 | 오픈소스 | 2002.07.12 |
[알아서 나쁠것없는 10원짜리 팁!] 수십 수백명사용자의 일괄생성 방법! [6] | 임현 | 2002.05.09 |
리눅스 아주 간단한 사용자 계정 주기-_- [7] | i- | 2002.03.12 |
간단한 ajax 채팅소스입니다. [12] | 제로저아 | 2008.10.23 |
관리자모드 - 관리자그룹만 모든 회원리스트보기 [2] | 이지혜609 | 2007.10.23 |
포인트부여시 ...회원로그인 [2] | 구본순 | 2007.08.28 |
mysql 관리하는 프로그램입니다. (7/26 13:03) 수정 [4] | 제로저아 | 2007.07.18 |
mysql 안쓰는 간단한 게시판. [20] | 제로저아 | 2007.07.15 |
[PHP 동영상강의] 43. 공용함수의 제작/쿠키로그인(보안) [4] | 서기 | 2006.03.16 |
[PHP 동영상강의] 39. 회원가입/로그인 처리 [8] | 서기 | 2006.02.06 |
[PHP 동영상강의] 25. 회원가입처리 / 로그인 구현 [6] | 서기 | 2005.12.16 |
효율적인 경로 지정하기 [9] | 대류 | 2005.07.27 |
나만의 미니홈 만들기 ㅡ password.php [8] | 예뜨락 | 2005.05.07 |
나만의 미니홈 만들기 ㅡ delete.php 파일 [2] | 예뜨락 | 2005.01.03 |
IE 에서도 투명 알파값이 적용된 PNG 이미지를 맘껏 활용하자! [8] | THE PAPER™ | 2004.12.27 |
나만의 미니홈 만들기 ㅡ view.php 파일과 제목링크 [9] | 예뜨락 | 2004.11.27 |