mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
#19598207 page paramter 없이 본문을 보는 경우 아래 List method에서 page값을 계산해 옴.
page값을 계산해 오는 method내에서 검색기능이 없어서 검색한 후 page 없는 본문을 볼 때는 page값이 이상해짐. page값을 계산해 오는 method에 검색기능을 추가 함 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8150 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
3b07a2f513
commit
cc423cacc2
2 changed files with 104 additions and 66 deletions
|
|
@ -201,72 +201,9 @@
|
|||
$use_division = false;
|
||||
|
||||
// 검색 옵션 정리
|
||||
$search_target = $obj->search_target;
|
||||
$search_keyword = $obj->search_keyword;
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'title' :
|
||||
case 'content' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'title_content' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title = $search_keyword;
|
||||
$args->s_content = $search_keyword;
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
$args->sort_index = 'documents.'.$args->sort_index;
|
||||
break;
|
||||
case 'user_name' :
|
||||
case 'nick_name' :
|
||||
case 'email_address' :
|
||||
case 'homepage' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
break;
|
||||
case 'is_notice' :
|
||||
case 'is_secret' :
|
||||
if($search_keyword=='N') $args->{"s_".$search_target} = 'N';
|
||||
elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y';
|
||||
else $args->{"s_".$search_target} = '';
|
||||
break;
|
||||
case 'member_srl' :
|
||||
case 'readed_count' :
|
||||
case 'voted_count' :
|
||||
case 'comment_count' :
|
||||
case 'trackback_count' :
|
||||
case 'uploaded_count' :
|
||||
$args->{"s_".$search_target} = (int)$search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
case 'last_update' :
|
||||
case 'ipaddress' :
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
break;
|
||||
case 'comment' :
|
||||
$args->s_comment = $search_keyword;
|
||||
$query_id = 'document.getDocumentListWithinComment';
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'tag' :
|
||||
$args->s_tags = str_replace(' ','%',$search_keyword);
|
||||
$query_id = 'document.getDocumentListWithinTag';
|
||||
break;
|
||||
default :
|
||||
if(strpos($search_target,'extra_vars')!==false) {
|
||||
$args->var_idx = substr($search_target, strlen('extra_vars'));
|
||||
$args->var_value = str_replace(' ','%',$search_keyword);
|
||||
$args->sort_index = 'documents.'.$args->sort_index;
|
||||
$query_id = 'document.getDocumentListWithExtraVars';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$searchOpt->search_target = $obj->search_target;
|
||||
$searchOpt->search_keyword = $obj->search_keyword;
|
||||
$this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division);
|
||||
|
||||
/**
|
||||
* division은 list_order의 asc 정렬일때만 사용할 수 있음
|
||||
|
|
@ -606,6 +543,11 @@
|
|||
$args->sort_index = $opt->sort_index;
|
||||
$args->order_type = $opt->order_type;
|
||||
|
||||
// 검색 옵션 정리
|
||||
$searchOpt->search_target = $opt->search_target;
|
||||
$searchOpt->search_keyword = $opt->search_keyword;
|
||||
$this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division);
|
||||
|
||||
// 전체 갯수를 구한후 해당 글의 페이지를 검색
|
||||
$output = executeQuery('document.getDocumentPage', $args);
|
||||
$count = $output->data->count;
|
||||
|
|
@ -1075,5 +1017,81 @@
|
|||
|
||||
$this->add('voted_member_list',$output->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter)
|
||||
* page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage)는 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 됨.
|
||||
* 검색옵션의 중복으로 인해 private method로 별도 분리
|
||||
**/
|
||||
function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division)
|
||||
{
|
||||
$search_target = $searchOpt->search_target;
|
||||
$search_keyword = $searchOpt->search_keyword;
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'title' :
|
||||
case 'content' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'title_content' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title = $search_keyword;
|
||||
$args->s_content = $search_keyword;
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
$args->sort_index = 'documents.'.$args->sort_index;
|
||||
break;
|
||||
case 'user_name' :
|
||||
case 'nick_name' :
|
||||
case 'email_address' :
|
||||
case 'homepage' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
break;
|
||||
case 'is_notice' :
|
||||
case 'is_secret' :
|
||||
if($search_keyword=='N') $args->{"s_".$search_target} = 'N';
|
||||
elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y';
|
||||
else $args->{"s_".$search_target} = '';
|
||||
break;
|
||||
case 'member_srl' :
|
||||
case 'readed_count' :
|
||||
case 'voted_count' :
|
||||
case 'comment_count' :
|
||||
case 'trackback_count' :
|
||||
case 'uploaded_count' :
|
||||
$args->{"s_".$search_target} = (int)$search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
case 'last_update' :
|
||||
case 'ipaddress' :
|
||||
$args->{"s_".$search_target} = $search_keyword;
|
||||
break;
|
||||
case 'comment' :
|
||||
$args->s_comment = $search_keyword;
|
||||
$query_id = 'document.getDocumentListWithinComment';
|
||||
$use_division = true;
|
||||
break;
|
||||
case 'tag' :
|
||||
$args->s_tags = str_replace(' ','%',$search_keyword);
|
||||
$query_id = 'document.getDocumentListWithinTag';
|
||||
break;
|
||||
default :
|
||||
if(strpos($search_target,'extra_vars')!==false) {
|
||||
$args->var_idx = substr($search_target, strlen('extra_vars'));
|
||||
$args->var_value = str_replace(' ','%',$search_keyword);
|
||||
$args->sort_index = 'documents.'.$args->sort_index;
|
||||
$query_id = 'document.getDocumentListWithExtraVars';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -21,5 +21,25 @@
|
|||
<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" />
|
||||
<group pipe="and">
|
||||
<condition operation="like" column="title" var="s_title" />
|
||||
<condition operation="like" column="content" var="s_content" pipe="or" />
|
||||
<condition operation="like" column="user_name" var="s_user_name" pipe="or" />
|
||||
<condition operation="like" column="user_id" var="s_user_id" pipe="or" />
|
||||
<condition operation="like" column="nick_name" var="s_nick_name" pipe="or" />
|
||||
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
|
||||
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
|
||||
<condition operation="like" column="tags" var="s_tags" pipe="or" />
|
||||
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="or" />
|
||||
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
|
||||
<condition operation="more" column="readed_count" var="s_readed_count" pipe="or" />
|
||||
<condition operation="more" column="voted_count" var="s_voted_count" pipe="or" />
|
||||
<condition operation="more" column="comment_count" var="s_comment_count" pipe="or" />
|
||||
<condition operation="more" column="trackback_count" var="s_trackback_count" pipe="or" />
|
||||
<condition operation="more" column="uploaded_count" var="s_uploaded_count" pipe="or" />
|
||||
<condition operation="like_prefix" column="regdate" var="s_regdate" pipe="or" />
|
||||
<condition operation="like_prefix" column="last_update" var="s_last_update" pipe="or" />
|
||||
<condition operation="like_prefix" column="ipaddress" var="s_ipaddress" pipe="or" />
|
||||
</group>
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue