diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-27 16:15:29 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-27 16:15:29 +0000 |
| commit | 90c586422da74ef4e56bc93c2b16aeab22bc613f (patch) | |
| tree | 77c67013aba3cd2227cf9dc3a3e1a77555a72580 /wp-inst/wp-settings.php | |
| parent | cc428420cc487facf6548355e826683e2c8a6e02 (diff) | |
Use multiple databases.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@80 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-settings.php')
| -rw-r--r-- | wp-inst/wp-settings.php | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/wp-inst/wp-settings.php b/wp-inst/wp-settings.php index 5cc3d63..7e51374 100644 --- a/wp-inst/wp-settings.php +++ b/wp-inst/wp-settings.php @@ -52,12 +52,38 @@ $domain = $_SERVER['HTTP_HOST']; if( substr( $domain, 0, 4 ) == 'www.' ) $domain = substr( $domain, 4 ); +function is_installed() { + global $wpdb, $domain, $base; + $check = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); + if( $check == false ) { + $msg = '<strong>Database Tables Missing.</strong><br /> The table <em>' . DB_NAME . '::' . $wpdb->site . '</em> is missing. Delete the .htaccess file and run the installer again!<br />'; + } else { + $msg = '<strong>Could Not Find Blog!</strong><br />'; + $msg .= "Searched for <em>" . $domain . $base . "</em> in " . DB_NAME . "::" . $wpdb->blogs . " table. Is that right?<br />"; + } + $msg .= "Please check that your database contains the following tables:<ul> + <li> $wpdb->blogs </li> + <li> $wpdb->users </li> + <li> $wpdb->usermeta </li> + <li> $wpdb->site </li> + <li> $wpdb->sitemeta </li> + <li> $wpdb->sitecategories </li> + </ul>"; + $msg .= "If you suspect a problem please report it to <a href='http://mu.wordpress.org/forums/'>support forums</a>!"; + die( "<h1>Fatal Error</h1> " . $msg ); +} $current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$base'"); +if( $current_blog == false ) { + is_installed(); +} $blog_id = $current_blog->blog_id; $is_public = $current_blog->is_public; $site_id = $current_blog->site_id; $current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='$site_id'"); +if( $current_site == false ) { + is_installed(); +} if( $current_site->domain == $domain && $current_site->path == $base ) { $wpblog = 'main'; } @@ -76,7 +102,13 @@ if( $blog_id == false ) { $blog_id = 1; } } else { - die( "No Blog by that name on this system." ); + $check = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); + if( $check == false ) { + $msg = ': DB Tables Missing'; + } else { + $msg = ''; + } + die( "No Blog by that name on this system." . $msg ); } } |
