Changeset 6441 for trunk/wp-admin/index.php
- Timestamp:
- 12/20/2007 10:36:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/index.php
r6431 r6441 32 32 33 33 <?php 34 // I'm not sure how to internationalize this, Nikolay?35 36 34 $num_posts = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'" ); 37 35 … … 48 46 $num_tags = wp_count_terms('post_tag'); 49 47 50 $sentence = 'You have '; 51 if ( $num_posts ) 52 $sentence .= '<a href="edit.php">' . number_format( $num_posts ) . ' posts</a>, '; 48 $post_type_texts = array(); 53 49 54 if ( $num_pages ) 55 $sentence .= '<a href="edit-pages.php">' . number_format( $num_pages ) . ' pages</a>, '; 50 if ( $num_posts ) { 51 $post_type_texts[] = '<a href="edit.php">'.sprintf( __ngettext( '%d post', '%d posts', $num_posts ), number_format_i18n( $num_posts ) ).'</a>'; 52 } 53 if ( $num_pages ) { 54 $post_type_texts[] = '<a href="edit-pages.php">'.sprintf( __ngettext( '%d page', '%d pages', $num_pages ), number_format_i18n( $num_pages ) ).'</a>'; 55 } 56 if ( $num_drafts ) { 57 $post_type_texts[] = '<a href="edit.php?post_status=draft">'.sprintf( __ngettext( '%d draft', '%d drafts', $num_drafts ), number_format_i18n( $num_drafts ) ).'</a>'; 58 } 59 if ( $num_future ) { 60 $post_type_texts[] = '<a href="edit.php?post_status=future">'.sprintf( __ngettext( '%d scheduled post', '%d scheduled posts', $num_future ), number_format_i18n( $num_future ) ).'</a>'; 61 } 56 62 57 if ( $num_drafts ) 58 $sentence .= '<a href="edit.php?post_status=draft">' . number_format( $num_drafts ) . ' drafts</a>, ';63 $cats_text = '<a href="categories.php">'.sprintf( __ngettext( '%d category', '%d categories', $num_cats ), number_format_i18n( $num_cats ) ).'</a>'; 64 $tags_text = sprintf( __ngettext( '%d tag', '%d tags', $num_tags ), number_format_i18n( $num_tags ) ); 59 65 60 if ( $num_future ) 61 $sentence .= '<a href="edit.php?post_status=future">' . number_format( $num_future ) . ' scheduled posts</a>, '; 66 $post_type_text = implode(', ', $post_type_texts); 62 67 63 68 // There is always a category 64 $sentence .= 'contained within <a href="categories.php">' . number_format( $num_cats ) . ' categories</a> and ' . number_format( $num_tags ) . ' tags.';69 $sentence = sprintf( __( 'You have %1$s, contained within %2$s and %3$s.' ), $post_type_text, $cats_text, $tags_text ); 65 70 66 71 ?> … … 69 74 $ct = current_theme_info(); 70 75 $sidebars_widgets = wp_get_sidebars_widgets(); 71 $num_widgets = count( $sidebar_widgets ); 76 $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) ); 77 $widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets ); 72 78 ?> 73 <p>You use the <?php echo $ct->title; ?> theme with <a href='widgets.php'><?php echo $num_widgets; ?> widgets</a>. <a href="themes.php">Change Theme</a>. You're using BetaPress TODO.</p> 79 <p><?php printf( __( 'You are using %1$s theme with %2$s.' ), $ct->title, $widgets_text ); ?> <a href="themes.php"><?php _e('Change Theme'); ?></a>. You're using BetaPress TODO.</p> 80 <p> 74 81 <?php do_action( 'rightnow_end' ); ?> 75 82 <?php do_action( 'activity_box_end' ); ?> … … 79 86 80 87 <div class="dashboard-widget"> 81 <div class="dashboard-widget-edit"><a href=""> See All</a> | <a href="">Edit</a></div>88 <div class="dashboard-widget-edit"><a href=""><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 82 89 <h3>Recent Comments</h3> 83 90 … … 112 119 $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') ) ); 113 120 ?> 114 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""> Edit</a></div>115 <h3> Incoming Links</h3>121 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 122 <h3><?php _e('Incoming Links'); ?></h3> 116 123 117 124 <div id="incominglinks"></div> … … 122 129 $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND " . get_private_posts_cap_sql('post') . " AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5"); 123 130 ?> 124 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""> Edit</a></div>131 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a></div> 125 132 <h3>Recent Posts</h3> 126 133 … … 139 146 140 147 <div class="dashboard-widget"> 141 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""> Edit</a> | <a href="">RSS</a></div>148 <div class="dashboard-widget-edit"><a href="<?php echo htmlspecialchars( $more_link ); ?>"><?php _e('See All'); ?></a> | <a href=""><?php _e('Edit'); ?></a> | <a href=""><?php _e('RSS'); ?></a></div> 142 149 <h3><?php echo apply_filters( 'dashboard_primary_title', __('Blog') ); ?></h3> 143 150 … … 147 154 <?php do_action( 'dashboard_widgets' ); ?> 148 155 149 <p><a href=""> Customize this page</a>.</p>156 <p><a href=""><?php _e('Customize this page'); ?></a>.</p> 150 157 151 158 </div>
Note: See TracChangeset
for help on using the changeset viewer.