2006-11-18 18:12:39 -05:00
|
|
|
<?php
|
|
|
|
require_once('admin.php');
|
|
|
|
require_once (ABSPATH . WPINC . '/rss.php');
|
|
|
|
|
2007-06-02 01:21:18 -04:00
|
|
|
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
2007-02-06 15:12:53 -05:00
|
|
|
|
2006-11-18 18:12:39 -05:00
|
|
|
switch ( $_GET['jax'] ) {
|
|
|
|
|
|
|
|
case 'incominglinks' :
|
2007-08-17 07:08:00 -04:00
|
|
|
|
2007-09-03 19:32:58 -04:00
|
|
|
$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') ) );
|
2007-08-17 07:08:00 -04:00
|
|
|
$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') ) );
|
|
|
|
|
|
|
|
$rss = @fetch_rss( $rss_feed );
|
2006-11-18 18:12:39 -05:00
|
|
|
if ( isset($rss->items) && 1 < count($rss->items) ) { // Technorati returns a 1-item feed when it has no results
|
|
|
|
?>
|
2007-08-17 07:08:00 -04:00
|
|
|
<h3><?php _e('Incoming Links'); ?> <cite><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('More »'); ?></a></cite></h3>
|
2006-11-18 18:12:39 -05:00
|
|
|
<ul>
|
|
|
|
<?php
|
|
|
|
$rss->items = array_slice($rss->items, 0, 10);
|
|
|
|
foreach ($rss->items as $item ) {
|
|
|
|
?>
|
|
|
|
<li><a href="<?php echo wp_filter_kses($item['link']); ?>"><?php echo wptexturize(wp_specialchars($item['title'])); ?></a></li>
|
|
|
|
<?php } ?>
|
|
|
|
</ul>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'devnews' :
|
2007-04-29 18:37:37 -04:00
|
|
|
$rss = @fetch_rss(apply_filters( 'dashboard_primary_feed', 'http://wordpress.org/development/feed/' ));
|
2006-11-18 18:12:39 -05:00
|
|
|
if ( isset($rss->items) && 0 != count($rss->items) ) {
|
|
|
|
?>
|
2007-04-29 18:37:37 -04:00
|
|
|
<h3><?php echo apply_filters( 'dashboard_primary_title', __('WordPress Development Blog') ); ?></h3>
|
2006-11-18 18:12:39 -05:00
|
|
|
<?php
|
|
|
|
$rss->items = array_slice($rss->items, 0, 3);
|
|
|
|
foreach ($rss->items as $item ) {
|
|
|
|
?>
|
|
|
|
<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>
|
|
|
|
<p><?php echo $item['description']; ?></p>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'planetnews' :
|
2007-04-29 18:37:37 -04:00
|
|
|
$rss = @fetch_rss(apply_filters( 'dashboard_secondary_feed', 'http://planet.wordpress.org/feed/' ));
|
2006-11-18 18:12:39 -05:00
|
|
|
if ( isset($rss->items) && 0 != count($rss->items) ) {
|
|
|
|
?>
|
2007-04-29 18:37:37 -04:00
|
|
|
<h3><?php echo apply_filters( 'dashboard_secondary_title', __('Other WordPress News') ); ?></h3>
|
2006-11-18 18:12:39 -05:00
|
|
|
<ul>
|
|
|
|
<?php
|
|
|
|
$rss->items = array_slice($rss->items, 0, 20);
|
|
|
|
foreach ($rss->items as $item ) {
|
|
|
|
$title = wp_specialchars($item['title']);
|
|
|
|
$author = preg_replace( '|(.+?):.+|s', '$1', $item['title'] );
|
|
|
|
$post = preg_replace( '|.+?:(.+)|s', '$1', $item['title'] );
|
|
|
|
?>
|
|
|
|
<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>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
2007-06-11 17:05:50 -04:00
|
|
|
<p class="readmore"><a href="<?php echo apply_filters( 'dashboard_secondary_link', 'http://planet.wordpress.org/' ); ?>"><?php _e('Read more »'); ?></a></p>
|
2006-11-18 18:12:39 -05:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|