mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-08 17:38:26 +01:00
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:
parent
0907d4faf1
commit
0584bb0fd4
@ -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;
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -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 } ?>
|
||||
|
43
b2rss.php
43
b2rss.php
@ -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>
|
@ -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; } } ?>
|
||||
|
Loading…
Reference in New Issue
Block a user