Make WordPress Core


Ignore:
Timestamp:
10/16/2006 04:16:06 AM (18 years ago)
Author:
markjaquith
Message:

SimplePie patch not ready for prime time. Need it to be a drop-in solution. Reverting to MagpieRSS for now.

File:
1 edited

Legend:

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

    r4378 r4399  
    1717
    1818<?php
    19 $rss = fetch_simplepie('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
    20 if ( $rss && $rss->get_item_quantity() > 0 ) {
     19$rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
     20if ( isset($rss->items) && 0 != count($rss->items) ) {
    2121?>
    2222<div id="incominglinks">
     
    2424<ul>
    2525<?php
    26 foreach ($rss->get_items(0, 10) as $item ) {
     26$rss->items = array_slice($rss->items, 0, 10);
     27foreach ($rss->items as $item ) {
    2728?>
    28     <li><a href="<?php echo wp_filter_kses($item->get_permalink()); ?>"><?php echo wptexturize(wp_specialchars($item->get_title())); ?></a></li>
     29    <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
    2930<?php } ?>
    3031</ul>
     
    129130<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>
    130131<?php
    131 $rss = fetch_simplepie('http://wordpress.org/development/feed/');
    132 if ( $rss && $rss->get_item_quantity() > 0 ) {
     132$rss = @fetch_rss('http://wordpress.org/development/feed/');
     133if ( isset($rss->items) && 0 != count($rss->items) ) {
    133134?>
    134135<div id="devnews">
    135136<h3><?php _e('WordPress Development Blog'); ?></h3>
    136137<?php
    137 foreach ($rss->get_items(0, 3) as $item ) {
     138$rss->items = array_slice($rss->items, 0, 3);
     139foreach ($rss->items as $item ) {
    138140?>
    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>
     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>
    141143<?php
    142144    }
     
    146148
    147149<?php
    148 $rss = fetch_simplepie('http://planet.wordpress.org/feed/');
    149 if ( $rss && $rss->get_item_quantity() > 0 ) {
     150$rss = @fetch_rss('http://planet.wordpress.org/feed/');
     151if ( isset($rss->items) && 0 != count($rss->items) ) {
    150152?>
    151153<div id="planetnews">
     
    153155<ul>
    154156<?php
    155 foreach ($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() );
     157$rss->items = array_slice($rss->items, 0, 20);
     158foreach ($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'] );
    159162?>
    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>
     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>
    161164<?php
    162165    }
Note: See TracChangeset for help on using the changeset viewer.