diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-12-04 15:30:49 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-12-04 15:30:49 +0000 |
| commit | 251e06d3943ea8268c6766f3441a86fac46cecac (patch) | |
| tree | 83a889a46f58dccc8917884117d9f3d87b09be77 /wp-admin | |
| parent | f9ebfdb40a94290202f5269e08a49d0985628c9c (diff) | |
Fixed pagination, fixes #519, props ktlee
Update siteurl and home if domain updated
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1168 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
| -rw-r--r-- | wp-admin/wpmu-blogs.php | 19 | ||||
| -rw-r--r-- | wp-admin/wpmu-edit.php | 6 |
2 files changed, 16 insertions, 9 deletions
diff --git a/wp-admin/wpmu-blogs.php b/wp-admin/wpmu-blogs.php index a130555..6764cd9 100644 --- a/wp-admin/wpmu-blogs.php +++ b/wp-admin/wpmu-blogs.php @@ -79,12 +79,13 @@ switch( $_GET['action'] ) { <div class="wrap"> <table style="border:0; width:100%;" cellspacing="2" cellpadding="5" class="editform"> <tr valign="top"> - <th scope="row"><?php _e('URL') ?></th> - <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td> + <th scope="row"><?php _e('Domain') ?></th> + <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td> </tr> <tr valign="top"> <th scope="row"><?php _e('Path') ?></th> - <td><input name="blog[path]" type="text" id="path" value="<?php echo $details['path'] ?>" size="40" /></td> + <td><input name="blog[path]" type="text" id="path" value="<?php echo $details['path'] ?>" size="40" /> + <br />(<?php _e( 'siteurl and home will be modified too' ); ?>)</td> </tr> <tr valign="top"> <th scope="row"><?php _e('Registered') ?></th> @@ -280,7 +281,7 @@ switch( $_GET['action'] ) { // List blogs default: $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; - $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 30; + $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15; $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; @@ -320,16 +321,16 @@ switch( $_GET['action'] ) { $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC'; - if ( $_GET['ip_address'] == '' ) - $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); - - $blog_list = $wpdb->get_results( $query, ARRAY_A ); - if( !empty($_GET['s']) || !empty($_GET['blog_id']) || !empty($_GET['ip_address'])) { + $blog_list = $wpdb->get_results( $query, ARRAY_A ); $total = count($blog_list); } else { $total = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "); } + + $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num ); + + $blog_list = $wpdb->get_results( $query, ARRAY_A ); // Pagination $url2 = "&order=" . $_GET['order'] . "&sortby=" . $_GET['sortby'] . "&s=" . $_GET['s'] . "&ip_address=" . $_GET['ip_address']; diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php index 637e718..c2ec4a9 100644 --- a/wp-admin/wpmu-edit.php +++ b/wp-admin/wpmu-edit.php @@ -154,6 +154,12 @@ switch( $_GET['action'] ) { $c++; } } + + if( get_blog_option( $id, 'siteurl' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) + update_blog_option( $id, 'siteurl', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); + + if( get_blog_option( $id, 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ) + update_blog_option( $id, 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] ); // update blogs table $result = $wpdb->query("UPDATE {$wpdb->blogs} SET |
