Content 위젯, RSS리더 기능 강화. (ATOM 1.0 Spec 사용시 작성자 홈페이지 정보가 있으면 링크되게 수정, Feed에 원본 홈페이지 링크 표시 되게 스킨 수정)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5882 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2009-03-16 13:12:32 +00:00
parent 6e897213c2
commit 6c25d6f583
3 changed files with 643 additions and 628 deletions

View file

@ -9,7 +9,7 @@
<description xml:lang="zh-CN">以各种样式显示主题,评论,附件等站内内容的全局控件。</description> <description xml:lang="zh-CN">以各种样式显示主题,评论,附件等站内内容的全局控件。</description>
<description xml:lang="zh-TW">是種可輸出討論板、評論,附加檔案等內容的控件。</description> <description xml:lang="zh-TW">是種可輸出討論板、評論,附加檔案等內容的控件。</description>
<version>0.1</version> <version>0.1</version>
<date>2009-02-10</date> <date>2009-03-16</date>
<author email_address="sol@ngleader.com" link="http://www.ngleader.com"> <author email_address="sol@ngleader.com" link="http://www.ngleader.com">
<name xml:lang="ko">sol</name> <name xml:lang="ko">sol</name>
@ -546,7 +546,8 @@
<name xml:lang="en">RSS URL</name> <name xml:lang="en">RSS URL</name>
<name xml:lang="ru">RSS URL</name> <name xml:lang="ru">RSS URL</name>
<name xml:lang="zh-TW">RSS URL</name> <name xml:lang="zh-TW">RSS URL</name>
<description xml:lang="ko">RSS URL은 타입이 RSS일 경우 등록되어야 합니다.</description> <description xml:lang="ko">RSS URL은 타입이 RSS일 경우 등록되어야 합니다.
(지원 문서 형식 : RSS 2.0, RSS 1.0, ATOM 1.0)</description>
<description xml:lang="zh-TW">RSS URL은 타입이 RSS일 경우 등록되어야 합니다.</description> <description xml:lang="zh-TW">RSS URL은 타입이 RSS일 경우 등록되어야 합니다.</description>
</var> </var>
<var id="rss_url1"> <var id="rss_url1">

View file

@ -483,7 +483,9 @@
$content_items[] = $content_item; $content_items[] = $content_item;
} }
/*
} elseif($xml_doc->{'rdf:RDF'}) { } elseif($xml_doc->{'rdf:RDF'}) {
// rss1.0 지원 by misol
$rss->title = $xml_doc->{'rdf:RDF'}->channel->title->body; $rss->title = $xml_doc->{'rdf:RDF'}->channel->title->body;
$rss->link = $xml_doc->{'rdf:RDF'}->channel->link->body; $rss->link = $xml_doc->{'rdf:RDF'}->channel->link->body;
@ -516,7 +518,9 @@
$content_items[] = $content_item; $content_items[] = $content_item;
} }
*/
} elseif($xml_doc->{'rdf:rdf'}) { } elseif($xml_doc->{'rdf:rdf'}) {
// rss1.0 지원 (Xml이 대소문자를 구분해야 하는데 XE의 XML파서가 전부 소문자로 바꾸는 바람에 생긴 case) by misol
$rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body; $rss->title = $xml_doc->{'rdf:rdf'}->channel->title->body;
$rss->link = $xml_doc->{'rdf:rdf'}->channel->link->body; $rss->link = $xml_doc->{'rdf:rdf'}->channel->link->body;
@ -550,6 +554,7 @@
$content_items[] = $content_item; $content_items[] = $content_item;
} }
} elseif($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') { } elseif($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') {
// Atom 1.0 spec 지원 by misol
$rss->title = $xml_doc->feed->title->body; $rss->title = $xml_doc->feed->title->body;
$links = $xml_doc->feed->link; $links = $xml_doc->feed->link;
if(is_array($links)) { if(is_array($links)) {
@ -596,6 +601,7 @@
} }
$content_item->setTitle($item->title); $content_item->setTitle($item->title);
$content_item->setNickName(max($item->author,$item->{'dc:creator'})); $content_item->setNickName(max($item->author,$item->{'dc:creator'}));
$content_item->setAuthorSite($value->author->uri->body);
//$content_item->setCategory($item->category); //$content_item->setCategory($item->category);
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->content); $item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->content);
if($item->description) { if($item->description) {
@ -767,6 +773,11 @@
function setNickName($nick_name){ function setNickName($nick_name){
$this->add('nick_name',$nick_name); $this->add('nick_name',$nick_name);
} }
// 글 작성자의 홈페이지 주소를 저장 by misol
function setAuthorSite($site_url){
$this->add('author_site',$site_url);
}
function setCategory($category){ function setCategory($category){
$this->add('category',$category); $this->add('category',$category);
} }
@ -804,6 +815,9 @@
function getNickName(){ function getNickName(){
return $this->get('nick_name'); return $this->get('nick_name');
} }
function getAuthorSite(){
return $this->get('author_site');
}
function getCommentCount(){ function getCommentCount(){
$comment_count = $this->get('comment_count'); $comment_count = $this->get('comment_count');
return $comment_count>0 ? $comment_count : ''; return $comment_count>0 ? $comment_count : '';

View file

@ -8,7 +8,7 @@
<td class="title"> <td class="title">
<!--@if($widget_info->show_browser_title=='Y' && $item->getBrowserTitle())--> <!--@if($widget_info->show_browser_title=='Y' && $item->getBrowserTitle())-->
<a href="{getSiteUrl($item->domain, '', 'mid', $item->get('mid'))}"><strong class="board">{$item->getBrowserTitle()}</strong></a> <a href="<!--@if($item->domain)-->{getSiteUrl($item->domain, '', 'mid', $item->get('mid'))}<!--@elseif($item->getContentsLink())-->{$item->getContentsLink()}<!--@end-->"><strong class="board">{$item->getBrowserTitle()}</strong></a>
<!--@end--> <!--@end-->
<!--@if($widget_info->show_category=='Y' && $item->get('category_srl') )--> <!--@if($widget_info->show_category=='Y' && $item->get('category_srl') )-->
<a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'category',$item->get('category_srl'))}"><strong class="category">{$item->getCategory()}</strong></a> <a href="{getSiteUrl($item->domain,'','mid',$item->get('mid'),'category',$item->get('category_srl'))}"><strong class="category">{$item->getCategory()}</strong></a>
@ -29,7 +29,7 @@
<!--@end--> <!--@end-->
</td> </td>
<!--@else if($v=='nickname')--> <!--@else if($v=='nickname')-->
<td><a href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}">{$item->getNickName()}</a></td> <td><a <!--@if($item->getMemberSrl())-->href="#" onclick="return false;" class="author member_{$item->getMemberSrl()}"<!--@elseif($item->getAuthorSite())-->href="{$item->getAuthorSite()}" onclick="window.open(this.href); return false;" class="author member"<!--@else-->href="#" onclick="return false;" class="author member"<!--@end--> >{$item->getNickName()}</a></td>
<!--@else if($v=='regdate')--> <!--@else if($v=='regdate')-->
<td class="time"><span class="date">{$item->getRegdate("Y-m-d")}</span> <span class="hour">{$item->getRegdate("H:i")}</span></td> <td class="time"><span class="date">{$item->getRegdate("Y-m-d")}</span> <span class="hour">{$item->getRegdate("H:i")}</span></td>
<!--@end--> <!--@end-->