Make WordPress Core


Ignore:
Timestamp:
10/11/2006 11:03:17 PM (18 years ago)
Author:
markjaquith
Message:

The changing of the pies. Now using SimplePie. props to gsnedders. fixes #2864

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/index.php

    r4349 r4378  
    1717
    1818<?php
    19 $rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
    20 if ( isset($rss->items) && 0 != count($rss->items) ) {
     19$rss = fetch_simplepie('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
     20if ( $rss && $rss->get_item_quantity() > 0 ) {
    2121?>
    2222<div id="incominglinks">
     
    2424<ul>
    2525<?php
    26 $rss->items = array_slice($rss->items, 0, 10);
    27 foreach ($rss->items as $item ) {
     26foreach ($rss->get_items(0, 10) as $item ) {
    2827?>
    29     <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
     28    <li><a href="<?php echo wp_filter_kses($item->get_permalink()); ?>"><?php echo wptexturize(wp_specialchars($item->get_title())); ?></a></li>
    3029<?php } ?>
    3130</ul>
     
    130129<p><?php _e("Need help with WordPress? Please see our <a href='http://codex.wordpress.org/'>documentation</a> or visit the <a href='http://wordpress.org/support/'>support forums</a>."); ?></p>
    131130<?php
    132 $rss = @fetch_rss('http://wordpress.org/development/feed/');
    133 if ( isset($rss->items) && 0 != count($rss->items) ) {
     131$rss = fetch_simplepie('http://wordpress.org/development/feed/');
     132if ( $rss && $rss->get_item_quantity() > 0 ) {
    134133?>
    135134<div id="devnews">
    136135<h3><?php _e('WordPress Development Blog'); ?></h3>
    137136<?php
    138 $rss->items = array_slice($rss->items, 0, 3);
    139 foreach ($rss->items as $item ) {
     137foreach ($rss->get_items(0, 3) as $item ) {
    140138?>
    141 <h4><a href='<?php echo wp_filter_kses($item['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> &#8212; <?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></h4>
    142 <p><?php echo $item['description']; ?></p>
     139<h4><a href='<?php echo wp_filter_kses($item->get_permalink()); ?>'><?php echo wp_specialchars($item->get_title()); ?></a> &#8212; <?php printf(__('%s ago'), human_time_diff( $item->get_date('U') ) ); ?></h4>
     140<p><?php echo $item->get_description(); ?></p>
    143141<?php
    144142    }
     
    148146
    149147<?php
    150 $rss = @fetch_rss('http://planet.wordpress.org/feed/');
    151 if ( isset($rss->items) && 0 != count($rss->items) ) {
     148$rss = fetch_simplepie('http://planet.wordpress.org/feed/');
     149if ( $rss && $rss->get_item_quantity() > 0 ) {
    152150?>
    153151<div id="planetnews">
     
    155153<ul>
    156154<?php
    157 $rss->items = array_slice($rss->items, 0, 20);
    158 foreach ($rss->items as $item ) {
    159 $title = wp_specialchars($item['title']);
    160 $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
    161 $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
     155foreach ($rss->get_items(0, 20) as $item ) {
     156$title = wp_specialchars($item->get_title());
     157$author = preg_replace( '|(.+?):.+|s', '$1', $item->get_title() );
     158$post = preg_replace( '|.+?:(.+)|s', '$1', $item->get_title() );
    162159?>
    163 <li><a href='<?php echo wp_filter_kses($item['link']); ?>'><span class="post"><?php echo $post; ?></span><span class="hidden"> - </span><cite><?php echo $author; ?></cite></a></li>
     160<li><a href='<?php echo wp_filter_kses($item->get_permalink()); ?>'><span class="post"><?php echo $post; ?></span><span class="hidden"> - </span><cite><?php echo $author; ?></cite></a></li>
    164161<?php
    165162    }
Note: See TracChangeset for help on using the changeset viewer.