本文整理汇总了PHP中Feed::loadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::loadAll方法的具体用法?PHP Feed::loadAll怎么用?PHP Feed::loadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::loadAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rssmaker_plugin_action
function rssmaker_plugin_action($_, $myUser)
{
if ($_['action'] == 'show_folder_rss') {
header('Content-Type: text/xml; charset=utf-8');
$feedManager = new Feed();
$feeds = $feedManager->loadAll(array('folder' => $_['id']));
$items = array();
foreach ($feeds as $feed) {
$parsing = new SimplePie();
$parsing->set_feed_url($feed->getUrl());
$parsing->init();
$parsing->set_useragent('Mozilla/4.0 Leed (LightFeed Agregator) ' . VERSION_NAME . ' by idleman http://projet.idleman.fr/leed');
$parsing->handle_content_type();
// UTF-8 par défaut pour SimplePie
$items = array_merge($parsing->get_items(), $items);
}
$link = 'http://projet.idleman.fr/leed';
echo '<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<title>Leed dossier ' . $_['name'] . '</title>
<atom:link href="' . $link . '" rel="self" type="application/rss+xml"/>
<link>' . $link . '</link>
<description>Aggrégation des flux du dossier leed ' . $_['name'] . '</description>
<language>fr-fr</language>
<copyright>DWTFYW</copyright>
<pubDate>' . date('r', gmstrftime(time())) . '</pubDate>
<lastBuildDate>' . date('r', gmstrftime(time())) . '</lastBuildDate>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>Leed (LightFeed Agregator) ' . VERSION_NAME . '</generator>';
usort($items, 'rssmaker_plugin_compare');
foreach ($items as $item) {
echo '<item>
<title><![CDATA[' . $item->get_title() . ']]></title>
<link>' . $item->get_permalink() . '</link>
<pubDate>' . date('r', gmstrftime(strtotime($item->get_date()))) . '</pubDate>
<guid isPermaLink="true">' . $item->get_permalink() . '</guid>
<description>
<![CDATA[
' . $item->get_description() . '
]]>
</description>
<content:encoded><![CDATA[' . $item->get_content() . ']]></content:encoded>
<dc:creator>' . ('' == $item->get_author() ? 'Anonyme' : $item->get_author()->name) . '</dc:creator>
</item>';
}
echo '</channel></rss>';
}
}
示例2: OneSync_plugin_syncronyzeFolder
function OneSync_plugin_syncronyzeFolder(&$_)
{
if ($_['action'] == 'syncronyzeFolder') {
$myUser = isset($_SESSION['currentUser']) ? unserialize($_SESSION['currentUser']) : false;
if ($myUser == false) {
exit('Vous devez vous connecter pour cette action.');
}
if (isset($_['folder']) && $_['folder'] != '') {
error_log('zzz');
$feedManager = new Feed();
$feeds = $feedManager->loadAll(array('folder' => $_['folder']));
$syncId = time();
foreach ($feeds as $feed) {
$feed->parse($syncId);
}
}
header('location: ./index.php');
}
}
示例3: getFeeds
function getFeeds()
{
$feedManager = new Feed();
return $feedManager->loadAll(array('folder' => $this->getId()), 'name');
}