root/branches/2.1/wp-admin/index-extra.php

Revision 4871, 2.2 kB (checked in by ryan, 2 years ago)

Send content type header. Props nbachiyski. fixes #3754

  • Property svn:eol-style set to native
Line 
1 <?php
2 require_once('admin.php');
3 require_once (ABSPATH . WPINC . '/rss.php');
4
5 @header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
6
7 switch ( $_GET['jax'] ) {
8
9 case 'incominglinks' :
10 $rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
11 if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
12 ?>
13 <h3><?php _e('Incoming Links'); ?> <cite><a href="http://www.technorati.com/search/<?php echo trailingslashit(get_option('home')); ?>?partner=wordpress"><?php _e('More &raquo;'); ?></a></cite></h3>
14 <ul>
15 <?php
16 $rss->items = array_slice($rss->items, 0, 10);
17 foreach ($rss->items as $item ) {
18 ?>
19     <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
20 <?php } ?>
21 </ul>
22 <?php
23 }
24 break;
25
26 case 'devnews' :
27 $rss = @fetch_rss('http://wordpress.org/development/feed/');
28 if ( isset($rss->items) && 0 != count($rss->items) ) {
29 ?>
30 <h3><?php _e('WordPress Development Blog'); ?></h3>
31 <?php
32 $rss->items = array_slice($rss->items, 0, 3);
33 foreach ($rss->items as $item ) {
34 ?>
35 <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>
36 <p><?php echo $item['description']; ?></p>
37 <?php
38     }
39 }
40 ?>
41
42 <?php
43 break;
44
45 case 'planetnews' :
46 $rss = @fetch_rss('http://planet.wordpress.org/feed/');
47 if ( isset($rss->items) && 0 != count($rss->items) ) {
48 ?>
49 <h3><?php _e('Other WordPress News'); ?></h3>
50 <ul>
51 <?php
52 $rss->items = array_slice($rss->items, 0, 20);
53 foreach ($rss->items as $item ) {
54 $title = wp_specialchars($item['title']);
55 $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
56 $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
57 ?>
58 <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>
59 <?php
60     }
61 ?>
62 </ul>
63 <p class="readmore"><a href="http://planet.wordpress.org/"><?php _e('Read more'); ?> &raquo;</a></p>
64 <?php
65 }
66 break;
67 }
68
69 ?>
Note: See TracBrowser for help on using the browser.