Changeset 1069 for trunk/wp-admin/index.php
- Timestamp:
- 10/12/07 16:21:15 (1 year ago)
- Files:
-
- trunk/wp-admin/index.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/index.php
r1005 r1069 1 1 <?php 2 require_once('admin.php'); 2 require_once('admin.php'); 3 3 4 4 function index_js() { 5 5 ?> 6 6 <script type="text/javascript"> 7 Event.observe( window, 'load', dashboard_init, false ); 8 function dashboard_init() { 9 var update1 = new Ajax.Updater( 'incominglinks', 'index-extra.php?jax=incominglinks' ); 10 var update2 = new Ajax.Updater( 'devnews', 'index-extra.php?jax=devnews' ); 11 var update3 = new Ajax.Updater( 'planetnews', 'index-extra.php?jax=planetnews' ); 12 } 7 jQuery(function() { 8 jQuery('#incominglinks').load('index-extra.php?jax=incominglinks'); 9 jQuery('#devnews').load('index-extra.php?jax=devnews'); 10 jQuery('#planetnews').load('index-extra.php?jax=planetnews'); 11 }); 13 12 </script> 14 13 <?php 15 14 } 16 15 add_action( 'admin_head', 'index_js' ); 17 wp_enqueue_script('prototype');18 wp_enqueue_script('interface');19 16 20 $title = __('Dashboard'); 17 wp_enqueue_script( 'jquery' ); 18 19 $title = __('Dashboard'); 21 20 $parent_file = 'index.php'; 22 21 require_once('admin-header.php'); … … 41 40 ?> 42 41 <div> 43 <h3><?php _e('Comments'); ?> <a href="edit-comments.php" title="<?php _e('More comments...'); ?>">»</a></h3>42 <h3><?php printf( __( 'Comments <a href="%s" title="More comments…">»</a>' ), 'edit-comments.php' ); ?></h3> 44 43 45 44 <?php if ( $numcomments ) : ?> 46 <p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s) '), number_format($numcomments) ); ?> »</a></strong></p>45 <p><strong><a href="moderation.php"><?php echo sprintf(__('Comments in moderation (%s) »'), number_format_i18n($numcomments) ); ?></a></strong></p> 47 46 <?php endif; ?> 48 47 … … 51 50 if ( $comments ) { 52 51 foreach ($comments as $comment) { 53 echo '<li>' . sprintf(__('%1$s on %2$s'), get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . apply_filters('the_title', get_the_title($comment->comment_post_ID)) . '</a>');52 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>'); 54 53 edit_comment_link(__("Edit"), ' <small>(', ')</small>'); 55 54 echo '</li>'; … … 65 64 ?> 66 65 <div> 67 <h3><?php _e('Posts'); ?> <a href="edit.php" title="<?php _e('More posts...'); ?>">»</a></h3>66 <h3><?php printf( __( 'Posts <a href="%s" title="More posts…">»</a>' ), 'edit.php' ); ?></h3> 68 67 <ul> 69 68 <?php … … 102 101 $numposts = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'"); 103 102 $numcomms = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'"); 104 $numcats = (int) $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->categories"); 103 $numcats = wp_count_terms('category'); 104 $numtags = wp_count_terms('post_tag'); 105 105 106 $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), number_format($numposts), 'edit.php'); 107 $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), number_format($numcomms), 'edit-comments.php'); 108 $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), number_format($numcats), 'categories.php'); 106 $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), number_format_i18n($numposts), 'edit.php'); 107 $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), number_format_i18n($numcomms), 'edit-comments.php'); 108 $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), number_format_i18n($numcats), 'categories.php'); 109 $tag_str = sprintf(__ngettext('%1$s tag', '%1$s tags', $numtags), number_format_i18n($numtags)); 109 110 ?> 110 111 111 <p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s .'), $post_str, $comm_str, $cat_str); ?></p>112 <p><?php printf(__('There are currently %1$s and %2$s, contained within %3$s and %4$s.'), $post_str, $comm_str, $cat_str, $tag_str); ?></p> 112 113 </div> 113 114
