Changeset 4378 for trunk/wp-admin/index.php
- Timestamp:
- 10/11/2006 11:03:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/index.php
r4349 r4378 17 17 18 18 <?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'); 20 if ( $rss && $rss->get_item_quantity() > 0 ) { 21 21 ?> 22 22 <div id="incominglinks"> … … 24 24 <ul> 25 25 <?php 26 $rss->items = array_slice($rss->items, 0, 10); 27 foreach ($rss->items as $item ) { 26 foreach ($rss->get_items(0, 10) as $item ) { 28 27 ?> 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> 30 29 <?php } ?> 31 30 </ul> … … 130 129 <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> 131 130 <?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/'); 132 if ( $rss && $rss->get_item_quantity() > 0 ) { 134 133 ?> 135 134 <div id="devnews"> 136 135 <h3><?php _e('WordPress Development Blog'); ?></h3> 137 136 <?php 138 $rss->items = array_slice($rss->items, 0, 3); 139 foreach ($rss->items as $item ) { 137 foreach ($rss->get_items(0, 3) as $item ) { 140 138 ?> 141 <h4><a href='<?php echo wp_filter_kses($item ['link']); ?>'><?php echo wp_specialchars($item['title']); ?></a> — <?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> — <?php printf(__('%s ago'), human_time_diff( $item->get_date('U') ) ); ?></h4> 140 <p><?php echo $item->get_description(); ?></p> 143 141 <?php 144 142 } … … 148 146 149 147 <?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/'); 149 if ( $rss && $rss->get_item_quantity() > 0 ) { 152 150 ?> 153 151 <div id="planetnews"> … … 155 153 <ul> 156 154 <?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'] ); 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() ); 162 159 ?> 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> 164 161 <?php 165 162 }
Note: See TracChangeset
for help on using the changeset viewer.