게시판 모듈에 최신순/업데이트 순 순서를 정할 수 있도록 기능 추가하고 xe시리즈의 스킨에 반영

git-svn-id: http://xe-core.googlecode.com/svn/trunk@1924 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-13 04:26:06 +00:00
parent 2759bf5363
commit 89d40258bd
8 changed files with 48 additions and 4 deletions

View file

@ -96,6 +96,20 @@
$args->sort_index = Context::get('sort_index');
$args->order_type = Context::get('order_type');
// 스킨에서 설정한 기본 정렬 대상을 구함
if(!$args->sort_index) {
switch($this->module_info->order_target) {
case "updated" :
$args->sort_index = "update_order";
$args->order_type = "asc";
break;
default :
$args->sort_index = "list_order";
$args->order_type = "asc";
break;
}
}
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
$output = $oDocumentModel->getDocumentList($args);

View file

@ -23,6 +23,15 @@
</color>
</colorset>
<extra_vars>
<var name="order_target" type="select">
<title xml:lang="ko">정렬 대상</title>
<title xml:lang="zh-CN">排列顺序</title>
<type>select</type>
<description xml:lang="ko">등록된 순서 또는 변경된 순서로 정렬을 할 수 있습니다.</description>
<description xml:lang="zh-CN">可排序文章的顺序。</description>
<default>newest</default>
<default>updated</default>
</var>
<var name="title" type="text">
<title xml:lang="ko">게시판 제목</title>
<title xml:lang="zh-CN">board标题</title>

View file

@ -23,6 +23,15 @@
</color>
</colorset>
<extra_vars>
<var name="order_target" type="select">
<title xml:lang="ko">정렬 대상</title>
<title xml:lang="zh-CN">排列顺序</title>
<type>select</type>
<description xml:lang="ko">등록된 순서 또는 변경된 순서로 정렬을 할 수 있습니다.</description>
<description xml:lang="zh-CN">可排序文章的顺序。</description>
<default>newest</default>
<default>updated</default>
</var>
<var name="title" type="text">
<title xml:lang="ko">게시판 제목</title>
<title xml:lang="zh-CN">board 标题</title>

View file

@ -97,8 +97,8 @@
<!--@else-->
<tr class="bg{($no+1)%2+1}">
<td class="num"><!--@if($document_srl == $document->document_srl)--><img src="./images/white/iconArrowD8.gif" border="0" /><!--@else-->{$no}<!--@end--></td>
<td rowspan="2" class="num"><!--@if($document_srl == $document->document_srl)--><img src="./images/white/iconArrowD8.gif" border="0" /><!--@else-->{$no}<!--@end--></td>
<!--@if($document->thumbnailExists(100))-->
<td rowspan="2" class="thumb">
<a href="{getUrl('','document_srl',$document->document_srl)}" class="thumbnailMedium"><img src="{$document->getThumbnail(100)}" border="0" alt="" /></a>
@ -138,7 +138,7 @@
<td class="date">{$document->getRegdate('Y-m-d')}</td>
</tr>
<tr class="bg{($no+1)%2+1}">
<td colspan="5" class="summary"><a href="{getUrl('','document_srl',$document->document_srl)}">{$document->getSummary(140)}</a></td>
<td colspan="6" class="summary"><a href="{getUrl('','document_srl',$document->document_srl)}">{$document->getSummary(140)}</a></td>
</tr>
<!--@end-->
<!--@end-->

View file

@ -23,6 +23,15 @@
</color>
</colorset>
<extra_vars>
<var name="order_target" type="select">
<title xml:lang="ko">정렬 대상</title>
<title xml:lang="zh-CN">排列顺序</title>
<type>select</type>
<description xml:lang="ko">등록된 순서 또는 변경된 순서로 정렬을 할 수 있습니다.</description>
<description xml:lang="zh-CN">可排序文章的顺序。</description>
<default>newest</default>
<default>updated</default>
</var>
<var name="title" type="text">
<title xml:lang="ko">게시판 제목</title>
<title xml:lang="zh-CN">board 标题</title>

View file

@ -86,7 +86,7 @@
$oDocumentController = &getController('document');
// 해당글의 댓글 수를 업데이트
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count);
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, true);
// 댓글의 권한을 부여
$this->addGrant($obj->comment_srl);

View file

@ -378,10 +378,12 @@
/**
* @brief 해당 document의 댓글 증가
**/
function updateCommentCount($document_srl, $comment_count) {
function updateCommentCount($document_srl, $comment_count, $comment_inserted = false) {
$args->document_srl = $document_srl;
$args->comment_count = $comment_count;
if($comment_inserted) $args->update_order = -1*getNextSequence();
return executeQuery('document.updateCommentCount', $args);
}

View file

@ -4,6 +4,7 @@
</tables>
<columns>
<column name="comment_count" var="comment_count" notnull="notnull" />
<column name="update_order" var="update_order" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />