]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/ms-load.php
Wordpress 3.5
[autoinstalls/wordpress.git] / wp-includes / ms-load.php
index 353cbe2fee5a1877f04bfa6a69babb31e6effc78..6a26b9cf06a2772428c4f04c3d0a007dddacb877 100644 (file)
@@ -69,7 +69,9 @@ function wp_get_active_network_plugins() {
  * @return bool|string Returns true on success, or drop-in file to include.
  */
 function ms_site_check() {
-       global $wpdb, $current_blog;
+       global $wpdb;
+
+       $blog = get_blog_details();
 
        // Allow short-circuiting
        $check = apply_filters('ms_site_check', null);
@@ -80,21 +82,21 @@ function ms_site_check() {
        if ( is_super_admin() )
                return true;
 
-       if ( '1' == $current_blog->deleted ) {
+       if ( '1' == $blog->deleted ) {
                if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
                        return WP_CONTENT_DIR . '/blog-deleted.php';
                else
                        wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ), '', array( 'response' => 410 ) );
        }
 
-       if ( '2' == $current_blog->deleted ) {
+       if ( '2' == $blog->deleted ) {
                if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
                        return WP_CONTENT_DIR . '/blog-inactive.php';
                else
                        wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
        }
 
-       if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
+       if ( $blog->archived == '1' || $blog->spam == '1' ) {
                if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
                        return WP_CONTENT_DIR . '/blog-suspended.php';
                else
@@ -119,8 +121,8 @@ function get_current_site_name( $current_site ) {
                $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
                if ( ! $current_site->site_name )
                        $current_site->site_name = ucfirst( $current_site->domain );
+               wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
        }
-       wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
 
        return $current_site;
 }
@@ -134,6 +136,10 @@ function get_current_site_name( $current_site ) {
  */
 function wpmu_current_site() {
        global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain;
+
+       if ( empty( $current_site ) )
+               $current_site = new stdClass;
+
        if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {
                $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;
                $current_site->domain = DOMAIN_CURRENT_SITE;
@@ -207,10 +213,12 @@ function wpmu_current_site() {
        }
 
        // Still no dice.
+       wp_load_translations_early();
+
        if ( 1 == count( $sites ) )
-               wp_die( sprintf( /*WP_I18N_BLOG_DOESNT_EXIST*/'That site does not exist. Please try <a href="%s">%s</a>.'/*/WP_I18N_BLOG_DOESNT_EXIST*/, $sites[0]->domain . $sites[0]->path ) );
+               wp_die( sprintf( __( 'That site does not exist. Please try <a href="%s">%s</a>.' ), 'http://' . $sites[0]->domain . $sites[0]->path ) );
        else
-               wp_die( /*WP_I18N_NO_SITE_DEFINED*/'No site defined on this host. If you are the owner of this site, please check <a href="http://codex.wordpress.org/Debugging_a_WordPress_Network">Debugging a WordPress Network</a> for help.'/*/WP_I18N_NO_SITE_DEFINED*/ );
+               wp_die( __( 'No site defined on this host. If you are the owner of this site, please check <a href="http://codex.wordpress.org/Debugging_a_WordPress_Network">Debugging a WordPress Network</a> for help.' ) );
 }
 
 /**
@@ -224,19 +232,21 @@ function wpmu_current_site() {
 function ms_not_installed() {
        global $wpdb, $domain, $path;
 
-       $title = /*WP_I18N_FATAL_ERROR*/'Error establishing database connection'/*/WP_I18N_FATAL_ERROR*/;
+       wp_load_translations_early();
+
+       $title = __( 'Error establishing a database connection' );
        $msg  = '<h1>' . $title . '</h1>';
        if ( ! is_admin() )
                die( $msg );
-       $msg .= '<p>' . /*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*/ . '</p>';
+       $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
+       $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
        if ( false && !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
-               $msg .= '<p>' . sprintf( /*WP_I18N_TABLES_MISSING_LONG*/'<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.'/*/WP_I18N_TABLES_MISSING_LONG*/, $wpdb->site ) . '</p>';
+               $msg .= '<p>' . sprintf( __( '<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.' ), $wpdb->site ) . '</p>';
        else
-               $msg .= '<p>' . sprintf( /*WP_I18N_NO_SITE_FOUND*/'<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?'/*/WP_I18N_NO_SITE_FOUND*/, rtrim( $domain . $path, '/' ), $wpdb->blogs, DB_NAME ) . '</p>';
-       $msg .= '<p><strong>' . /*WP_I18N_WHAT_DO_I_DO*/'What do I do now?'/*WP_I18N_WHAT_DO_I_DO*/ . '</strong> ';
-       $msg .= /*WP_I18N_RTFM*/'Read the <a target="_blank" href="http://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.'/*/WP_I18N_RTFM*/;
-       $msg .= ' ' . /*WP_I18N_STUCK*/'If you&#8217;re still stuck with this message, then check that your database contains the following tables:'/*/WP_I18N_STUCK*/ . '</p><ul>';
+               $msg .= '<p>' . sprintf( __( '<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?' ), rtrim( $domain . $path, '/' ), $wpdb->blogs, DB_NAME ) . '</p>';
+       $msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';
+       $msg .= __( 'Read the <a target="_blank" href="http://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' );
+       $msg .= ' ' . __( 'If you&#8217;re still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>';
        foreach ( $wpdb->tables('global') as $t => $table ) {
                if ( 'sitecategories' == $t )
                        continue;
@@ -246,5 +256,3 @@ function ms_not_installed() {
 
        wp_die( $msg, $title );
 }
-
-?>
\ No newline at end of file