XE(XpressEngine)와 관련된 유용한 정보를 공유하는 곳입니다.

관련메뉴 XE 스킨 | 제로보드4 팁
  • 웹미니 한줄 전광판 영역 입니다.
글 수 93

0

조회 수 : 1524 신고 : 0

작성자 : 오니기리죠
포인트 : 596 | 레벨 : 2
출처 : http://www.xpressengine.com/index.php?mi...l=20512810 

============  댓글 역순으로 하는 방법  ============

 

 

1.  modules/comment/comment.model.php 에서


function getCommentList($document_srl, $page = 0, $is_admin = false, $count = 0) {    함수 내부에서

 

if(!$page) $page = (int)( ($oDocument->getCommentCount()-1) / $comment_count) + 1;               

// 정해진 수에 따라 목록을 구해옴
$args->document_srl = $document_srl;
$args->list_count = $comment_count;
$args->page = $page;
$args->page_count = 10;

$output = executeQueryArray('comment.getCommentPageList', $args);

 


부분을 찾아서...    아래처럼 수정할것  (빨간색 부분에, 댓글 역순으로 출력할 게시판 mid 값으로 바꿔주세요)

 


// 정해진 수에 따라 목록을 구해옴
$args->document_srl = $document_srl;
$args->list_count = $comment_count;
$args->page = $page;
$args->page_count = 10;

// 페이지 역순 기능 위해서 수정 (sejin7940)
if(Context::get('mid')=="board_chat") {   
 $page=1;
 $output = executeQueryArray('comment.getCommentPageListReverse', $args);
}
else {
 if(!$page) $page = (int)( ($oDocument->getCommentCount()-1) / $comment_count) + 1;               
 $output = executeQueryArray('comment.getCommentPageList', $args);
}

 

 

 

2. modules/comment/queries/getCommentPageListReverse.xml  파일을 추가할 것


<query id="getCommentPageListReverse" action="select">
    <tables>
        <table name="comments" alias="comments" />
        <table name="comments_list" alias="comments_list" />
    </tables>
    <columns>
        <column name="comments.*" />
        <column name="comments_list.depth" alias="depth" />
    </columns>
    <conditions>
        <condition operation="equal" column="comments_list.document_srl" var="document_srl" notnull="notnull" pipe="and" />
        <condition operation="equal" column="comments_list.comment_srl" var="comments.comment_srl" filter="number" pipe="and" />
        <condition operation="more" column="comments_list.head" default="0" pipe="and" />
        <condition operation="more" column="comments_list.arrange" default="0" pipe="and" />
    </conditions>
    <navigation>
        <list_count var="list_count" default="list_count" />
        <page_count var="page_count" default="10" />
        <page var="page" default="1" />
  <index var="sort_index" default="head" order="desc" />
  <index var="sort_index" default="comments_list.depth" order="asc" />
    </navigation>
</query>

 

소중한 댓글 부탁드립니다.
추천수 10단위당 메달이 1개씩 노출되고, 추천수에 따라 배경색이 변하며, 일정수의 추천수를 받을시 BEST 아이콘이 붙게됩니다.
추천수에 따른 배경색 보기 본문으로 바로가기
  • 추천수 50개이상
  • 추천수 30개이상
  • 추천수 20개이상
  • 추천수 10개이상
  • 추천수 3개이상
닫기

첫번째 댓글을 남겨주세요!

List of Articles
번호 제목 글쓴이 날짜 추천 수 조회 수sort
93 hit 권한 있는 회원에게만 글쓰기 버튼 노출 title: [ani]깜빡이는 표정빽짱구 2018-11-11   17118
92 한도메인으로 자동으로 접속하기 [9] title: [ani]깜빡이는 표정빽짱구 2007-09-27   9841
91 특정도메인으로 접속시 원하는도메인으로 리다이렉트 시키기 file [18] title: [ani]깜빡이는 표정빽짱구 2009-08-03 3 9003
90 제 사이트 상단 로그인 file [18] title: [ani]깜빡이는 표정빽짱구 2008-04-15   8669
89 슬라이드 되는 최근 이미지스킨 수정해 올립니다. file [8] 한주네 2010-02-25 2 8410
88 비회원 글쓰기 버튼 숨기기 [15] title: 버섯이슬이 2009-11-09 4 8385
87 관리자페이지에서 SSL 설정후 이상이 생길때 file [4] title: [ani]깜빡이는 표정빽짱구 2009-04-07   8300
86 한글이 깨질때 해결방법 file [3] title: [ani]깜빡이는 표정빽짱구 2009-07-28   8154
85 게시물에 파일첨부후 한글이 안써질때 [12] title: [ani]깜빡이는 표정빽짱구 2009-11-25 3 7925
84 관리자 로그인시 원하는걸 보여주자 [7] title: [ani]깜빡이는 표정빽짱구 2008-04-15   7868
83 현재위치출력 레이아웃에 직접 적용하기 file [4] title: [ani]깜빡이는 표정빽짱구 2010-11-15 1 6719
82 탭형식의 최근문서 출력 위젯 이용하기... file [13] title: 버섯이슬이 2009-11-10 2 6704
81 특정페이지에서 원하는 내용 보여주기 [5] title: [ani]깜빡이는 표정빽짱구 2009-01-31 2 6594
80 검색결과를 원하는 페이지에 뿌려주자 file [2] title: [ani]깜빡이는 표정빽짱구 2009-07-14   6354
79 관리자에게만 보여주자 (응용) file [6] title: [ani]깜빡이는 표정빽짱구 2009-04-02 1 6167
78 출석 체크 위젯 사용시 날짜네비게이션이 먹통일때. [3] 세발자전거 2010-02-06   5911
77 새글표시 애드온 사용시 1차메뉴를 2차메뉴중 게시판으로 연결한 경우 file [2] 세발자전거 2010-03-20 1 5809
76 서브타이틀 나타내는 방법 [10] 이온디 2010-02-24 1 5798
75 현재 위치 출력 위젯 file [2] 코아 코스튬 2011-04-24   5683
74 텍스트를 관리자에서 입력후 메인에 뿌려주자! file [11] title: [ani]깜빡이는 표정빽짱구 2009-08-21   5674