Ticket #2793: alpha.diff
File alpha.diff, 4.3 KB (added by , 18 years ago) |
---|
-
wp-admin/users.php
30 30 var $search_term; 31 31 var $page; 32 32 var $raw_page; 33 var $letter_search; 33 34 var $users_per_page = 50; 34 35 var $first_user; 35 36 var $last_user; … … 39 40 var $too_many_total_users = false; 40 41 var $search_errors; 41 42 42 function WP_User_Search ($search_term = '', $page = '' ) { // constructor43 function WP_User_Search ($search_term = '', $page = '', $letter = '') { // constructor 43 44 $this->search_term = $search_term; 44 45 $this->raw_page = ( '' == $page ) ? false : (int) $page; 45 46 $this->page = (int) ( '' == $page ) ? 1 : $page; 47 $this->letter_search = ( '' == $letter ) ? "" : " AND user_login LIKE '$letter%'"; 46 48 47 49 $this->prepare_query(); 48 50 $this->query(); … … 62 64 $search_sql .= implode(' OR ', $searches); 63 65 $search_sql .= ')'; 64 66 } 65 $this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql ";67 $this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql $this->letter_search"; 66 68 67 69 if ( !$_GET['update'] && !$this->search_term && !$this->raw_page && $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users") > $this->users_per_page ) 68 70 $this->too_many_total_users = sprintf(__('Because this blog has more than %s users, they cannot all be shown on one page. Use the paging or search functionality in order to find the user you want to edit.'), $this->users_per_page); … … 88 90 $next_page = ( ($this->page * $this->users_per_page) < $this->total_users_for_query ) ? true : false; 89 91 $this->paging_text = ''; 90 92 if ( $prev_page ) 91 $this->paging_text .= '<p class="alignleft"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page - 1 ), 'users.php?') . '">« Previous Page</a></p>';93 $this->paging_text .= '<p class="alignleft"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page - 1, 'userletter' => $_GET['userletter']), 'users.php?') . '">« Previous Page</a></p>'; 92 94 if ( $next_page ) 93 $this->paging_text .= '<p class="alignright"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page + 1 ), 'users.php?') . '">Next Page »</a></p>';95 $this->paging_text .= '<p class="alignright"><a href="' . add_query_arg(array('usersearch' => $this->search_term, 'userspage' => $this->page + 1, 'userletter' => $_GET['userletter']), 'users.php?') . '">Next Page »</a></p>'; 94 96 if ( $prev_page || $next_page ) 95 97 $this->paging_text .= '<br style="clear:both" />'; 96 98 } … … 271 273 include('admin-header.php'); 272 274 273 275 // Query the users 274 $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage'] );276 $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage'], $_GET['userletter']); 275 277 276 278 // Make the user objects 277 279 foreach ( $wp_user_search->get_results() as $userid ) { … … 333 335 <?php endif; ?> 334 336 335 337 <div class="wrap"> 338 <?php 339 for ( $i=65; $i<=90; $i++ ) $user_alphabet[] = chr($i); 340 $user_alphabet = apply_filters('user_alphabet', $user_alphabet); 341 foreach ( $user_alphabet as $letter ) { 342 $alpha_list .= ( $_GET['userletter'] == $letter ) ? 343 "<li class='current'><a href='users.php?userletter=$letter'><strong>$letter</strong></a></li>\n" 344 : "<li><a href='users.php?userletter=$letter'>$letter</a></li>\n"; 345 } 346 ?><ul id='user_alphabet'> 347 <?php echo $alpha_list; ?> 348 </ul> 336 349 337 350 <?php if ( $wp_user_search->is_search() ) : ?> 338 351 <h2><?php printf(__('Users Matching "%s" by Role'), $wp_user_search->search_term); ?></h2> … … 507 520 } // end of the $action switch 508 521 509 522 include('admin-footer.php'); 510 ?> 511 No newline at end of file 523 ?> -
wp-admin/wp-admin.css
417 417 color: #333; 418 418 } 419 419 420 #adminmenu li, #submenu li {420 #adminmenu li, #submenu li, #user_alphabet li { 421 421 display: inline; 422 422 line-height: 200%; 423 423 list-style: none; 424 424 text-align: center; 425 425 } 426 426 427 #user_alphabet { 428 text-align: center; 429 } 430 431 #user_alphabet li { 432 padding: .3em; 433 text-align: center; 434 font-size: 120%; 435 } 436 427 437 #submenu { 428 438 background: #0d324f; 429 439 border-bottom: none;