Ticket #12460: ms-sites.php.3.diff

File ms-sites.php.3.diff, 23.4 KB (added by ocean90, 3 years ago)

fix indentation, add filter for status (needs #12531); Screen: http://grab.by/2SfJ

Line 
1Index: wp-admin/includes/misc.php
2===================================================================
3--- wp-admin/includes/misc.php  (revision 13607)
4+++ wp-admin/includes/misc.php  (working copy)
5@@ -410,6 +410,8 @@
6 
7                switch ( $map_option ) {
8                        case 'edit_per_page':
9+                       case 'ms_sites_per_page':
10+                       case 'ms_users_per_page':
11                        case 'edit_comments_per_page':
12                        case 'upload_per_page':
13                        case 'categories_per_page':
14Index: wp-admin/includes/template.php
15===================================================================
16--- wp-admin/includes/template.php      (revision 13607)
17+++ wp-admin/includes/template.php      (working copy)
18@@ -3767,6 +3767,12 @@
19                case 'edit-pages':
20                        $per_page_label = __('Pages per page:');
21                        break;
22+               case 'ms-sites':
23+                       $per_page_label = __('Sites per page:');
24+                       break;
25+               case 'ms-users':
26+                       $per_page_label = __('Users per page:');
27+                       break;
28                case 'edit-comments':
29                        $per_page_label = __('Comments per page:');
30                        break;
31Index: wp-admin/ms-edit.php
32===================================================================
33--- wp-admin/ms-edit.php        (revision 13607)
34+++ wp-admin/ms-edit.php        (working copy)
35@@ -221,6 +221,9 @@
36                // rewrite rules can't be flushed during switch to blog
37                delete_option( 'rewrite_rules' );
38 
39+               // update blogs count
40+               delete_site_transient( "blog_count" );
41+
42                // update blogs table
43                $blog_data = stripslashes_deep($_POST[ 'blog' ]);
44                update_blog_details($id, $blog_data);
45@@ -292,35 +295,52 @@
46 
47                if ( $id != '0' && $id != $current_site->blog_id )
48                        wpmu_delete_blog( $id, true );
49-
50+       
51                wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) );
52                exit();
53        break;
54 
55        case "allblogs":
56-               check_admin_referer('allblogs');
57+               if ( isset($_POST['doaction']) || isset($_POST['doaction2']) ) {
58+                       check_admin_referer('bulk-sites');
59+
60                if ( ! current_user_can( 'manage_sites' ) )
61                        wp_die( __('You do not have permission to access this page.') );
62 
63+               if ( $_GET['action'] != -1 || $_POST['action2'] != -1 )
64+                       $doaction = $doaction = ($_POST['action'] != -1) ? $_POST['action'] : $_POST['action2'];
65+
66+
67                foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) {
68                        if ( $val != '0' && $val != $current_site->blog_id ) {
69-                               if ( isset($_POST['allblog_delete']) ) {
70-                                       $blogfunction = 'all_delete';
71-                                       wpmu_delete_blog( $val, true );
72-                               } elseif ( isset($_POST['allblog_spam']) ) {
73-                                       $blogfunction = 'all_spam';
74-                                       update_blog_status( $val, "spam", '1', 0 );
75-                                       set_time_limit(60);
76-                               } elseif ( isset($_POST['allblog_notspam']) ) {
77-                                       $blogfunction = 'all_notspam';
78-                                       update_blog_status( $val, "spam", '0', 0 );
79-                                       set_time_limit(60);
80+                               switch ( $doaction ) {
81+                                       case 'delete':
82+                                               $blogfunction = 'all_delete';
83+                                               wpmu_delete_blog( $val, true );
84+                                               break;
85+                                       case 'spam':
86+                                               $blogfunction = 'all_spam';
87+                                               update_blog_status( $val, "spam", '1', 0 );
88+                                               set_time_limit(60);
89+                                               break;
90+                                       case 'notspam':
91+                                               $blogfunction = 'all_notspam';
92+                                               update_blog_status( $val, "spam", '0', 0 );
93+                                               set_time_limit(60);
94+                                               break;
95                                }
96-                       }
97-               }
98+                       } else {
99+                               wp_die( __('You are not allowed to change one of this sites.') );
100+                               exit();
101+                       };
102+               };
103 
104                wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) );
105                exit();
106+
107+               } else {
108+                       wp_redirect( admin_url("ms-sites.php") );
109+               }
110        break;
111 
112        case "archiveblog":
113@@ -397,7 +417,6 @@
114        case "unmature":
115                update_blog_status( $id, 'mature', '0' );
116                do_action( 'unmature_blog', $id );
117-
118                wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'umature'), $_POST['ref'] ) );
119                exit();
120        break;
121Index: wp-admin/ms-sites.php
122===================================================================
123--- wp-admin/ms-sites.php       (revision 13607)
124+++ wp-admin/ms-sites.php       (working copy)
125@@ -156,7 +156,7 @@
126                                                <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
127                        </div></div>
128 
129-                       <div id="blogedit_blogoptions" class="postbox " >
130+                       <div id="blogedit_blogoptions" class="postbox" >
131                        <h3 class='hndle'><span><?php printf( __('Site options (%soptions)'), $blog_prefix ); ?></span></h3>
132                        <div class="inside">
133                                <table class="form-table">
134@@ -178,7 +178,7 @@
135                                                                ?>
136                                                                        <tr class="form-field">
137                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
138-                                                                               <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
139+                                                                               <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
140                                                                        </tr>
141                                                                <?php
142                                                                } else {
143@@ -311,7 +311,7 @@
144                        <div class="inside">
145                                <table class="form-table">
146                                                <?php do_action( 'wpmueditblogaction', $id ); ?>
147-                                       </table>
148+                               </table>
149                                <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
150                        </div></div>
151 
152@@ -326,27 +326,46 @@
153        // List blogs
154        case 'list':
155        default:
156-               $apage = ( isset($_GET['apage'] ) && intval( $_GET['apage'] ) ) ? absint( $_GET['apage'] ) : 1;
157-               $num = ( isset($_GET['num'] ) && intval( $_GET['num'] ) ) ? absint( $_GET['num'] ) : 15;
158-               $s = isset($_GET['s']) ? esc_attr( trim( $_GET[ 's' ] ) ) : '';
159-               $like_s = like_escape($s);
160+               $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
161+               if ( empty($pagenum) )
162+                       $pagenum = 1;
163 
164+               $per_page = (int) get_user_option( 'ms_sites_per_page' );
165+               if ( empty( $per_page ) || $per_page < 1 )
166+                       $per_page = 15;
167+
168+               $per_page = apply_filters( 'ms_sites_per_page', $per_page );
169+
170+               $s = isset($_GET['s']) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
171+               $like_s = esc_sql( like_escape( $s ) );
172+
173                $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
174 
175-               if ( isset($_GET['blog_name']) ) {
176-                       $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
177-               } elseif ( isset($_GET['blog_id']) ) {
178-                       $query .= " AND   blog_id = '". absint( $_GET['blog_id'] )."' ";
179-               } elseif ( isset($_GET['blog_ip']) ) {
180-                       $query = "SELECT *
181-                               FROM {$wpdb->blogs}, {$wpdb->registration_log}
182-                               WHERE site_id = '{$wpdb->siteid}'
183-                               AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
184-                               AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
185+               if ( isset( $_GET['blogstatus'] ) ) {
186+                       if ( 'deleted' == $_GET['blogstatus'] ) {
187+                               $query .= " AND {$wpdb->blogs}.deleted = '1' ";
188+                       } elseif ( 'archived' == $_GET['blogstatus'] ) {
189+                               $query .= " AND {$wpdb->blogs}.archived = '1' ";
190+                       } elseif ( 'spam' == $_GET['blogstatus'] ) {
191+                               $query .= " AND {$wpdb->blogs}.spam = '1' ";
192+                       }
193                }
194 
195+               if ( isset( $_GET['searchaction'] ) ) {
196+                       if ( 'name' == $_GET['searchaction'] ) {
197+                               $query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
198+                       } elseif ( 'id' == $_GET['searchaction'] ) {
199+                               $query .= " AND {$wpdb->blogs}.blog_id = '{$like_s}' ";
200+                       } elseif ( 'ip' == $_GET['searchaction'] ) {
201+                               $query = "SELECT *
202+                                       FROM {$wpdb->blogs}, {$wpdb->registration_log}
203+                                       WHERE site_id = '{$wpdb->siteid}'
204+                                       AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
205+                                       AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
206+                       }
207+               }
208+
209                $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
210-
211                if ( $order_by == 'registered' ) {
212                        $query .= ' ORDER BY registered ';
213                } elseif ( $order_by == 'lastupdated' ) {
214@@ -355,67 +374,120 @@
215                        $query .= ' ORDER BY domain ';
216                } else {
217                        $order_by = 'id';
218-                       $query .= ' ORDER BY ' . $wpdb->blogs . '.blog_id ';
219+                       $query .= " ORDER BY {$wpdb->blogs}.blog_id ";
220                }
221 
222-               $order = isset($_GET['order']) ? $_GET['order'] : 'ASC';
223-               $order = ( 'DESC' == $order ) ? 'DESC' : 'ASC';
224+               $order = ( isset( $_GET['order'] ) && 'DESC' == $_GET['order'] ) ? "DESC" : "ASC";
225                $query .= $order;
226 
227-               if ( !empty($s) )
228-                       $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
229-               else
230-                       $total = $wpdb->get_var( "SELECT COUNT(blog_id) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ");
231+               $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
232 
233-               $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num );
234+               $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page) . ", " . intval( $per_page );
235                $blog_list = $wpdb->get_results( $query, ARRAY_A );
236 
237-               // Pagination
238-               $url2 = "&amp;order=" . $order . "&amp;sortby=" . $order_by . "&amp;s=";
239-               if ( !empty($_GET[ 'blog_ip' ])  )
240-                       $url2 .= "&amp;ip_address=" . urlencode( $s );
241+               $num_pages = ceil($total / $per_page);
242+               $page_links = paginate_links( array(
243+                       'base' => add_query_arg( 'paged', '%#%' ),
244+                       'format' => '',
245+                       'prev_text' => __('&laquo;'),
246+                       'next_text' => __('&raquo;'),
247+                       'total' => $num_pages,
248+                       'current' => $pagenum
249+               ));
250+
251+               if ( empty($_GET['mode']) )
252+                       $mode = 'list';
253                else
254-                       $url2 .= $s . "&amp;ip_address=" . urlencode( $s );
255+                       $mode = esc_attr( $_GET['mode'] );
256 
257-               $blog_navigation = paginate_links( array(
258-                       'base' => add_query_arg( 'apage', '%#%' ).$url2,
259-                       'format' => '',
260-                       'total' => ceil($total / $num),
261-                       'current' => $apage
262-               ));
263+               // for subsubsub and $blog_list
264+               $status_list = array( 'archived' => array( 'site-archived', __('Archived') ), 'spam' => array( 'site-spammed', __('Spam') ), 'deleted' => array( 'site-deleted', __('Deleted') ) );
265                ?>
266 
267-               <div class="wrap" style="position:relative;">
268+               <div class="wrap">
269                <?php screen_icon(); ?>
270-               <h2><?php _e('Sites') ?></h2>
271+               <h2><?php _e('Sites') ?>
272+               <a href="#form-add-site" class="button add-new-h2"><?php echo esc_html_x('Add New', 'sites'); ?></a>
273+               <?php
274+               if ( isset($_GET['s']) && $_GET['s'] )
275+               printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) );
276+               ?>
277+               </h2>
278 
279+               <ul class="subsubsub">
280+               <?php
281+               $status_links = array();
282+               $status_class = '';
283+               $count = get_blog_count();
284+               
285+               if ( empty($_GET['blogstatus']) || $_GET['blogstatus'] == 'all' )
286+                               $status_class = ' class="current"';
287+
288+               $status_links[] = "<li><a href='ms-sites.php?blogstatus=all'$status_class>" . sprintf( __( 'All <span class="count">(%s)</span>' ), number_format_i18n( $count->all ) ) . '</a>';
289+
290+               foreach ( $status_list as $status => $col ) {
291+                       $status_class = '';
292+
293+                       if ( empty( $count->$status ) )
294+                               continue;
295+
296+                       if ( isset( $_GET['blogstatus'] ) && ( $_GET['blogstatus'] == $status ) )
297+                               $status_class = ' class="current"';
298+
299+                       $status_links[] = "<li><a href='ms-sites.php?blogstatus=$status'$status_class>" . sprintf(  $col[1] . ' <span class="count">(%s)</span>' , number_format_i18n( $count->$status ) ) . '</a>';
300+               };
301+
302+               echo implode( " |</li>\n", $status_links ) . '</li>';
303+               unset( $status_links );
304+               ?>
305+               </ul>
306+
307                <form action="ms-sites.php" method="get" id="ms-search">
308-                       <input type="hidden" name="action" value="blogs" />
309-                       <input type="text" name="s" value="<?php echo($s); ?>" size="17" />
310-                       <input type="submit" class="button" name="blog_name" value="<?php esc_attr_e('Search blogs by name') ?>" />
311-                       <input type="submit" class="button" name="blog_id" value="<?php esc_attr_e('by blog ID') ?>" />
312-                       <input type="submit" class="button" name="blog_ip" value="<?php esc_attr_e('by IP address') ?>" />
313+               <p class="search-box">
314+               <input type="hidden" name="action" value="blogs" />
315+               <input type="text" name="s" value="<?php esc_attr_e( $s ); ?>" />
316+               <input type="submit" class="button" value="<?php esc_attr_e('Search Site by') ?>" />
317+               <select name="searchaction">
318+                       <option value="name" selected="selected"><?php _e('Name'); ?></option>
319+                       <option value="id"><?php _e('ID'); ?></option>
320+                       <option value="ip"><?php _e('IP address'); ?></option>
321+               </select>
322+               </p>
323                </form>
324 
325-               <form id="form-blog-list" action="ms-edit.php?action=allblogs" method="post">
326-
327+               <form id="form-site-list" action="ms-edit.php?action=allblogs" method="post">
328+               <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
329                <div class="tablenav">
330-                       <?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?>
331+               <div class="alignleft actions">
332+                       <select name="action">
333+                               <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
334+                               <option value="delete"><?php _e('Delete'); ?></option>
335+                               <option value="spam"><?php _e('Mark as Spam'); ?></option>
336+                               <option value="notspam"><?php _e('Not Spam'); ?></option>
337+                       </select>
338+                       <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
339+                       <?php wp_nonce_field('bulk-sites'); ?>
340+               </div>
341 
342-                       <div class="alignleft">
343-                               <input type="submit" value="<?php esc_attr_e('Delete') ?>" name="allblog_delete" class="button-secondary delete" />
344-                               <input type="submit" value="<?php esc_attr_e('Mark as Spam') ?>" name="allblog_spam" class="button-secondary" />
345-                               <input type="submit" value="<?php esc_attr_e('Not Spam') ?>" name="allblog_notspam" class="button-secondary" />
346-                               <?php wp_nonce_field( 'allblogs' ); ?>
347-                               <br class="clear" />
348-                       </div>
349+               <?php if ( $page_links ) { ?>
350+               <div class="tablenav-pages">
351+               <?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
352+               number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
353+               number_format_i18n( min( $pagenum * $per_page, $num_pages ) ),
354+               number_format_i18n( $num_pages ),
355+               $page_links
356+               ); echo $page_links_text; ?>
357                </div>
358+               <?php } ?>
359+               
360+               <div class="view-switch">
361+                       <a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
362+                       <a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
363+               </div>
364 
365-               <br class="clear" />
366+               </div>
367 
368-               <?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?>
369-                       <p><a href="ms-users.php?action=users&s=<?php echo urlencode( stripslashes( $s ) ) ?>"><?php _e('Search Users:') ?> <strong><?php echo stripslashes( $s ); ?></strong></a></p>
370-               <?php endif; ?>
371+               <div class="clear"></div>
372 
373                <?php
374                // define the columns to display, the syntax is 'internal name' => 'display name'
375@@ -432,35 +504,55 @@
376                        $posts_columns['plugins'] = __('Actions');
377 
378                $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns);
379-
380-               $sortby_url = "s=";
381-               if ( !empty($_GET[ 'blog_ip' ]) )
382-                       $sortby_url .= "&ip_address=" . urlencode( $s );
383-               else
384-                       $sortby_url .= urlencode( $s ) . "&ip_address=" . urlencode( $s );
385                ?>
386 
387-               <table width="100%" cellpadding="3" cellspacing="3" class="widefat">
388+               <table class="widefat">
389                        <thead>
390                                <tr>
391-                               <th scope="col" class="check-column"></th>
392-                               <?php foreach($posts_columns as $column_id => $column_display_name) {
393-                                       $column_link = "<a href='ms-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
394-                                       if ( $order_by == $column_id ) {
395-                                               $column_link .= ($order_by == 'DESC') ? 'order=ASC&amp;' : 'order=DESC&amp;';
396-                                       }
397-                                       $column_link .= "apage={$apage}'>{$column_display_name}</a>";
398+                               <th style="" class="manage-column column-cb check-column" id="cb" scope="col">
399+                                       <input type="checkbox" />
400+                               </th>
401+                               <?php
402+                               foreach($posts_columns as $column_id => $column_display_name) {
403+                                       $column_link = "<a href='";
404+                                       $order2 = '';
405+                                       if ( $order_by == $column_id )
406+                                               $order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
407 
408+                                       $column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), $_SERVER['REQUEST_URI'] ) );
409+                                       $column_link .= "'>{$column_display_name}</a>";
410                                        $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
411-                                       ?>
412-                                       <th scope="col"><?php echo $col_url ?></th>
413+                               ?>
414+                               <th scope="col">
415+                                       <?php echo $col_url ?>
416+                               </th>
417                                <?php } ?>
418                                </tr>
419                        </thead>
420+                       <tfoot>
421+                               <tr>
422+                               <th class="manage-column column-cb check-column" id="cb" scope="col">
423+                                       <input type="checkbox" />
424+                               </th>
425+                               <?php foreach($posts_columns as $column_id => $column_display_name) {
426+                                       $column_link = "<a href='";
427+                                       $order2 = '';
428+                                       if ( $order_by == $column_id )
429+                                               $order2 = ($order == 'DESC') ? 'ASC' : 'DESC';
430+                                               
431+                                       $column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) );
432+                                       $column_link .= "'>{$column_display_name}</a>";
433+                                       $col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
434+                               ?>
435+                               <th scope="col">
436+                                       <?php echo $col_url ?>
437+                               </th>
438+                               <?php } ?>
439+                               </tr>
440+                       </tfoot>
441                        <tbody id="the-list">
442                        <?php
443                        if ( $blog_list ) {
444-                               $status_list = array( 'archived' => array( 'site-archived', __('Archived') ), 'spam' => array( 'site-spammed', __('Spam') ), 'deleted' => array( 'site-deleted', __('Deleted') ) );
445                                $class = '';
446                                foreach ( $blog_list as $blog ) {
447                                        $class = ('alternate' == $class) ? '' : 'alternate';
448@@ -500,10 +592,12 @@
449                                                        break;
450 
451                                                        case 'blogname': ?>
452-                                                               <td valign="top">
453+                                                               <td class="column-title">
454                                                                        <a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; echo $blog_state?></a>
455-                                                                       <br/>
456                                                                        <?php
457+                                                                       if ( 'list' != $mode )
458+                                                                               echo '<p>' . get_blog_option( $blog['blog_id'], 'blogname' ) . '- <em>' . get_blog_option( $blog['blog_id'], 'blogdescription ' ) . '</em></p>';
459+
460                                                                        $actions        = array();
461                                                                        $actions[]      = '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
462                                                                        $actions[]      = "<a href='" . get_admin_url($blog['blog_id']) . "' class='edit'>" . __('Backend') . '</a>';
463@@ -539,17 +633,21 @@
464 
465                                                        case 'lastupdated': ?>
466                                                                <td valign="top">
467-                                                                       <?php echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['last_updated']); ?>
468-                                                               </td>
469+                                                                       <?php
470+                                                                       if ( 'list' == $mode )
471+                                                                               $date = 'Y/m/d';
472+                                                                       else
473+                                                                               $date = 'Y/m/d \<\b\r \/\> g:i:s a';
474+                                                                       echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?>
475+                                                               </td>
476                                                        <?php
477                                                        break;
478-                                                       case 'registered': ?>
479+                                               case 'registered': ?>
480                                                                <td valign="top">
481-                                                                       <?php echo mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['registered']); ?>
482+                                                               <?php echo mysql2date(__( $date ), $blog['registered'] ); ?>
483                                                                </td>
484-                                                       <?php
485-                                                       break;
486-
487+                                               <?php
488+                                               break;
489                                                        case 'users': ?>
490                                                                <td valign="top">
491                                                                        <?php
492@@ -560,8 +658,12 @@
493                                                                                        $blogusers = array_slice( $blogusers, 0, 5 );
494                                                                                        $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . get_admin_url($blog['blog_id'], 'users.php') . '">' . __( 'More' ) . '</a>';
495                                                                                }
496-                                                                               foreach ( $blogusers as $key => $val )
497-                                                                                       echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
498+                                                                               foreach ( $blogusers as $key => $val ) {
499+                                                                                       echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ';
500+                                                                                       if ( 'list' != $mode )
501+                                                                                               echo '(' . $val->user_email . ')';
502+                                                                                       echo '<br />';
503+                                                                               }
504                                                                                if ( $blogusers_warning != '' )
505                                                                                        echo '<strong>' . $blogusers_warning . '</strong><br />';
506                                                                        }
507@@ -592,7 +694,7 @@
508                                        <?php
509                                }
510                        } else { ?>
511-                               <tr style='background-color: <?php echo $bgcolor; ?>'>
512+                               <tr>
513                                        <td colspan="8"><?php _e('No blogs found.') ?></td>
514                                </tr>
515                        <?php
516@@ -601,34 +703,52 @@
517 
518                        </tbody>
519                </table>
520+               <div class="tablenav">
521+                       <?php
522+                       if ( $page_links )
523+                               echo "<div class='tablenav-pages'>$page_links_text</div>";
524+                       ?>
525+
526+                       <div class="alignleft actions">
527+                       <select name="action2">
528+                               <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
529+                               <option value="delete"><?php _e('Delete'); ?></option>
530+                               <option value="spam"><?php _e('Mark as Spam'); ?></option>
531+                               <option value="notspam"><?php _e('Not Spam'); ?></option>
532+                       </select>
533+                       <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
534+                       </div>
535+                       <br class="clear" />
536+               </div>
537+
538                </form>
539                </div>
540 
541                <div class="wrap">
542-                       <a name="form-add-blog"></a>
543+                       <a name="form-add-site"></a>
544                        <h2><?php _e('Add Site') ?></h2>
545                        <form method="post" action="ms-edit.php?action=addblog">
546                                <?php wp_nonce_field('add-blog') ?>
547                                <table class="form-table">
548                                        <tr class="form-field form-required">
549-                                               <th style="text-align:center;" scope='row'><?php _e('Site Address') ?></th>
550+                                               <th scope='row'><?php _e('Site Address') ?></th>
551                                                <td>
552                                                <?php if ( is_subdomain_install() ) { ?>
553-                                                       <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
554+                                                       <input name="blog[domain]" type="text" class="regular-text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
555                                                <?php } else {
556-                                                       echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>
557+                                                       echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e('Domain') ?>"/>
558                                                <?php }
559                                                echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>";
560                                                ?>
561                                                </td>
562                                        </tr>
563                                        <tr class="form-field form-required">
564-                                               <th style="text-align:center;" scope='row'><?php _e('Site Title') ?></th>
565-                                               <td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td>
566+                                               <th scope='row'><?php _e('Site Title') ?></th>
567+                                               <td><input name="blog[title]" type="text" class="regular-text" title="<?php _e('Title') ?>"/></td>
568                                        </tr>
569                                        <tr class="form-field form-required">
570-                                               <th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th>
571-                                               <td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td>
572+                                               <th scope='row'><?php _e('Admin Email') ?></th>
573+                                               <td><input name="blog[email]" type="text" class="regular-text" title="<?php _e('Email') ?>"/></td>
574                                        </tr>
575                                        <tr class="form-field">
576                                                <td colspan='2'><?php _e('A new user will be created if the above email address is not in the database.') ?><br /><?php _e('The username and password will be mailed to this email address.') ?></td>