Changeset 586
- Timestamp:
- 06/21/06 17:36:07 (2 years ago)
- Files:
-
- trunk/wp-inst/wp-includes/wpmu-functions.php (modified) (3 diffs)
- trunk/wp-inst/wp-signup.php (modified) (3 diffs)
- trunk/wp-inst/wpmu-settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-inst/wp-includes/wpmu-functions.php
r585 r586 85 85 $bloginfo = get_blog_details( $blog_id, false ); // only get bare details! 86 86 87 if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) { 88 return "http://" . $bloginfo->domain . $bloginfo->path; 89 } else { 90 return get_blogaddress_by_domain($bloginfo->domain, $bloginfo->path); 91 } 87 return get_real_siteurl( $bloginfo->domain, $bloginfo->path ); 92 88 } 93 89 … … 442 438 if ( $blog && isset( $blog->domain ) ) { 443 439 $blogs[$match[1]]->userblog_id = $match[1]; 444 $blogs[$match[1]]->domain = $blog->domain; 445 } else { // Temporary fix for people who don't get usermeta cleaned up when a blog is deleted 446 delete_usermeta( $id, "wp_{$match[1]}_capabilities" ); 447 delete_usermeta( $id, "wp_{$match[1]}_user_level" ); 440 $blogs[$match[1]]->domain = $blog->domain; 441 $blogs[$match[1]]->path = $blog->path; 448 442 } 449 443 } … … 1329 1323 } 1330 1324 1325 function get_real_siteurl( $domain, $path ) { 1326 if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) { 1327 return "http://" . $domain . $path; 1328 } else { 1329 return get_blogaddress_by_domain($domain, $path); 1330 } 1331 } 1332 1331 1333 ?> trunk/wp-inst/wp-signup.php
r585 r586 34 34 print '<tr>'; 35 35 36 echo '<th valign="top">' . __('Blog Domain:') . '</th><td>'; 36 if( constant( "VHOST" ) == 'no' ) 37 echo '<th valign="top">' . __('Blog Name:') . '</th><td>'; 38 else 39 echo '<th valign="top">' . __('Blog Domain:') . '</th><td>'; 37 40 38 41 if ( $errmsg = $errors->get_error_message('blog_id') ) { 39 42 ?><p><strong><?php echo $errmsg ?></strong></p><?php 40 43 } 41 print '<input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: right; font-size: 30px;" /><span style="font-size: 30px">.' . $current_site->domain . $current_site->path . '</span><br />'; 44 if( constant( "VHOST" ) == 'no' ) { 45 print '<span style="font-size: 20px">' . get_real_siteurl( $current_site->domain, $current_site->path ) . '</span><input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: left; font-size: 20px;" /><br />'; 46 } else { 47 print '<input name="blog_id" type="text" id="blog_id" value="'.$blog_id.'" maxlength="50" style="width:40%; text-align: right; font-size: 20px;" /><span style="font-size: 20px">' . get_real_siteurl( $current_site->domain, $current_site->path ) . '</span><br />'; 48 } 42 49 if ( !is_user_logged_in() ) { 43 50 print '(<strong>Your address will be '; 44 if( constant( "VHOST" == 'no' )) {51 if( constant( "VHOST" ) == 'no' ) { 45 52 print $current_site->domain . $current_site->path . 'blogname'; 46 53 } else { … … 145 152 if ( ! empty($blogs) ) foreach ( $blogs as $blog ) { 146 153 $display = str_replace(".$domain", '', $blog->domain); 147 echo "<li><a href=' http://$blog->domain'>$display</a></li>";154 echo "<li><a href='" . get_real_siteurl( $blog->domain, $blog->path ) . "'>$display</a></li>"; 148 155 } 149 156 ?> … … 184 191 185 192 function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { 186 ?> 187 <h2><?php printf(__('%s Is Yours'), $domain) ?></h2> 188 <p><?php printf(__('<a href="%1$s">%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.'), "http://${domain}${path}", $domain, "http://${domain}${path}wp-login.php", $user_name) ?></p> 193 $url = get_real_siteurl( $domain, $path ); 194 ?> 195 <h2><?php printf(__('%s Is Yours'), $url ) ?></h2> 196 <p><?php printf(__('<a href="%1$s">%2$s</a> is your new blog. <a href="%3$s">Login</a> as "%4$s" using your existing password.'), $url, $url, $url . "wp-login.php", $user_name) ?></p> 189 197 <?php 190 198 do_action('signup_finished'); trunk/wp-inst/wpmu-settings.php
r550 r586 16 16 $wpdb->hide_errors(); 17 17 18 if( constant( 'VHOST' ) == 'yes' ) 19 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'"); 20 else 21 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'"); 18 // Get site and blog details 19 if( defined( "WP_INSTALLING" ) == false ) { 20 if( constant( 'VHOST' ) == 'yes' ) { 21 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'"); 22 if( $current_blog != null ) 23 $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'"); 24 } else { 25 $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) ); 26 $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 27 if( $current_site == null ) { 28 $path = '/'; 29 $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" ); 30 if( $current_site == null ) 31 die( "No WPMU site defined on this host." ); 32 } 33 $blogname = htmlspecialchars( str_replace( $path, '', $_SERVER[ 'REQUEST_URI' ] ) ); 34 $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) ); 35 if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' ) { 36 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'"); 37 } else { 38 $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$blogname.$domain' AND path = '$path'"); 39 } 40 } 22 41 23 if( $current_blog== false )24 is_installed();42 if( $current_blog == false || $current_site == false ) 43 is_installed(); 25 44 26 $blog_id = $current_blog->blog_id;27 $public = $current_blog->public;28 $site_id = $current_blog->site_id;45 $blog_id = $current_blog->blog_id; 46 $public = $current_blog->public; 47 $site_id = $current_blog->site_id; 29 48 30 if( $site_id == 0 )31 $site_id = 1;49 if( $site_id == 0 ) 50 $site_id = 1; 32 51 33 $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='$site_id'"); 34 35 if( $current_site == false ) 36 is_installed(); 37 38 $current_site->site_name = $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = '$site_id' AND meta_key = 'site_name'" ); 39 52 $current_site->site_name = $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = '$site_id' AND meta_key = 'site_name'" ); 53 } 40 54 if( $blog_id == false ) { 41 55 // no blog found, are we installing? Check if the table exists.
