本文整理汇总了PHP中Feed::getRemoteFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::getRemoteFeed方法的具体用法?PHP Feed::getRemoteFeed怎么用?PHP Feed::getRemoteFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::getRemoteFeed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawAdminBoxEnd
?>
<li class="empty">글이 없습니다.</li>
<?php
}
?>
</ul>
</div>
<?php echo drawAdminBoxEnd();?>
</div>
<!-- new version -->
<div id="new_version_sidebar" class="sidebar_item">
<?php
list($feedItems, $totalFeedItems) = FeedItem::getFeedItems('blogURL','itcanus.net/bloglounge_download',Feed::blogURL2Id('http://itcanus.net/bloglounge_download'),1,10);
if($totalFeedItems==0) { // 자동등록된 공지사항 피드를 삭제하였을경우 .. 동적으로 읽어 온다.
list($status, $feed, $xml) = Feed::getRemoteFeed('http://itcanus.net/bloglounge_download/rss');
if($status == 0) {
$feedItems = Feed::getFeedItems($xml);
if(count($feedItems) > 10) $feedItems = array_slice($feedItems, 0,10);
$totalFeedItems = count($feedItems);
}
}
?>
<?php echo drawAdminBoxBegin('new_version');?>
<div class="title">
<a href="http://itcanus.net/bloglounge_download" target="_blank"><?php echo _t('다운로드');?></a> <span class="subtitle"><?php echo _t('현재버전');?> v<?php echo BLOGLOUNGE_VERSION;?></span>
</div>
<div class="line"></div>
<div class="data">
<ul>
<?php
示例2: updateFeed
function updateFeed($feedURL){
global $database, $db, $event;
if (preg_match("/^[0-9]+$/", $feedURL))
$feedURL = $db->queryCell('SELECT xmlURL FROM '.$database['prefix'].'Feeds WHERE id="'.$feedURL.'"');
list($feedId, $lastUpdate, $autoUpdate, $feedVisibility, $isVerified, $owner) = $db->pick('SELECT id, lastUpdate, autoUpdate, visibility, isVerified, owner FROM '.$database['prefix'].'Feeds WHERE xmlURL="'.$feedURL.'"');
$result = $event->on('Add.checkFeed', array($feedURL, $feedId));
if(is_array($result) && count($result)>=3) {
list($status, $feed, $xml) = $result;
} else {
$feedURL = trim('http://' . str_replace('http://','',$feedURL));
list($status, $feed, $xml) = Feed::getRemoteFeed($feedURL);
}
if ($status > 0){
$db->execute("UPDATE {$database['prefix']}Feeds SET lastUpdate = ".gmmktime()." WHERE xmlURL = '{$feedURL}'");
return array(0, $db->queryCell('SELECT title FROM '.$database['prefix'].'Feeds WHERE xmlURL = "' . $feedURL . '"'), 0);
} else{
$sQuery = (Validator::getBool($autoUpdate)) ? "title = '{$feed['title']}', description = '{$feed['description']}', " : '';
$db->execute("UPDATE {$database['prefix']}Feeds SET blogURL = '{$feed['blogURL']}', $sQuery language = '{$feed['language']}', lastUpdate = ".gmmktime()." WHERE xmlURL = '{$feedURL}'");
if(Validator::getBool(Settings::get('useVerifier')) && $owner != 1 && !Validator::getBool($isVerified)) {
if(!$this->checkVerifier($feedId,$feedURL,$xml)) {
return array(false, $feed['title']);
} else {
$db->execute("UPDATE {$database['prefix']}Feeds SET isVerified = 'y' WHERE xmlURL = '{$feedURL}'");
}
}
$this->updated = 0;
$result = $this->saveFeedItems($feedId,$feedVisibility,$xml)?0:1;
return array($result, $feed['title'], $this->updated);
}
}