Changeset 1170
- Timestamp:
- 12/04/07 16:12:51 (1 year ago)
- Files:
-
- trunk/wp-admin/wpmu-users.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/wpmu-users.php
r1122 r1170 40 40 <div class="wrap"> 41 41 <?php 42 $ start = isset( $_GET['start'] ) ? intval( $_GET['start'] ) : 0;43 $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 30;42 $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; 43 $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15; 44 44 45 45 $query = "SELECT * FROM {$wpdb->users}"; … … 68 68 $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; 69 69 70 $query .= " LIMIT " . intval( $start ) . ", " . intval( $num ); 70 if( !empty($_GET['s'])) { 71 $user_list = $wpdb->get_results( $query, ARRAY_A ); 72 $total = count($user_list); 73 } else { 74 $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->users}"); 75 } 76 77 $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); 78 71 79 $user_list = $wpdb->get_results( $query, ARRAY_A ); 72 73 $next = ( count( $user_list ) < $num ) ? false : true; 80 81 // Pagination 82 $user_navigation = paginate_links( array( 83 'base' => add_query_arg( 'apage', '%#%' ), 84 'format' => '', 85 'total' => ceil($total / $num), 86 'current' => $apage 87 )); 74 88 ?> 75 89 <h2><?php _e("Users"); ?></h2> 76 <div style="float:right; padding:0 20px; margin-top:10px;"> 77 <h4 style="margin:0 0 4px;"><?php _e('User Navigation') ?></h4> 78 <?php 79 $url2 = "order=" . $_GET['order'] . "&sortby=" . $_GET['sortby'] . "&s=" .$_GET['s']; 80 if( $start == 0 ) { 81 _e('Previous Users'); 82 } elseif( $start <= 30 ) { 83 echo '<a href="wpmu-users.php?start=0' . $url2 . '">'.__('Previous Users').'</a>'; 84 } else { 85 echo '<a href="wpmu-users.php?start=' . ( $start - $num ) . '&' . $url2 . '">'.__('Previous Users').'</a>'; 86 } 87 if ( $next ) { 88 echo ' || <a href="wpmu-users.php?start=' . ( $start + $num ) . '&' . $url2 . '">'.__('Next Users').'</a>'; 89 } else { 90 echo ' || '.__('Next Users'); 91 } 92 ?> 90 91 <div style="float:right; padding:0 20px; margin-top:20px;"> 92 <?php if ( $user_navigation ) echo "<p class='pagenav'>$user_navigation</p>"; ?> 93 93 </div> 94 94 … … 159 159 _e('Blogs'); 160 160 } else { ?> 161 <a href="wpmu-users.php?sortby=<?php echo $column_id ?>&<?php if( $_GET['sortby'] == $column_id ) { if( $_GET['order'] == 'DESC' ) { echo "order=ASC&" ; } else { echo "order=DESC&"; } } ?> start=<?php echo $start?>"><?php echo $column_display_name; ?></a>161 <a href="wpmu-users.php?sortby=<?php echo $column_id ?>&<?php if( $_GET['sortby'] == $column_id ) { if( $_GET['order'] == 'DESC' ) { echo "order=ASC&" ; } else { echo "order=DESC&"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a> 162 162 <?php } ?> 163 163 </th> … … 250 250 </table> 251 251 252 <div style="float:right; padding:0 20px; margin-top:20px;"> 253 <?php if ( $user_navigation ) echo "<p class='pagenav'>$user_navigation</p>"; ?> 254 </div> 255 252 256 <p><input class="button" type="button" value="<?php _e('Check All') ?>" onclick="this.value=check_all_rows()" /></p> 253 257
