本文整理汇总了PHP中RSSFeed::display方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::display方法的具体用法?PHP RSSFeed::display怎么用?PHP RSSFeed::display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::display方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sprintf
case 'Profile':
if (isset($_POST['profiles_id']) && $_POST['profiles_id']) {
$item = new Profile_RSSFeed();
}
break;
case 'Entity':
$item = new Entity_RSSFeed();
break;
}
if (!is_null($item)) {
$item->add($_POST);
Event::log($_POST["rssfeeds_id"], "rssfeed", 4, "tools", sprintf(__('%s adds a target'), $_SESSION["glpiname"]));
}
}
Html::back();
} else {
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
Html::helpHeader(RSSFeed::getTypeName(Session::getPluralNumber()), '', $_SESSION["glpiname"]);
} else {
Html::header(RSSFeed::getTypeName(Session::getPluralNumber()), '', "tools", "rssfeed");
}
$rssfeed->display(array('id' => $_GET["id"]));
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
Html::helpFooter();
} else {
Html::footer();
}
}
}
}
}
示例2: while
FROM post
LEFT JOIN category ON category_id = post_category_id
WHERE post_valid=1
LIMIT 10');
while ($row = mysql_fetch_object($request)) {
// Creating a new feed item
$rssItem = new Item();
$rssItem->setTitle($row->post_title);
$rssItem->setDescription($row->post_description);
$rssItem->setLink('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id);
$rssItem->setGuid('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id, true);
$rssItem->setComments('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id . '#comments');
$rssItem->setAuthor($row->post_author_email, $row->post_author_name);
$rssItem->setPubDate($row->post_date);
$rssItem->setSource($row->post_source_uri, $row->post_source_name);
$rssItem->setEnclosure('http://www.mywebsite.com/blog/images/nopicture.jpg', 2800, 'image/jpg');
$rssItem->setCategory('http://www.mywebsite.com/blog/category.php.idCat=' . $row->category_id, $row->category_name);
// Add the item to the feed
$rssFeed->appendItem($rssItem);
}
// Save the feed
$rssFeed->save();
// SQL connection closing
mysql_close();
// Send headers to the browser
header('Content-Type: text/xml; charset=utf-8');
// Display the feed
$rssFeed->display();
} catch (RSSFeedException $e) {
echo $e->getErrorMessage();
}
示例3: RSSFeedItem
$oRssItem->setDescription('Rien à afficher -> Il faut toujours revoir les leçons du jour.');
$oRssItem->setLink($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath . '/login.php');
$oRssItem->setGuid($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath . '/login.php', true);
if (!empty($sEmail)) {
$oRssItem->setAuthor($sEmail, 'ADMIN');
}
$oRssItem->setPubDate(date("Y-m-d h:i:s"));
$oRssFeed->appendItem($oRssItem);
$oRssItem = null;
} else {
// Récupération de l'email
//$sEmail = getSettingValue("gepiSchoolEmail");
$sEmail = $rss_email_defaut;
$oRssItem = new RSSFeedItem();
$oRssItem->setTitle('ERREUR sur le CDT');
$oRssItem->setDescription('Rien à afficher -> Il faut toujours apprendre les leçons du jour.');
$oRssItem->setLink($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath . '/login.php');
$oRssItem->setGuid($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath . '/login.php', true);
if (!empty($sEmail)) {
$oRssItem->setAuthor($sEmail, 'ADMIN');
}
$oRssItem->setPubDate(date("Y-m-d h:i:s"));
$oRssFeed->appendItem($oRssItem);
$oRssItem = null;
}
// Sauvegarde du flux RSS
$oRssFeed->save('../temp/rss-news.xml');
// Affichage sur la sortie standard
header('Content-Type: text/xml; charset=UTF-8');
$oRssFeed->display();