Correctly respect excerpt wishes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-04-24 20:12:58 +00:00
parent 277e4b627e
commit 2320c9b128
2 changed files with 11 additions and 18 deletions

View File

@ -4,6 +4,7 @@ if (! $feed) {
$doing_rss = 1; $doing_rss = 1;
require('wp-blog-header.php'); require('wp-blog-header.php');
} }
$more = 1;
header('Content-type: application/rss+xml', true); header('Content-type: application/rss+xml', true);
@ -44,17 +45,13 @@ add_filter('the_content', 'trim');
<dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt); ?></dc:date> <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt); ?></dc:date>
<dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator> <dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
<?php the_category_rss('rdf') ?> <?php the_category_rss('rdf') ?>
<?php $more = 1; if (get_settings('rss_use_excerpt')) { <?php if (get_settings('rss_use_excerpt')) : ?>
?>
<description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description> <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
<?php <?php else : ?>
} else { // use content
?>
<description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description> <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description>
<?php
} // end else use content
?>
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded> <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
<?php endif; ?>
</item> </item>
<?php } } ?> <?php } } ?>
</rdf:RDF> </rdf:RDF>

View File

@ -4,10 +4,10 @@ if (! $feed) {
$doing_rss = 1; $doing_rss = 1;
require('wp-blog-header.php'); require('wp-blog-header.php');
} }
$more = 1;
$charset = get_settings('blog_charset'); $charset = get_settings('blog_charset');
if (!$charset) $charset = 'UTF-8'; if (!$charset) $charset = 'UTF-8';
header('Content-type: application/rss+xml', true); header('Content-type: text/xml', true);
?> ?>
<?php echo '<?xml version="1.0" encoding="' . $charset . '"?'.'>'; ?> <?php echo '<?xml version="1.0" encoding="' . $charset . '"?'.'>'; ?>
@ -33,17 +33,13 @@ header('Content-type: application/rss+xml', true);
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $post->post_date_gmt); ?></pubDate> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $post->post_date_gmt); ?></pubDate>
<?php the_category_rss() ?> <?php the_category_rss() ?>
<guid><?php the_permalink($id); ?></guid> <guid><?php the_permalink($id); ?></guid>
<?php $more = 1; if (get_settings('rss_use_excerpt')) { <?php if (get_settings('rss_use_excerpt')) : ?>
?>
<description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description> <description><?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?></description>
<?php <?php else : ?>
} else { // use content
?>
<description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description> <description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2) ?></description>
<?php
} // end else use content
?>
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded> <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
<?php endif; ?>
</item> </item>
<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?> <?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
</channel> </channel>