Make WordPress Core

Changeset 13642


Ignore:
Timestamp:
03/10/2010 08:34:42 AM (15 years ago)
Author:
nacin
Message:

Store subdomain/subdirectory choice in sitemeta. For now, only used in case we return to network.php without constants. see #11816

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r13641 r13642  
    703703        'siteurl' => get_option( 'siteurl' ),
    704704        'add_new_users' => '0',
    705         'upload_space_check_disabled' => '0'
     705        'upload_space_check_disabled' => '0',
     706        'subdomain_install' => intval( $subdomain_install ),
    706707    );
    707708
  • trunk/wp-admin/network.php

    r13641 r13642  
    169169function network_step2() {
    170170    global $base, $wpdb;
     171    $hostname = get_clean_basedomain();
    171172    if ( $_POST ) {
    172         $vhost = (bool) $_POST['subdomain_install'];
     173        $vhost = 'localhost' == $hostname ? false : (bool) $_POST['subdomain_install'];
    173174    } else {
    174175        if ( is_multisite() ) {
     
    177178    <div class="updated"><p><strong><?php _e( 'Notice: The Network feature is already enabled.' ); ?></strong> <?php _e( 'The original configuration steps are shown here for reference.' ); ?></p></div>
    178179<?php   } else {
    179             $vhost = false; // @todo.
     180            $vhost = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
    180181?>
    181182    <div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
    182183    <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
     184<?php
     185        }
     186    }
     187
     188    if ( $_POST || ! is_multisite() ) {
     189?>
    183190        <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
    184191        <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
    185192        <div class="updated inline"><p><?php _e( '<strong>Caution:</strong> We recommend you backup your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' ); ?></p></div>
    186193<?php
    187         }
    188194    }
    189195?>
     
    195201define( 'VHOST', '<?php echo $vhost ? 'yes' : 'no'; ?>' );
    196202$base = '<?php echo $base; ?>';
    197 define( 'DOMAIN_CURRENT_SITE', '<?php echo get_clean_basedomain(); ?>' );
     203define( 'DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>' );
    198204define( 'PATH_CURRENT_SITE', '<?php echo $base; ?>' );
    199205define( 'SITE_ID_CURRENT_SITE', 1 );
Note: See TracChangeset for help on using the changeset viewer.