웹마스터 팁

게시물 본문에 그 글의 추천인과 비추천인을 표시합니다.


1.

첨부파일을 다운받아 압축을 풀면 getDocumentVotedList.xmlgetNickName.xml 파일이 나옵니다. 

이 두 개의 파일을 modules/document/queries 폴더 안에 넣습니다. 


첨부파일 : getDocumentVotedList.zip


2.

modules/document/document.item.php 에서 적당한 곳에 다음 함수를 추가합니다.


        /**

         * @brief 추천/비추천인 리스트를 구함

         **/

         

        function getVotedList($point) {

            if(!$this->document_srl) return;

            if($this->isSecret() && !$this->isGranted()) return;


            $args->document_srl = $this->document_srl;

            $args->point = $point;

            $output = executeQueryArray('document.getDocumentVotedList', $args);            

            return $output->data;

        }


        /**

         * @brief member_srl에 해당하는 nick_name을 구함

         **/

         

function getNickNameByMemberSrl($member_srl) {

            $args->member_srl = $member_srl;

            $output = executeQuery('document.getNickName', $args);

            return $output->data->nick_name;

        }


3. 

적용하려는 게시판 스킨의 view_document.html 을 열어 다음과 같이 추가합니다.


{$oDocument->getContent()}

<!--@end-->

</div>


<!--@if($oDocument->get('voted_count'))-->

<div style="background-color:ivory;padding:10px">

추천인 : 

{@  $voted_list = $oDocument->getVotedList(1)}

  <!--@foreach($voted_list as $val)-->

<span style="margin-left:5px"> {$oDocument->getNickNameByMemberSrl($val->member_srl)} </span>

        <!--@end-->   

     </div>

     <!--@end-->

    

<!--@if($oDocument->get('blamed_count'))-->

<div style="background-color:#f5f5f5;padding:10px">

비추천인 : 

{@  $blamed_list = $oDocument->getVotedList(-1)}

  <!--@foreach($blamed_list as $val)-->

<span style="margin-left:5px"> {$oDocument->getNickNameByMemberSrl($val->member_srl)} </span>

        <!--@end-->   

     </div>

     <!--@end-->


getVotedList(1) 이면 추천인을, getVotedList(-1)이면 비추천인을 출력합니다.

디자인이나 위치는 원하시는대로 바꿔주시면 됩니다.

 

제목 글쓴이 날짜
"이 게시물을..." 추천/비추천/신고 메뉴를 버튼으로 [28] file xe촙5 2007.11.08
☆조회수.추천수 구간에 따른 이미지 나타내기(Hot 등..) - 갤러리게시판&최근이미지위젯☆ [5] 오기오기 2008.06.12
추천 비추천 레벨 권한 [4] 한이73 2009.03.17
게시판 스킨에서 조회수, 추천수, 최근 수정일 외 항목도 정렬가능하게 하기 SMaker 2009.06.11
엄지 추천 기능 본문에 삽입 하고자 하실때 (급조) [2] file thejeon 2009.07.29
추천과 추천포인트 관련 팁 [8] 고진감래 2009.09.30
추천인/비추천인 표시하기 [7] file 고진감래 2009.11.05
특정 확장변수를 글 추천자에게만 보이게 하기 [10] 뮤랑이 2010.01.11
관리자에게 무제한 추천기능 부여 (XE Core 수정) [8] sejin7940 2010.06.30
게시물 하단에 예쁜 추천,비추천 아이콘 버튼 추가하기~ [12] file xemall 2010.11.28
CSS파일이용하여 링크에 건반효과주기(강력추천) [8] 호호짱 2003.05.23
몇 가지 팁..( 좀 깁니다.. 어느 정도 안다고 생각하시는 분들, 추천 ) [3] naughtykidd 2004.02.26
[JavaScript] 랜덤 추천 사이트 링크버튼 만들기 (추천) [4] SM 2002.02.25
[추천] 가로형 배너 슬라이드 [7] file ⓣinⓣin™ 2004.06.10
[추천] 세로형 배너 슬라이드 [4] ⓣinⓣin™ 2004.06.24
[추천 팁] phpmyadmin 으로 복구 할때. 후니 2001.02.28
[추천 소스] 특정일로부터 몇일 지났나 또는 몇일 남았나 알아보는 소스 ㅡ.ㅡ; [1] 타스케 2001.11.15
[추천 소스] phpMyAdmin 다중사용자용... [5] WOWpc 2001.11.29
[추천 팁] 디망쉬식 스킨 시스템 [4] 디망쉬 2001.12.11
[추천 팁] index key 값을 갖는array에서 value에 의한 key값 반환 [1] 차카게살자 2002.03.11