Index: wp-admin/includes/misc.php
===================================================================
--- wp-admin/includes/misc.php	(revision 13586)
+++ wp-admin/includes/misc.php	(working copy)
@@ -408,6 +408,8 @@
 
 		switch ( $map_option ) {
 			case 'edit_per_page':
+            case 'ms_sites_per_page':
+            case 'ms_users_per_page':
 			case 'edit_comments_per_page':
 			case 'upload_per_page':
 			case 'categories_per_page':
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 13586)
+++ wp-admin/includes/template.php	(working copy)
@@ -3767,6 +3767,12 @@
 		case 'edit-pages':
 			$per_page_label = __('Pages per page:');
 			break;
+        case 'ms-sites':
+			$per_page_label = __('Sites per page:');
+			break;
+        case 'ms-users':
+			$per_page_label = __('Users per page:');
+			break;
 		case 'edit-comments':
 			$per_page_label = __('Comments per page:');
 			break;
Index: wp-admin/ms-edit.php
===================================================================
--- wp-admin/ms-edit.php	(revision 13586)
+++ wp-admin/ms-edit.php	(working copy)
@@ -298,29 +298,46 @@
 	break;
 
 	case "allblogs":
-		check_admin_referer('allblogs');
-		if ( ! current_user_can( 'manage_sites' ) )
-			wp_die( __('You do not have permission to access this page.') );
-
-		foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) {
-			if ( $val != '0' && $val != $current_site->blog_id ) {
-				if ( isset($_POST['allblog_delete']) ) {
-					$blogfunction = 'all_delete';
-					wpmu_delete_blog( $val, true );
-				} elseif ( isset($_POST['allblog_spam']) ) {
-					$blogfunction = 'all_spam';
-					update_blog_status( $val, "spam", '1', 0 );
-					set_time_limit(60);
-				} elseif ( isset($_POST['allblog_notspam']) ) {
-					$blogfunction = 'all_notspam';
-					update_blog_status( $val, "spam", '0', 0 );
-					set_time_limit(60);
-				}
-			}
-		}
-
-		wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) );
-		exit();
+        
+        if ( isset($_POST['doaction']) || isset($_POST['doaction2']) ) {
+    		check_admin_referer('bulk-sites');
+            
+            if ( ! current_user_can( 'manage_sites' ) )
+    			wp_die( __('You do not have permission to access this page.') );
+      
+            // Handle bulk actions   
+            if ( $_GET['action'] != -1 || $_POST['action2'] != -1 ) {
+                $doaction = $doaction = ($_POST['action'] != -1) ? $_POST['action'] : $_POST['action2'];
+            }
+            
+            foreach ( (array) $_POST[ 'allblogs' ] as $key => $val ) {
+                if ( $val != '0' && $val != $current_site->blog_id ) {
+                    switch ( $doaction ) {
+                        case 'delete':
+                            $blogfunction = 'all_delete';
+                			wpmu_delete_blog( $val, true );
+                            break;
+                        case 'spam':
+                            $blogfunction = 'all_spam';
+                			update_blog_status( $val, "spam", '1', 0 );
+                			set_time_limit(60);
+                            break;
+                        case 'notspam':
+                            $blogfunction = 'all_notspam';
+                			update_blog_status( $val, "spam", '0', 0 );
+                			set_time_limit(60);
+                            break;
+                   }
+                } else {
+                    wp_die( __('You are not allowed to change this site.') );
+                };
+            };
+            
+            wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), wp_get_referer() ) );
+            exit();
+        } else {
+            wp_redirect( admin_url("ms-sites.php") );
+        }
 	break;
 
 	case "archiveblog":
Index: wp-admin/ms-sites.php
===================================================================
--- wp-admin/ms-sites.php	(revision 13586)
+++ wp-admin/ms-sites.php	(working copy)
@@ -178,7 +178,7 @@
 								?>
 									<tr class="form-field">
 										<th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
-										<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>
+										<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>
 									</tr>
 								<?php
 								} else {
@@ -323,28 +323,47 @@
 		<?php
 	break;
 
-	// List blogs
+	// List sites
 	case 'list':
 	default:
-		$apage = ( isset($_GET['apage'] ) && intval( $_GET['apage'] ) ) ? absint( $_GET['apage'] ) : 1;
-		$num = ( isset($_GET['num'] ) && intval( $_GET['num'] ) ) ? absint( $_GET['num'] ) : 15;
-		$s = isset($_GET['s']) ? esc_attr( trim( $_GET[ 's' ] ) ) : '';
-		$like_s = like_escape($s);
+        
+        $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
+        if ( empty($pagenum) )
+        	$pagenum = 1;
+        // Todo: doesn't work :(
+        $per_page = (int) get_user_option( 'ms_sites_per_page' );
+        if ( empty( $per_page ) || $per_page < 1 )
+        	$per_page = 15;
 
+        $per_page = apply_filters( 'ms_sites_per_page', $per_page );
+        
+        
+        $s = isset($_GET['s']) ? stripslashes( trim( $_GET[ 's' ] ) ) : ''; 
+        $like_s = esc_sql( like_escape( $s ) ); 
+
 		$query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
 
-		if ( isset($_GET['blog_name']) ) {
-			$query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
-		} elseif ( isset($_GET['blog_id']) ) {
-			$query .= " AND   blog_id = '". absint( $_GET['blog_id'] )."' ";
-		} elseif ( isset($_GET['blog_ip']) ) {
-			$query = "SELECT *
-				FROM {$wpdb->blogs}, {$wpdb->registration_log}
-				WHERE site_id = '{$wpdb->siteid}'
-				AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
-				AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
-		}
-
+        if ( isset( $_GET['searchaction'] ) ) {
+    		if ( 'name' == $_GET['searchaction'] ) {
+    			$query .= " AND ( {$wpdb->blogs}.domain LIKE '%{$like_s}%' OR {$wpdb->blogs}.path LIKE '%{$like_s}%' ) ";
+    		} elseif ( 'id' == $_GET['searchaction'] ) {
+    			$query .= " AND {$wpdb->blogs}.blog_id = '{$like_s}' ";
+    		} elseif ( 'ip' == $_GET['searchaction'] ) {
+    			$query = "SELECT *
+    				FROM {$wpdb->blogs}, {$wpdb->registration_log}
+    				WHERE site_id = '{$wpdb->siteid}'
+    				AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
+    				AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
+    		}
+        }
+        
+        // Todo: Filter Sites by status
+        /*if ( isset ( $_POST['status'] ) ) {
+            if ( 'archived' == $_POST['status'] ) {
+    			$query .= " AND {$wpdb->blogs}.archived = '1' ";
+            }
+        }*/
+        
 		$order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
 
 		if ( $order_by == 'registered' ) {
@@ -367,56 +386,90 @@
 		else
 			$total = $wpdb->get_var( "SELECT COUNT(blog_id) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ");
 
-		$query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num );
+		$query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page) . ", " . intval( $per_page );
 		$blog_list = $wpdb->get_results( $query, ARRAY_A );
 
-		// Pagination
-		$url2 = "&amp;order=" . $order . "&amp;sortby=" . $order_by . "&amp;s=";
-		if ( !empty($_GET[ 'blog_ip' ])  )
-			$url2 .= "&amp;ip_address=" . urlencode( $s );
-		else
-			$url2 .= $s . "&amp;ip_address=" . urlencode( $s );
+        $num_pages = ceil($total / $per_page);
+       
+		$page_links = paginate_links( array(
+        	'base' => add_query_arg( 'paged', '%#%' ),
+        	'format' => '',
+        	'prev_text' => __('&laquo;'),
+        	'next_text' => __('&raquo;'),
+        	'total' => $num_pages,
+        	'current' => $pagenum
+        ));
+        
+        if ( empty($_GET['mode']) )
+        	$mode = 'list';
+        else
+        	$mode = esc_attr($_GET['mode']);
+        ?>
 
-		$blog_navigation = paginate_links( array(
-			'base' => add_query_arg( 'apage', '%#%' ).$url2,
-			'format' => '',
-			'total' => ceil($total / $num),
-			'current' => $apage
-		));
-		?>
-
 		<div class="wrap" style="position:relative;">
 		<?php screen_icon(); ?>
-		<h2><?php _e('Sites') ?></h2>
-
+		<h2><?php _e('Sites') ?>
+        <a href="#form-add-site" class="button add-new-h2"><?php echo esc_html_x('Add New', 'sites'); ?></a> <?php
+        if ( isset($_GET['s']) && $_GET['s'] )
+        	printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
+        </h2>
+        
 		<form action="ms-sites.php" method="get" id="ms-search">
+        <p class="search-box">
 			<input type="hidden" name="action" value="blogs" />
-			<input type="text" name="s" value="<?php echo($s); ?>" size="17" />
-			<input type="submit" class="button" name="blog_name" value="<?php esc_attr_e('Search blogs by name') ?>" />
-			<input type="submit" class="button" name="blog_id" value="<?php esc_attr_e('by blog ID') ?>" />
-			<input type="submit" class="button" name="blog_ip" value="<?php esc_attr_e('by IP address') ?>" />
+			<input type="text" name="s" value="<?php esc_attr_e( $s ); ?>" />
+            <input type="submit" class="button" value="<?php esc_attr_e('Search Site by') ?>" />
+            <select name="searchaction">
+                <option value="name" selected="selected"><?php _e('Name'); ?></option>
+                <option value="id"><?php _e('ID'); ?></option>
+                <option value="ip"><?php _e('IP address'); ?></option>
+            </select>
+        </p>
 		</form>
-
+                
 		<form id="form-blog-list" action="ms-edit.php?action=allblogs" method="post">
+        <input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
+        <div class="tablenav">
+          
+            <div class="alignleft actions">
+                <select name="action">
+                <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+                <option value="delete"><?php _e('Delete'); ?></option>
+                <option value="spam"><?php _e('Mark as Spam'); ?></option>
+                <option value="notspam"><?php _e('Not Spam'); ?></option>
+                </select>
+                <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
+                <?php wp_nonce_field('bulk-sites'); ?>
+                
 
-		<div class="tablenav">
-			<?php if ( $blog_navigation ) echo "<div class='tablenav-pages'>$blog_navigation</div>"; ?>
+                <select name="status">
+                <option<?php selected( $s, 0 ); ?> value="-1"><?php _e('Show all status'); ?></option>
+                <option value="archived"><?php _e('Archived'); ?></option>
+                <option value="spammed"><?php _e('Spam'); ?></option>
+                <option value="deleted"><?php _e('Deleted'); ?></option>
+                </select>
+                <input type="submit" id="sites-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
+            </div>
+		
+			<?php if ( $page_links ) { ?>
+            <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
+            	number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
+            	number_format_i18n( min( $pagenum * $per_page, $num_pages ) ),
+            	number_format_i18n( $num_pages ),
+            	$page_links
+            ); echo $page_links_text; ?></div>
+            <?php } ?>
+            
+            <div class="view-switch">
+            	<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>
+            	<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>
+            </div>
+            
+            <div class="clear"></div>
+        </div>
+        
+        <div class="clear"></div>
 
-			<div class="alignleft">
-				<input type="submit" value="<?php esc_attr_e('Delete') ?>" name="allblog_delete" class="button-secondary delete" />
-				<input type="submit" value="<?php esc_attr_e('Mark as Spam') ?>" name="allblog_spam" class="button-secondary" />
-				<input type="submit" value="<?php esc_attr_e('Not Spam') ?>" name="allblog_notspam" class="button-secondary" />
-				<?php wp_nonce_field( 'allblogs' ); ?>
-				<br class="clear" />
-			</div>
-		</div>
-
-		<br class="clear" />
-
-		<?php if ( isset($_GET['s']) && !empty($_GET['s']) ) : ?>
-			<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>
-		<?php endif; ?>
-
 		<?php
 		// define the columns to display, the syntax is 'internal name' => 'display name'
 		$blogname_columns = ( is_subdomain_install() ) ? __('Domain') : __('Path');
@@ -440,23 +493,39 @@
 			$sortby_url .= urlencode( $s ) . "&ip_address=" . urlencode( $s );
 		?>
 
-		<table width="100%" cellpadding="3" cellspacing="3" class="widefat">
+		<table cellspacing="0" class="widefat">
 			<thead>
 				<tr>
-				<th scope="col" class="check-column"></th>
+				<th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox" /></th>
 				<?php foreach($posts_columns as $column_id => $column_display_name) {
 					$column_link = "<a href='ms-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
 					if ( $order_by == $column_id ) {
+						$column_link .= ($order == 'DESC') ? 'order=ASC&amp;' : 'order=DESC&amp;';
+					}
+					$column_link .= "paged={$pagenum}'>{$column_display_name}</a>";
+
+					$col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
+					?>
+					<th scope="col"><?php echo $col_url ?></th>
+				<?php } ?>
+				</tr>
+			</thead>
+            <tfoot>
+				<tr>
+				<th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox" /></th>
+				<?php foreach($posts_columns as $column_id => $column_display_name) {
+					$column_link = "<a href='ms-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
+					if ( $order_by == $column_id ) {
 						$column_link .= ($order_by == 'DESC') ? 'order=ASC&amp;' : 'order=DESC&amp;';
 					}
-					$column_link .= "apage={$apage}'>{$column_display_name}</a>";
+					$column_link .= "paged={$pagenum}'>{$column_display_name}</a>";
 
 					$col_url = ($column_id == 'users' || $column_id == 'plugins') ? $column_display_name : $column_link;
 					?>
 					<th scope="col"><?php echo $col_url ?></th>
 				<?php } ?>
 				</tr>
-			</thead>
+			</tfoot>
 			<tbody id="the-list">
 			<?php
 			if ( $blog_list ) {
@@ -491,7 +560,7 @@
 						switch ( $column_name ) {
 							case 'id': ?>
 								<th scope="row" class="check-column">
-									<input type='checkbox' id='blog_<?php echo $blog['blog_id'] ?>' name='allblogs[]' value='<?php echo esc_attr($blog['blog_id']) ?>' />
+									<input type="checkbox" id="blog_<?php echo $blog['blog_id'] ?>" name="allblogs[]" value="<?php echo esc_attr($blog['blog_id']) ?>" />
 								</th>
 								<th scope="row">
 									<?php echo $blog['blog_id'] ?>
@@ -500,9 +569,13 @@
 							break;
 
 							case 'blogname': ?>
-								<td valign="top">
+								<td class="column-title">
 									<a href="ms-sites.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; echo $blog_state?></a>
-									<br/>
+                                    <p>
+                                    <?php 
+                                    if ( 'list' != $mode  )
+                                        echo get_blog_option( $blog['blog_id'], 'blogname' ) . '- <em>' . get_blog_option( $blog['blog_id'], 'blogdescription ' ) . '</em>'; ?>
+                                    </p>
 									<?php
 									$actions	= array();
 									$actions[]	= '<a href="ms-sites.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
@@ -539,13 +612,18 @@
 
 							case 'lastupdated': ?>
 								<td valign="top">
-									<?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']); ?>
+									<?php
+                                    if ( 'list' == $mode )
+                                        $date = 'Y/m/d';
+                                    else
+                                        $date = 'Y/m/d \<\b\r \/\> g:i:s a';
+                                    echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?>
 								</td>
 							<?php
 							break;
 							case 'registered': ?>
 								<td valign="top">
-									<?php echo mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['registered']); ?>
+									<?php echo mysql2date(__( $date ), $blog['registered'] ); ?>
 								</td>
 							<?php
 							break;
@@ -592,7 +670,7 @@
 					<?php
 				}
 			} else { ?>
-				<tr style='background-color: <?php echo $bgcolor; ?>'>
+				<tr >
 					<td colspan="8"><?php _e('No blogs found.') ?></td>
 				</tr>
 			<?php
@@ -601,34 +679,53 @@
 
 			</tbody>
 		</table>
+        
+        <div class="tablenav">
+            <?php
+            if ( $page_links )
+            	echo "<div class='tablenav-pages'>$page_links_text</div>";
+            ?>
+
+            <div class="alignleft actions">
+                <select name="action2">
+                <option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
+                <option value="delete"><?php _e('Delete'); ?></option>
+                <option value="spam"><?php _e('Mark as Spam'); ?></option>
+                <option value="notspam"><?php _e('Not Spam'); ?></option>
+                </select>
+                <input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
+            </div>
+        <br class="clear" />
+        </div>
+                
 		</form>
 		</div>
 
 		<div class="wrap">
-			<a name="form-add-blog"></a>
+			<a name="form-add-site"></a>
 			<h2><?php _e('Add Site') ?></h2>
 			<form method="post" action="ms-edit.php?action=addblog">
 				<?php wp_nonce_field('add-blog') ?>
 				<table class="form-table">
 					<tr class="form-field form-required">
-						<th style="text-align:center;" scope='row'><?php _e('Site Address') ?></th>
+						<th scope='row'><?php _e('Site Address') ?></th>
 						<td>
 						<?php if ( is_subdomain_install() ) { ?>
-							<input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
+							<input name="blog[domain]" type="text" class="regular-text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
 						<?php } else {
-							echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>
+							echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" class="regular-text" title="<?php _e('Domain') ?>"/>
 						<?php }
 						echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>";
 						?>
 						</td>
 					</tr>
 					<tr class="form-field form-required">
-						<th style="text-align:center;" scope='row'><?php _e('Site Title') ?></th>
-						<td><input name="blog[title]" type="text" size="20" title="<?php _e('Title') ?>"/></td>
+						<th scope='row'><?php _e('Site Title') ?></th>
+						<td><input name="blog[title]" type="text" class="regular-text" title="<?php _e('Title') ?>"/></td>
 					</tr>
 					<tr class="form-field form-required">
-						<th style="text-align:center;" scope='row'><?php _e('Admin Email') ?></th>
-						<td><input name="blog[email]" type="text" size="20" title="<?php _e('Email') ?>"/></td>
+						<th scope='row'><?php _e('Admin Email') ?></th>
+						<td><input name="blog[email]" type="text" class="regular-text" title="<?php _e('Email') ?>"/></td>
 					</tr>
 					<tr class="form-field">
 						<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>
