묻고답하기

게시판의 리스트 화면에서  정렬기준(확장변수 복수의 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 남기남
종합예술인 모바일페이지 화면짤림 현상 질문드립니다. [2] file 2018.01.24 by 종합예술인
쮸야282 10여년 홈담고 있던 호스팅을 옮기려 하는데, 혹시 옮기면 따로 해줘야 할게 있습니까? [1] 2018.01.24 by 디자인클립
시움 회원가입할때 이상한 창이 [2] file 2018.01.24 by 시움
killenemy 엑셀로 된 자료를 게시판에 업로드하는 방법은 없을까요? [1] 2018.01.24 by 디자인클립
DY 크롬에서 글 등록 버튼을 눌러도 아무 반응이 없네요 ㅠ file  
y**** SSL 인증서 없이 https 통신하는 법? [1] 2018.01.24 by 기진곰
신라면 콘텐츠 문의입니다. [5] 2018.01.23 by 코코넛
x**** 404 에러  
기러기오빠 해당 오류의 뜻이 무엇인가요? [1] 2018.01.23 by sejin7940
sky**** 관리 메뉴에서 welcome_page 의 수정을 어디서 하는지요? [1] 2018.01.22 by 기러기오빠
제이오 사이트메뉴편집이 안보이고 글쓰기가 안됩니다. 도와주세욤 [1] 2018.01.22 by ezup2
신라면 홈페이지 제작 문의입니다.  
허접 네이버아이디 회원가입 위젯에서 이메일 주소 확인 창의 오픈 유무의 차이가 궁금합니다 file  
putty XE 사이트메뉴 편집에서 "모듈이 존재하지 않음" 이라고 나오면서 수정이 안되요 [1] file 2018.01.22 by sky****
Kxo 멘붕옵니다... 페이지관리에서 welcome 페이지 수정한 뒤로 [2] file 2018.01.22 by sky****
killenemy 윈도우 모바일에서 제로보드 XE를 사용할 수는 없나요?  
sky**** 모바일 게시판 하단에 밴드 공유 버튼을 넣으려고 합니다. [2] 2018.01.22 by sky****
hyama 무료 도메인에 관련해서 물어봅니다. [6] 2018.01.22 by hyama
rail_man XE 업데이트 후 에디트플러스에서 오류가 납니다. [1] file 2018.01.22 by 디자인클립
네모세상 쿡래빗 레이아웃 사이트맵 배경색 변경 file  
패닉 xe 설치 오류 [1] 2018.01.21 by sejin7940
카이4525b 게시물 주소 복사 기능 관련 문의입니다. [2] 2018.01.21 by 카이4525b
셍셍 대시보드 로그인을 누르면 홈으로 이동해요 ㅠㅠ [1] 2018.01.21 by 휘즈
rail_man 도메인을 관리자 페이지 일반 설정에서 변경 후 접속하니 오류가 발생합니다. [1] 2018.01.21 by 휘즈
울댕댕 홈페이지 에러ㅠㅠㅠ file  
알랭 글상자/인용구 에디터 컴포넌트가 아예 작동이 안되는데요  
시크릿_이루어진다 커뮤니티 사이트 만들려고하는데요. [3] 2018.01.19 by 2donggalbi
pinta 홈페이지 제목이 한자 (한문) 로 표기됩니다 ㅜㅜ 도와주세요 (사진 有) [1] file 2018.01.19 by 2donggalbi
쮸야282 네이버 사이트 검색이 얼마전부터 안되네요. 혹시 아시는분 계신지요? [6] file 2018.01.19 by 쮸야282
sky**** 피드버너 feedburner 에서 RSS 인식 오류가 납니다.