mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
NOISSUE PHP 버전 호환성 개선
This commit is contained in:
parent
e49c7265ff
commit
c5c69bba4e
1 changed files with 73 additions and 67 deletions
|
|
@ -49,10 +49,10 @@ class mcontent extends WidgetHandler
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$obj = new stdClass();
|
||||||
// Apply to all modules in the site if a target module is not specified
|
// Apply to all modules in the site if a target module is not specified
|
||||||
if(!$args->module_srls)
|
if(!$args->module_srls)
|
||||||
{
|
{
|
||||||
$obj = new stdClass();
|
|
||||||
$obj->site_srl = (int)$site_module_info->site_srl;
|
$obj->site_srl = (int)$site_module_info->site_srl;
|
||||||
$output = executeQueryArray('widgets.content.getMids', $obj);
|
$output = executeQueryArray('widgets.content.getMids', $obj);
|
||||||
if($output->data)
|
if($output->data)
|
||||||
|
|
@ -170,6 +170,7 @@ class mcontent extends WidgetHandler
|
||||||
function _getCommentItems($args)
|
function _getCommentItems($args)
|
||||||
{
|
{
|
||||||
// CommentModel:: getCommentList() to take advantage of the variable order
|
// CommentModel:: getCommentList() to take advantage of the variable order
|
||||||
|
$obj = new stdClass();
|
||||||
$obj->module_srl = $args->module_srl;
|
$obj->module_srl = $args->module_srl;
|
||||||
$obj->sort_index = $args->order_target;
|
$obj->sort_index = $args->order_target;
|
||||||
$obj->list_count = $args->list_count;
|
$obj->list_count = $args->list_count;
|
||||||
|
|
@ -270,6 +271,7 @@ class mcontent extends WidgetHandler
|
||||||
{
|
{
|
||||||
$oDocumentModel = &getModel('document');
|
$oDocumentModel = &getModel('document');
|
||||||
|
|
||||||
|
$obj = new stdClass();
|
||||||
$obj->module_srls = $obj->module_srl = $args->module_srl;
|
$obj->module_srls = $obj->module_srl = $args->module_srl;
|
||||||
$obj->direct_download = 'Y';
|
$obj->direct_download = 'Y';
|
||||||
$obj->isvalid = 'Y';
|
$obj->isvalid = 'Y';
|
||||||
|
|
@ -420,6 +422,7 @@ class mcontent extends WidgetHandler
|
||||||
|
|
||||||
$oXmlParser = new XmlParser();
|
$oXmlParser = new XmlParser();
|
||||||
$xml_doc = $oXmlParser->parse($buff);
|
$xml_doc = $oXmlParser->parse($buff);
|
||||||
|
$rss = new stdClass();
|
||||||
if($xml_doc->rss)
|
if($xml_doc->rss)
|
||||||
{
|
{
|
||||||
$rss->title = $xml_doc->rss->channel->title->body;
|
$rss->title = $xml_doc->rss->channel->title->body;
|
||||||
|
|
@ -436,6 +439,7 @@ class mcontent extends WidgetHandler
|
||||||
{
|
{
|
||||||
if($key >= $args->list_count) break;
|
if($key >= $args->list_count) break;
|
||||||
unset($item);
|
unset($item);
|
||||||
|
$item = new stdClass();
|
||||||
|
|
||||||
foreach($value as $key2 => $value2)
|
foreach($value as $key2 => $value2)
|
||||||
{
|
{
|
||||||
|
|
@ -474,6 +478,7 @@ class mcontent extends WidgetHandler
|
||||||
{
|
{
|
||||||
if($key >= $args->list_count) break;
|
if($key >= $args->list_count) break;
|
||||||
unset($item);
|
unset($item);
|
||||||
|
$item = new stdClass();
|
||||||
|
|
||||||
foreach($value as $key2 => $value2)
|
foreach($value as $key2 => $value2)
|
||||||
{
|
{
|
||||||
|
|
@ -495,84 +500,85 @@ class mcontent extends WidgetHandler
|
||||||
$content_items[] = $content_item;
|
$content_items[] = $content_item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom') {
|
else if($xml_doc->feed && $xml_doc->feed->attrs->xmlns == 'http://www.w3.org/2005/Atom')
|
||||||
// Atom 1.0 spec supported by misol
|
|
||||||
$rss->title = $xml_doc->feed->title->body;
|
|
||||||
$links = $xml_doc->feed->link;
|
|
||||||
if(is_array($links))
|
|
||||||
{
|
|
||||||
foreach ($links as $value)
|
|
||||||
{
|
{
|
||||||
if($value->attrs->rel == 'alternate')
|
// Atom 1.0 spec supported by misol
|
||||||
{
|
$rss->title = $xml_doc->feed->title->body;
|
||||||
$rss->link = $value->attrs->href;
|
$links = $xml_doc->feed->link;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
|
|
||||||
|
|
||||||
$items = $xml_doc->feed->entry;
|
|
||||||
|
|
||||||
if(!$items) return;
|
|
||||||
if($items && !is_array($items)) $items = array($items);
|
|
||||||
|
|
||||||
$content_items = array();
|
|
||||||
|
|
||||||
foreach ($items as $key => $value)
|
|
||||||
{
|
|
||||||
if($key >= $args->list_count) break;
|
|
||||||
unset($item);
|
|
||||||
|
|
||||||
foreach($value as $key2 => $value2)
|
|
||||||
{
|
|
||||||
if(is_array($value2)) $value2 = array_shift($value2);
|
|
||||||
$item->{$key2} = $this->_getRssBody($value2);
|
|
||||||
}
|
|
||||||
|
|
||||||
$content_item = new mcontentItem($rss->title);
|
|
||||||
$links = $value->link;
|
|
||||||
if(is_array($links))
|
if(is_array($links))
|
||||||
{
|
{
|
||||||
foreach ($links as $val)
|
foreach ($links as $value)
|
||||||
{
|
{
|
||||||
if($val->attrs->rel == 'alternate')
|
if($value->attrs->rel == 'alternate')
|
||||||
{
|
{
|
||||||
$item->link = $val->attrs->href;
|
$rss->link = $value->attrs->href;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
|
else if($links->attrs->rel == 'alternate') $rss->link = $links->attrs->href;
|
||||||
|
|
||||||
$content_item->setContentsLink($rss->link);
|
$items = $xml_doc->feed->entry;
|
||||||
if($item->title)
|
|
||||||
|
if(!$items) return;
|
||||||
|
if($items && !is_array($items)) $items = array($items);
|
||||||
|
|
||||||
|
$content_items = array();
|
||||||
|
|
||||||
|
foreach ($items as $key => $value)
|
||||||
{
|
{
|
||||||
if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
|
if($key >= $args->list_count) break;
|
||||||
|
unset($item);
|
||||||
|
|
||||||
|
foreach($value as $key2 => $value2)
|
||||||
|
{
|
||||||
|
if(is_array($value2)) $value2 = array_shift($value2);
|
||||||
|
$item->{$key2} = $this->_getRssBody($value2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$content_item = new mcontentItem($rss->title);
|
||||||
|
$links = $value->link;
|
||||||
|
if(is_array($links))
|
||||||
|
{
|
||||||
|
foreach ($links as $val)
|
||||||
|
{
|
||||||
|
if($val->attrs->rel == 'alternate')
|
||||||
|
{
|
||||||
|
$item->link = $val->attrs->href;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($links->attrs->rel == 'alternate') $item->link = $links->attrs->href;
|
||||||
|
|
||||||
|
$content_item->setContentsLink($rss->link);
|
||||||
|
if($item->title)
|
||||||
|
{
|
||||||
|
if(stripos($value->title->attrs->type, "html") === FALSE) $item->title = $value->title->body;
|
||||||
|
}
|
||||||
|
$content_item->setTitle($item->title);
|
||||||
|
$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
|
||||||
|
$content_item->setAuthorSite($value->author->uri->body);
|
||||||
|
|
||||||
|
//$content_item->setCategory($item->category);
|
||||||
|
$item->description = ($item->content) ? $item->content : $item->description = $item->summary;
|
||||||
|
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
|
||||||
|
|
||||||
|
if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
|
||||||
|
{
|
||||||
|
$item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
|
||||||
|
$content_item->setLink($item->link);
|
||||||
|
$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));
|
||||||
|
$content_item->setRegdate($date);
|
||||||
|
|
||||||
|
$content_items[] = $content_item;
|
||||||
}
|
}
|
||||||
$content_item->setTitle($item->title);
|
|
||||||
$content_item->setNickName(max($item->author,$item->{'dc:creator'}));
|
|
||||||
$content_item->setAuthorSite($value->author->uri->body);
|
|
||||||
|
|
||||||
//$content_item->setCategory($item->category);
|
|
||||||
$item->description = ($item->content) ? $item->content : $item->description = $item->summary;
|
|
||||||
$item->description = preg_replace('!<a href=!is','<a onclick="window.open(this.href);return false" href=', $item->description);
|
|
||||||
|
|
||||||
if(($item->content && stripos($value->content->attrs->type, "html") === FALSE) || (!$item->content && stripos($value->summary->attrs->type, "html") === FALSE))
|
|
||||||
{
|
|
||||||
$item->description = htmlspecialchars($item->description, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$content_item->setContent($this->_getSummary($item->description, $args->content_cut_size));
|
|
||||||
$content_item->setLink($item->link);
|
|
||||||
$date = date('YmdHis', strtotime(max($item->published,$item->updated,$item->{'dc:date'})));
|
|
||||||
$content_item->setRegdate($date);
|
|
||||||
|
|
||||||
$content_items[] = $content_item;
|
|
||||||
}
|
}
|
||||||
}
|
return $content_items;
|
||||||
return $content_items;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _getTrackbackItems($args){
|
function _getTrackbackItems($args){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue