Make WordPress Core

Changeset 375


Ignore:
Timestamp:
09/21/2003 11:06:53 PM (21 years ago)
Author:
mikelittle
Message:

Fix to handle no (matching) posts found.
http://sourceforge.net/tracker/index.php?func=detail&aid=809176&group_id=51422&atid=463233

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/b2rdf.php

    r352 r375  
    5252    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    5353>
    54 
    5554<channel rdf:about="<?php bloginfo_rss("url") ?>">
    56 
    5755    <title><?php bloginfo_rss('name') ?></title>
    5856    <link><?php bloginfo_rss('url') ?></link>
     
    6664    <sy:updateFrequency>1</sy:updateFrequency>
    6765    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    68 
    6966    <items>
    7067        <rdf:Seq>
    71         <?php $items_count = 0; foreach ($posts as $post) { start_b2(); ?>
     68        <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_b2(); ?>
    7269            <rdf:li rdf:resource="<?php permalink_single_rss() ?>"/>
    73         <?php $b2_items[] = $row; $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
     70        <?php $b2_items[] = $row; $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } } ?>
    7471        </rdf:Seq>
    7572    </items>
    7673</channel>
    77 
    78 <?php foreach ($posts as $post) { start_b2(); ?>
     74<?php if ($posts) { foreach ($posts as $post) { start_b2(); ?>
    7975<item rdf:about="<?php permalink_single_rss() ?>">
    8076    <title><?php the_title_rss() ?></title>
     
    9591    <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    9692</item>
    97 <?php } ?>
    98 
     93<?php } }  ?>
    9994</rdf:RDF>
  • trunk/b2rss.php

    r352 r375  
    5656        <language><?php echo $rss_language ?></language>
    5757
    58 <?php $items_count = 0; foreach ($posts as $post) { start_b2(); ?>
     58<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_b2(); ?>
    5959        <item>
    6060            <title><?php the_title_rss() ?></title>
     
    7575            <link><?php permalink_single_rss() ?></link>
    7676        </item>
    77 <?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
     77<?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } } ?>
    7878    </channel>
    7979</rss>
  • trunk/b2rss2.php

    r352 r375  
    6767    <sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
    6868
    69     <?php $items_count = 0; foreach ($posts as $post) { start_b2(); ?>
     69    <?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_b2(); ?>
    7070    <item rdf:about="<?php permalink_single_rss() ?>">
    7171        <title><?php the_title_rss() ?></title>
     
    8787        <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    8888    </item>
    89     <?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } ?>
     89    <?php $items_count++; if (($items_count == $posts_per_rss) && empty($m)) { break; } } } ?>
    9090</channel>
    9191</rss>
Note: See TracChangeset for help on using the changeset viewer.