묻고답하기

게시판의 리스트 화면에서  정렬기준(확장변수 복수의 order by) 추가 하는 방법이 있나요?

 

no edit.png

 

 

위와 같이 홈페이지를 구축해서 사용중 입니다. 확장변수로 값을 입력받아서 엑셀로 출력하는 홈페이지 입니다.

그런데 위의 빨간 테두리에 있는 것 처럼 "게시판 설정" 에 보면 정렬기준이 하나 밖에 없습니다.

 

default_setting_board_sort.png

 

 

확장변수의 근무일자를 선택해서 내림차순으로 정렬되게 했는데요. 문제는 오른쪽에 시작 시간이 09:00 시가 내림차순으로 똑같이 적용이 되어서 정렬이 되야 합니다 붉은 09:00 가 아래의 20:00 밑으로 정렬이 되야 하는데 현재 XE 게시판 설정화면에는 정렬이 하나만 선택이되도록 되어 있어서 처리가 안됩니다.

 

혹시 방법을 아시는 분이 계시나요? 게시판 list.html 파일의 상단에 강제로 정렬시키는 방법은 사용해 봤는데 게시글 검색을 하면 정상적으로 나오지를 않습니다. 이 방법이 아닌 방법을 찾고 있습니다.

 

================================================================================

 

위 처럼 제가 질문을 올렸었습니다. 답변이 없어서 몇일 어설픈 프로그래밍 실력으로 이것 저것 해보다가 자체적으로 해결했습니다.

그냥 저 정렬방법을 5순위까지 적용가능하게 처리 했더니 되기는 하는데 제대로 한건지는 모르겠습니다.

현재 해당 기능이 되도록 처리 하고 서버 재시작 후 정상적으로 동작하고 있습니다.

아래의 화면처럼 만들어서 현재 잘 사용하고 있습니다.

 

board_sort_type.png

 

정렬순서가 뒤죽 박죽 중간 중간 건너 띄어도 차례대로 선택된것들로만 1순위 2순위 3순위 식으로 정렬처리 되도록 했습니다.

그리고 나서 게시판으로 이동을 하니 아래와 같이 정렬이 정상적으로 되고 있습니다.

 

board_list_order_extra_sort.png

 

modules / document / document.model.php

modules / board / board.view.php

modules / board / board.admin.controller.php

modules / board / board.admin.view.php

modules / board / tpl / board_insert.html

 

그리고 각각 순위별 쿼리를 위해서 확장변수 정렬을 담당하는 xml 파일

modules / board / queries / getDocumentListExtraSort.xml (기본정렬, 1순위 정렬용)

modules / board / queries / getDocumentListExtraSort2.xml (2순위 정렬용)

modules / board / queries / getDocumentListExtraSort3.xml (3순위 정렬용)

modules / board / queries / getDocumentListExtraSort4.xml (4순위 정렬용)

modules / board / queries / getDocumentListExtraSort5.xml (5순위 정렬용)

 

파일을 따로 만들어서 저장 후 해당 php 파일에서 $query_id를 각각 지정되서 처리 되도록 수정했습니다.

 

그리고 하단 검색을 했을 때에도 정렬이 똑같이 되서 보이도록

modules / board / queries / getDocumentListWithinExtraVarsExtraSort.xml

modules / board / queries / getDocumentListWithinExtraVarsExtraSort2.xml

modules / board / queries / getDocumentListWithinExtraVarsExtraSort3.xml

modules / board / queries / getDocumentListWithinExtraVarsExtraSort4.xml

modules / board / queries / getDocumentListWithinExtraVarsExtraSort5.xml

 

식으로 따로 따로 만들어서 똑같은 방법으로 처리 했습니다.

 

board.view.php 에서 sort_index 값을 sort_index2, sort_index3, sort_index4, sort_index5 식으로 받도록 하고

정렬 방법도 desc, asc 값도 나눠서 order_type~5 까지 받아서 처리하게 설정 후 각각의 sort_index 구간을 php에서 찾아서 나머지 sort_index2~5 및 order_type2~5를 추가하고 쿼리 아이디도 각각 지정되게 한 후 처음에 확인하니 무한로딩이 걸렸습니다.

 

서버 재시작 후 에는 정상적으로 작동이 되었습니다.

제일 힘들었던 것이 xml 파일 이해하는 것이 었습니다. 아직도 이해는 못하고 어떻게 처리 하면 되는지 감으로 한것이라...

 

아무튼 직접 삽질 후 처리 했습니다. ㅠㅠ

 

xml 파일 중 확장변수 정렬 관련 getDocumentListExtraSort5.xml 파일은 안에 내용을 아래와 같이 했습니다.

굵게 색깔이 처리된 부분이 추가한 부분입니다. 쿼리 아이디도 파일명에 맞게 수정했구요...

 

<query id="getDocumentListExtraSort5" action="select">
    <tables>
        <table name="documents" alias="d" />
        <table name="document_extra_vars" alias="ev" />
        <table name="document_extra_vars" alias="ev2" />
        <table name="document_extra_vars" alias="ev3" />
        <table name="document_extra_vars" alias="ev4" />
        <table name="document_extra_vars" alias="ev5" />

    </tables>
    <columns>
        <column name="d.*" />
    </columns>
 <index_hint name="idx_document_list_order" type="use" />
    <conditions>
        <condition operation="equal" column="ev.eid" var="sort_index" />
        <condition operation="equal" column="ev.document_srl" default="d.document_srl" pipe="and" />
        <condition operation="in" column="d.module_srl" var="module_srl" filter="number" pipe="and" />
        <condition operation="notin" column="d.module_srl" var="exclude_module_srl" filter="number" pipe="and" />
        <condition operation="in" column="d.category_srl" var="category_srl" pipe="and" />
        <condition operation="equal" column="d.is_notice" var="s_is_notice" pipe="and" />
        <condition operation="equal" column="d.member_srl" var="member_srl" filter="number" pipe="and" />
        <condition operation="in" column="d.status" var="statusList" pipe="and" />
        <group pipe="and">
            <condition operation="more" column="d.list_order" var="division" pipe="and" />
            <condition operation="below" column="d.list_order" var="last_division" pipe="and" />
        </group>
        <group pipe="and">
            <condition operation="like" column="d.title" var="s_title" />
            <condition operation="like" column="d.content" var="s_content" pipe="or" />
            <condition operation="like" column="d.user_name" var="s_user_name" pipe="or" />
            <condition operation="like" column="d.user_id" var="s_user_id" pipe="or" />
            <condition operation="like" column="d.nick_name" var="s_nick_name" pipe="or" />
            <condition operation="like" column="d.email_address" var="s_email_address" pipe="or" />
            <condition operation="like" column="d.homepage" var="s_homepage" pipe="or" />
            <condition operation="like" column="d.tags" var="s_tags" pipe="or" />
            <condition operation="equal" column="d.is_secret" var="s_is_secret" pipe="or" />
            <condition operation="equal" column="d.member_srl" var="s_member_srl" pipe="or" />
            <condition operation="more" column="d.readed_count" var="s_readed_count" pipe="or" />
            <condition operation="more" column="d.voted_count" var="s_voted_count" pipe="or" />
            <condition operation="less" column="d.blamed_count" var="s_blamed_count" pipe="or" />
            <condition operation="more" column="d.comment_count" var="s_comment_count" pipe="or" />
            <condition operation="more" column="d.trackback_count" var="s_trackback_count" pipe="or" />
            <condition operation="more" column="d.uploaded_count" var="s_uploaded_count" pipe="or" />
            <condition operation="like_prefix" column="d.regdate" var="s_regdate" pipe="or" />
            <condition operation="like_prefix" column="d.last_update" var="s_last_update" pipe="or" />
            <condition operation="like_prefix" column="d.ipaddress" var="s_ipaddress" pipe="or" />
        </group>
        <group pipe="and">
            <condition operation="more" column="d.last_update" var="start_date" pipe="and" />
            <condition operation="less" column="d.last_update" var="end_date" pipe="and" />
        </group>
        <group pipe="and">
         <condition operation="equal" column="ev2.eid" var="sort_index2" pipe="and" />
   <condition operation="equal" column="ev2.document_srl" default="d.document_srl" pipe="and" />
         <condition operation="equal" column="ev3.eid" var="sort_index3" pipe="and" />
   <condition operation="equal" column="ev3.document_srl" default="d.document_srl" pipe="and" />
         <condition operation="equal" column="ev4.eid" var="sort_index4" pipe="and" />
   <condition operation="equal" column="ev4.document_srl" default="d.document_srl" pipe="and" />
         <condition operation="equal" column="ev5.eid" var="sort_index5" pipe="and" />
   <condition operation="equal" column="ev5.document_srl" default="d.document_srl" pipe="and" />
        </group>

    </conditions>
    <navigation>
        <index var="ev.value" default="ev.value" order="order_type" />
        <index var="ev2.value" default="ev2.value" order="order_type2" />
        <index var="ev3.value" default="ev3.value" order="order_type3" />
        <index var="ev4.value" default="ev4.value" order="order_type4" />
        <index var="ev5.value" default="ev5.value" order="order_type5" />

        <list_count var="list_count" default="20" />
        <page_count var="page_count" default="10" />
        <page var="page" default="1" />
    </navigation>
</query>
 

 

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
AimJin 회원가입시와 로그인할때 영문자를 자동으로 대문자로 변경 [1] 2017.12.01 by AimJin
koll**** XE XML 쿼리에 Having 절은 어떻게 쓰나요? [1] 2017.12.01 by SimpleCode
그램린 작성 글 보기 질문드려요! [3] 2017.12.01 by sejin7940
NKorea 1.9.0 버전에서 SCM Music Player 적용시 백지화 현상이 생겨요 ㅜㅜ file  
NKorea 1.8.46에서 1.9.0 업데이트후 홈페이지 500에러 어떻게 하조 [2] file 2017.12.01 by NKorea
퐁퐁탄 레이아웃, 위젯 등을 잘 만들고 싶어요 [2] 2017.12.01 by 퐁퐁탄
AIESEC 홈페이지 로그인이 안됩니다. [1] 2017.11.30 by sejin7940
salsatour 네이버로그인연동후 로그인에러시..  
아찌 1.8.46 업데이트후 홈페이지 바보됐어요 [13] file 2017.11.30 by XE
메이 에디터가 이상합니다 [1] file 2017.11.30 by 아찌
railman 게시판 글이 "나눔고딕"으로 작성하였으나 다른 글자체로 나옵니다. [2] 2017.11.30 by 루소
eavanJ auto slide 문제 해결하고 싶어요 file  
웡석이 게시판 클릭시 최신게시물을 해당 카테고리만 출력하게끔 하고싶습니다. [3] 2017.11.29 by sejin7940
이지d 모바일 댓글보기 권한문제  
thdwjdtjr 게시판 제목을 진하게가 아닌 보통으로 수정하고자 합니다. [3] file 2017.11.28 by 우주학개론
Ines 모바일로 댓글 추천버튼 누를시 신고가 됩니다 [1] 2017.11.28 by 우주학개론
포포리 홈페이지 로그인이 갑자기 안되요. [1] 2017.11.28 by 디자인클립
SGWA 아이폰에서 웹페이지가 열리지 안습니다. [1] 2017.11.28 by Ansi™
지현 XEDITION게시판 수정에 관해 질문드려요! [2] file 2017.11.28 by 지현
새로운아침 XpressEngine 데이터 추출 ver. 0.6 에러가 뜨네요 [2] 2017.11.28 by 배워서남준다
병아리 로그인창 크기변경?? [5] file 2017.11.27 by 병아리
임점숙 카페24에서 가상서버호스팅 이용중입니다 [2] 2017.11.26 by 임점숙
임점숙 가상서버호스팅에서 xe설치하는법  
Regenesis XE "사이트메뉴 편집"에서 메뉴 링크 이미지 등록이 되지 않습니다. [1] file 2017.11.25 by dubu
이경우 안녕하세요 달력 게시판질문입니다. file  
트리픽 xedition레이아웃 모바일 사용 안하는 법 없을까요? [4] 2017.11.25 by 우주학개론
너의계절 관리자 게시판 권한설정을 위한 관리자 로그인 [1] 2017.11.25 by 휘즈
한국재즈댄스협회bc112 안녕하세요. 질문입니다. [1] 2017.11.25 by sejin7940
이와이 글쓴이가 관리자일때 [2] 2017.11.24 by 이와이
시크릿_이루어진다 이미지 리사이즈시 원본이미지 용량 쭐일 순 없나요? [1] 2017.11.24 by HowtoXE