From d08414276a14cf6827ccbacc52e82554b6c5334a Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 30 Apr 2010 15:21:10 +0000 Subject: [PATCH] Prune and tidy the message in ms_not_installed. Only show detailed information if wp-admin, likesingle installs. Use ->tables. @todo: non-'MU' codex link. git-svn-id: http://svn.automattic.com/wordpress/trunk@14317 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-load.php | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index fc1ad1db0..b6be47c80 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -189,9 +189,9 @@ function wpmu_current_site() { /** * Displays a failure message. * - * Used when blog does not exist. Checks for a missing $wpdb->site table as well. + * Used when a blog's tables do not exist. Checks for a missing $wpdb->site table as well. * - * @todo update for 3.0, pare down, and i18n + * @todo update Codex link for 3.0.0 * * @access private * @since 3.0.0 @@ -199,23 +199,24 @@ function wpmu_current_site() { function ms_not_installed() { global $wpdb, $domain, $path; - $msg = '

' . /*WP_I18N_FATAL_ERROR*/'Fatal Error'/*/WP_I18N_FATAL_ERROR*/ . '

'; - $msg .= '

' . /*WP_I18N_CONTACT_OWNER*/'If your site does not display, please contact the owner of this network.'/*/WP_I18N_CONTACT_OWNER*/ . '

'; - $msg .= '

' . /*WP_I18N_CHECK_MYSQL*/'If you are the owner of this network please check that MySQL is running properly and all tables are error free.'/*/WP_I18N_CHECK_MYSQL*/ . '

'; - if ( !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ) - $msg .= '

' . sprintf( /*WP_I18N_TABLES_MISSING_LONG*/'Database tables are missing. This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'/*/WP_I18N_TABLES_MISSING_LONG*/, $wpdb->site ) . '

'; + $msg = '

' . /*WP_I18N_FATAL_ERROR*/'Error establishing database connection'/*/WP_I18N_FATAL_ERROR*/ . '

'; + if ( ! is_admin() ) + die( $msg ); + $msg .= '

' . /*WP_I18N_CONTACT_OWNER*/'If your site does not display, please contact the owner of this network.'/*/WP_I18N_CONTACT_OWNER*/ . ''; + $msg .= ' ' . /*WP_I18N_CHECK_MYSQL*/'If you are the owner of this network please check that MySQL is running properly and all tables are error free.'/*/WP_I18N_CHECK_MYSQL*/ . '

'; + if ( false && !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) ) + $msg .= '

' . sprintf( /*WP_I18N_TABLES_MISSING_LONG*/'Database tables are missing. This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.'/*/WP_I18N_TABLES_MISSING_LONG*/, $wpdb->site ) . '

'; else - $msg .= '

' . sprintf( /*WP_I18N_NO_SITE_FOUND*/'Could Not Find Site! Searched for table %1$s in %2$s. Is that right?'/*/WP_I18N_NO_SITE_FOUND*/, $domain . $path, DB_NAME, $wpdb->blogs ) . '

'; - $msg .= '

' . /*WP_I18N_WHAT_DO_I_DO*/'What do I do now?'/*WP_I18N_WHAT_DO_I_DO*/ . '

'; - // @todo Update WPMU codex link. - $msg .= '

' . /*WP_I18N_RTFM*/'Read the bug report page. Some of the guidelines there may help you figure out what went wrong.'/*/WP_I18N_RTFM*/ . '

'; - $msg .= '

' . /*WP_I18N_STUCK*/'If you’re still stuck with this message, then check that your database contains the following tables:'/*/WP_I18N_STUCK*/ . '