Пример #1
0
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();
}