Ticket #12086: 12086.diff
File 12086.diff, 8.7 KB (added by , 14 years ago) |
---|
-
wp-admin/edit-comments.php
192 192 $link = add_query_arg( 'comment_type', $comment_type, $link ); 193 193 194 194 foreach ( $stati as $status => $label ) { 195 $class = '';195 $class = ( $status == $comment_status ) ? ' class="current"' : ''; 196 196 197 if ( $status == $comment_status )198 $class = ' class="current"';199 197 if ( !isset( $num_comments->$status ) ) 200 198 $num_comments->$status = 10; 199 if ( empty( $num_comments->$status ) ) 200 continue; 201 201 $link = add_query_arg( 'comment_status', $status, $link ); 202 202 if ( $post_id ) 203 203 $link = add_query_arg( 'p', absint( $post_id ), $link ); … … 270 270 271 271 <div class="tablenav"> 272 272 273 <?php if ( $comments ) { ?> 273 274 <?php if ( $page_links ) : ?> 274 275 <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s', 275 276 number_format_i18n( $start + 1 ), … … 346 347 347 348 <div class="clear"></div> 348 349 349 <?php if ( $comments ) { ?>350 350 <table class="widefat comments fixed" cellspacing="0"> 351 351 <thead> 352 352 <tr> -
wp-admin/upload.php
143 143 } else { 144 144 $start = ( (int) $_GET['paged'] - 1 ) * $media_per_page; 145 145 $orphans = $wpdb->get_results( $wpdb->prepare( "SELECT SQL_CALC_FOUND_ROWS * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1 LIMIT %d, %d", $start, $media_per_page ) ); 146 $page_links_total = ceil($wpdb->get_var( "SELECT FOUND_ROWS()" ) / $media_per_page); 146 $total_orphans = $wpdb->get_var( "SELECT FOUND_ROWS()" ); 147 $page_links_total = ceil( $total_orphans / $media_per_page ); 147 148 } 148 149 149 150 $post_mime_types = get_post_mime_types(); … … 219 220 $type_links = array(); 220 221 $_num_posts = (array) wp_count_attachments(); 221 222 $_total_posts = array_sum($_num_posts) - $_num_posts['trash']; 223 if ( !isset( $total_orphans ) ) 224 $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" ); 222 225 $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts)); 223 226 foreach ( $matches as $type => $reals ) 224 227 foreach ( $reals as $real ) … … 234 237 235 238 if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) 236 239 $class = ' class="current"'; 240 if ( !empty( $num_posts[$mime_type] ) ) 241 $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>'; 242 } 243 $type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>'; 237 244 238 $type_links[] = "<li><a href='upload.php?post_mime_type=$mime_type'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>'; 239 } 240 $type_links[] = '<li><a href="upload.php?detached=1"' . ( isset($_GET['detached']) ? ' class="current"' : '' ) . '>' . __('Unattached') . '</a>'; 241 if ( EMPTY_TRASH_DAYS && ( MEDIA_TRASH || !empty($_num_posts['trash']) ) ) 245 if ( !empty($_num_posts['trash']) ) 242 246 $type_links[] = '<li><a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>'; 243 247 244 248 echo implode( " |</li>\n", $type_links) . '</li>'; … … 255 259 </form> 256 260 257 261 <form id="posts-filter" action="" method="get"> 262 <?php if ( have_posts() || isset( $orphans ) ) { ?> 258 263 <div class="tablenav"> 259 264 <?php 265 260 266 if ( ! isset($page_links_total) ) 261 267 $page_links_total = $wp_query->max_num_pages; 262 268 … … 279 285 <?php endif; ?> 280 286 281 287 <div class="alignleft actions"> 288 <?php if ( ! isset( $orphans ) || ! empty( $orphans ) ) { ?> 282 289 <select name="action" class="select-action"> 283 290 <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option> 284 291 <?php if ( $is_trash ) { ?> … … 328 335 329 336 <?php } // ! is_singular ?> 330 337 331 <?php if ( isset($_GET['detached']) ) { ?> 338 <?php 339 340 } // ! empty( $orphans ) 341 342 if ( isset($_GET['detached']) ) { ?> 332 343 <input type="submit" id="find_detached" name="find_detached" value="<?php esc_attr_e('Scan for lost attachments'); ?>" class="button-secondary" /> 333 344 <?php } elseif ( isset($_GET['status']) && $_GET['status'] == 'trash' && current_user_can('edit_others_posts') ) { ?> 334 345 <input type="submit" id="delete_all" name="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" /> … … 339 350 <br class="clear" /> 340 351 </div> 341 352 353 <?php } // have_posts() || !empty( $orphans ) ?> 354 342 355 <div class="clear"></div> 343 356 344 <?php if ( isset($orphans) ) { ?>357 <?php if ( ! empty( $orphans ) ) { ?> 345 358 <table class="widefat" cellspacing="0"> 346 359 <thead> 347 360 <tr> … … 365 378 366 379 <tbody id="the-list" class="list:post"> 367 380 <?php 368 if ( $orphans ) {369 381 foreach ( $orphans as $post ) { 370 382 $class = 'alternate' == $class ? '' : 'alternate'; 371 383 $att_title = esc_html( _draft_or_post_title($post->ID) ); … … 423 435 } ?> 424 436 <td class="date column-date"><?php echo $h_time ?></td> 425 437 </tr> 426 <?php } 427 428 } else { ?> 429 <tr><td colspan="5"><?php _e('No media attachments found.') ?></td></tr> 430 <?php } ?> 438 <?php } ?> 431 439 </tbody> 432 440 </table> 433 441 … … 442 450 <div class="tablenav"> 443 451 444 452 <?php 453 if ( have_posts() || ! empty( $orphans ) ) { 454 445 455 if ( $page_links ) 446 456 echo "<div class='tablenav-pages'>$page_links_text</div>"; 447 457 ?> … … 466 476 <?php } ?> 467 477 </div> 468 478 479 <?php } ?> 469 480 <br class="clear" /> 470 481 </div> 471 482 <?php find_posts_div(); ?> -
wp-admin/plugins.php
630 630 ?> 631 631 </ul> 632 632 633 <?php if ( ! empty( $plugins ) ) { ?> 634 633 635 <div class="tablenav"> 636 634 637 <?php 638 635 639 if ( $page_links ) 636 640 echo '<div class="tablenav-pages">', $page_links_text, '</div>'; 637 641 … … 653 657 print_plugin_actions($status, "action2"); 654 658 ?> 655 659 </div> 660 <?php } elseif ( ! empty( $all_plugins ) ) { ?> 661 <p><?php __( 'No plugins found.' ); ?></p> 662 <?php } ?> 656 663 </form> 657 664 658 665 <?php if ( empty($all_plugins) ) : ?> 666 <br class="clear" /> 659 667 <p><?php _e('You do not appear to have any plugins available at this time.') ?></p> 660 668 <?php endif; ?> 661 669 -
wp-admin/edit.php
400 400 <div class="clear"></div> 401 401 <p><?php 402 402 if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] ) 403 _e( 'No posts found in the trash');403 _e( 'No posts found in the Trash.' ); 404 404 else 405 _e( 'No posts found');405 _e( 'No posts found.' ); 406 406 ?></p> 407 407 <?php } ?> 408 408 -
wp-admin/link-manager.php
99 99 <form id="posts-filter" action="" method="get"> 100 100 <div class="tablenav"> 101 101 102 <?php 103 if ( 'all' == $cat_id ) 104 $cat_id = ''; 105 $args = array( 'category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0 ); 106 if ( ! empty( $_GET['s'] ) ) 107 $args['search'] = $_GET['s']; 108 $links = get_bookmarks( $args ); 109 if ( $links ) { 110 ?> 111 102 112 <div class="alignleft actions"> 103 113 <select name="action"> 104 114 <option value="" selected="selected"><?php _e('Bulk Actions'); ?></option> … … 135 145 <div class="clear"></div> 136 146 137 147 <?php 138 if ( 'all' == $cat_id )139 $cat_id = '';140 $args = array('category' => $cat_id, 'hide_invisible' => 0, 'orderby' => $sqlorderby, 'hide_empty' => 0);141 if ( !empty($_GET['s']) )142 $args['search'] = $_GET['s'];143 $links = get_bookmarks( $args );144 if ( $links ) {145 148 $link_columns = get_column_headers('link-manager'); 146 149 $hidden = get_hidden_columns('link-manager'); 147 150 ?> … … 251 254 </tbody> 252 255 </table> 253 256 254 <?php } else { ?>255 <p><?php _e('No links found.') ?></p>256 <?php } ?>257 258 257 <div class="tablenav"> 259 258 260 259 <div class="alignleft actions"> … … 265 264 <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 266 265 </div> 267 266 267 <?php } else { ?> 268 <p><?php _e( 'No links found.' ) ?></p> 269 <?php } ?> 270 268 271 <br class="clear" /> 269 272 </div> 270 273