최근 이미지 위젯의 가로/세로 갯수 조절하고 옵션 노출 여부 기능 추가. xe_official 스킨 추가

git-svn-id: http://xe-core.googlecode.com/svn/trunk@2187 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-05 04:31:51 +00:00
parent 5830757472
commit 75fe99c37b
11 changed files with 323 additions and 48 deletions

View file

@ -251,7 +251,7 @@
if($modified_time > $file_created_time) unlink($thumbnail_file);
}
if(file_exists($thumbnail_file)&&filesize($thumbnail_file)<1) return;
if(file_exists($thumbnail_file)&&filesize($thumbnail_file)<1) return Context::getRequestUri()."common/tpl/images/blank.gif";
// 썸네일 파일이 있으면 url return
if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file;

View file

@ -15,6 +15,28 @@
<description xml:lang="en">This widget will show images in articles.</description>
</author>
<extra_vars>
<var id="title">
<name xml:lang="ko">제목</name>
<name xml:lang="zh-CN">栏目名</name>
<name xml:lang="jp">タイトル</name>
<name xml:lang="en">Title</name>
<type>text</type>
<description xml:lang="ko">최근 게시물의 제목으로 출력됩니다.</description>
<description xml:lang="zh-CN">显示为最新主题列表的标题。</description>
<description xml:lang="jp">最近の書き込みのタイトルとして表示されます。</description>
<description xml:lang="en">It will be the title of the newest articles.</description>
</var>
<var id="mid_list">
<name xml:lang="ko">대상 모듈</name>
<name xml:lang="jp">モジュール</name>
<name xml:lang="zh-CN">对象模块</name>
<name xml:lang="en">Target Module</name>
<type>mid_list</type>
<description xml:lang="ko">선택하신 모듈에 등록된 글을 대상으로 합니다.</description>
<description xml:lang="jp">チェックされたコンテンツを対象とします。</description>
<description xml:lang="zh-CN">把被选模块中的主题作为对象。</description>
<description xml:lang="en">Articles on chosen module will be the target.</description>
</var>
<var id="title_length">
<name xml:lang="ko">글 제목 길이</name>
<name xml:lang="jp">題名の文字数</name>
@ -37,27 +59,91 @@
<description xml:lang="zh-CN">可以指定要显示的图片宽度。(默认为100)</description>
<description xml:lang="en">You can set the width of image. (100 as default)</description>
</var>
<var id="list_count">
<name xml:lang="ko">이미지 수</name>
<var id="cols_list_count">
<name xml:lang="ko">가로 이미지 수</name>
<name xml:lang="jp">イメージ数</name>
<name xml:lang="zh-CN">图片数</name>
<name xml:lang="en">Number of Images</name>
<type>text</type>
<description xml:lang="ko">출력될 이미지의 수를 정하실 수 있습니다. (기본 5개)</description>
<description xml:lang="ko">출력될 가로 이미지의 수를 정하실 수 있습니다. (기본 5개)</description>
<description xml:lang="jp">表示されるイメージの数を指定することができますデフォルト5個</description>
<description xml:lang="zh-CN">可以指定要显示的图片个数。(默认为5个)</description>
<description xml:lang="en">You can set the number of images to display. (5 as default)</description>
</var>
<var id="mid_list">
<name xml:lang="ko">대상 모듈</name>
<name xml:lang="jp">モジュール</name>
<name xml:lang="zh-CN">对象模块</name>
<name xml:lang="en">Target Module</name>
<type>mid_list</type>
<description xml:lang="ko">선택하신 모듈에 등록된 글을 대상으로 합니다.</description>
<description xml:lang="jp">チェックされたコンテンツを対象とします</description>
<description xml:lang="zh-CN">把被选模块中的主题作为对象。</description>
<description xml:lang="en">Articles on chosen module will be the target.</description>
<var id="rows_list_count">
<name xml:lang="ko">세로 이미지 수</name>
<name xml:lang="jp">イメージ数</name>
<name xml:lang="zh-CN">图片数</name>
<name xml:lang="en">Number of Images</name>
<type>text</type>
<description xml:lang="ko">출력될 세로 이미지의 수를 정하실 수 있습니다. (기본 1개)</description>
<description xml:lang="jp">表示されるイメージの数を指定することができますデフォルト5個</description>
<description xml:lang="zh-CN">可以指定要显示的图片个数。(默认为5个)</description>
<description xml:lang="en">You can set the number of images to display. (5 as default)</description>
</var>
<var id="display_author">
<name xml:lang="ko">글쓴이 표시</name>
<name xml:lang="jp">投稿者表示</name>
<name xml:lang="zh-CN">显示昵称</name>
<name xml:lang="en">Display Author</name>
<type>select</type>
<description />
<options>
<name xml:lang="ko">표시</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<value>N</value>
</options>
</var>
<var id="display_regdate">
<name xml:lang="ko">작성일 표시</name>
<name xml:lang="jp">作成日表示</name>
<name xml:lang="zh-CN">显示发表日期</name>
<name xml:lang="en">Display Registered Date</name>
<type>select</type>
<description />
<options>
<name xml:lang="ko">표시</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<value>N</value>
</options>
</var>
<var id="display_readed_count">
<name xml:lang="ko">조회수 표시</name>
<name xml:lang="jp">照合数表示</name>
<name xml:lang="zh-CN">显示查看数</name>
<name xml:lang="en">Display Hit</name>
<description />
<type>select</type>
<options>
<name xml:lang="ko">표시</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<value>N</value>
</options>
</var>
<var id="display_voted_count">
<name xml:lang="ko">추천수 표시</name>
<name xml:lang="jp">推薦数表示</name>
<name xml:lang="zh-CN">显示推荐数</name>
<name xml:lang="en">Display Votes</name>
<description />
<type>select</type>
<options>
<name xml:lang="ko">표시</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<value>N</value>
</options>
</var>
</extra_vars>
</widget>

View file

@ -15,16 +15,36 @@
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args) {
// 위젯 자체적으로 설정한 변수들을 체크
$title_length = (int)$args->title_length;
if(!$title_length) $title_length = 10;
// 글자 제목 길이
$widget_info->title_length = (int)$args->title_length;
if(!$widget_info->title_length) $widget_info->title_length = 10;
$thumbnail_width = (int)$args->thumbnail_width;
if(!$thumbnail_width) $thumbnail_width = 100;
// 썸네일 가로 크기
$widget_info->thumbnail_width = (int)$args->thumbnail_width;
if(!$widget_info->thumbnail_width) $widget_info->thumbnail_width = 100;
$list_count = (int)$args->list_count;
if(!$list_count) $list_count = 5;
// 가로 이미지 수
$widget_info->rows_list_count = (int)$args->rows_list_count;
if(!$widget_info->rows_list_count) $widget_info->rows_list_count = 5;
// 세로 이미지 수
$widget_info->cols_list_count = (int)$args->cols_list_count;
if(!$widget_info->cols_list_count) $widget_info->cols_list_count = 1;
// 노출 여부 체크
if($args->display_author!='Y') $widget_info->display_author = 'N';
else $widget_info->display_author = 'Y';
if($args->display_regdate!='Y') $widget_info->display_regdate = 'N';
else $widget_info->display_regdate = 'Y';
if($args->display_readed_count!='Y') $widget_info->display_readed_count = 'N';
else $widget_info->display_readed_count = 'Y';
if($args->display_voted_count!='Y') $widget_info->display_voted_count = 'N';
else $widget_info->display_voted_count = 'Y';
// 제목
$widget_info->title = $args->title;
// 대상 모듈 정리
$mid_list = explode(",",$args->mid_list);
// 템플릿 파일에서 사용할 변수들을 세팅
@ -32,12 +52,11 @@
// 변수 정리
$obj->sort_index = $order_target;
$obj->list_count = $list_count;
$obj->list_count = $widget_info->rows_list_count * $widget_info->cols_list_count;
// mid에 해당하는 module_srl을 구함
$oModuleModel = &getModel('module');
$module_srl_list = $oModuleModel->getModuleSrlByMid($mid_list);
$obj->module_srls = implode(",",$module_srl_list);
$obj->direct_download = 'Y';
$obj->isvalid = 'Y';
@ -57,11 +76,12 @@
$oDocumentModel = &getModel('document');
$documents_output = $oDocumentModel->getDocuments($document_srl_list);
if(!count($documents_output)) return;
foreach($documents_output as $key => $val) {
$document_list[] = $val;
}
$widget_info->document_list = $documents_output;
$widget_info->title_length = $title_length;
$widget_info->thumbnail_width = $thumbnail_width;
$widget_info->list_count = $list_count;
$widget_info->document_list = $document_list;
Context::set('widget_info', $widget_info);

View file

@ -1,6 +1,23 @@
.ni_box { border:1px solid #EEEEEE; padding:5px; }
.ni_box .ni_item { float:left; margin:3px; list-style:none; text-align:center;}
.ni_box .ni_item a { color:#444444; text-decoration:none; }
.ni_box .ni_item a:visited { color:#AAAAAA; text-decoration:none; }
.ni_box .ni_item .thumbnail { border:1px solid #DDDDDD; padding:4px; }
.ni_box .ni_item .thumbnail:hover { border:1px solid #888888; padding:4px;}
.ni_box { overflow:hidden; }
.ni_box .title_box { border:1px solid #EEEEEE; padding:5px; height:14px; overflow:hidden; }
.ni_box .title_box .title { no-repeat left; font-weight:bold; height:14px; float:left; }
.ni_box .title_box .more A { float:right; color:#AAAAAA; text-decoration:none; font-weight:bold; font-size:.75em; }
.ni_box .thumbnail_box { width:100%; table-layout:fixed; }
.ni_box .thumbnail_box .thumbnail { margin:3px; padding:3px; border:1px solid #EFEFEF; text-align:center; }
.ni_box .thumbnail_box .thumbnail:hover { border:1px solid #888888; }
.ni_box .thumbnail_box .thumbnail img { border:none; }
.ni_box .thumbnail_box .thumbnail img:hover { border:none; }
.ni_box .thumbnail_box a { color:#444444; text-decoration:none; }
.ni_box .thumbnail_box a:visited { color:#AAAAAA; text-decoration:none; }
.ni_box .thumbnail_box td.bottomBorder { border-bottom:1px dashed #EEEEEE; padding-bottom:5px; }
.ni_box .thumbnail_box div strong { font-weight:bold; font-size:0.75em; color:#CCCCCC; }
.ni_box .thumbnail_box div.author { color:#AAAAAA; }
.ni_box .thumbnail_box div.author a { color:#AAAAAA; }
.ni_box .thumbnail_box div.regdate { font-size:0.75em; color:#CCCCCC; margin-top:2px;}
.ni_box .thumbnail_box div.readAndVoted { color:#AAAAAA; font-size:0.75em; }
.ni_box .thumbnail_box div.readAndVoted span.div_block { color:#DDDDDD; font-size:0.75em; }
.ni_box .thumbnail_box div.readAndVoted strong { color:orange; }

View file

@ -5,23 +5,61 @@
<!--@end-->
<div class="ni_box">
<ul>
{@ $count = 0; }
<!--@foreach($widget_info->document_list as $oDocument)-->
<!--@if($oDocument->thumbnailExists($widget_info->thumbnail_width) )-->
<li class="ni_item">
<a href="{getUrl('','document_srl',$oDocument->document_srl)}"><img src="{$oDocument->getThumbnail($widget_info->thumbnail_width)}" width="{$widget_info->thumbnail_width}" height="{$widget_info->thumbnail_width}" border="0" alt="" class="thumbnail" /></a>
<div><a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->title_length)}</a></div>
<div class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div>
</li>
{@ $count++}
<!--@if($widget_info->title)-->
<div class="title_box">
<div class="title">{$widget_info->title}</div>
<!--@if($widget_info->module_name)-->
<div class="more"><a href="{getUrl('','mid',$widget_info->module_name)}">more</a></div>
<!--@end-->
</div>
<!--@end-->
</ul>
<!--@if(count($widget_info->document_list))-->
<table class="thumbnail_box">
{@ $count = 0; }
<!--@for($i=0;$i<$widget_info->rows_list_count;$i++)-->
<tr>
<!--@for($j=0;$j<$widget_info->cols_list_count;$j++)-->
{@ $oDocument = $widget_info->document_list[$i*$widget_info->cols_list_count + $j]}
<td <!--@if($widget_info->rows_list_count>1)-->class="bottomBorder"<!--@end-->>
<div class="thumbnail"><a href="{getUrl('','document_srl',$oDocument->document_srl)}"><img src="{$oDocument->getThumbnail($widget_info->thumbnail_width)}" width="{$widget_info->thumbnail_width}" height="{$widget_info->thumbnail_width}" border="0" alt="" class="thumbnail" /></a></div>
<div>
<a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->title_length)}</a>
<!--@if($oDocument->getCommentCount())--><strong>[{$oDocument->getCommentCount()}]</strong><!--@end-->
</div>
<!--@if($widget_info->display_author == 'Y')-->
<div class="author member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div>
<!--@end-->
<!--@if($widget_info->display_regdate == 'Y')-->
<div class="regdate">{$oDocument->getRegdate()}</div>
<!--@end-->
<!--@if($widget_info->display_readed_count == 'Y' || $widget_info->display_voted_count == 'Y' )-->
<div class="readAndVoted">
<!--@if($widget_info->display_readed_count == 'Y')-->
{$lang->readed_count} {$oDocument->get('readed_count')}
<!--@end-->
<!--@if($widget_info->display_voted_count == 'Y' )-->
<!--@if($widget_info->display_readed_count == 'Y')--><span class="div_block">|</span><!--@end-->
{$lang->voted_count} <strong>{$oDocument->get('voted_count')}</strong>
<!--@end-->
</div>
<!--@end-->
</td>
<!--@end-->
<!--@for($k=$j;$k<$widget_info->cols_list_count;$k++)--><td>&nbsp;</td><!--@end-->
</tr>
<!--@end-->
</table>
<!--@end-->
<div class="clear"></div>
</div>

View file

@ -0,0 +1,24 @@
.ni_box { padding-bottom:5px; overflow:hidden; position:relative;}
.ni_box h2 { font-size:1em; display:block; height:21px; padding:9px 0 0 9px; margin-bottom:5px; color:#000000; background:url(../images/normal/lineNotice.gif) no-repeat left bottom;}
.ni_box .more { position:absolute; top:12px; right:11px; color:#000000; font:.8em Tahoma;}
.ni_box a.more { text-decoration:none;}
.ni_box a.more:hover { text-decoration:underline;}
.ni_box .thumbnail_box { width:100%; table-layout:fixed; }
.ni_box .thumbnail_box .thumbnail { margin:3px; padding:3px; border:none; text-align:center; }
.ni_box .thumbnail_box .thumbnail img { border:1px solid #DEDEDE; }
.ni_box .thumbnail_box .thumbnail img:hover { border:1px solid #54564b; }
.ni_box .thumbnail_box a { color:#000000; text-decoration:none; }
.ni_box .thumbnail_box a:visited { color:#54564b; text-decoration:none; }
.ni_box .thumbnail_box td.bottomBorder { border-bottom:1px dashed #EEEEEE; padding-bottom:5px; }
.ni_box .thumbnail_box div strong { font-weight:bold; font-size:0.75em; color:#ed2a32; }
.ni_box .thumbnail_box div.author { color:#54564b; }
.ni_box .thumbnail_box div.author a { color:#54564b; }
.ni_box .thumbnail_box div.regdate { font-size:0.75em; color:#AAAAAA; margin-top:2px;}
.ni_box .thumbnail_box div.readAndVoted { color:#333333; font-size:0.75em; }
.ni_box .thumbnail_box div.readAndVoted span.div_block { color:#333333; font-size:0.75em; }
.ni_box .thumbnail_box div.readAndVoted strong { color:#ed2a32; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

View file

@ -0,0 +1,65 @@
<!-- 설정된 컬러셋의 종류에 따라서 css파일을 import 합니다 -->
<!--@if($colorset=="normal"||!$colorset)-->
<!--%import("css/normal.css")-->
<!--@end-->
<div class="ni_box">
<!--@if($widget_info->title)-->
<h2>{$widget_info->title}</h2>
<!--@end-->
<!--@if(count($widget_info->document_list))-->
<div>
<table class="thumbnail_box">
{@ $count = 0; }
<!--@for($i=0;$i<$widget_info->rows_list_count;$i++)-->
<tr>
<!--@for($j=0;$j<$widget_info->cols_list_count;$j++)-->
{@ $oDocument = $widget_info->document_list[$i*$widget_info->cols_list_count + $j]}
<td <!--@if($widget_info->rows_list_count>1)-->class="bottomBorder"<!--@end-->>
<div class="thumbnail"><a href="{getUrl('','document_srl',$oDocument->document_srl)}"><img src="{$oDocument->getThumbnail($widget_info->thumbnail_width)}" width="{$widget_info->thumbnail_width}" height="{$widget_info->thumbnail_width}" border="0" alt="" class="thumbnail" /></a></div>
<div>
<a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->title_length)}</a>
<!--@if($oDocument->getCommentCount())--><strong>[{$oDocument->getCommentCount()}]</strong><!--@end-->
</div>
<!--@if($widget_info->display_author == 'Y')-->
<div class="author member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div>
<!--@end-->
<!--@if($widget_info->display_regdate == 'Y')-->
<div class="regdate">{$oDocument->getRegdate()}</div>
<!--@end-->
<!--@if($widget_info->display_readed_count == 'Y' || $widget_info->display_voted_count == 'Y' )-->
<div class="readAndVoted">
<!--@if($widget_info->display_readed_count == 'Y')-->
{$lang->readed_count} {$oDocument->get('readed_count')}
<!--@end-->
<!--@if($widget_info->display_voted_count == 'Y' && $oDocument->get('voted_count')>0 )-->
<!--@if($widget_info->display_readed_count == 'Y')--><span class="div_block">|</span><!--@end-->
{$lang->voted_count} <strong>{$oDocument->get('voted_count')}</strong>
<!--@end-->
</div>
<!--@end-->
</td>
<!--@end-->
<!--@for($k=$j;$k<$widget_info->cols_list_count;$k++)--><td>&nbsp;</td><!--@end-->
</tr>
<!--@end-->
</table>
<!--@end-->
</div>
<!--@if($widget_info->module_name)-->
<a href="{getUrl('','mid',$widget_info->module_name)}" class="more">more</a>
<!--@end-->
</div>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<skin>
<title xml:lang="ko">최신 이미지 위젯 기본 스킨</title>
<title xml:lang="jp">最新イメージ表示のデフォルトスキン</title>
<title xml:lang="zh-CN">最新图片列表默认皮肤</title>
<title xml:lang="en">Newest Image Widget Default Skin</title>
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">Zero</name>
<name xml:lang="en">Zero</name>
<description xml:lang="ko">최신 이미지 위젯의 기본 스킨입니다.</description>
<description xml:lang="jp">最新イメージを表示するウィジェットのデフォルトスキンです。</description>
<description xml:lang="zh-CN">最新图片列表控件的默认皮肤.</description>
<description xml:lang="en">This is default skin of newest image widget.</description>
</maker>
<colorset>
<color name="normal">
<title xml:lang="ko">기본 컬러</title>
<title xml:lang="jp">デフォルトカラー</title>
<title xml:lang="zh-CN">默认颜色</title>
<title xml:lang="en">Default Color</title>
</color>
</colorset>
</skin>