mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 12:22:15 +09:00
문서모듈에 게시물의 확장사 목록을 구하는 기능 추가. 게시판 기본 스킨 + 최근게시글 위젯 기본 스킨에 기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2649 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9edd6d32af
commit
6043141c6d
16 changed files with 68 additions and 3 deletions
|
|
@ -92,6 +92,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Replies & Trackbacks">[T<strong>{$document->getTrackbackCount()}</strong>]</span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</div>
|
||||
</td>
|
||||
<!--@if($module_info->display_author!='N')--><td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td><!--@end-->
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Replies & Trackbacks">[T<strong>{$document->getTrackbackCount()}</strong>]</span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</div>
|
||||
</td>
|
||||
<td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
|
||||
|
|
@ -115,6 +117,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Replies & Trackbacks">[T<strong>{$document->getTrackbackCount()}</strong>]</span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</div>
|
||||
</td>
|
||||
<td class="author noline"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Trackbacks"><img src="./images/common/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$document->getTrackbackCount()}</strong></span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</td>
|
||||
<td class="reading">{$document->get('readed_count')}</td>
|
||||
<td class="recommend">{$document->get('voted_count')}</td>
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Trackbacks"><img src="./images/common/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$document->getTrackbackCount()}</strong></span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</td>
|
||||
<!--@if($module_info->display_author!='N')--><td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td><!--@end-->
|
||||
<!--@if($module_info->display_readed_count!='N')--><td class="reading">{$document->get('readed_count')>0?$document->get('readed_count'):' '}</td><!--@end-->
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Trackbacks"><img src="./images/common/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$document->getTrackbackCount()}</strong></span>
|
||||
<!--@end-->
|
||||
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</td>
|
||||
<td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
|
||||
<td class="reading">{$document->get('readed_count')}</td>
|
||||
|
|
@ -128,6 +130,7 @@
|
|||
<!--@if($document->getTrackbackCount())-->
|
||||
<span class="replyAndTrackback" title="Trackbacks"><img src="./images/common/iconTrackback.gif" alt="" width="12" height="13" class="trackback icon" /> <strong>{$document->getTrackbackCount()}</strong></span>
|
||||
<!--@end-->
|
||||
{$document->printExtraImages(60*60*2)}
|
||||
</td>
|
||||
<td class="author"><div class="member_{$document->get('member_srl')}">{$document->getNickName()}</div></td>
|
||||
<td class="reading">{$document->get('readed_count')}</td>
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@
|
|||
return $oTrackbackModel->getTrackbackList($this->document_srl, $is_admin);
|
||||
}
|
||||
|
||||
function thumbnailExists($width, $height) {
|
||||
function thumbnailExists($width = 80, $height = 0) {
|
||||
if(!$this->getThumbnail($width, $height)) return false;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -341,6 +341,54 @@
|
|||
return Context::getRequestUri().$thumbnail_file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 새글, 최신 업데이트글, 비밀글, 이미지/동영상/첨부파일등의 아이콘 출력용 함수
|
||||
* $time_interval 에 지정된 시간(초)로 새글/최신 업데이트글의 판별
|
||||
**/
|
||||
function getExtraImages($time_interval = 7200) {
|
||||
|
||||
// 아이콘 목록을 담을 변수 미리 설정
|
||||
$buffs = array();
|
||||
|
||||
// 최신 시간 설정
|
||||
$time_check = date("YmdHis", time()-$time_interval);
|
||||
|
||||
// 새글 체크
|
||||
if($this->get('regdate')>$time_check) $buffs[] = "new";
|
||||
else if($this->get('last_update')>$time_check) $buffs[] = "update";
|
||||
|
||||
// 비밀글 체크
|
||||
if($this->isSecret()) $buffs[] = "secret";
|
||||
|
||||
// 사진 이미지 체크
|
||||
if(preg_match('!<img([^>]*?)>!is', $this->get('content'))) $buffs[] = "image";
|
||||
|
||||
// 동영상 체크
|
||||
if(preg_match('!<embed([^>]*?)>!is', $this->get('content'))) $buffs[] = "movie";
|
||||
|
||||
// 첨부파일 체크
|
||||
if($this->hasUploadedFiles()) $buffs[] = "file";
|
||||
|
||||
return $buffs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief getExtraImages로 구한 값을 이미지 태그를 씌워서 리턴
|
||||
**/
|
||||
function printExtraImages($time_check = 7200) {
|
||||
// 아이콘 디렉토리 구함
|
||||
$path = sprintf('%s%s',getUrl(), 'modules/document/tpl/icons/');
|
||||
|
||||
$buffs = $this->getExtraImages($time_check);
|
||||
if(!count($buffs)) return;
|
||||
|
||||
$buff = null;
|
||||
foreach($buffs as $key => $val) {
|
||||
$buff .= sprintf('<img src="%s%s.gif" alt="%s" title="%s" width="13" height="13" />', $path, $val, $val, $val);
|
||||
}
|
||||
return $buff;
|
||||
}
|
||||
|
||||
function hasUploadedFiles() {
|
||||
if($this->isSecret() && !$this->isGranted()) return false;
|
||||
return $this->get('uploaded_count')? true : false;
|
||||
|
|
|
|||
BIN
modules/document/tpl/icons/file.gif
Normal file
BIN
modules/document/tpl/icons/file.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 545 B |
BIN
modules/document/tpl/icons/image.gif
Normal file
BIN
modules/document/tpl/icons/image.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 522 B |
BIN
modules/document/tpl/icons/movie.gif
Normal file
BIN
modules/document/tpl/icons/movie.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 524 B |
BIN
modules/document/tpl/icons/new.gif
Normal file
BIN
modules/document/tpl/icons/new.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 B |
BIN
modules/document/tpl/icons/secret.gif
Normal file
BIN
modules/document/tpl/icons/secret.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 338 B |
BIN
modules/document/tpl/icons/update.gif
Normal file
BIN
modules/document/tpl/icons/update.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 79 B |
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
<ul class="documentList">
|
||||
<!--@foreach($widget_info->document_list as $oDocument)-->
|
||||
<li><a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->subject_cut_size)}</a></li>
|
||||
<li><a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->subject_cut_size)}</a> {$oDocument->printExtraImages()}</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
</div>
|
||||
<ul>
|
||||
<!--@foreach($widget_info->document_list as $oDocument)-->
|
||||
<li><a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->subject_cut_size)}</a></li>
|
||||
<li><a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->subject_cut_size)}</a> {$oDocument->printExtraImages()}</li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
<span class="writer">
|
||||
- {$oDocument->getNickName()}
|
||||
</span>
|
||||
|
||||
{$oDocument->printExtraImages()}
|
||||
</div>
|
||||
<div class="regdate">{$oDocument->getRegdate("Y-m-d")}</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
<!--@if($oDocument->getCommentCount())-->
|
||||
<span class="comment">[<a href="{$oDocument->getPermanentUrl()}#comment">{$oDocument->getCommentCount()}</a>]</span>
|
||||
<!--@end-->
|
||||
|
||||
{$oDocument->printExtraImages()}
|
||||
</span>
|
||||
<span class="date"><span>{$oDocument->getRegdate("Y-m-d")}</span></span>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue