mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
게시판 모듈에서 조회/추천/제목/댓글수 정렬외의 정렬대상에서 문서번호만으로 접속시 해당 문서의 페이지를 자동으로 구하는 루틴을 보다 정교하게 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4276 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cf8d8c720a
commit
4496358bad
4 changed files with 51 additions and 12 deletions
|
|
@ -412,15 +412,35 @@
|
|||
/**
|
||||
* @brief 해당 document의 page 가져오기, module_srl이 없으면 전체에서..
|
||||
**/
|
||||
function getDocumentPage($document_srl, $module_srl=0, $list_count) {
|
||||
// 변수 설정
|
||||
$args->document_srl = $document_srl;
|
||||
$args->module_srl = $module_srl;
|
||||
function getDocumentPage($oDocument, $opt) {
|
||||
// 정렬 형식에 따라서 query args 변경
|
||||
switch($opt->sort_index) {
|
||||
case 'update_order' :
|
||||
if($opt->order_type == 'desc') $args->rev_update_order = $oDocument->get('update_order');
|
||||
else $args->update_order = $oDocument->get('update_order');
|
||||
break;
|
||||
case 'regdate' :
|
||||
if($opt->order_type == 'desc') $args->rev_regdate = $oDocument->get('regdate');
|
||||
else $args->regdate = $oDocument->get('regdate');
|
||||
break;
|
||||
case 'voted_count' :
|
||||
case 'readed_count' :
|
||||
case 'comment_count' :
|
||||
case 'title' :
|
||||
return 1;
|
||||
break;
|
||||
default :
|
||||
if($opt->order_type == 'desc') $args->rev_list_order = $oDocument->get('list_order');
|
||||
else $args->list_order = $oDocument->get('list_order');
|
||||
break;
|
||||
}
|
||||
$args->sort_index = $opt->sort_index;
|
||||
$args->order_type = $opt->order_type;
|
||||
|
||||
// 전체 갯수를 구한후 해당 글의 페이지를 검색
|
||||
$output = executeQuery('document.getDocumentPage', $args);
|
||||
$count = $output->data->count;
|
||||
$page = (int)(($count-1)/$list_count)+1;
|
||||
$page = (int)(($count-1)/$opt->list_count)+1;
|
||||
return $page;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,22 @@
|
|||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="module_srl" var="module_srl" />
|
||||
<condition operation="more" column="document_srl" var="document_srl" filter="number" notnull="notnull" pipe="and" />
|
||||
<condition operation="more" column="comment_count" var="comment_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="comment_count" var="rev_comment_count" filter="number" pipe="and" />
|
||||
<condition operation="more" column="voted_count" var="voted_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="voted_count" var="rev_voted_count" filter="number" pipe="and" />
|
||||
<condition operation="more" column="readed_count" var="readed_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="readed_count" var="rev_readed_count" filter="number" pipe="and" />
|
||||
<condition operation="less" column="list_order" var="list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="list_order" var="rev_list_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="title" var="title" filter="number" pipe="and" />
|
||||
<condition operation="less" column="title" var="rev_title" filter="number" pipe="and" />
|
||||
<condition operation="more" column="regdate" var="regdate" filter="number" pipe="and" />
|
||||
<condition operation="less" column="regdate" var="rev_regdate" filter="number" pipe="and" />
|
||||
<condition operation="less" column="update_order" var="update_order" filter="number" pipe="and" />
|
||||
<condition operation="more" column="update_order" var="rev_update_order" filter="number" pipe="and" />
|
||||
</conditions>
|
||||
<navigation>
|
||||
<index var="sort_index" default="list_order" order="order_type" />
|
||||
</navigation>
|
||||
</query>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue