To finish setting up your blog, please fill in the following form and click Submit.
-
-
-
- You will be sent an email with your password and login links and details.";
-}
-
function step3() {
global $wpdb, $current_site;
$base = stripslashes( dirname( $_SERVER["SCRIPT_NAME"] ) );
@@ -420,14 +402,43 @@ We hope you enjoy your new weblog.
print "
Congrats! Your WPMU site has been set up and you have been sent details of your login and password in an email.
WordPress MU strips the string "www" from the URLs of sites using this software. It is still possible to visit your site using the "www" prefix with an address like but any links will not have the "www" prefix. They will instead point at .
+
The preferred method of hosting blogs is without the "www" prefix as it's more compact and simple.
You can still use "" and URLs like "www.blog1." to address your site and blogs after installation but internal links will use the format.
+
www. is depreciated has a lot more information on why 'www.' isn't needed any more.
+
+ hide_errors();
-$sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site
-if( count( $sites ) == 1 ) {
- $current_site = $sites[0];
- $path = $current_site->path;
-}
-
-if( isset( $current_site ) == false ) {
+function wpmu_current_site() {
+ global $wpdb, $current_site, $domain, $path, $sites;
$path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
if( constant( 'VHOST' ) == 'yes' ) {
$current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" );
- if( $current_site == null ) {
- $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='/'" );
- if( $current_site == null ) {
- $sitedomain = substr( $domain, 1 + strpos( $domain, '.' ) );
- $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" );
- if( $current_site == null ) {
- $path = '/';
- $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" );
- if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
- if( count( $sites ) == 1 ) {
- $current_site = $sites[0];
- die( "That blog does not exist. Please try http://{$current_site->domain}{$current_site->path}" );
- } else {
- die( "No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance." );
- }
- }
- }
+ if( $current_site != null )
+ return $current_site;
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='/'" );
+ if( $current_site != null ) {
+ $path = '/';
+ return $current_site;
+ }
+ $sitedomain = substr( $domain, 1 + strpos( $domain, '.' ) );
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='$path'" );
+ if( $current_site != null )
+ return $current_site;
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$sitedomain' AND path='/'" );
+ if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
+ if( count( $sites ) == 1 ) {
+ $current_site = $sites[0];
+ die( "That blog does not exist. Please try http://{$current_site->domain}{$current_site->path}" );
} else {
- $path = '/';
+ die( "No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance." );
}
+ } else {
+ $path = '/';
}
} else {
$current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" );
- if( $current_site == null ) {
- $path = '/';
- $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='$path'" );
- if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
- $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" );
- if( count( $sites ) == 1 ) {
- $current_site = $sites[0];
- die( "That blog does not exist. Please try http://{$current_site->domain}{$current_site->path}" );
- } else {
- die( "No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance." );
- }
+ if( $current_site != null )
+ return $current_site;
+ $current_site = $wpdb->get_row( "SELECT * FROM $wpdb->site WHERE domain = '$domain' AND path='/'" );
+ if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
+ if( count( $sites ) == 1 ) {
+ $current_site = $sites[0];
+ die( "That blog does not exist. Please try http://{$current_site->domain}{$current_site->path}" );
+ } else {
+ die( "No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance." );
}
+ } else {
+ $path = '/';
}
}
+ return $current_site;
+}
+
+$wpdb->hide_errors();
+$sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site
+if( count( $sites ) == 1 ) {
+ $current_site = $sites[0];
+ $path = $current_site->path;
+} else {
+ $current_site = wpmu_current_site();
}
--
cgit