diff --git a/widgets/newest_images/conf/info.xml b/widgets/newest_images/conf/info.xml new file mode 100644 index 000000000..ecfdc7309 --- /dev/null +++ b/widgets/newest_images/conf/info.xml @@ -0,0 +1,30 @@ + + + 최근 이미지 출력 + + 제로 + 작성된 글의 내용에 포함된 이미지를 출력하는 위젯입니다. + + + + 글 제목 길이 + text + 정한 글자수만큼 글 제목을 잘라서 출력합니다. (기본 10자) + + + 이미지 가로크기 + text + 출력될 이미지의 가로크기를 정하실 수 있습니다. (기본 100) + + + 이미지 수 + text + 출력될 이미지의 수를 정하실 수 있습니다. (기본 5개) + + + 대상 모듈 + mid_list + 선택하신 모듈에 등록된 글을 대상으로 합니다. + + + diff --git a/widgets/newest_images/newest_images.class.php b/widgets/newest_images/newest_images.class.php new file mode 100644 index 000000000..6ca751ec9 --- /dev/null +++ b/widgets/newest_images/newest_images.class.php @@ -0,0 +1,60 @@ +title_length; + if(!$title_length) $title_length = 10; + $thumbnail_width = (int)$args->thumbnail_width; + if(!$thumbnail_width) $thumbnail_width = 100; + + $list_count = (int)$args->list_count; + if(!$list_count) $list_count = 5; + $mid_list = explode(",",$args->mid_list); + + // DocumentModel::getDocumentList()를 이용하기 위한 변수 정리 + $obj->mid = $mid_list; + $obj->sort_index = $order_target; + $obj->list_count = $list_count*2; + + // document 모듈의 model 객체를 받아서 getDocumentList() method를 실행 + $oDocumentModel = &getModel('document'); + $output = $oDocumentModel->getDocumentList($obj); + + // 템플릿 파일에서 사용할 변수들을 세팅 + if(count($mid_list)==1) $widget_info->module_name = $mid_list[0]; + + $widget_info->document_list = $output->data; + $widget_info->title_length = $title_length; + $widget_info->thumbnail_width = $thumbnail_width; + $widget_info->list_count = $list_count; + + 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; + } + } +?> diff --git a/widgets/newest_images/skins/default/css/normal.css b/widgets/newest_images/skins/default/css/normal.css new file mode 100644 index 000000000..ef0b56689 --- /dev/null +++ b/widgets/newest_images/skins/default/css/normal.css @@ -0,0 +1,7 @@ +.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 a:hover { font-weight:bold; letter-spacing:-1px; } +.ni_box .ni_item img { padding:5px; } +.ni_box .ni_item img:hover { border:1px solid #888888; padding:4px;} diff --git a/widgets/newest_images/skins/default/images/blank.gif b/widgets/newest_images/skins/default/images/blank.gif new file mode 100644 index 000000000..35d42e808 Binary files /dev/null and b/widgets/newest_images/skins/default/images/blank.gif differ diff --git a/widgets/newest_images/skins/default/list.html b/widgets/newest_images/skins/default/list.html new file mode 100644 index 000000000..f428eda28 --- /dev/null +++ b/widgets/newest_images/skins/default/list.html @@ -0,0 +1,30 @@ + + + + + + +
+ +
+
diff --git a/widgets/newest_images/skins/default/skin.xml b/widgets/newest_images/skins/default/skin.xml new file mode 100644 index 000000000..fea65b307 --- /dev/null +++ b/widgets/newest_images/skins/default/skin.xml @@ -0,0 +1,13 @@ + + + 최신 이미지 위젯 기본 스킨 + + 제로 + 최신 이미지 위젯의 기본 스킨입니다. + + + + 기본 컬러 + + +