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:
parent
fb10a6c04c
commit
4ee3e0d116
@ -154,7 +154,8 @@ $rss_encoded_html = 0;
|
|||||||
# length (in words) of excerpts in the RSS feed? 0=unlimited
|
# 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
|
# note: in b2rss.php, this will be set to 0 if you use encoded HTML
|
||||||
$rss_excerpt_length = 50;
|
$rss_excerpt_length = 50;
|
||||||
|
#use the excerpt field for rss feed.
|
||||||
|
$rss_use_excerpt = 1;
|
||||||
|
|
||||||
|
|
||||||
// ** Weblogs.com ping **
|
// ** Weblogs.com ping **
|
||||||
@ -349,4 +350,4 @@ $passsql = $dbpassword;
|
|||||||
$path = $pathserver;
|
$path = $pathserver;
|
||||||
$base = $dbname;
|
$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: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:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
|
||||||
<dc:subject><?php the_category_rss() ?></dc:subject>
|
<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>
|
<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>
|
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
|
||||||
</item>
|
</item>
|
||||||
<?php } ?>
|
<?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"; ?>
|
?><?php echo "<?xml version=\"1.0\"?".">\n"; ?>
|
||||||
<!-- generator="b2/<?php echo $b2_version ?>" -->
|
<!-- generator="b2/<?php echo $b2_version ?>" -->
|
||||||
<rss version="0.92">
|
<rss version="0.92">
|
||||||
<channel>
|
<channel>
|
||||||
<title><?php bloginfo_rss("name") ?></title>
|
<title><?php bloginfo_rss("name") ?></title>
|
||||||
<link><?php bloginfo_rss("url") ?></link>
|
<link><?php bloginfo_rss("url") ?></link>
|
||||||
<description><?php bloginfo_rss("description") ?></description>
|
<description><?php bloginfo_rss("description") ?></description>
|
||||||
<lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
|
<lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
|
||||||
<docs>http://backend.userland.com/rss092</docs>
|
<docs>http://backend.userland.com/rss092</docs>
|
||||||
<managingEditor><?php echo $admin_email ?></managingEditor>
|
<managingEditor><?php echo $admin_email ?></managingEditor>
|
||||||
<webMaster><?php echo $admin_email ?></webMaster>
|
<webMaster><?php echo $admin_email ?></webMaster>
|
||||||
<language><?php echo $rss_language ?></language>
|
<language><?php echo $rss_language ?></language>
|
||||||
|
|
||||||
<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
|
<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
|
||||||
<item>
|
<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
|
// 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
|
// 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>";
|
||||||
<description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
|
if ($rss_use_excerpt) {
|
||||||
<link><?php permalink_single_rss() ?></link>
|
?>
|
||||||
</item>
|
<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; } } ?>
|
<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
|
||||||
|
</channel>
|
||||||
</channel>
|
|
||||||
</rss>
|
</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:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
|
||||||
<dc:subject><?php the_category_rss() ?></dc:subject>
|
<dc:subject><?php the_category_rss() ?></dc:subject>
|
||||||
<guid isPermaLink="false"><?php echo $id; ?>@<?php bloginfo_rss("url") ?></guid>
|
<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>
|
<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>
|
<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
|
||||||
</item>
|
</item>
|
||||||
<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
|
<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user