]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/index-extra.php
Wordpress 2.3.3-scripts
[autoinstalls/wordpress.git] / wp-admin / index-extra.php
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
11 $rss_feed = apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
12 $more_link = apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) );
13
14 $rss = @fetch_rss( $rss_feed );
15 if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
16 ?>
17 <h3><?php _e('Incoming Links'); ?> <cite><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('More &raquo;'); ?></a></cite></h3>
18 <ul>
19 <?php
20 $rss->items = array_slice($rss->items, 0, 10);
21 foreach ($rss->items as $item ) {
22 ?>
23         <li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
24 <?php } ?>
25 </ul>
26 <?php
27 }
28 break;
29
30 case 'devnews' :
31 $rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', 'http://wordpress.org/development/feed/' ));
32 if ( isset($rss->items) && 0 != count($rss->items) ) {
33 ?>
34 <h3><?php echo apply_filters( 'dashboard_primary_title', __('WordPress Development Blog') ); ?></h3>
35 <?php
36 $rss->items = array_slice($rss->items, 0, 3);
37 foreach ($rss->items as $item ) {
38 ?>
39 <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>
40 <p><?php echo $item['description']; ?></p>
41 <?php
42         }
43 }
44 ?>
45
46 <?php
47 break;
48
49 case 'planetnews' :
50 $rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', 'http://planet.wordpress.org/feed/' ));
51 if ( isset($rss->items) && 0 != count($rss->items) ) {
52 ?>
53 <h3><?php echo apply_filters( 'dashboard_secondary_title', __('Other WordPress News') ); ?></h3>
54 <ul>
55 <?php
56 $rss->items = array_slice($rss->items, 0, 20);
57 foreach ($rss->items as $item ) {
58 $title = wp_specialchars($item['title']);
59 $author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
60 $post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
61 ?>
62 <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>
63 <?php
64         }
65 ?>
66 </ul>
67 <p class="readmore"><a href="<?php echo apply_filters( 'dashboard_secondary_link', 'http://planet.wordpress.org/' ); ?>"><?php _e('Read more &raquo;'); ?></a></p>
68 <?php
69 }
70 break;
71 }
72
73 ?>