本文整理汇总了PHP中RSS::printRSSFeed方法的典型用法代码示例。如果您正苦于以下问题:PHP RSS::printRSSFeed方法的具体用法?PHP RSS::printRSSFeed怎么用?PHP RSS::printRSSFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSS
的用法示例。
在下文中一共展示了RSS::printRSSFeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Blog
if (!empty($post->id)) {
$blog = $post->blog;
} else {
if (!empty($_GET["blogId"])) {
$blog = new Blog($_GET["blogId"]);
}
}
if (!empty($blog->id)) {
// Include language
include scriptPath . "/" . folderBlog . "/include/language/" . $blog->language . "/general.php";
// Get the post list
$items = array();
$result = $dbi->query("SELECT id,moduleContentId FROM " . commentTableName . " WHERE moduleId=" . $dbi->quote(blogModuleId) . " AND moduleContentTypeId=" . $dbi->quote(blogPostContentId) . " AND spam='0' AND " . (!empty($post->id) ? "moduleContentId=" . $dbi->quote($post->id) : "moduleContentId IN(SELECT Id FROM " . blogPostTableName . " WHERE blogId=" . $dbi->quote($blog->id) . " AND draft=0)") . " ORDER BY posted DESC LIMIT 15");
for ($i = 0; list($id, $postId) = $result->fetchrow_array(); $i++) {
$comment = new Comment($id);
// Get name of user
$name = "";
if (!empty($comment->userId)) {
$user = new User($comment->userId);
$name = $user->name;
} else {
$name = $comment->name;
}
// Create new item
$item = new RSSItem($comment->id, $name, array(), "", "", scriptUrl . "/" . folderBlog . "/" . fileBlogPost . "?postId=" . $postId . "#comments", $comment->message, "", $comment->posted, $comment->subject);
$items[] = $item;
}
// Print feed
$rss = new RSS($blog->title . " - " . $lComment["Header"], $blog->description, $blog->getBlogLink(), scriptUrl . "/" . folderBlog . "/" . fileBlogCommentRSS . "?blogId=" . $blog->id, $items);
$rss->printRSSFeed();
}