WordPress.org

Make WordPress Core

Changeset 18


Ignore:
Timestamp:
05/06/2003 10:16:07 PM (15 years ago)
Author:
mikelittle
Message:

Added rss_use_excerpt flag

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2config.php

    r3 r18  
    155155#  note: in b2rss.php, this will be set to 0 if you use encoded HTML
    156156$rss_excerpt_length = 50;
    157 
     157#use the excerpt field for rss feed.
     158$rss_use_excerpt = 1;
    158159
    159160
  • trunk/b2rdf.php

    r3 r18  
    4646    <dc:creator><?php the_author() ?> (mailto:<?php the_author_email() ?>)</dc:creator>
    4747    <dc:subject><?php the_category_rss() ?></dc:subject>
     48<?php if ($rss_use_excerpt) {
     49?>
     50    <description><?php the_excerpt_rss($rss_excerpt_length, 2) ?></description>
     51<?php
     52} else { // use content
     53?>
    4854    <description><?php the_content_rss('', 0, '', $rss_excerpt_length, 2) ?></description>
     55<?php
     56} // end else use content
     57?>
    4958    <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    5059</item>
  • trunk/b2rss.php

    r3 r18  
    1010<!-- generator="b2/<?php echo $b2_version ?>" -->
    1111<rss version="0.92">
    12     <channel>
    13         <title><?php bloginfo_rss("name") ?></title>
    14         <link><?php bloginfo_rss("url") ?></link>
    15         <description><?php bloginfo_rss("description") ?></description>
    16         <lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
    17         <docs>http://backend.userland.com/rss092</docs>
    18         <managingEditor><?php echo $admin_email ?></managingEditor>
    19         <webMaster><?php echo $admin_email ?></webMaster>
    20         <language><?php echo $rss_language ?></language>
     12    <channel>
     13        <title><?php bloginfo_rss("name") ?></title>
     14        <link><?php bloginfo_rss("url") ?></link>
     15        <description><?php bloginfo_rss("description") ?></description>
     16        <lastBuildDate><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</lastBuildDate>
     17        <docs>http://backend.userland.com/rss092</docs>
     18        <managingEditor><?php echo $admin_email ?></managingEditor>
     19        <webMaster><?php echo $admin_email ?></webMaster>
     20        <language><?php echo $rss_language ?></language>
    2121
    2222<?php $items_count = 0; while($row = mysql_fetch_object($result)) { start_b2(); ?>
    23         <item>
    24                 <title><?php the_title_rss() ?></title><?php
     23        <item>
     24            <title><?php the_title_rss() ?></title>
     25<?php
    2526// we might use this in the future, but not now, that's why it's commented in PHP
    2627// so that it doesn't appear at all in the RSS
    27 //              echo "<category>"; the_category_unicode(); echo "</category>"; ?>
    28                 <description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
    29                 <link><?php permalink_single_rss() ?></link>
    30         </item>
     28//          echo "<category>"; the_category_unicode(); echo "</category>";
     29if ($rss_use_excerpt) {
     30?>
     31            <description><?php the_excerpt_rss($rss_excerpt_length, $rss_encoded_html) ?></description>
     32<?php
     33} else { // use content
     34?>
     35            <description><?php the_content_rss('', 0, '', $rss_excerpt_length, $rss_encoded_html) ?></description>
     36<?php
     37} // end else use content
     38?>
     39            <link><?php permalink_single_rss() ?></link>
     40        </item>
    3141<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
    32 
    33     </channel>
     42    </channel>
    3443</rss>
  • trunk/b2rss2.php

    r3 r18  
    3838        <dc:subject><?php the_category_rss() ?></dc:subject>
    3939        <guid isPermaLink="false"><?php echo $id; ?>@<?php bloginfo_rss("url") ?></guid>
     40<?php if ($rss_use_excerpt) {
     41?>
     42        <description><?php the_excerpt_rss($rss_excerpt_length, 2) ?></description>
     43<?php
     44} else { // use content
     45?>
    4046        <description><?php the_content_rss('', 0, '', $rss_excerpt_length, 2) ?></description>
     47<?php
     48} // end else use content
     49?>
    4150        <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    4251    </item>
Note: See TracChangeset for help on using the changeset viewer.