포럼형 위젯 스킨 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3577 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-23 07:01:21 +00:00
parent 905826c0d1
commit 554ccd6d71
20 changed files with 339 additions and 0 deletions

View file

@ -73,6 +73,7 @@
* @brief 여러개의 module_srl에 해당하는 모듈의 정보를 구함
**/
function getModulesInfo($module_srls) {
if(is_array($module_srls)) $module_srls = implode(',',$module_srls);
$args->module_srls = $module_srls;
$output = executeQueryArray('module.getModulesInfo', $args);
if(!$output->toBool()) return;

View file

@ -0,0 +1,91 @@
<?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">포럼형 최근 게시물</title>
<title xml:lang="es">포럼형 최근 게시물</title>
<title xml:lang="ru">포럼형 최근 게시물</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2008. 1. 23">
<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="es">zero</name>
<name xml:lang="ru">zero</name>
<description xml:lang="ko">
한개 또는 여러개의 게시판을 포럼형식으로 정리하여 노출하는 위젯입니다.
대상 게시판에 설정되어 있는 제목과 설명을 이용하여 설명을 출력합니다.
</description>
<description xml:lang="zh-CN">
한개 또는 여러개의 게시판을 포럼형식으로 정리하여 노출하는 위젯입니다.
대상 게시판에 설정되어 있는 제목과 설명을 이용하여 설명을 출력합니다.
</description>
<description xml:lang="jp">
한개 또는 여러개의 게시판을 포럼형식으로 정리하여 노출하는 위젯입니다.
대상 게시판에 설정되어 있는 제목과 설명을 이용하여 설명을 출력합니다.
</description>
<description xml:lang="en">
한개 또는 여러개의 게시판을 포럼형식으로 정리하여 노출하는 위젯입니다.
대상 게시판에 설정되어 있는 제목과 설명을 이용하여 설명을 출력합니다.
</description>
<description xml:lang="ru">
한개 또는 여러개의 게시판을 포럼형식으로 정리하여 노출하는 위젯입니다.
대상 게시판에 설정되어 있는 제목과 설명을 이용하여 설명을 출력합니다.
</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>
<name xml:lang="ru">Заголовок</name>
<type>text</type>
</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>
<name xml:lang="ru">Длительность индикации для новых объектов</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>
<description xml:lang="ru">Вы можете установить длительность индикации для нового объекта. (единица - час)</description>
</var>
<var id="subject_cut_size">
<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>
<name xml:lang="ru">Длина темы</name>
<type>text</type>
<description xml:lang="ko">제목 글자수를 지정할 수 있습니다. (0또는 비워주시면 자르지 않습니다)</description>
<description xml:lang="jp">タイトルの文字数が指定できます「0」または空欄の場合は、文字数を制限しません</description>
<description xml:lang="zh-CN">可以设置标题的字数。(0或留空为不限)</description>
<description xml:lang="en">Length of Subject can be assigned. (0 or blank value will not restrict the length)</description>
<description xml:lang="es">El largo del título puede ser asignado. (valor 0 o en blanco no restringe el largo)</description>
<description xml:lang="ru">Длина темы может быть присвоена. (0 или пустое значение не будут ограничивать длину)</description>
</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>
<name xml:lang="ru">Модуль назначения</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>
<description xml:lang="ru">Статьи назначения для сортировки будут теми, что были размещены в выбранном модуле.</description>
</var>
</extra_vars>
</widget>

View file

@ -0,0 +1,95 @@
<?php
/**
* @class forum
* @author zero (zero@nzeo.com)
* @brief 최근 게시물을 출력하는 위젯
* @version 0.1
**/
class forum extends WidgetHandler {
/**
* @brief 위젯의 실행 부분
*
* ./widgets/위젯/conf/info.xml 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args) {
// 제목
$title = $args->title;
// 최근 글 표시 시간
$duration_new = $args->duration_new;
if(!$duration_new) $duration_new = 12;
// 제목 길이 자르기
$subject_cut_size = $args->subject_cut_size;
if(!$subject_cut_size) $subject_cut_size = 0;
// 대상 모듈
if($args->mid_list) $mid_list = explode(",",$args->mid_list);
else return;
// module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌
$oModuleModel = &getModel('module');
$module_srls = $oModuleModel->getModuleSrlByMid($mid_list);
// 대상 모듈의 정보를 구함
$module_list = $oModuleModel->getModulesInfo($module_srls);
// 각 모듈별로 먼저 정리 시작
foreach($module_list as $module) {
$modules[$module->module_srl]->title = $module->browser_title;
$modules[$module->module_srl]->mid = $module->mid;
$modules[$module->module_srl]->description = $module->description;
$modules[$module->module_srl]->document_count = 0;
$modules[$module->module_srl]->comment_count = 0;
// 최근 수정된 댓글의 정보
$last_args = null;
$last_args->module_srl = $module->module_srl;
$output = executeQuery('widgets.forum.getLatestComments', $last_args);
if(is_array($output->data)) $modules[$module->module_srl]->last_comment = array_pop($output->data);
else $modules[$module->module_srl]->last_comment = null;
}
// 각 모듈별 전체글을 구함
$total_documents_args->module_srl = $module->module_srl;
$total_documents_args->module_srls = implode(',',$module_srls);
$total_documents_output = executeQueryArray('widgets.forum.getTotalDocuments',$total_documents_args);
foreach($total_documents_output->data as $val) {
$modules[$val->module_srl]->document_count = $val->count;
}
// 각 모듈별 댓글 수를 구함
$total_comments_args->module_srl = $module->module_srl;
$total_comments_args->module_srls = implode(',',$module_srls);
$total_comments_output = executeQueryArray('widgets.forum.getTotalComments',$total_comments_args);
foreach($total_comments_output->data as $val) {
$modules[$val->module_srl]->comment_count = $val->count;
}
$widget_info->title = $title;
$widget_info->modules = $modules;
$widget_info->subject_cut_size = $subject_cut_size;
$widget_info->duration_new = $duration_new * 60*60;
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;
}
}
?>

View file

@ -0,0 +1,14 @@
<query id="getLatestComments" action="select">
<tables>
<table name="comments" />
</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>

View file

@ -0,0 +1,15 @@
<query id="getTotalComments" action="select">
<tables>
<table name="comments" />
</tables>
<columns>
<column name="module_srl" alias="module_srl"/>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" filter="numbers" notnull="notnull" />
</conditions>
<groups>
<group column="module_srl" />
</groups>
</query>

View file

@ -0,0 +1,15 @@
<query id="getTotalDocuments" action="select">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="module_srl" alias="module_srl"/>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srls" filter="numbers" notnull="notnull" />
</conditions>
<groups>
<group column="module_srl" />
</groups>
</query>

Binary file not shown.

View file

@ -0,0 +1,28 @@
.xeForum { background:url("../images/back.gif") repeat-x left top; padding:0; }
.xeForum div.forumTable { padding:0 6px 0 6px; }
.xeForum table { width:100%; border:0; table-layout:fixed; }
.xeForum table tr.top { height:22px; }
.xeForum table th { vertical-align:bottom; color:#ffffff; font-weight:normal; padding-bottom:5px; }
.xeForum table th.title { font-weight:normal; text-align:left; padding-left:10px; }
.xeForum table th.last_post { text-align:left; padding-left:15px; }
.xeForum table tr.content { background:#EFEFEF; height:55px; }
.xeForum table td.topic, .xeForum td.icon, .xeForum td.title, .xeForum td.topic, .xeForum td.replies , .xeForum td.last_post{ padding:5px 0 5px 0; border-top:1px solid #FFFFFF; }
.xeForum table td.topic, .xeForum td.icon, .xeForum td.title, .xeForum td.topic, .xeForum td.replies , .xeForum td.last_post{ padding:5px 0 5px 0; border-bottom:1px solid #6E6E6E; }
.xeForum table td.icon { text-align:center; }
.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 a { font-weight:normal; text-decoration:none; 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 { text-align:center; color:#3A3947; font-family:tahoma; font-size:8pt; }
.xeForum table td.last_post { text-align:left; color:#3A3947; font-family:tahoma; font-size:8pt; padding-left:15px; }
.xeForum table td.last_post div.author img { vertical-align:middle; }
.xeForum table td.last_post div.date { margin-top:5px; text-align:left; color:#3A3947; font-family:tahoma; font-size:8pt; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,020 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

View file

@ -0,0 +1,47 @@
<!--%import("css/common.css")-->
<div class="xeForum">
<img src="./images/lt.gif" alt="" class="fl" />
<img src="./images/rt.gif" alt="" class="fr" />
<div class="forumTable">
<table cellspacing="0" class="xeForum clear">
<col width="60" />
<col />
<col width="70" />
<col width="70" />
<col width="160" />
<tr class="top">
<th colspan="2" class="title"><!--@if($widget_info->title)-->{$widget_info->title}<!--@else-->&nbsp;<!--@end--></th>
<th class="topic">{$lang->topic}</th>
<th class="replies">{$lang->replies}</th>
<th class="last_post">{$lang->last_post}</th>
</tr>
<!--@foreach($widget_info->modules as $val)-->
<tr class="content">
<td class="icon"><img src="./images/icon.gif" alt="icon" /></td>
<td class="title">
<strong><a href="{getUrl('','mid',$val->mid)}">{$val->title}</a></strong>
<p>{$val->description}</p>
</td>
<td class="topic">{number_format($val->document_count)}</td>
<td class="replies">{number_format($val->comment_count)}</td>
<td class="last_post">
<!--@if($val->last_comment)-->
<div class="author">
<span class="member_{$val->last_comment->member_srl}">{$val->last_comment->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>
</div>
<div class="date">{zdate($val->last_comment->regdate,"Y-m-d H:i")}</div>
<!--@else-->
&nbsp;
<!--@end-->
</td>
</tr>
<!--@end-->
</table>
</div>
<img src="./images/lb.gif" alt="" class="fl" />
<img src="./images/rb.gif" alt="" class="fr" />
<div class="clear"></div>
</div>

View file

@ -0,0 +1,33 @@
<?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">기본 포럼형 위젯 스킨</title>
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2008. 1. 23">
<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="white">
<title xml:lang="ko">흰색 바탕용</title>
<title xml:lang="jp">白い背景用</title>
<title xml:lang="zh-CN">白色背景</title>
<title xml:lang="en">White Background</title>
</color>
</colorset>
</skin>