Added rss_use_excerpt flag

git-svn-id: http://svn.automattic.com/wordpress/trunk@18 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2003-05-06 22:16:07 +00:00
parent 0907d4faf1
commit 0584bb0fd4
4 changed files with 47 additions and 19 deletions

View File

@ -154,7 +154,8 @@ $rss_encoded_html = 0;
# length (in words) of excerpts in the RSS feed? 0=unlimited
# note: in b2rss.php, this will be set to 0 if you use encoded HTML
$rss_excerpt_length = 50;
#use the excerpt field for rss feed.
$rss_use_excerpt = 1;
// ** Weblogs.com ping **

View File

@ -45,7 +45,16 @@ if (!isset($rss_language)) { $rss_language = 'en'; }
<dc:date><?php the_time('Y-m-d\TH:i:s'); ?></dc:date>
<dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
<dc:subject><?php the_category_rss() ?></dc:subject>
<?php if ($rss_use_excerpt) {
?>
<description><?php the_excerpt_rss($rss_excerpt_length, 2) ?></description>
<?php
} else { // use content
?>
<description><?php the_content_rss('', 0, '', $rss_excerpt_length, 2) ?></description>
<?php
} // end else use content
?>
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
</item>
<?php } ?>

View File

@ -21,14 +21,23 @@ if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_leng
<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
<item>
<title><?php the_title_rss() ?></title><?php
<title><?php the_title_rss() ?></title>
<?php
// we might use this in the future, but not now, that's why it's commented in PHP
// so that it doesn't appear at all in the RSS
// echo "<category>"; the_category_unicode(); echo "</category>"; ?>
// echo "<category>"; the_category_unicode(); echo "</category>";
if ($rss_use_excerpt) {
?>
<description><?php the_excerpt_rss($rss_excerpt_length, $rss_encoded_html) ?></description>
<?php
} else { // use content
?>
<description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
<?php
} // end else use content
?>
<link><?php permalink_single_rss() ?></link>
</item>
<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
</channel>
</rss>

View File

@ -37,7 +37,16 @@ if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_leng
<dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
<dc:subject><?php the_category_rss() ?></dc:subject>
<guid isPermaLink="false"><?php echo $id; ?>@<?php bloginfo_rss("url") ?></guid>
<?php if ($rss_use_excerpt) {
?>
<description><?php the_excerpt_rss($rss_excerpt_length, 2) ?></description>
<?php
} else { // use content
?>
<description><?php the_content_rss('', 0, '', $rss_excerpt_length, 2) ?></description>
<?php
} // end else use content
?>
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
</item>
<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>