Changeset 21823 for trunk/wp-includes/ms-functions.php
- Timestamp:
- 09/11/2012 10:22:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r21664 r21823 1121 1121 */ 1122 1122 function install_blog($blog_id, $blog_title = '') { 1123 global $wpdb, $table_prefix, $wp_roles; 1124 $wpdb->suppress_errors(); 1123 global $wpdb, $wp_roles, $current_site; 1125 1124 1126 1125 // Cast for security … … 1130 1129 1131 1130 if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") ) 1132 die(__('<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>') . '</body></html>'); 1133 1134 $wpdb->suppress_errors(false); 1135 1136 $url = get_blogaddress_by_id($blog_id); 1131 die( __( '<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>' ) . '</body></html>' ); 1132 1133 $url = get_blogaddress_by_id( $blog_id ); 1137 1134 1138 1135 // Set everything up … … 1143 1140 1144 1141 $url = untrailingslashit( $url ); 1145 // fix url. 1146 update_option('siteurl', $url); 1147 update_option('home', $url); 1148 update_option('fileupload_url', $url . "/files" ); 1149 update_option('upload_path', UPLOADBLOGSDIR . "/$blog_id/files"); 1150 update_option('blogname', stripslashes( $blog_title ) ); 1151 update_option('admin_email', ''); 1152 $wpdb->update( $wpdb->options, array('option_value' => ''), array('option_name' => 'admin_email') ); 1142 1143 update_option( 'siteurl', $url ); 1144 update_option( 'home', $url ); 1145 1146 if ( get_site_option( 'ms_files_rewriting' ) ) 1147 update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" ); 1148 else 1149 update_option( 'upload_path', get_blog_option( $current_site->blog_id, 'upload_path' ) ); 1150 1151 update_option( 'blogname', stripslashes( $blog_title ) ); 1152 update_option( 'admin_email', '' ); 1153 1153 1154 1154 // remove all perms 1155 $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $table_prefix.'user_level' ) ); 1156 1157 $wpdb->delete( $wpdb->usermeta, array( 'meta_key' => $table_prefix.'capabilities' ) ); 1158 1159 $wpdb->suppress_errors( false ); 1155 $table_prefix = $wpdb->get_blog_prefix(); 1156 delete_metadata( 'user', 0, $table_prefix . 'user_level', null, true ); // delete all 1157 delete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // delete all 1160 1158 } 1161 1159
Note: See TracChangeset
for help on using the changeset viewer.