diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-02 12:30:42 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-09-02 12:30:42 +0000 |
| commit | ad62a7b04aa199e6be21af5fe9ebb8b62197b789 (patch) | |
| tree | f235eb1f20a12d1af503a72e5bc7d5a28b8c49b3 | |
| parent | 9bf1d59004abceedb7d7f109afa8203d41a09805 (diff) | |
Added upgrade page to upgrade all blogs on site.
Added gmt_offset to install script and upgrade script.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@278 7be80a69-a1ef-0310-a953-fb0f7c49ff36
| -rw-r--r-- | wp-inst/wp-admin/menu.php | 1 | ||||
| -rw-r--r-- | wp-inst/wp-admin/upgrade-functions.php | 1 | ||||
| -rw-r--r-- | wp-inst/wp-admin/upgrade-schema.php | 1 | ||||
| -rw-r--r-- | wp-inst/wp-admin/wpmu-upgrade-site.php | 61 |
4 files changed, 64 insertions, 0 deletions
diff --git a/wp-inst/wp-admin/menu.php b/wp-inst/wp-admin/menu.php index 05c37f6..698fb73 100644 --- a/wp-inst/wp-admin/menu.php +++ b/wp-inst/wp-admin/menu.php @@ -69,6 +69,7 @@ if( is_site_admin() ) { $submenu[ 'wpmu-admin.php' ][15] = array( 'Feeds', '10', 'wpmu-feeds.php' ); $submenu[ 'wpmu-admin.php' ][20] = array( 'Themes', '10', 'wpmu-themes.php' ); $submenu[ 'wpmu-admin.php' ][25] = array( 'Options', '10', 'wpmu-options.php' ); + $submenu[ 'wpmu-admin.php' ][30] = array( 'Upgrade', '10', 'wpmu-upgrade-site.php' ); } // Create list of page plugin hook names. diff --git a/wp-inst/wp-admin/upgrade-functions.php b/wp-inst/wp-admin/upgrade-functions.php index bb277db..c7426f3 100644 --- a/wp-inst/wp-admin/upgrade-functions.php +++ b/wp-inst/wp-admin/upgrade-functions.php @@ -79,6 +79,7 @@ function upgrade_160() { $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); } } + add_option( "gmt_offset", 0 ); } // The functions we use to actually do stuff diff --git a/wp-inst/wp-admin/upgrade-schema.php b/wp-inst/wp-admin/upgrade-schema.php index d26442d..3ddf446 100644 --- a/wp-inst/wp-admin/upgrade-schema.php +++ b/wp-inst/wp-admin/upgrade-schema.php @@ -239,6 +239,7 @@ function populate_options() { add_option('ping_sites', 'http://rpc.pingomatic.com/'); add_option('advanced_edit', 0); add_option('comment_max_links', 2); + add_option('gmt_offset', 0); // 1.5 add_option('default_email_category', 1, __('Posts by email go to this category')); add_option('recently_edited'); diff --git a/wp-inst/wp-admin/wpmu-upgrade-site.php b/wp-inst/wp-admin/wpmu-upgrade-site.php new file mode 100644 index 0000000..94a18f6 --- /dev/null +++ b/wp-inst/wp-admin/wpmu-upgrade-site.php @@ -0,0 +1,61 @@ +<?php +require_once('admin.php'); + +$title = __('WPMU Admin'); +$parent_file = 'wpmu-admin.php'; +require_once('admin-header.php'); +if( is_site_admin() == false ) { + die( __('<p>You do not have permission to access this page.</p>') ); +} +if (isset($_GET['updated'])) { + ?><div id="message" class="updated fade"><p><?php _e('Options saved.') ?></p></div><?php +} +print '<div class="wrap">'; +switch( $_GET[ 'action' ] ) { + case "upgrade": + if( isset( $_GET[ 'n' ] ) == false ) { + $n = 0; + } else { + $n = $_GET[ 'n' ]; + } + $blogs = $wpdb->get_results( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' ORDER BY registered DESC LIMIT $n, 10", ARRAY_A ); + if( is_array( $blogs ) ) { + foreach( $blogs as $details ) { + $siteurl = $wpdb->get_var( "SELECT option_value from {$wpmuBaseTablePrefix}{$details[ 'blog_id' ]}_options WHERE option_name = 'siteurl'" ); + print "$siteurl<br>"; + $fp = fopen( $siteurl . "wp-admin/upgrade.php?step=1", "r" ); + if( $fp ) { + while( feof( $fp ) == false ) { + fgets($fp, 4096); + } + fclose( $fp ); + } + } + ?> + <p>If your browser doesn't start loading the next page automatically click this link: <a href="?action=upgrade&n=<?php echo ($n + 10) ?>">Next Blogs</a> </p> + <script language='javascript'> + <!-- + + function nextpage() { + location.href="wpmu-upgrade-site.php?action=upgrade&n=<?php echo ($n + 10) ?>"; + } + setTimeout( "nextpage()", 250 ); + + //--> + </script> + <?php + } else { + print "All Done!"; + } + break; + default: + ?> + <p>You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade.</p> + <p><a href="wpmu-upgrade-site.php?action=upgrade">Upgrade Site</a></p> + <?php + break; + +} +?> +</div> +<?php include('admin-footer.php'); ?> |
