diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-22 12:54:24 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-12-22 12:54:24 +0000 |
| commit | 4fb300c67a3442cd0209a6129d53f0f727b60743 (patch) | |
| tree | a190684f113f031dbbac1d0bf09a1202251e3524 /wp-admin/index.php | |
| parent | 866b3a1b844041e6128e7e3c22710b49e72b99ec (diff) | |
| download | wordpress-mu-4fb300c67a3442cd0209a6129d53f0f727b60743.tar.gz wordpress-mu-4fb300c67a3442cd0209a6129d53f0f727b60743.tar.xz wordpress-mu-4fb300c67a3442cd0209a6129d53f0f727b60743.zip | |
WP Merge to rev 4661
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@828 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/index.php')
| -rw-r--r-- | wp-admin/index.php | 100 |
1 files changed, 33 insertions, 67 deletions
diff --git a/wp-admin/index.php b/wp-admin/index.php index 96ab1d5..92702e3 100644 --- a/wp-admin/index.php +++ b/wp-admin/index.php @@ -1,36 +1,36 @@ <?php require_once('admin.php'); + +function index_js() { +?> +<script type="text/javascript"> +Event.observe( window, 'load', dashboard_init, false ); +function dashboard_init() { + var update1 = new Ajax.Updater( 'incominglinks', 'index-extra.php?jax=incominglinks' ); + var update2 = new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews' ); + var update3 = new Ajax.Updater( 'planetnews', 'index-extra.php?jax=planetnews' ); +} +</script> +<?php +} +add_action( 'admin_head', 'index_js' ); +wp_enqueue_script('prototype'); + $title = __('Dashboard'); $parent_file = 'index.php'; require_once('admin-header.php'); -require_once (ABSPATH . WPINC . '/rss.php'); $today = current_time('mysql', 1); ?> <div class="wrap"> -<h2><?php _e('Dashboard'); ?></h2> +<h2><?php _e('Welcome to WordPress'); ?></h2> <div id="zeitgeist"> <h2><?php _e('Latest Activity'); ?></h2> -<?php -$rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('siteurl')) .'&partner=wordpress'); -if ( isset($rss->items) && 0 != count($rss->items) ) { -?> -<div id="incominglinks"> -<h3><?php _e('Incoming Links'); ?> <cite><a href="http://www.technorati.com/search/<?php echo trailingslashit(get_option('siteurl')); ?>?partner=wordpress"><?php _e('More'); ?> »</a></cite></h3> -<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> -</div> -<?php } ?> +<div id="incominglinks"></div> <?php $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT 5"); @@ -46,11 +46,11 @@ if ( $comments || $numcomments ) : <?php endif; ?> <ul> -<?php +<?php if ( $comments ) { foreach ($comments as $comment) { echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>'); - edit_comment_link(__("Edit"), ' <small>(', ')</small>'); + edit_comment_link(__("Edit"), ' <small>(', ')</small>'); echo '</li>'; } } @@ -80,7 +80,7 @@ foreach ($recentposts as $post) { <?php if ( $scheduled = $wpdb->get_results("SELECT ID, post_title, post_date_gmt FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'future' ORDER BY post_date ASC") ) : -?> +?> <div> <h3><?php _e('Scheduled Entries:') ?></h3> <ul> @@ -90,7 +90,7 @@ foreach ($scheduled as $post) { $post->post_title = sprintf(__('Post #%s'), $post->ID); echo "<li>" . sprintf(__('%1$s in %2$s'), "<a href='post.php?action=edit&post=$post->ID' title='" . __('Edit this post') . "'>$post->post_title</a>", human_time_diff( current_time('timestamp', 1), strtotime($post->post_date_gmt. ' GMT') )) . "</li>"; } -?> +?> </ul> </div> <?php endif; ?> @@ -99,7 +99,7 @@ foreach ($scheduled as $post) { <h3><?php _e('Blog Stats'); ?></h3> <?php $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); -if (0 < $numposts) $numposts = number_format($numposts); +if (0 < $numposts) $numposts = number_format($numposts); $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); if (0 < $numcomms) $numcomms = number_format($numcomms); @@ -107,14 +107,17 @@ if (0 < $numcomms) $numcomms = number_format($numcomms); $numcats = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); if (0 < $numcats) $numcats = number_format($numcats); ?> -<p><?php printf(__('There are currently %1$s <a href="%2$s" title="Posts">posts</a> and %3$s <a href="%4$s" title="Comments">comments</a>, contained within %5$s <a href="%6$s" title="categories">categories</a>.'), $numposts, 'edit.php', $numcomms, 'edit-comments.php', $numcats, 'categories.php'); ?></p> +<p><?php +$post_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Posts">post</a>', '%1$s <a href="%2$s" title="Posts">posts</a>', $numposts), $numposts, 'edit.php'); +$comm_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Comments">comment</a>', '%1$s <a href="%2$s" title="Comments">comments</a>', $numcomms), $numcomms, 'edit-comments.php'); +$cat_str = sprintf(__ngettext('%1$s <a href="%2$s" title="Categories">category</a>', '%1$s <a href="%2$s" title="Categories">categories</a>', $numcats), $numcats, 'categories.php'); + +printf(__('There are currently %1$s and %2$s, contained within %3$s.'), $post_str, $comm_str, $cat_str); ?></p> </div> <?php do_action('activity_box_end'); ?> </div> -<h3><?php _e('Welcome to WordPress MU'); ?></h3> - <p><?php _e('Use these links to get started:'); ?></p> <ul> @@ -130,48 +133,11 @@ if (0 < $numcats) $numcats = number_format($numcats); <?php endif; ?> </ul> <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> -<?php -$rss = @fetch_rss('http://wordpress.org/development/feed/'); -if ( isset($rss->items) && 0 != count($rss->items) ) { -?> -<div id="devnews"> -<h3><?php _e('WordPress Development Blog'); ?></h3> -<?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 - } -} -?> -</div> -<?php -$rss = @fetch_rss('http://planet.wordpress.org/feed/'); -if ( isset($rss->items) && 0 != count($rss->items) ) { -?> -<div id="planetnews"> -<h3><?php _e('Other WordPress News'); ?></h3> -<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> -<p class="readmore"><a href="http://planet.wordpress.org/"><?php _e('Read more'); ?> »</a></p> -</div> -<?php -} -?> +<div id="devnews"></div> + +<div id="planetnews"></div> + <div style="clear: both"> <br clear="all" /> </div> |
