홈페이지를 관리하면서 기술적으로 필요한 글들을 메모 형식으로 정리하였습니다.
현재까지는 교회 홈피 관리자에게 도움이 되는 다소 전문적인 내용이 많습니다.
이제는 인터넷에 글을 쓸 때 이쁘게 디자인 할 수 있도록 돕는 내용을 더 많이 올릴 계획입니다.
게시물을 클릭하면 hit 수가 1회씩 올라가는데 동일한 ip 주소에서는 24시간에 1회 한정된다.
이것을 방문 클릭시 상승하도록 수정하는 경우 아래처럼 화일을 수정한다.
(추가/수정. XE 1.2.4 의 경우) 2009년 10월 수정 -- VE 1.4.2버전에서도 적용 (버전에 따라 내용이 달라질 수 있음 2010 5. 30)
xe/modules/document/ 에 있는 document.controller.php 열어 510번줄쯤 코드 540줄
2011년 8월 1일 최근버전 1.457에서 다시 수정함 위의 화일 573번줄 정도에서 부터 아래 부분을 교체수정 -- file 재첨부
/**
* @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;
}
위의 부분을 아래처럼 수정
/**
* @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;
}
출처
수정 php화일 첨부


