웹마스터 팁

조회수 클릭때 마다 올라가기
./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