Added rss_use_excerpt flag

git-svn-id: https://develop.svn.wordpress.org/trunk@18 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mike Little 2003-05-06 22:16:07 +00:00
parent fb10a6c04c
commit 4ee3e0d116
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 **
@ -349,4 +350,4 @@ $passsql = $dbpassword;
$path = $pathserver;
$base = $dbname;
?>
?>

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

@ -9,26 +9,35 @@ if (!isset($rss_excerpt_length) || ($rss_encoded_html == 1)) { $rss_excerpt_leng
?><?php echo "<?xml version=\"1.0\"?".">\n"; ?>
<!-- generator="b2/<?php echo $b2_version ?>" -->
<rss version="0.92">
<channel>
<title><?php bloginfo_rss("name") ?></title>
<link><?php bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
<docs>http://backend.userland.com/rss092</docs>
<managingEditor><?php echo $admin_email ?></managingEditor>
<webMaster><?php echo $admin_email ?></webMaster>
<language><?php echo $rss_language ?></language>
<channel>
<title><?php bloginfo_rss("name") ?></title>
<link><?php bloginfo_rss("url") ?></link>
<description><?php bloginfo_rss("description") ?></description>
<lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
<docs>http://backend.userland.com/rss092</docs>
<managingEditor><?php echo $admin_email ?></managingEditor>
<webMaster><?php echo $admin_email ?></webMaster>
<language><?php echo $rss_language ?></language>
<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
<item>
<title><?php the_title_rss() ?></title><?php
<item>
<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>"; ?>
<description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
<link><?php permalink_single_rss() ?></link>
</item>
// 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>
</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; } } ?>