From 7c8f6326a18fe40bc8b63c7dce8126972be1e80d Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 13 Mar 2007 04:39:57 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@389 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/comment/comment.model.php | 49 ++++++++++++++++++- modules/comment/lang/ko.lang.php | 12 +++++ .../comment/queries/getTotalCommentList.xml | 34 ++++++++----- .../getTotalCommentListWithinMember.xml | 29 +++++++++++ modules/comment/tpl.admin/comment_list.html | 26 ++++++++++ 5 files changed, 136 insertions(+), 14 deletions(-) create mode 100644 modules/comment/queries/getTotalCommentListWithinMember.xml diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index a7874a408..54d8fe1c2 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -141,14 +141,59 @@ // DB 객체 생성 $oDB = &DB::getInstance(); + $query_id = 'comment.getTotalCommentList'; + // 변수 설정 - $args->sort_index = $obj->sort_index; + $args->sort_index = 'list_order'; $args->page = $obj->page?$obj->page:1; $args->list_count = $obj->list_count?$obj->list_count:20; $args->page_count = $obj->page_count?$obj->page_count:10; + // 검색 옵션 정리 + $search_target = trim(Context::get('search_target')); + $search_keyword = trim(Context::get('search_keyword')); + if($search_target && $search_keyword) { + switch($search_target) { + case 'content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_content = $search_keyword; + break; + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + $query_id = 'comment.getTotalCommentListWithinMember'; + $args->sort_index = 'comments.list_order'; + break; + case 'user_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_name = $search_keyword; + break; + case 'nick_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_nick_name = $search_keyword; + break; + case 'email_address' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_email_address = $search_keyword; + break; + case 'homepage' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_homepage = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'last_update' : + $args->s_last_upate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + } + } + // comment.getTotalCommentList 쿼리 실행 - $output = $oDB->executeQuery('comment.getTotalCommentList', $args); + $output = $oDB->executeQuery($query_id, $args); // 결과가 없거나 오류 발생시 그냥 return if(!$output->toBool()||!count($output->data)) return $output; diff --git a/modules/comment/lang/ko.lang.php b/modules/comment/lang/ko.lang.php index 6736fa13e..880d6cdf4 100644 --- a/modules/comment/lang/ko.lang.php +++ b/modules/comment/lang/ko.lang.php @@ -11,4 +11,16 @@ $lang->msg_cart_is_null = '삭제할 글을 선택해주세요'; $lang->msg_checked_comment_is_deleted = '%d개의 댓글이 삭제되었습니다'; + + $lang->search_target_list = array( + 'content' => '내용', + 'user_id' => '아이디', + 'user_name' => '이름', + 'nick_name' => '닉네임', + 'email_address' => '이메일주소', + 'homepage' => '홈페이지', + 'regdate' => '등록일', + 'last_update' => '최근수정일 ', + 'ipaddress' => 'IP 주소', + ); ?> diff --git a/modules/comment/queries/getTotalCommentList.xml b/modules/comment/queries/getTotalCommentList.xml index f1410474c..24e00dd87 100644 --- a/modules/comment/queries/getTotalCommentList.xml +++ b/modules/comment/queries/getTotalCommentList.xml @@ -1,14 +1,24 @@ - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + + + diff --git a/modules/comment/queries/getTotalCommentListWithinMember.xml b/modules/comment/queries/getTotalCommentListWithinMember.xml new file mode 100644 index 000000000..dfe8841c1 --- /dev/null +++ b/modules/comment/queries/getTotalCommentListWithinMember.xml @@ -0,0 +1,29 @@ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/comment/tpl.admin/comment_list.html b/modules/comment/tpl.admin/comment_list.html index d075a0274..f069651aa 100644 --- a/modules/comment/tpl.admin/comment_list.html +++ b/modules/comment/tpl.admin/comment_list.html @@ -18,6 +18,8 @@ + + @@ -28,6 +30,8 @@ + + @@ -41,6 +45,28 @@ + +
+
+ + + + +
+ + + + +
+ +
+ +
[{$lang->first_page}]
{$lang->user_name} {$lang->content} {$lang->date}{$lang->last_update}{$lang->ipaddress} {$lang->cmd_move}
{$val->user_name} {$val->content} {zdate($val->regdate,"Y-m-d")}{zdate($val->last_upgdate,"Y-m-d")}{$val->ipaddress} {$lang->cmd_move}