示例#1
0
?>
</subtitle> <updated><?php 
echo mysql2date('Y-m-d\\TH:i:s\\Z', get_lastpostmodified('GMT'), false);
?>
</updated> <link rel="alternate" type="<?php 
bloginfo_rss('html_type');
?>
" href="<?php 
bloginfo_rss('url');
?>
" /> <id><?php 
bloginfo_rss('url');
bloginfo('atom_url');
?>
</id><link rel="self" type="application/atom+xml" href="<?php 
self_link();
?>
" />
	<?php 
$category_name = "";
if (!empty($wp_query->query['category_name'])) {
    $category_name = "/" . $wp_query->query['category_name'];
}
$count_posts = $wp_query->found_posts;
echo '<link rel="first" href="' . get_bloginfo('url') . $category_name . '/feed/atom/" ></link>' . "\n";
$postsperpage = get_option('posts_per_rss');
$total_pages = ceil($count_posts / $postsperpage);
$currentpage = get_query_var('paged') ? get_query_var('paged') : 1;
if ($currentpage > $total_pages) {
    $currentpage = $total_pages;
}
示例#2
0
/**
 * Output an RSS2 feed of topics, based on the query passed.
 *
 * @since bbPress (r3171)
 *
 * @uses bbp_version()
 * @uses bbp_is_single_topic()
 * @uses bbp_user_can_view_forum()
 * @uses bbp_get_topic_forum_id()
 * @uses bbp_show_load_topic()
 * @uses bbp_topic_permalink()
 * @uses bbp_topic_title()
 * @uses bbp_get_topic_reply_count()
 * @uses bbp_topic_content()
 * @uses bbp_has_topics()
 * @uses bbp_topics()
 * @uses bbp_the_topic()
 * @uses get_wp_title_rss()
 * @uses get_option()
 * @uses bloginfo_rss
 * @uses self_link()
 * @uses the_author()
 * @uses get_post_time()
 * @uses rss_enclosure()
 * @uses do_action()
 * @uses apply_filters()
 *
 * @param array $topics_query
 */
function bbp_display_topics_feed_rss2($topics_query = array())
{
    // User cannot access this forum
    if (bbp_is_single_forum() && !bbp_user_can_view_forum(array('forum_id' => bbp_get_forum_id()))) {
        return;
    }
    // Display the feed
    header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
    header('Status: 200 OK');
    echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
    ?>

	<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"

		<?php 
    do_action('bbp_feed');
    ?>
	>

	<channel>

		<title><?php 
    bloginfo_rss('name');
    ?>
 &#187; <?php 
    _e('All Topics', 'bbpress');
    ?>
</title>
		<atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
		<link><?php 
    self_link();
    ?>
</link>
		<description><?php 
    //
    ?>
</description>
		<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
    ?>
</pubDate>
		<generator>http://bbpress.org/?v=<?php 
    bbp_version();
    ?>
</generator>
		<language><?php 
    bloginfo_rss('language');
    ?>
</language>

		<?php 
    do_action('bbp_feed_head');
    ?>

		<?php 
    if (bbp_has_topics($topics_query)) {
        ?>

			<?php 
        while (bbp_topics()) {
            bbp_the_topic();
            ?>

				<item>
					<guid><?php 
            bbp_topic_permalink();
            ?>
</guid>
					<title><![CDATA[<?php 
            bbp_topic_title();
            ?>
]]></title>
					<link><?php 
            bbp_topic_permalink();
            ?>
</link>
					<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_meta(bbp_get_topic_id(), '_bbp_last_active_time', true));
            ?>
</pubDate>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>

					<?php 
            if (!post_password_required()) {
                ?>

					<description>
						<![CDATA[
						<p><?php 
                printf(esc_html__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
                ?>
</p>
						<?php 
                bbp_topic_content();
                ?>
						]]>
					</description>

					<?php 
                rss_enclosure();
                ?>

					<?php 
            }
            ?>

					<?php 
            do_action('bbp_feed_item');
            ?>

				</item>

				<?php 
        }
        ?>
			<?php 
    }
    ?>

		<?php 
    do_action('bbp_feed_footer');
    ?>

	</channel>
	</rss>

<?php 
    exit;
}
示例#3
0
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	<?php do_action('rss2_ns'); do_action('rss2_comments_ns'); ?>
	>
<channel>
	<title><?php
		if ( is_singular() )
			printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
		elseif ( is_search() )
			printf(ent2ncr(__('Comments for %s searching on %s')), get_bloginfo_rss( 'name' ), esc_attr($wp_query->query_vars['s']));
		else
			printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
	?></title>
	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
	<description><?php bloginfo_rss("description") ?></description>
	<lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
	<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
	<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
	<?php do_action('commentsrss2_head'); ?>
<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
	$comment_post = get_post($comment->comment_post_ID);
	get_post_custom($comment_post->ID);
?>
	<item>
		<title><?php
			if ( !is_singular() ) {
				$title = get_the_title($comment_post->ID);
/**
 * Output an RSS2 feed of replies, based on the query passed.
 *
 * @since bbPress (r3171)
 *
 * @uses bbp_version()
 * @uses bbp_is_single_topic()
 * @uses bbp_user_can_view_forum()
 * @uses bbp_get_topic_forum_id()
 * @uses bbp_show_load_topic()
 * @uses bbp_topic_permalink()
 * @uses bbp_topic_title()
 * @uses bbp_get_topic_reply_count()
 * @uses bbp_topic_content()
 * @uses bbp_has_replies()
 * @uses bbp_replies()
 * @uses bbp_the_reply()
 * @uses bbp_reply_url()
 * @uses bbp_reply_title()
 * @uses bbp_reply_content()
 * @uses get_wp_title_rss()
 * @uses get_option()
 * @uses bloginfo_rss
 * @uses self_link()
 * @uses the_author()
 * @uses get_post_time()
 * @uses rss_enclosure()
 * @uses do_action()
 * @uses apply_filters()
 *
 * @param array $replies_query
 */
function bbp_display_replies_feed_rss2($replies_query = array())
{
    // User cannot access forum this topic is in
    if (bbp_is_single_topic() && !bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
        return;
    }
    // Adjust the title based on context
    if (bbp_is_single_topic() && bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
        $title = apply_filters('wp_title_rss', get_wp_title_rss(' &#187; '));
    } elseif (!bbp_show_lead_topic()) {
        $title = ' &#187; ' . __('All Posts', 'bbpress');
    } else {
        $title = ' &#187; ' . __('All Replies', 'bbpress');
    }
    // Display the feed
    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    header('Status: 200 OK');
    echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
    ?>

	<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"

		<?php 
    do_action('bbp_feed');
    ?>
	>

	<channel>
		<title><?php 
    bloginfo_rss('name');
    echo $title;
    ?>
</title>
		<atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
		<link><?php 
    self_link();
    ?>
</link>
		<description><?php 
    //
    ?>
</description>
		<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
    ?>
</pubDate>
		<generator>http://bbpress.org/?v=<?php 
    bbp_version();
    ?>
</generator>
		<language><?php 
    bloginfo_rss('language');
    ?>
</language>

		<?php 
    do_action('bbp_feed_head');
    ?>

		<?php 
    if (bbp_is_single_topic()) {
        ?>
			<?php 
        if (bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
            ?>
				<?php 
            if (bbp_show_lead_topic()) {
                ?>

					<item>
						<guid><?php 
                bbp_topic_permalink();
                ?>
</guid>
						<title><![CDATA[<?php 
                bbp_topic_title();
                ?>
]]></title>
						<link><?php 
                bbp_topic_permalink();
                ?>
</link>
						<pubDate><?php 
                echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
                ?>
</pubDate>
						<dc:creator><?php 
                the_author();
                ?>
</dc:creator>

						<description>
							<![CDATA[
							<p><?php 
                printf(__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
                ?>
</p>
							<?php 
                bbp_topic_content();
                ?>
							]]>
						</description>

						<?php 
                rss_enclosure();
                ?>

						<?php 
                do_action('bbp_feed_item');
                ?>

					</item>

				<?php 
            }
            ?>
			<?php 
        }
        ?>
		<?php 
    }
    ?>

		<?php 
    if (bbp_has_replies($replies_query)) {
        ?>
			<?php 
        while (bbp_replies()) {
            bbp_the_reply();
            ?>

				<item>
					<guid><?php 
            bbp_reply_url();
            ?>
</guid>
					<title><![CDATA[<?php 
            bbp_reply_title();
            ?>
]]></title>
					<link><?php 
            bbp_reply_url();
            ?>
</link>
					<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
            ?>
</pubDate>
					<dc:creator><?php 
            the_author();
            ?>
</dc:creator>

					<description>
						<![CDATA[
						<?php 
            bbp_reply_content();
            ?>
						]]>
					</description>

					<?php 
            rss_enclosure();
            ?>

					<?php 
            do_action('bbp_feed_item');
            ?>

				</item>

			<?php 
        }
        ?>
		<?php 
    }
    ?>

		<?php 
    do_action('bbp_feed_footer');
    ?>

	</channel>
	</rss>

<?php 
    // We're done here
    exit;
}
示例#5
0
    /**
     * Output for Stream Records as a feed.
     *
     * @return xml
     */
    public static function feed_template()
    {
        $die_title = esc_html__('Access Denied', 'stream');
        $die_message = '<h1>' . $die_title . '</h1><p>' . esc_html__('You don\'t have permission to view this feed, please contact your site Administrator.', 'stream') . '</p>';
        if (!isset($_GET[self::FEED_QUERY_VAR]) || empty($_GET[self::FEED_QUERY_VAR])) {
            wp_die($die_message, $die_title);
        }
        $args = array('meta_key' => self::USER_FEED_KEY, 'meta_value' => $_GET[self::FEED_QUERY_VAR], 'number' => 1);
        $user = get_users($args);
        if (!is_super_admin($user[0]->ID)) {
            $roles = isset($user[0]->roles) ? (array) $user[0]->roles : array();
            if (self::$is_network_feed) {
                wp_die($die_message, $die_title);
            }
            if (!$roles || !array_intersect($roles, WP_Stream_Settings::$options['general_role_access'])) {
                wp_die($die_message, $die_title);
            }
        }
        $blog_id = self::$is_network_feed ? null : get_current_blog_id();
        $args = array('blog_id' => $blog_id, 'records_per_page' => wp_stream_filter_input(INPUT_GET, 'records_per_page', FILTER_SANITIZE_NUMBER_INT, array('options' => array('default' => get_option('posts_per_rss')))), 'search' => wp_stream_filter_input(INPUT_GET, 'search'), 'object_id' => wp_stream_filter_input(INPUT_GET, 'object_id', FILTER_SANITIZE_NUMBER_INT), 'ip' => wp_stream_filter_input(INPUT_GET, 'ip', FILTER_VALIDATE_IP), 'author' => wp_stream_filter_input(INPUT_GET, 'author', FILTER_SANITIZE_NUMBER_INT), 'author_role' => wp_stream_filter_input(INPUT_GET, 'author_role'), 'date' => wp_stream_filter_input(INPUT_GET, 'date'), 'date_from' => wp_stream_filter_input(INPUT_GET, 'date_from'), 'date_to' => wp_stream_filter_input(INPUT_GET, 'date_to'), 'record__in' => wp_stream_filter_input(INPUT_GET, 'record__in', FILTER_SANITIZE_NUMBER_INT), 'record_parent' => wp_stream_filter_input(INPUT_GET, 'record_parent', FILTER_SANITIZE_NUMBER_INT), 'order' => wp_stream_filter_input(INPUT_GET, 'order', FILTER_DEFAULT, array('options' => array('default' => 'desc'))), 'orderby' => wp_stream_filter_input(INPUT_GET, 'orderby', FILTER_DEFAULT, array('options' => array('default' => 'ID'))), 'fields' => wp_stream_filter_input(INPUT_GET, 'fields', FILTER_DEFAULT, array('options' => array('default' => 'with-meta'))));
        $records = wp_stream_query($args);
        $latest_record = isset($records[0]->created) ? $records[0]->created : null;
        $records_admin_url = add_query_arg(array('page' => WP_Stream_Admin::RECORDS_PAGE_SLUG), admin_url(WP_Stream_Admin::ADMIN_PARENT_PAGE));
        if ('json' === wp_stream_filter_input(INPUT_GET, self::FEED_TYPE_QUERY_VAR)) {
            if (version_compare(PHP_VERSION, '5.4', '>=')) {
                echo json_encode($records, JSON_PRETTY_PRINT);
            } else {
                echo json_encode($records);
            }
        } else {
            header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
            printf('<?xml version="1.0" encoding="%s"?>', esc_attr(get_option('blog_charset')));
            ?>

			<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/"
				<?php 
            /**
             * Action fires during RSS xmls printing
             */
            ?>
				<?php 
            do_action('rss2_ns');
            ?>
			>
				<channel>
					<title><?php 
            bloginfo_rss('name');
            ?>
 - <?php 
            esc_html_e('Stream Feed', 'stream');
            ?>
</title>
					<atom:link href="<?php 
            self_link();
            ?>
" rel="self" type="application/rss+xml" />
					<link><?php 
            echo esc_url($records_admin_url);
            ?>
</link>
					<description><?php 
            bloginfo_rss('description');
            ?>
</description>
					<lastBuildDate><?php 
            echo esc_html(mysql2date('r', $latest_record, false));
            ?>
</lastBuildDate>
					<language><?php 
            bloginfo_rss('language');
            ?>
</language>
					<sy:updatePeriod><?php 
            echo esc_html('hourly');
            ?>
</sy:updatePeriod>
					<sy:updateFrequency><?php 
            echo absint(1);
            ?>
</sy:updateFrequency>
					<?php 
            /**
             * Action fires during RSS head
             */
            ?>
					<?php 
            do_action('rss2_head');
            ?>
					<?php 
            foreach ($records as $record) {
                ?>
						<?php 
                $record_link = add_query_arg(array('record__in' => (int) $record->ID), $records_admin_url);
                $author = get_userdata($record->author);
                $display_name = isset($author->display_name) ? $author->display_name : 'N/A';
                ?>
						<item>
							<title><![CDATA[ <?php 
                echo trim($record->summary);
                ?>
 ]]></title>
							<pubDate><?php 
                echo esc_html(mysql2date('r', $record->created, false));
                ?>
</pubDate>
							<dc:creator><?php 
                echo esc_html($display_name);
                ?>
</dc:creator>
							<category domain="connector"><![CDATA[ <?php 
                echo esc_html($record->connector);
                ?>
 ]]></category>
							<category domain="context"><![CDATA[ <?php 
                echo esc_html($record->context);
                ?>
 ]]></category>
							<category domain="action"><![CDATA[ <?php 
                echo esc_html($record->action);
                ?>
 ]]></category>
							<category domain="ip"><?php 
                echo esc_html($record->ip);
                ?>
</category>
							<guid isPermaLink="false"><?php 
                echo esc_url($record_link);
                ?>
</guid>
							<link><?php 
                echo esc_url($record_link);
                ?>
</link>
							<?php 
                /**
                 * Action fires during RSS item
                 */
                ?>
							<?php 
                do_action('rss2_item');
                ?>
						</item>
					<?php 
            }
            ?>
				</channel>
			</rss>
			<?php 
            exit;
        }
    }
	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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	<?php 
do_action('rss2_ns');
?>
>

<channel>
	<title><?php 
echo esc_html($title);
?>
</title>
	<atom:link href="<?php 
esc_url(self_link());
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
echo esc_url(apply_filters('ssp_feed_channel_link_tag', $ss_podcasting->home_url, $podcast_series));
?>
</link>
	<description><?php 
echo esc_html($description);
?>
</description>
	<lastBuildDate><?php 
echo esc_html(mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false));
?>
</lastBuildDate>
	<language><?php 
    /**
     * Output the RSS feed.
     */
    protected function output()
    {
        $this->http_headers();
        echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
        ?>

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	<?php 
        /**
         * Fires at the end of the opening RSS tag for feed output so plugins can add extra attributes.
         *
         * @since 1.8.0
         */
        do_action('bp_activity_feed_rss_attributes');
        ?>
>

<channel>
	<title><?php 
        echo $this->title;
        ?>
</title>
	<link><?php 
        echo $this->link;
        ?>
</link>
	<atom:link href="<?php 
        self_link();
        ?>
" rel="self" type="application/rss+xml" />
	<description><?php 
        echo $this->description;
        ?>
</description>
	<lastBuildDate><?php 
        echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
        ?>
</lastBuildDate>
	<generator>https://buddypress.org/?v=<?php 
        bp_version();
        ?>
</generator>
	<language><?php 
        bloginfo_rss('language');
        ?>
</language>
	<ttl><?php 
        echo $this->ttl;
        ?>
</ttl>
	<sy:updatePeriod><?php 
        echo $this->update_period;
        ?>
</sy:updatePeriod>
 	<sy:updateFrequency><?php 
        echo $this->update_frequency;
        ?>
</sy:updateFrequency>
	<?php 
        /**
         * Fires at the end of channel elements list in RSS feed so plugins can add extra channel elements.
         *
         * @since 1.8.0
         */
        do_action('bp_activity_feed_channel_elements');
        ?>

	<?php 
        if (bp_has_activities($this->activity_args)) {
            ?>
		<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>
			<item>
				<guid isPermaLink="false"><?php 
                bp_activity_feed_item_guid();
                ?>
</guid>
				<title><?php 
                echo stripslashes(bp_get_activity_feed_item_title());
                ?>
</title>
				<link><?php 
                bp_activity_thread_permalink();
                ?>
</link>
				<pubDate><?php 
                echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false);
                ?>
</pubDate>

				<?php 
                if (bp_get_activity_feed_item_description()) {
                    ?>
					<content:encoded><![CDATA[<?php 
                    $this->feed_content();
                    ?>
]]></content:encoded>
				<?php 
                }
                ?>

				<?php 
                if (bp_activity_can_comment()) {
                    ?>
					<slash:comments><?php 
                    bp_activity_comment_count();
                    ?>
</slash:comments>
				<?php 
                }
                ?>

				<?php 
                /**
                 * Fires at the end of the individual RSS Item list in RSS feed so plugins can add extra item elements.
                 *
                 * @since 1.8.0
                 */
                do_action('bp_activity_feed_item_elements');
                ?>
			</item>
		<?php 
            }
            ?>

	<?php 
        }
        ?>
</channel>
</rss><?php 
    }
示例#8
0
function gwolle_gb_rss()
{
    // Only show the first page of entries.
    $entriesPerPage = (int) get_option('gwolle_gb-entriesPerPage', 20);
    /* Get the entries for the RSS Feed */
    $entries = gwolle_gb_get_entries(array('offset' => 0, 'num_entries' => $entriesPerPage, 'checked' => 'checked', 'trash' => 'notrash', 'spam' => 'nospam'));
    /* Get the time of the last entry, else of the last edited post */
    if (is_array($entries) && !empty($entries)) {
        $lastbuild = gmdate('D, d M Y H:i:s', $entries[0]->get_datetime());
    } else {
        $lastbuild = mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
    }
    $postid = gwolle_gb_get_postid();
    if ($postid) {
        $permalink = get_bloginfo('url') . '?p=' . $postid;
    } else {
        $permalink = get_bloginfo('url');
    }
    /* Get the Language setting */
    $WPLANG = get_option('WPLANG', false);
    if (!$WPLANG) {
        $WPLANG = WPLANG;
    }
    if (!$WPLANG) {
        $WPLANG = 'en-us';
    }
    $WPLANG = str_replace('_', '-', $WPLANG);
    $WPLANG = strtolower($WPLANG);
    /* Build the XML content */
    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
    ?>

	<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/"
		<?php 
    do_action('rss2_ns');
    ?>
>

		<channel>
			<title><?php 
    bloginfo_rss('name');
    echo " - " . __('Guestbook Feed', GWOLLE_GB_TEXTDOMAIN);
    ?>
</title>
			<atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
			<link><?php 
    echo $permalink;
    ?>
</link>
			<description><?php 
    bloginfo_rss('description');
    echo " - " . __('Guestbook Feed', GWOLLE_GB_TEXTDOMAIN);
    ?>
</description>
			<lastBuildDate><?php 
    echo $lastbuild;
    ?>
</lastBuildDate>
			<language><?php 
    echo $WPLANG;
    ?>
</language>
			<sy:updatePeriod><?php 
    echo apply_filters('rss_update_period', 'hourly');
    ?>
</sy:updatePeriod>
			<sy:updateFrequency><?php 
    echo apply_filters('rss_update_frequency', '1');
    ?>
</sy:updateFrequency>
			<?php 
    do_action('rss2_head');
    ?>

			<?php 
    if (is_array($entries) && !empty($entries)) {
        foreach ($entries as $entry) {
            ?>
					<item>
						<title><?php 
            _e('Guestbook Entry by', GWOLLE_GB_TEXTDOMAIN);
            echo " " . trim($entry->get_author_name());
            ?>
</title>
						<link><?php 
            echo $permalink;
            ?>
</link>
						<pubDate><?php 
            echo gmdate('D, d M Y H:i:s', $entry->get_datetime());
            ?>
</pubDate>
						<dc:creator><?php 
            echo trim($entry->get_author_name());
            ?>
</dc:creator>
						<guid isPermaLink="false"><?php 
            echo $permalink;
            ?>
</guid>
						<description><![CDATA[<?php 
            echo wp_trim_words($entry->get_content(), 12, '...');
            ?>
]]></description>
						<content:encoded><![CDATA[<?php 
            echo wp_trim_words($entry->get_content(), 25, '...');
            ?>
]]></content:encoded>
						<?php 
            rss_enclosure();
            ?>
						<?php 
            do_action('rss2_item');
            ?>
					</item>
					<?php 
        }
    }
    ?>
		</channel>
	</rss>
	<?php 
}
    /**
     * Output the RSS feed.
     */
    protected function output()
    {
        // set up some additional headers if not on a directory page
        // this is done b/c BP uses pseudo-pages
        if (!bp_is_directory()) {
            global $wp_query;
            $wp_query->is_404 = false;
            status_header(200);
        }
        header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
        echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
        ?>

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	<?php 
        do_action('bp_activity_feed_rss_attributes');
        ?>
>

<channel>
	<title><?php 
        echo $this->title;
        ?>
</title>
	<link><?php 
        echo $this->link;
        ?>
</link>
	<atom:link href="<?php 
        self_link();
        ?>
" rel="self" type="application/rss+xml" />
	<description><?php 
        echo $this->description;
        ?>
</description>
	<lastBuildDate><?php 
        echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false);
        ?>
</lastBuildDate>
	<generator>http://buddypress.org/?v=<?php 
        bp_version();
        ?>
</generator>
	<language><?php 
        bloginfo_rss('language');
        ?>
</language>
	<ttl><?php 
        echo $this->ttl;
        ?>
</ttl>
	<sy:updatePeriod><?php 
        echo $this->update_period;
        ?>
</sy:updatePeriod>
 	<sy:updateFrequency><?php 
        echo $this->update_frequency;
        ?>
</sy:updateFrequency>
	<?php 
        do_action('bp_activity_feed_channel_elements');
        ?>

	<?php 
        if (bp_has_activities($this->activity_args)) {
            ?>
		<?php 
            while (bp_activities()) {
                bp_the_activity();
                ?>
			<item>
				<guid isPermaLink="false"><?php 
                bp_activity_feed_item_guid();
                ?>
</guid>
				<title><?php 
                echo stripslashes(bp_get_activity_feed_item_title());
                ?>
</title>
				<link><?php 
                bp_activity_thread_permalink();
                ?>
</link>
				<pubDate><?php 
                echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false);
                ?>
</pubDate>

				<?php 
                if (bp_get_activity_feed_item_description()) {
                    ?>
					<content:encoded><![CDATA[<?php 
                    $this->feed_content();
                    ?>
]]></content:encoded>
				<?php 
                }
                ?>

				<?php 
                if (bp_activity_can_comment()) {
                    ?>
					<slash:comments><?php 
                    bp_activity_comment_count();
                    ?>
</slash:comments>
				<?php 
                }
                ?>

				<?php 
                do_action('bp_activity_feed_item_elements');
                ?>
			</item>
		<?php 
            }
            ?>

	<?php 
        }
        ?>
</channel>
</rss><?php 
    }
function create_my_customfeed()
{
    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    $more = 1;
    echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
    $mfgigcal_options = get_option('mfgigcal_settings');
    if (WPLANG == "") {
        $language = "en-us";
    } else {
        $language = WPLANG;
    }
    ?>
	
	<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/"
		xmlns:mfgigcal="http://wordpress.org/extend/plugins/mf-gig-calendar/"
		<?php 
    do_action('rss2_ns');
    ?>
	>
	
	<channel>
		<title><?php 
    bloginfo_rss('name');
    wp_title_rss();
    ?>
</title>
		<atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
		<link><?php 
    bloginfo_rss('url');
    ?>
</link>
		<description>MF Gig Cal Events</description>
		<lastBuildDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
    ?>
</lastBuildDate>
		<language><?php 
    echo $language;
    ?>
</language>
		<sy:updatePeriod><?php 
    echo apply_filters('rss_update_period', 'hourly');
    ?>
</sy:updatePeriod>
		<sy:updateFrequency><?php 
    echo apply_filters('rss_update_frequency', '1');
    ?>
</sy:updateFrequency>
		<?php 
    do_action('rss2_head');
    ?>
		
		
		<?php 
    //get events from db
    global $wpdb;
    $mfgigcal_table = $wpdb->prefix . "mfgigcal";
    $mfgigcal_settings = get_option('mfgigcal_settings');
    // get the dates
    $today = date("Y-m-d");
    $sql = "SELECT * FROM {$mfgigcal_table} WHERE end_date >= '{$today}' ORDER BY start_date";
    $mfgigcal_events = $wpdb->get_results($sql);
    if (!empty($mfgigcal_events)) {
        foreach ($mfgigcal_events as $mfgigcal_event) {
            ?>
			
			<item>
				<guid isPermaLink="false"><?php 
            echo $mfgigcal_settings['calendar_url'];
            ?>
?event_id=<?php 
            echo $mfgigcal_event->id;
            ?>
</guid>
				<title><![CDATA[<?php 
            echo $mfgigcal_event->title;
            ?>
]]></title>
				<link><?php 
            echo $mfgigcal_settings['calendar_url'];
            ?>
?event_id=<?php 
            echo $mfgigcal_event->id;
            ?>
</link>
				<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', $mfgigcal_event->pub_date, false);
            ?>
</pubDate>
				<description><![CDATA[<p><?php 
            echo mfgigcal_feed_FormatDate($mfgigcal_event->start_date, $mfgigcal_event->end_date);
            ?>
 <?php 
            echo $mfgigcal_event->time;
            ?>
</p>
				<?php 
            echo $mfgigcal_event->location;
            if ($mfgigcal_settings['rss_details']) {
                echo $mfgigcal_event->details;
            }
            ?>
]]></description>
				<mfgigcal:event-date><?php 
            echo mfgigcal_feed_FormatDate($mfgigcal_event->start_date, $mfgigcal_event->end_date);
            ?>
</mfgigcal:event-date>
				<mfgigcal:event-time><![CDATA[<?php 
            echo $mfgigcal_event->time;
            ?>
]]></mfgigcal:event-time>
				<mfgigcal:location><![CDATA[<?php 
            echo $mfgigcal_event->location;
            ?>
]]></mfgigcal:location>
				<mfgigcal:content><![CDATA[<?php 
            echo $mfgigcal_event->details;
            ?>
]]></mfgigcal:content>
			</item>
		
			<?php 
        }
        //end event loop
    }
    //end check for events
    ?>
		
	</channel>
	</rss>

	<?php 
}
示例#11
0
function draw_feed($posts)
{
    header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
    echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
    ?>
    <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/"
      <?php 
    do_action('rss2_ns');
    ?>
>
    <channel>
      <title><?php 
    bloginfo_rss('name');
    ?>
 - Feed</title>
      <atom:link href="<?php 
    self_link();
    ?>
" rel="self" type="application/rss+xml" />
      <link><?php 
    bloginfo_rss('url');
    ?>
</link>
      <description><?php 
    bloginfo_rss('description');
    ?>
</description>
      <lastBuildDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
    ?>
</lastBuildDate>
      <language><?php 
    echo get_option('rss_language');
    ?>
</language>
      <sy:updatePeriod><?php 
    echo apply_filters('rss_update_period', 'hourly');
    ?>
</sy:updatePeriod>
      <sy:updateFrequency><?php 
    echo apply_filters('rss_update_frequency', '1');
    ?>
</sy:updateFrequency>
      <?php 
    do_action('rss2_head');
    ?>
      <?php 
    foreach ($posts as $post) {
        ?>
        <item>
          <title><?php 
        echo $post->post_title;
        ?>
</title>
          <?php 
        $datetime = new DateTime($post->post_date);
        $permalink = site_url() . $datetime->format('/Y/m/') . $post->post_name;
        ?>
          <link><?php 
        echo $permalink;
        ?>
</link>
          <pubDate><?php 
        echo $post->post_date;
        ?>
</pubDate>
          <dc:creator><?php 
        echo get_the_author_meta('display_name', $post->post_author);
        ?>
</dc:creator>
          <guid isPermaLink="false"><?php 
        echo $post->guid;
        ?>
</guid>
          <description><![CDATA[<?php 
        echo trim(strip_tags($post->post_content));
        ?>
]]></description>
          <content:encoded><![CDATA[<?php 
        trim(strip_tags($post->post_content));
        ?>
]]></content:encoded>
          <?php 
        rss_enclosure($post);
        ?>
          <?php 
        $thumbnail_size = apply_filters('rss_enclosure_image_size', 'large');
        $thumbnail_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($thumbnail_id, 'large');
        if ($thumbnail_id) {
            printf('<enclosure name="featured_image" url="%s" length="%s" type="%s" />', $thumbnail[0], filesize(path_join($upload_dir['basedir'], $thumbnail['path'])), get_post_mime_type($thumbnail_id));
        }
        ?>
        </item>
      <?php 
    }
    ?>
    </channel>
    </rss>
  <?php 
}
示例#12
0
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="<?php echo get_option('rss_language'); ?>"
  xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
  <?php do_action('atom_ns'); ?>
 >
	<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
	<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>

	<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>

	<link rel="alternate" type="text/html" href="<?php bloginfo_rss('url') ?>" />
	<id><?php bloginfo('atom_url'); ?></id>
	<link rel="self" type="application/atom+xml" href="<?php self_link(); ?>" />

	<?php do_action('atom_head'); ?>
	<?php while (have_posts()) : the_post(); ?>
	<entry>
		<author>
			<name><?php the_author() ?></name>
			<?php $author_url = get_the_author_meta('url'); if ( !empty($author_url) ) : ?>
			<uri><?php the_author_meta('url')?></uri>
			<?php endif; ?>
		</author>
		<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
		<link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" />
		<id><?php the_guid() ; ?></id>
		<updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
		<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
    function render_output($wgt_miss, $wgt_count, $wgt_format, $wgt_white)
    {
        global $switched;
        global $wpdb;
        $table_prefix = $wpdb->base_prefix;
        header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
        if (!isset($wgt_miss) || $wgt_miss == '') {
            $wgt_miss = array();
        }
        $white = 0;
        if (isset($wgt_white) && $wgt_white != '' && count($wgt_white) > 0 && $wgt_white[0] && $wgt_white[0] != '') {
            $white = 1;
        }
        echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
        ?>
<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><?php 
        bloginfo_rss('name');
        wp_title_rss();
        ?>
</title>
	<link><?php 
        self_link();
        ?>
</link>
	<atom:link href="<?php 
        self_link();
        ?>
" rel="self" type="application/rss+xml" />
	<description><?php 
        bloginfo_rss("description");
        ?>
</description>
	<language><?php 
        echo get_option('rss_language');
        ?>
</language>
	<sy:updatePeriod><?php 
        echo apply_filters('rss_update_period', 'hourly');
        ?>
</sy:updatePeriod>
	<sy:updateFrequency><?php 
        echo apply_filters('rss_update_frequency', '1');
        ?>
</sy:updateFrequency><?php 
        $sqlstr = '';
        $blog_list = get_blog_list(0, 'all');
        if ($white == 0 && !in_array(1, $wgt_miss) || $white == 1 && in_array(1, $wgt_white)) {
            $sqlstr = "SELECT 1 as blog_id, id, post_date_gmt, post_type from " . $table_prefix . "posts where post_status = 'publish' and post_type = 'post' ";
        }
        $uni = '';
        foreach ($blog_list as $blog) {
            if ($white == 0 && !in_array($blog['blog_id'], $wgt_miss) && $blog['blog_id'] != 1 || $white == 1 && $blog['blog_id'] != 1 && in_array($blog['blog_id'], $wgt_white)) {
                if ($sqlstr != '') {
                    $uni = ' union ';
                }
                $sqlstr .= $uni . " SELECT " . $blog['blog_id'] . " as blog_id, id, post_date_gmt, post_type from " . $table_prefix . $blog['blog_id'] . "_posts  where post_status = 'publish' and post_type = 'post' ";
            }
        }
        $limit = '';
        if ((int) $wgt_count > 0) {
            $limit = ' LIMIT 0, ' . (int) $wgt_count;
        } else {
            $limit = ' LIMIT 0, 100';
        }
        $sqlstr .= " ORDER BY post_date_gmt desc " . $limit;
        $post_list = $wpdb->get_results($sqlstr, ARRAY_A);
        foreach ($post_list as $post) {
            $txt = $wgt_format == '' ? '{excerpt}' : $wgt_format;
            $p = get_blog_post($post["blog_id"], $post["id"]);
            $ex = $p->post_excerpt;
            //if (!isset($ex) || trim($ex) == '')
            //$ex = substr(strip_tags($p->post_content), 0, 65) . '...';
            echo "\r";
            ?>
	<item>
		<title><![CDATA[<?php 
            echo $p->post_title;
            ?>
]]></title>
		<link><?php 
            echo get_blog_permalink($post["blog_id"], $post["id"]);
            ?>
</link>
		<dc:creator><?php 
            echo get_userdata($p->post_author)->nickname;
            ?>
</dc:creator>
		<guid isPermaLink="false"><?php 
            echo $p->guid;
            ?>
</guid>
		<pubDate><?php 
            echo date(DATE_RFC822, strtotime($p->post_date));
            ?>
</pubDate><?php 
            //	echo '<content:encoded><![CDATA[' . $p->post_content . ']]></content:encoded>';
            $txt = str_replace('{content}', $p->post_content, $txt);
            $txt = str_replace('{excerpt}', $ex, $txt);
            $txt = str_replace('{blog}', get_blog_option($post["blog_id"], 'blogname'), $txt);
            echo "\r";
            ?>
		<description><![CDATA[<?php 
            echo $txt;
            ?>
]]></description>			
	</item><?php 
        }
        echo "\r";
        ?>
</channel>
</rss><?php 
    }
示例#14
0
function liq_spp_feed(){
	$opt = get_option('liq_spp');
	$oterm = liq_get_spp_post($opt['liq_spp_rss_num']);

	header("Content-Type: application/rss+xml; charset=UTF-8");
	echo '<?xml version="1.0"?>';
	?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		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/">
		
		<channel>
			<title><?php bloginfo_rss('name');?></title>
			<link><?php bloginfo_rss('url') ?></link>
			<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
			<description><?php bloginfo_rss("description") ?></description>
			<language><?php echo get_option('rss_language'); ?></language>
			<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
			<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>

	<?php $date = mktime(); ?>
	<?php foreach ($oterm as $post) { ?>
	<?php 		
		$permalink = build_permalink_for($post->term,0);
		$date = strtotime('-11 hours',$date);
	?>
	<item>
		<title><?php echo $post->term; ?></title>
		<link><?php echo $permalink; ?></link>
		<description><?php echo '<![CDATA['.$post->term.'.. <a href="'.$permalink.'">Continue reading</a>'.']]>';  ?></description>
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000',  date('d-m-Y H:i:s',$date) );?></pubDate>
	</item>
	<?php } ?>
	</channel>
	</rss>

<?php
}