웹진형 최근 게시글 출력 위젯 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3045 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-11-22 07:30:51 +00:00
parent 4011643097
commit adb33464cf
9 changed files with 595 additions and 0 deletions

View file

@ -0,0 +1,311 @@
<?xml version="1.0" encoding="utf-8"?>
<widget version="0.1">
<title xml:lang="ko">웹진 형태 최근 문서 출력</title>
<title xml:lang="zh-CN">웹진 형태 최근 문서 출력</title>
<title xml:lang="jp">웹진 형태 최근 문서 출력</title>
<title xml:lang="en">Display webzine style newest documents</title>
<title xml:lang="es">웹진 형태 최근 문서 출력</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="en">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">최근 문서를 웹진형태로 출력하는 위젯입니다.</description>
<description xml:lang="zh-CN">최근 문서를 웹진형태로 출력하는 위젯입니다.</description>
<description xml:lang="jp">최근 문서를 웹진형태로 출력하는 위젯입니다.</description>
<description xml:lang="en">This widget displays newest articles like webzine style.</description>
<description xml:lang="es">최근 문서를 웹진형태로 출력하는 위젯입니다.</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>
<name xml:lang="es">Título</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>
<description xml:lang="es">Este será el título de los documentos recientes.</description>
</var>
<var id="order_target">
<name xml:lang="ko">정렬 대상</name>
<name xml:lang="zh-CN">排序对象</name>
<name xml:lang="jp">ソート対象</name>
<name xml:lang="en">Target to be sorted</name>
<name xml:lang="en">Objetivo para ser ordenados</name>
<type>select</type>
<description xml:lang="ko">등록된 순서 또는 변경된 순서로 정렬을 할 수 있습니다.</description>
<description xml:lang="zh-CN">可以按照指定的顺序进行排序。</description>
<description xml:lang="jp">登録された順番または変更された順番にソートできます。</description>
<description xml:lang="en">The list of newewst articles may be sorted by submitted order or modified order.</description>
<description xml:lang="es">La lista de los documentos recientes pueden ser ordenados en el orden del agregado o en el de modificados.</description>
<options>
<name xml:lang="ko">최신 등록순</name>
<name xml:lang="zh-CN">最新发表顺</name>
<name xml:lang="jp">最新登録順</name>
<name xml:lang="en">Newest Submitted Order</name>
<name xml:lang="es">Orden de agregados recientemente</name>
<value>list_order</value>
</options>
<options>
<name xml:lang="ko">최근 변경순</name>
<name xml:lang="zh-CN">最新修改顺</name>
<name xml:lang="jp">最近変更順</name>
<name xml:lang="en">Newest Modified Order</name>
<name xml:lang="es">Orden de modificados recientemente</name>
<value>update_order</value>
</options>
</var>
<var id="order_type">
<name xml:lang="ko">정렬 방법</name>
<name xml:lang="zh-CN">排序方式</name>
<name xml:lang="jp">ソートタイプ</name>
<name xml:lang="en">Sorting Type</name>
<name xml:lang="es">Tipo de ordenamiento</name>
<type>select</type>
<description xml:lang="ko">정렬대상을 내림차순 또는 올림차순으로 정렬할 수 있습니다.</description>
<description xml:lang="zh-CN">对其排序对象可进行升序/降序方式排序。</description>
<description xml:lang="jp">ソートタイプを、降順、昇順にソートできます。</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>
<options>
<name xml:lang="ko">내림차순</name>
<name xml:lang="zh-CN">降序</name>
<name xml:lang="jp">降順</name>
<name xml:lang="en">Desending order</name>
<name xml:lang="es">Orden Descendente</name>
<value>desc</value>
</options>
<options>
<name xml:lang="ko">올림차순</name>
<name xml:lang="zh-CN">升序</name>
<name xml:lang="jp">昇順</name>
<name xml:lang="en">Asending order</name>
<name xml:lang="en">Orden Acendente</name>
<value>asc</value>
</options>
</var>
<var id="duration_new">
<name xml:lang="ko">new 표시 시간 (hours)</name>
<name xml:lang="zh-CN">new图标显示时间(hours)</name>
<name xml:lang="jp">Newの表示時間 (Hours)</name>
<name xml:lang="en">Duration of indication for new item</name>
<type>text</type>
<description xml:lang="ko">새로 등록된 게시물의 new 표시시간을 정할 수 있습니다. (시간 단위)</description>
<description xml:lang="zh-CN">可以设置最新更新主题的new图标显示时间。</description>
<description xml:lang="jp">新しく登録された書き込みに対して「New」の表示時間を指定します時間単位</description>
<description xml:lang="en">You may set the duration of indication for fresh item. (unit is hour)</description>
</var>
<var id="subject_cut_size" type="text">
<name xml:lang="ko">제목 글자수</name>
<name xml:lang="jp">タイトルの文字数</name>
<name xml:lang="zh-CN">标题字数</name>
<name xml:lang="en">Length of Subject</name>
<name xml:lang="es">Número de letras del título</name>
<type>text</type>
<description lang="ko">제목 글자수를 지정할 수 있습니다. (0또는 비워주시면 자르지 않습니다)</description>
<description lang="jp">タイトルの文字数が指定できます「0」または空欄の場合は、文字数を制限しません</description>
<description lang="zh-CN">可以设置标题的字数。(0或留空为不限)</description>
<description lang="en">Length of Subject can be assigned. (0 or blank value will not restrict the length)</description>
<description lang="es">El largo del título puede ser asignado. (valor 0 o en blanco no restringe el largo)</description>
</var>
<var id="content_cut_size" type="text">
<name xml:lang="ko">내용 글자수</name>
<name xml:lang="jo">내용 글자수</name>
<name xml:lang="zh-CN">내용 글자수</name>
<name xml:lang="en">Length of Content</name>
<name xml:lang="es">Número de letras del Contenidos</name>
<type>text</type>
<description lang="ko">내용 글자수를 지정할 수 있습니다. (기본 50)</description>
<description lang="jp">내용 글자수를 지정할 수 있습니다. (기본 50)</description>
<description lang="zh-CN">내용 글자수를 지정할 수 있습니다. (기본 50)</description>
<description lang="en">Length of Content can be assigned. (default 50)</description>
<description lang="es">El largo del Contenidos puede ser asignado. (Predefinido 50)</description>
</var>
<var id="thumbnail_type">
<name xml:lang="ko">썸네일 생성 방법</name>
<name xml:lang="jp">サムネール生成方法</name>
<name xml:lang="zh-CN">缩略图生成方式</name>
<description xml:lang="ko">썸네일 생성 방법을 선택할 수 있습니다. (crop : 꽉 채우기, ratio : 비율 맞추기)</description>
<description xml:lang="zh-CN">可以选择缩略图生成方式。 (crop : 裁减, ratio : 比例)</description>
<type>select</type>
<options>
<name xml:lang="ko">Crop (채우기)</name>
<name xml:lang="jp">Crop (切り取り)</name>
<name xml:lang="zh-CN">Crop (裁减)</name>
<value>crop</value>
</options>
<options>
<name xml:lang="ko">Ratio (비율 맞추기)</name>
<name xml:lang="jp">Ratio (比率)</name>
<name xml:lang="zh-CN">Ratio (比例)</name>
<value>ratio</value>
</options>
</var>
<var id="thumbnail_width">
<name xml:lang="ko">이미지 가로크기</name>
<name xml:lang="jp">イメージ横幅</name>
<name xml:lang="zh-CN">宽度</name>
<name xml:lang="en">Width of Image</name>
<name xml:lang="es">Ancho de la imagen</name>
<type>text</type>
<description xml:lang="ko">출력될 이미지의 가로크기를 정하실 수 있습니다. (기본 100)</description>
<description xml:lang="jp">表示されるイメージの横幅のサイズを指定することができますデフォルト100</description>
<description xml:lang="zh-CN">可以指定要显示的图片宽度。(默认为100)</description>
<description xml:lang="en">You can set the width of image. (100 as default)</description>
<description xml:lang="es">Usted puede definir el ancho de la imagen. (predefinido:100)</description>
</var>
<var id="thumbnail_height">
<name xml:lang="ko">이미지 세로크기</name>
<name xml:lang="jp">イメージ縦幅</name>
<name xml:lang="zh-CN">高度</name>
<description xml:lang="ko">이미지의 세로 크기를 지정할 수 있습니다. (기본 100px)</description>
<description xml:lang="jp">イメージの立幅サイズを指定します(デフォルト 100px</description>
<description xml:lang="zh-CN">可以指定图片高度。(默认为100px)</description>
<type>text</type>
</var>
<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>
<name xml:lang="es">Número de imágenes</name>
<type>text</type>
<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>
<description xml:lang="es">Usted puede definir el múmero de imágenes a mostrar. (predefinido: 5)</description>
</var>
<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>
<name xml:lang="es">Número de imágenes</name>
<type>text</type>
<description xml:lang="ko">출력될 세로 이미지의 수를 정하실 수 있습니다. (기본 1개)</description>
<description xml:lang="jp">表示されるイメージの数を指定することができますデフォルト5個</description>
<description xml:lang="zh-CN">可以指定要显示的纵向图片个数。(默认为1个)</description>
<description xml:lang="en">You can set the number of images to display. (5 as default)</description>
<description xml:lang="es">Usted puede definir el número de imágenes a mostrar. (predefinido: 5 )</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>
<name xml:lang="es">Mostrar el Autor</name>
<type>select</type>
<description />
<options>
<name xml:lang="ko">표시</name>
<name xml:lang="jp">表示</name>
<name xml:lang="zh-CN">显示</name>
<name xml:lang="en">Show</name>
<name xml:lang="es">Mostrar</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<name xml:lang="jp">非表示</name>
<name xml:lang="zh-CN">不显示</name>
<name xml:lang="en">Hide</name>
<name xml:lang="es">Ocultar</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>
<name xml:lang="es">Mostrar el día agregado</name>
<type>select</type>
<description />
<options>
<name xml:lang="ko">표시</name>
<name xml:lang="jp">表示</name>
<name xml:lang="zh-CN">显示</name>
<name xml:lang="en">Show</name>
<name xml:lang="es">Mostrar</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<name xml:lang="jp">非表示</name>
<name xml:lang="zh-CN">不显示</name>
<name xml:lang="en">Hide</name>
<name xml:lang="es">Ocultar</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>
<name xml:lang="es">Mostrar Ayuda</name>
<description />
<type>select</type>
<options>
<name xml:lang="ko">표시</name>
<name xml:lang="jp">表示</name>
<name xml:lang="zh-CN">显示</name>
<name xml:lang="en">Show</name>
<name xml:lang="es">Mostrar</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<name xml:lang="jp">非表示</name>
<name xml:lang="zh-CN">不显示</name>
<name xml:lang="en">Hide</name>
<name xml:lang="es">Ocultar</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>
<name xml:lang="es">Mostrar Recomendados</name>
<description />
<type>select</type>
<options>
<name xml:lang="ko">표시</name>
<name xml:lang="jp">表示</name>
<name xml:lang="zh-CN">显示</name>
<name xml:lang="en">Show</name>
<name xml:lang="es">Mostrar</name>
<value>Y</value>
</options>
<options>
<name xml:lang="ko">표시하지 않음</name>
<name xml:lang="jp">非表示</name>
<name xml:lang="zh-CN">不显示</name>
<name xml:lang="en">Hide</name>
<name xml:lang="es">Ocultar</name>
<value>N</value>
</options>
</var>
<var id="mid_list">
<name xml:lang="ko">대상 모듈</name>
<name xml:lang="zh-CN">模块对象</name>
<name xml:lang="jp">モジュール</name>
<name xml:lang="en">Target Module</name>
<name xml:lang="es">Módulo Objetivo</name>
<type>mid_list</type>
<description xml:lang="ko">선택하신 모듈에 등록된 글을 대상으로 합니다.</description>
<description xml:lang="zh-CN">将把被选模块当中的主题作为对象。</description>
<description xml:lang="jp">チェックされたモジュールに登録されたコンテンツ(書き込み)を対象とします。</description>
<description xml:lang="en">The target articles to be sorted will be the ones submitted in the selected module.</description>
<description xml:lang="es">El objetivo de los documentos agregados serán los del módulo selccionado.</description>
</var>
</extra_vars>
</widget>

View file

@ -0,0 +1,16 @@
<query id="getDocumentList" action="select">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="category_srl" var="category_srl" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="list_order" order="order_type" />
<list_count var="list_count" default="20" />
</navigation>
</query>

View file

@ -0,0 +1,44 @@
.nw_box { padding-bottom:5px; overflow:hidden; position:relative;}
.nw_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;}
.nw_box .more { position:absolute; top:12px; right:11px; color:#000000; font:.8em Tahoma;}
.nw_box a.more { text-decoration:none;}
.nw_box a.more:hover { text-decoration:underline;}
.nw_box .listTable { width:100%; table-layout:fixed; border:none;}
.nw_box .listTable tr td { border-bottom:1px dotted #DEDEDE; padding-bottom:3px; margin-bottom:3px; vertical-align:top; overflow:hidden; }
.nw_box .thumbnailBox { width:100%; border:none; }
.nw_box .thumbnailBox tr td { border-bottom:none; padding:none; margin:none; }
.nw_box .thumbnailBox .thumbnail { text-align:center; padding:6px; }
.nw_box .thumbnailBox .thumbnail img { padding:4px; border:1px solid #DEDEDE; }
.nw_box .thumbnailBox .thumbnail img:hover { border:1px solid #54564b; }
.nw_box .thumbnailBox .desc { padding-left:5px; }
.nw_box .thumbnailBox .titleBox { margin-top:8px; margin-bottom:5px;}
.nw_box .thumbnailBox .titleBox .title { }
.nw_box .thumbnailBox .titleBox .title strong { font-weight:bold; font-size:0.9em; color:#ed2a32; }
.nw_box .thumbnailBox .titleBox .title a { color:#000000; text-decoration:none; }
.nw_box .thumbnailBox .titleBox .title a:hover { text-decoration:underline; }
.nw_box .thumbnailBox .titleBox .regdate { font-size:0.9em; color:#AAAAAA; }
.nw_box .thumbnailBox .contentBox { overflow:hidden; margin-bottom:5px;}
.nw_box .thumbnailBox .authorBox { margin-top:5px; }
.nw_box .thumbnailBox .author { color:#54564b; margin-right:10px;}
.nw_box .thumbnailBox .author span,div { color:#54564b; }
.nw_box .thumbnailBox .readAndVoted { color:#999999; font-size:0.9em; }
.nw_box .thumbnailBox .readAndVoted span.div_block { color:#333333; font-size:0.9em; }
.nw_box .thumbnailBox .readAndVoted strong { color:#FE6700; }
.nw_box .thumbnailBox td.bottomBorder { border-bottom:1px dashed #EEEEEE; padding-bottom:5px; }

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,91 @@
<!-- 설정된 컬러셋의 종류에 따라서 css파일을 import 합니다 -->
<!--@if($colorset=="normal"||!$colorset)-->
<!--%import("css/normal.css")-->
<!--@end-->
<div class="nw_box">
<!--@if($widget_info->title)-->
<h2>{$widget_info->title}</h2>
<!--@end-->
<!--@if(count($widget_info->document_list))-->
<div>
<table cellspacing="0" class="listTable">
{@ $count = 0; }
<!--@for($i=0;$i<$widget_info->rows_list_count;$i++)-->
<tr valign="top">
<!--@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-->><!--@if($oDocument->document_srl)-->
<table cellspacing="0" class="thumbnailBox">
<col width="{$widget_info->thumbnail_width+30}" />
<col />
<tr>
<td class="thumbnail" height="100">
<a href="{getUrl('','document_srl',$oDocument->document_srl)}"><img src="{$oDocument->getThumbnail($widget_info->thumbnail_width,$widget_info->thumbnail_height,$widget_info->thumbnail_type)}" border="0" alt="" /></a>
</td>
<td class="desc">
<div class="titleBox">
<span class="title">
<a href="{$oDocument->getPermanentUrl()}#{$oDocument->getCommentCount()}">{$oDocument->getTitleText($widget_info->subject_cut_size)}</a>
<!--@if($oDocument->getCommentCount())--><strong>[{$oDocument->getCommentCount()}]</strong><!--@end-->
</span>
<!--@if($widget_info->display_regdate == 'Y')-->
<span class="regdate">[{$oDocument->getRegdate("m-d")}]</span>
<!--@end-->
</div>
<div class="contentbox">
{$oDocument->getSummary($widget_info->content_cut_size)}
</div>
<!--@if($widget_info->display_author == 'Y' || $widget_info->display_readed_count == 'Y' || $widget_info->display_voted_count == 'Y' )-->
<div class="authorBox">
<!--@if($widget_info->display_author == 'Y')-->
<span class="author"><span class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</span></span>
<!--@end-->
<!--@if($widget_info->display_readed_count == 'Y' || $widget_info->display_voted_count == 'Y' )-->
<span 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')-->, <!--@end-->
{$lang->voted_count} <strong>{$oDocument->get('voted_count')}</strong>
<!--@end-->
</span>
<!--@end-->
</div>
<!--@end-->
<!--@end-->
</td>
</tr>
</table>
</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">Display newest documents like webzine style</title>
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 11. 22">
<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">글 목록과 이미지가 같이 출력되는 웹진형 스킨입니다. 이미지가 있는 글들만 노출이 됩니다.</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>

View file

@ -0,0 +1,108 @@
<?php
/**
* @class webzine
* @author zero (zero@nzeo.com)
* @brief 최근글을 이미지와 같이 웹진형으로 출력
* @version 0.1
**/
class webzine extends WidgetHandler {
/**
* @brief 위젯의 실행 부분
*
* ./widgets/위젯/conf/info.xml 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args) {
// 글자 제목 길이
$widget_info->subject_cut_size = (int)$args->subject_cut_size;
if(!$widget_info->subject_cut_size) $widget_info->subject_cut_size = 10;
// 내용 길이
$widget_info->content_cut_size = (int)$args->content_cut_size ;
if(!$widget_info->content_cut_size) $widget_info->content_cut_size= 50;
// 썸네일 생성 방법
$widget_info->thumbnail_type = $args->thumbnail_type;
if(!$widget_info->thumbnail_type) $widget_info->thumbnail_type = 'crop';
// 썸네일 가로 크기
$widget_info->thumbnail_width = (int)$args->thumbnail_width;
if(!$widget_info->thumbnail_width) $widget_info->thumbnail_width = 100;
// 썸네일 세로 크기
$widget_info->thumbnail_height = (int)$args->thumbnail_height;
if(!$widget_info->thumbnail_height) $widget_info->thumbnail_height = 100;
// 세로 이미지 수
$widget_info->rows_list_count = (int)$args->rows_list_count;
if(!$widget_info->rows_list_count) $widget_info->rows_list_count = 1;
// 가로 이미지 수
$widget_info->cols_list_count = (int)$args->cols_list_count;
if(!$widget_info->cols_list_count) $widget_info->cols_list_count = 5;
// 노출 여부 체크
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);
// 템플릿 파일에서 사용할 변수들을 세팅
if(count($mid_list)==1) $widget_info->module_name = $mid_list[0];
// 변수 정리
$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);
if(is_array($module_srl_list)) $obj->module_srls = implode(",",$module_srl_list);
else $obj->module_srls = $module_srl_list;
$obj->direct_download = 'Y';
$obj->isvalid = 'Y';
// 정해진 모듈에서 문서별 파일 목록을 구함
$files_output = executeQuery("file.getOneFileInDocument", $obj);
$oDocumentModel = &getModel('document');
if(count($files_output->data)) {
foreach($files_output->data as $key => $val) {
$oDocument = null;
$oDocument = $oDocumentModel->getDocument();
$oDocument->setAttribute($val);
$document_list[] = $oDocument;
}
}
$document_count = count($document_list);
$total_count = $widget_info->rows_list_count * $widget_info->cols_list_count;
for($i=$document_count;$i<$total_count;$i++) $document_list[] = new DocumentItem();
$widget_info->document_list = $document_list;
Context::set('widget_info', $widget_info);
// 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// 템플릿 파일을 지정
$tpl_file = 'list';
// 템플릿 컴파일
$oTemplate = &TemplateHandler::getInstance();
$output = $oTemplate->compile($tpl_path, $tpl_file);
return $output;
}
}
?>