게시판 모듈에서 기존의 스킨에서 임시 처리하던 정렬 옵션을 게시판 모듈 자체 설정으로 변경. 기본/수정/등록일/추천/조회/댓글수/제목순 정렬 기능 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4070 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-04-04 03:58:01 +00:00
parent 29f9b4ce49
commit 95a74eaade
15 changed files with 321 additions and 272 deletions

View file

@ -181,6 +181,9 @@
if($extra_var->use_category!='Y') $extra_var->use_category = 'N';
if($extra_var->except_notice!='Y') $extra_var->except_notice = 'N';
if($extra_var->consultation!='Y') $extra_var->consultation = 'N';
if($extra_var->order_target) $extra_var->consultation = 'N';
if(!in_array($extra_var->order_target,$this->order_target)) $extra_var->order_target = 'list_order';
if(!in_array($extra_var->order_type,array('asc','desc'))) $extra_var->order_type = 'asc';
unset($extra_var->act);
unset($extra_var->page);
unset($extra_var->board_name);

View file

@ -42,6 +42,12 @@
// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
$template_path = sprintf("%stpl/",$this->module_path);
$this->setTemplatePath($template_path);
// 정렬 옵션을 세팅
foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key);
$order_target['list_order'] = Context::getLang('document_srl');
$order_target['update_order'] = Context::getLang('last_update');
Context::set('order_target', $order_target);
}
/**

View file

@ -9,6 +9,8 @@
var $search_option = array('title','content','title_content','comment','user_name','nick_name','user_id','tag'); ///< 검색 옵션
var $order_target = array('list_order', 'update_order', 'regdate', 'voted_count', 'readed_count', 'comment_count', 'title'); // 정렬 옵션
var $skin = "default"; ///< 스킨 이름
var $list_count = 20; ///< 한 페이지에 나타날 글의 수
var $page_count = 10; ///< 페이지의 수

View file

@ -164,12 +164,13 @@
$args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...)
$args->search_keyword = Context::get('search_keyword'); ///< 검색어
if($this->module_info->use_category=='Y') $args->category_srl = Context::get('category'); ///< 카테고리 사용시 선택된 카테고리
$args->sort_index = Context::get('sort_index');
$args->order_type = Context::get('order_type');
// 지정된 정렬값이 없다면 스킨에서 설정한 정렬 값을 이용함
if(!$args->sort_index) $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
if(!$args->order_type) $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
if(!in_array($args->sort_index, $this->order_target)) $args->sort_index = $this->module_info->order_target?$this->module_info->order_target:'list_order';
if(!in_array($args->order_type, array('asc','desc'))) $args->order_type = $this->module_info->order_type?$this->module_info->order_type:'asc';
// 특정 문서의 permalink로 직접 접속할 경우 page값을 직접 구함
if(count($_GET)==1 && isset($_GET['document_srl']) && $oDocument->isExists() && !$oDocument->isNotice()) {

View file

@ -115,34 +115,6 @@
<default>blog</default>
<default>forum</default>
</var>
<var name="order_target" type="select">
<title xml:lang="ko">정렬 대상</title>
<title xml:lang="jp">ソート対象</title>
<title xml:lang="zh-CN">排序对象</title>
<title xml:lang="en">Align Target</title>
<title xml:lang="es">Alinear Meta</title>
<description xml:lang="ko">등록된 순서 또는 변경된 순서로 정렬을 할 수 있습니다.</description>
<description xml:lang="jp">登録順、変更順にソートできます。</description>
<description xml:lang="zh-CN">可对主题按发表顺或最后更新顺进行排序。</description>
<description xml:lang="en">It can align articles as registered order or modified order.</description>
<description xml:lang="es">Puede alinear los artículos registrados como fin o modificar el orden.</description>
<default>list_order</default>
<default>update_order</default>
</var>
<var name="order_type" type="select">
<title xml:lang="ko">정렬 방법</title>
<title xml:lang="jp">ソート方法</title>
<title xml:lang="zh-CN">排序方式</title>
<title xml:lang="en">Sorting Type</title>
<title xml:lang="es">Tipo de ordenamiento</title>
<description xml:lang="ko">정렬대상을 내림차순 또는 올림차순으로 정렬할 수 있습니다.</description>
<description xml:lang="jp">ソート方法を、降順、昇順にできます。</description>
<description xml:lang="zh-CN">对其排序对象可进行升序/降序方式排序。</description>
<description xml:lang="en">You can sort target articles by asending or desending order.</description>
<description xml:lang="es">Usted puede ordenar los documentos en orden acendente o en orden descendente.</description>
<default>asc</default>
<default>desc</default>
</var>
<var name="display_login_info" type="select">
<title xml:lang="ko">로그인 정보 출력</title>
<title xml:lang="zh-CN">显示会员信息组</title>

View file

@ -35,6 +35,14 @@
<th scope="row">{$lang->use_category}</th>
<td><!--@if($module_info->use_category=='Y')-->{$lang->use}<!--@else-->{$lang->notuse}<!--@end--></td>
</tr>
<tr>
<th scope="row">{$lang->order_target}</th>
<td>{$order_target[$module_info->order_target]}</td>
</tr>
<tr>
<th scope="row">{$lang->order_type}</th>
<td><!--@if($module_info->order_type=='asc')-->{$lang->order_asc}<!--@else-->{$lang->order_desc}<!--@end--></td>
</tr>
<tr>
<th scope="row">{$lang->list_count}</th>
<td>{$module_info->list_count?$module_info->list_count:20}</td>

View file

@ -84,6 +84,26 @@
<label for="fld_for_category">{$lang->about_use_category}</label>
</td>
</tr>
<tr>
<th scope="row">{$lang->order_target}</th>
<td>
<select name="order_target">
<!--@foreach($order_target as $key => $val)-->
<option value="{$key}" <!--@if($module_info->order_target == $key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
</td>
</tr>
<tr>
<th scope="row">{$lang->order_type}</th>
<td>
<select name="order_type">
<option value="asc" <!--@if($module_info->order_type != 'desc')-->selected="selected"<!--@end-->>{$lang->order_asc}</option>
<option value="desc" <!--@if($module_info->order_type == 'desc')-->selected="selected"<!--@end-->>{$lang->order_desc}</option>
</select>
</td>
</tr>
<tr>
<th scope="row">{$lang->list_count}</th>
<td>

View file

@ -14,6 +14,8 @@
<param name="skin" target="skin" />
<param name="browser_title" target="browser_title" />
<param name="use_category" target="use_category" />
<param name="order_target" target="order_target" />
<param name="order_type" target="order_type" />
<param name="list_count" target="list_count" />
<param name="search_list_count" target="search_list_count" />
<param name="except_notice" target="except_notice" />