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

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

0

조회 수 : 1525 신고 : 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 서버이전과 도메인 변경후 회원가입 500에러 title: [ani]깜빡이는 표정빽짱구 2021-08-19   126
92 XE 도메인 변경후 해야할것 title: [ani]깜빡이는 표정빽짱구 2021-08-19   158
91 특정 페이지에서 로그인한 회원 접속시 메인으로 리다이렉팅 시키기 title: [ani]깜빡이는 표정빽짱구 2018-12-14   172
90 xe 유용한 함수들 title: [ani]깜빡이는 표정빽짱구 2018-09-24   182
89 block, include, load, unload 문법 title: [ani]깜빡이는 표정빽짱구 2018-09-26   186
88 xe에서 메시지(XE_VALIDATOR_MESSAGE)가 출력되지 않을때 title: [ani]깜빡이는 표정빽짱구 2018-12-01   190
87 기본 쪽지 알림과 알림센터 쪽지 알림 file title: [ani]깜빡이는 표정빽짱구 2018-11-13   202
86 모바일 작성표시 애드온 사용시 SEO 브라우저 타이틀에 태그 포함되는 문제 title: [ani]깜빡이는 표정빽짱구 2018-09-27   206
85 게시판일때 출력하기 title: [ani]깜빡이는 표정빽짱구 2018-11-11   209
84 xe 나의 메뉴 즐겨찾기 위젯 title: [ani]깜빡이는 표정빽짱구 2018-12-03   211
83 XE 변수 목록 title: [ani]깜빡이는 표정빽짱구 2018-11-27   233
82 xe 게시판 회원 확장변수 출력 file title: [ani]깜빡이는 표정빽짱구 2018-12-14   236
81 사이트내 Nprogress 적용 file title: [ani]깜빡이는 표정빽짱구 2018-09-17   245
80 지식인 게시판 게시글 다른곳으로 이동 title: [ani]깜빡이는 표정빽짱구 2018-10-04   262
79 댓글이 없을때 '첫번째 댓글을 남겨주세요' 보여주기 [2] title: [ani]깜빡이는 표정빽짱구 2018-10-16 1 268
78 SEO 모듈 동작이 안될때 title: [ani]깜빡이는 표정빽짱구 2018-09-16   272
77 xe 회원 그룹명 하나만 출력하기 title: [ani]깜빡이는 표정빽짱구 2018-12-14   285
76 댓글 새로고침 file [1] title: [ani]깜빡이는 표정빽짱구 2018-10-16 2 287
75 XE 카카오 공유하기 버튼 title: [ani]깜빡이는 표정빽짱구 2018-09-24   292
74 xe files 빈폴더 삭제 title: [ani]깜빡이는 표정빽짱구 2018-12-25   306