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 추천 수 조회 수
33 댓글 역순으로 출력하기 오니기리죠 2012-06-10   1525
32 XE 1.5.x 사용자들 중에 IE9에서 셀렉트박스 목록이 안보일때 title: [ani]깜빡이는 표정빽짱구 2012-06-30   1744
31 XE 관리자 사이트 메뉴 편집에 내용이 안나올때 title: [ani]깜빡이는 표정빽짱구 2016-02-28   529
30 XE 관리자로 로그인시 관리자 페이지 500에러 발생할때 title: [ani]깜빡이는 표정빽짱구 2016-02-28   485
29 XE 유용한 함수들 title: [ani]깜빡이는 표정빽짱구 2016-09-02   348
28 웹미니 로그인 위젯 카운트다운 삭제법 좀 알려주세요. 롱코트 2016-12-26   480
27 xe 설치된 사이트 네이버 웹마스터 도구 등록이 제대로 안될때 title: [ani]깜빡이는 표정빽짱구 2017-06-22   497
26 관리자 '잘못된 요청입니다' 출력시 title: [ani]깜빡이는 표정빽짱구 2018-09-15   349
25 SEO 모듈 동작이 안될때 title: [ani]깜빡이는 표정빽짱구 2018-09-16   272
24 사이트내 Nprogress 적용 file title: [ani]깜빡이는 표정빽짱구 2018-09-17   245
23 게시판에 인기,베오베 아이콘 출력하기 file [1] title: [ani]깜빡이는 표정빽짱구 2018-09-22   321
22 XE 카카오 공유하기 버튼 title: [ani]깜빡이는 표정빽짱구 2018-09-24   292
21 xe 유용한 함수들 title: [ani]깜빡이는 표정빽짱구 2018-09-24   182
20 block, include, load, unload 문법 title: [ani]깜빡이는 표정빽짱구 2018-09-26   186
19 모바일 작성표시 애드온 사용시 SEO 브라우저 타이틀에 태그 포함되는 문제 title: [ani]깜빡이는 표정빽짱구 2018-09-27   206
18 지식인 게시판 게시글 다른곳으로 이동 title: [ani]깜빡이는 표정빽짱구 2018-10-04   262
17 댓글 새로고침 file [1] title: [ani]깜빡이는 표정빽짱구 2018-10-16 2 287
16 댓글이 없을때 '첫번째 댓글을 남겨주세요' 보여주기 [2] title: [ani]깜빡이는 표정빽짱구 2018-10-16 1 268
15 xe 에서 인증메일이 오지 않을때 file title: [ani]깜빡이는 표정빽짱구 2018-10-20   405
14 xe 비밀번호 찾기 질문/답변 필수 제거하기 title: [ani]깜빡이는 표정빽짱구 2018-10-21   573