mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 03:52:15 +09:00
포럼 위젯에 최근글-최근댓글의 처리를 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3578 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
554ccd6d71
commit
8578efa48f
5 changed files with 42 additions and 9 deletions
|
|
@ -45,13 +45,32 @@
|
||||||
$modules[$module->module_srl]->document_count = 0;
|
$modules[$module->module_srl]->document_count = 0;
|
||||||
$modules[$module->module_srl]->comment_count = 0;
|
$modules[$module->module_srl]->comment_count = 0;
|
||||||
|
|
||||||
// 최근 수정된 댓글의 정보
|
// 최근 등록된 댓글의 정보
|
||||||
|
$last_comment = null;
|
||||||
$last_args = null;
|
$last_args = null;
|
||||||
$last_args->module_srl = $module->module_srl;
|
$last_args->module_srl = $module->module_srl;
|
||||||
$output = executeQuery('widgets.forum.getLatestComments', $last_args);
|
$output = executeQuery('widgets.forum.getLatestComments', $last_args);
|
||||||
|
if(is_array($output->data)) $last_comment = array_pop($output->data);
|
||||||
|
|
||||||
if(is_array($output->data)) $modules[$module->module_srl]->last_comment = array_pop($output->data);
|
// 최근 등록된 글의 정보
|
||||||
else $modules[$module->module_srl]->last_comment = null;
|
$last_document = null;
|
||||||
|
$last_args = null;
|
||||||
|
$last_args->module_srl = $module->module_srl;
|
||||||
|
$output = executeQuery('widgets.forum.getLatestDocuments', $last_args);
|
||||||
|
if(is_array($output->data)) $last_document = array_pop($output->data);
|
||||||
|
|
||||||
|
$last_item = null;
|
||||||
|
if($last_comment && $last_document) {
|
||||||
|
if($last_document->regdate > $last_comment->regdate) $last_item = $last_document;
|
||||||
|
else $last_item = $last_comment;
|
||||||
|
} elseif($last_document) {
|
||||||
|
$last_item = $last_document;
|
||||||
|
} elseif($last_comment) {
|
||||||
|
$last_item = $last_comment;
|
||||||
|
}
|
||||||
|
$modules[$module->module_srl]->last_item = $last_item;
|
||||||
|
|
||||||
|
if($last_item && $last_item->regdate > date("YmdHis",time()-$duration_new*60*60)) $modules[$module->module_srl]->is_new = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 각 모듈별 전체글을 구함
|
// 각 모듈별 전체글을 구함
|
||||||
|
|
|
||||||
14
widgets/forum/queries/getLatestDocuments.xml
Normal file
14
widgets/forum/queries/getLatestDocuments.xml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<query id="getLatestDocuments" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="documents" />
|
||||||
|
</tables>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="in" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="list_order" order="asc" />
|
||||||
|
<list_count var="list_count" default="1" />
|
||||||
|
<page_count var="page_count" default="1" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
Binary file not shown.
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
.xeForum table td.title a { text-decoration:none; color:#3A3947; font-size:9pt;}
|
.xeForum table td.title a { text-decoration:none; color:#3A3947; font-size:9pt;}
|
||||||
.xeForum table td.title p { margin-top:5px; font-weight:normal; text-decoration:none; color:#838383; font-size:9pt;}
|
.xeForum table td.title p { margin-top:5px; font-weight:normal; text-decoration:none; color:#838383; font-size:9pt;}
|
||||||
.xeForum table td.title p a { font-weight:normal; text-decoration:none; color:#838383; font-size:9pt;}
|
.xeForum table td.title p a { font-weight:normal; text-decoration:underline; color:#838383; font-size:9pt;}
|
||||||
|
|
||||||
.xeForum table td.topic, .xeForum td.replies, .xeForum td.last_post { background:#EFEFEF url("../images/div.gif") no-repeat left 3px; }
|
.xeForum table td.topic, .xeForum td.replies, .xeForum td.last_post { background:#EFEFEF url("../images/div.gif") no-repeat left 3px; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<!--@foreach($widget_info->modules as $val)-->
|
<!--@foreach($widget_info->modules as $val)-->
|
||||||
<tr class="content">
|
<tr class="content">
|
||||||
<td class="icon"><img src="./images/icon.gif" alt="icon" /></td>
|
<td class="icon"><img src="./images/icon<!--@if($val->is_new)-->_new<!--@end-->.gif" alt="icon" /></td>
|
||||||
<td class="title">
|
<td class="title">
|
||||||
<strong><a href="{getUrl('','mid',$val->mid)}">{$val->title}</a></strong>
|
<strong><a href="{getUrl('','mid',$val->mid)}">{$val->title}</a></strong>
|
||||||
<p>{$val->description}</p>
|
<p>{$val->description}</p>
|
||||||
|
|
@ -27,12 +27,12 @@
|
||||||
<td class="topic">{number_format($val->document_count)}</td>
|
<td class="topic">{number_format($val->document_count)}</td>
|
||||||
<td class="replies">{number_format($val->comment_count)}</td>
|
<td class="replies">{number_format($val->comment_count)}</td>
|
||||||
<td class="last_post">
|
<td class="last_post">
|
||||||
<!--@if($val->last_comment)-->
|
<!--@if($val->last_item)-->
|
||||||
<div class="author">
|
<div class="author">
|
||||||
<span class="member_{$val->last_comment->member_srl}">{$val->last_comment->nick_name}</span>
|
<span class="member_{$val->last_item->member_srl}">{$val->last_item->nick_name}</span>
|
||||||
<a href="{getUrl('','document_srl',$val->last_comment->document_srl)}#comment_{$val->last_comment->comment_srl}"><img src="./images/replies.gif" alt="go" /></a>
|
<a href="{getUrl('','document_srl',$val->last_item->document_srl)}<!--@if($val->last_item->comment_srl)-->#comment_{$val->last_item->comment_srl}<!--@end-->"><img src="./images/replies.gif" alt="go" /></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="date">{zdate($val->last_comment->regdate,"Y-m-d H:i")}</div>
|
<div class="date">{zdate($val->last_item->regdate,"Y-m-d H:i")}</div>
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
|
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue