묻고답하기

0.2.5 에서 새로 생긴 "이 게시글을..." 팝업 기능을 스킨으로 적응시켜 보려고 합니다.
아마도~~ 모든 스킨 제작자들이 이 고민을 할 것이라고 생각되어 이 부분의 소스 분석으로 공론화 하려고 생각하여 글을 씁니다.

1. "이 게시글을..."을 클릭하면 대략 5가지 기능의 메뉴가 팝업창에 생기나 봅니다.
그래서 매우 중요한 기능이죠.

=================================================
/modules/document/ document.model.php 파일의 함수입니다.
=================================================

    class documentModel extends document {
        ~~기타생략~~
        /**
         * @brief 선택된 게시물의 팝업메뉴 표시
         *
         * 인쇄, 스크랩, 추천, 비추천, 신고 기능 추가
         **/
        function getDocumentMenu() {

            // 요청된 게시물 번호와 현재 로그인 정보 구함
            $document_srl = Context::get('target_srl');
            $mid = Context::get('+ '+ 'cur_mid');
            $logged_info = Context::get('logged_info');
            $act = Context::get('cur_act');
           
            // menu_list 에 "표시할글,target,url" 을 배열로 넣는다
            $menu_list = array();

            // trigger 호출
            ModuleHandler::triggerCall('document.getDocumentMenu', 'before', $menu_list);

            // 인쇄 버튼 추가
            $menu_str = Context::getLang('cmd_print');
            $menu_link = sprintf("%s?document_srl=%s&act=dispDocumentPrint",Context::getRequestUri(),$document_srl);
            $menu_list[] = sprintf("\n%s,%s,winopen('%s','MemberModifyInfo')", '' ,$menu_str, $menu_link);

            // 추천 버튼 추가
            $menu_str = Context::getLang('cmd_vote');
            $menu_link = sprintf("doCallModuleAction('+ 'document','procDocumentVoteUp','%s')", $document_srl);
            $menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);

            // 비추천 버튼 추가
            $menu_str = Context::getLang('cmd_vote_down');
            $menu_link = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
            $menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);

            // 신고 기능 추가
            $menu_str = Context::getLang('cmd_declare');
            $menu_link = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
            $menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);

            // 회원이어야만 가능한 기능
            if($logged_info->member_srl) {

                // 스크랩 버튼 추가
                $menu_str = Context::getLang('cmd_scrap'+ ');
                $menu_link = sprintf("doCallModuleAction('+ 'member','procMemberScrapDocument','%s')", $document_srl);
                $menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
            }

            // trigger 호출 (after)
            ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list);

            // 정보를 저장
            $this->add("menu_list", implode("\n",$menu_list));
        }


이 중에서 새로 생긴 것은 비추천 인것 같습니다.
신고도 새로 생긴 것인가요?
어쨌든.
이거 두가지 기존에 만든 스킨에 기능 추가해 넣을라구 합니다 ㅋㅋ
근데 얄굳게도 스킨파일에는 해당 소스가 없네요.
그래서 디벼보기 시작했습니다.

2. 대충 통빡으로 굴려서 procDocumentVoteDown 이 부분을 어트게 해서 넘겨주면 될 것 같네요.
아래 나오는 함수를 들여다 보면, getContent함수에 전달하는 $add_document_info  값이 기본으로 true로 되어 있네요
이 부분을 false로 하면 된다고 제로님이 언지를 주셨습니다.
(이 부분은 나인테일님 글에 댓글 주셨죠
http://www.zeroboard.com/15971318 )
=================================================
/modules/document/ document.item.php에 나오는 함수입니다.
=================================================

    class documentItem extends Object {
                ~~클래스 앞부분 생략~~
        function getContent($add_document_info = true) {
            if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');

            $_SESSION['accessible'+ '][$this->document_srl] = true;

            $content = $this->get('content');

            // OL/LI 태그를 위한 치환 처리
            $content = preg_replace('!<(ol|ul|blockquote)>!is','<
\\1 style="margin-left:40px;">',$content);

            // url에 대해서 정규표현식으로 치환
            $content = preg_replace('!([^>^"^\'^=])(http|https|ftp|mms):\/\/([^ ^<^"^\']*)!is','$1<a href="$2://$3" onclick="window.open(this.href);return false;">$2://$3</a>',' '.$content);
            if(!$add_document_info) return $content;

            $content = sprintf(
                    '<!--BeforeDocument(%d,%d)--><div class="document_%d_%d">%s</div><div class="document_popup_menu"><span class="document_popup_menu document_%d">%s</span></div><!--AfterDocument(%d,%d)-->',
                    $this->document_srl, $this->get('member_srl'),
                    $this->document_srl, $this->get('member_srl'),
                    $content,
                    $this->document_srl, Context::getLang('cmd_document_do'),
                    $this->document_srl, $this->get('member_srl'),
                    $this->document_srl, $this->get('member_srl')
            );
            return $content;
        }

으아~ content에 많이 붙었네요

보시다 시피 내용 뒤에 뭐를 붙입니다.
<span class="document_popup_menu document_%d">
지난번에 보니, 게시판에서 이름을 클릭할 경우 회원정보가 뜨는데 거기 실명이 공개되어서 그거 없애느라고 미니팝업 소스를 찾았었죠. 이것도 그것과 비슷할 거에요.
이 부분은 어트게 변형하겠죠? 
컴파일 할때 소스를 바꿔서 어트게 해 주는 것 같습니다. 이 부분은 아직 찾지를 못했습니다.


3. 통빡을 굴리기 위해서ㅋㅋ 기존에 사용하던 스킨 소스를 들여다 보겠습니다.
=================================================================
게시판 스킨의 view_document.html파일의 아랫부분을 변형해 쓰던 것입니다.
=================================================================

              <li class="listButton">
                  <
!--@if($oDocument->isEditable())-->
                  <!--수정-->
                  <a href="{getUrl('act','dispBoardWrite','document_srl',$oDocument->document_srl)}" class="button"><span>{$lang->cmd_modify}</span></a>
                  <!--삭제-->
                  <a href="{getUrl('act','dispBoardDelete','document_srl',$oDocument->document_srl)}" class="button"><span>{$lang->cmd_delete}</span></a>
                  <
!--@end-->
                  <!--프린트-->
                  <a href="{getUrl('','act','dispDocumentPrint','document_srl',$oDocument->document_srl)}" onclick="winopen(this.href);return false;" class="button"><span>{$lang->cmd_print}</span></a>
                  <!--스크렙-->
                  <
!--@if($is_logged)--><a href="#" onclick="doScrap({$oDocument->document_srl}); return false;" class="button"><span>{$lang->cmd_scrap}</span></a><!--@end-->
                  <!--리스트-->
                  <a href="{getUrl('document_srl','')}" class="button"><span>{$lang->cmd_list}</span></a>
                  <!--추천-->
                  <a href="#" onclick="doVote();return false;" class="button"><span>{$lang->cmd_vote}</span></a>
              </li>


음... 통빡이 잘 굴러가야 하는데 여기서 딱 멈췄네요

3. 통박굴리기
기존에 <추천>은 doVote(); 이걸로 하나만 하다가 procDocumentVoteUp /// 'procDocumentVoteDown 이렇게 두가지로 바뀐 거 같죠?
근데 내가 알기로는 doVote저거는 자바스크립트였던 거 같은데요
이거 초보 통빡으로 연결하기 좀 복잡하겠는데요

맨 위 소스랑 직접 연결해 볼께요

신고 procDocumentDeclare 이거는 비교할 게 없는...


추천 doVote();이거는 둘로 변함
procDocumentVoteUp
procDocumentVoteDown

예전 doScrap({$oDocument->document_srl});
변경 procMemberScrapDocument


에~ 근데 더이상 진도가 안나갑니다.

4. 질문

기존 소스를 어떻게 변경해야 될까요?

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
농부18호 최근 게시물 굵게! [3] 2007.11.08 by 농부18호
MEGAMIX 도와주세요~ 제로보드 이전에 관하여 [2] 2007.11.08 by MEGAMIX
xe촙5 [0.2.5따라잡기] "이 게시글을..." 관련기능 스킨으로 [4] 2007.11.08 by xe촙5
간츠 메뉴에서 게시판추가시 mid창..글씨가-0- file  
bug0513.myid.net ini_get 함수가 제대로 작동 안되는것 같습니다. [2] 2007.11.07 by bug0513.myid.net
바닥천사 갑자기 로그인이 안되네요--;;  
RestSeoi 파일용량관련  
맨델스죤 제로보드4 저작권 문의드립니다. [1] 2007.11.07 by 한윤도
멍이누나 최근게시물삽입에관한..꼭좀도와주세요.ㅠㅠ  
soms84 제로보드4 에서 export한 migration 파일이 XE 에서 임포트가 안됩니다  
엽이아빠 블로그 제목 출력과 관련된 파일은 무엇인지요? [1] file 2007.11.07 by guny
hong''gun 홈페이지 도메인을 연결했는데요. [1] 2007.11.07 by 백성찬
느티나무언덕 최근게시물 타이틀 깨짐현상! [5] file 2007.11.07 by 멍이누나
소리바치 XE 설치할때 ''DB & 관리자 정보 입력''에서 에러가 납니다. [1] file 2007.11.07 by 백성찬
도봉인포 RSS 는 어떻게 ? 왕초보 입니다. [1] 2007.11.07 by 백성찬
청명 최근게시물 목록 클릭하면 새창으로 게시판을 띄우려 하는데.. [6] 2007.11.07 by 청명
상후니 그룹별 카운터 관리를 따로 하려면 어떻게 하나요?  
주하니 회원정보 프로필 이미지 안보이는데요? [2] 2007.11.07 by 주하니
아나킨 최근 이미지 뽑는 방법  
leios01 글이 안 보입니다. [1] 2007.11.07 by 용우아빠
곽태영* ko.lang.php 파일 수정 시 게시판 출력에러 [2] 2007.11.07 by 가디스
푸른 요청하신 모듈을 찾을수 없습니다라고 뜨네요 [1] 2007.11.07 by 김관빈
남말현 오라클에서 사용자정보를 끌고와야 하는 상황입니다. ㅠㅠ  
싸리치 알바트로스 갤러리에서 세로로 긴 이미지 아래 짤림현상요 [2] file 2007.11.07 by 안성식605
간츠 페이지수정에서 최근이미지정보인가요.. [5] file 2007.11.07 by 간츠
PayItForward 첨부파일 모듈에서 대기와 유효..  
함께해요! 포토샵 액션기능 중에서 이런 기능도 있나요? [2] 2007.11.07 by 함께해요!
사쿠라캐럿 이런 현상.. 어떻게 설명을 드려야할지-_ㅠ [4] 2007.11.07 by 사쿠라캐럿
지오426 제로보드XE를 삭제하려면 어떻게해야 합니까? [1] 2007.11.07 by 백성찬
마음의밭 퍼미션에러가 나네요 [2] 2007.11.07 by 마음의밭