* Prints summary of server statistics in preparation for setting up a network.
*
* @since 3.0.0
*/
function filestats( $err ) {
?>
<h2><?php esc_html_e( 'Server Summary' ); ?></h2>
<p><?php _e( 'If you post a message to the WordPress support forum at <a target="_blank" href="http://wordpress.org/support/">http://wordpress.org/support/</a> then copy and paste the following information into your message:' ); ?></p>
<blockquote style="background: #eee; border: 1px solid #333; padding: 5px;">
wp_die( sprintf( __( 'Sorry, I need to be able to read %s. Please check the permissions on this file.' ), $htaccess_sample ) );
}
?>
<li><p><?php _e( 'Replace the contents of your <code>.htaccess</code> with the following:' ); ?></p>
<textarea name="htaccess" cols="120" rows="20">
<?php echo wp_htmledit_pre( $htaccess_file ); ?>
</textarea>
</li>
<?php
}
/**
* Prints part of step 1 for network settings and checks for mod_rewrite.
*
* @since 3.0.0
* @return bool Whether mod_rewrite is enabled.
*/
function step1() {
$rewrite_enabled = false;
?>
<h2><?php esc_html_e( 'Installing Network of WordPress Sites' ); ?></h2>
<p><?php _e( 'I will help you enable the features for creating a network of sites by asking you a few questions so that you can create configuration files and make a directory to store all your uploaded files.' ); ?></p>
<h2><?php esc_html_e( 'What do I need?' ); ?></h2>
<ul>
<li><?php _e( 'Access to your server to change directory permissions. This can be done through ssh or ftp for example.' ); ?></li>
<li><?php _e( 'A valid email where your password and administrative emails will be sent.' ); ?></li>
<li><?php _e( "Wildcard dns records if you're going to use the virtual host (sub-domain) functionality. Check the <a href='http://trac.mu.wordpress.org/browser/trunk/README.txt'>README</a> for further details." ); ?></li>
</ul>
<?php
$mod_rewrite_msg = "\n<p>" . __( 'If the <code>mod_rewrite</code> module is disabled ask your administrator to enable that module, or look at the <a href="http://httpd.apache.org/docs/mod/mod_rewrite.html">Apache documentation</a> or <a href="http://www.google.com/search?q=apache+mod_rewrite">elsewhere</a> for help setting it up.' ) . '</p>';
if ( function_exists( 'apache_get_modules' ) ) {
$modules = apache_get_modules();
if ( ! in_array( 'mod_rewrite', $modules ) )
echo '<p>' . __( '<strong>Warning!</strong> It looks like mod_rewrite is not installed.' ) . '</p>' . $mod_rewrite_msg;
else
$rewrite_enabled = true;
} else {
echo '<p>' . __( 'Please make sure <code>mod_rewrite</code> is installed as it will be activated at the end of this install.' ) . '</p>' . $mod_rewrite_msg;
}
return $rewrite_enabled;
}
/**
* Prints most of step 1 for network settings.
*
* @since 3.0.0
* @param bool $rewrite_enabled Whether mod_rewrite is enabled. Default false.
*/
function printstep1form( $rewrite_enabled = false ) {
<p><?php _e( 'Please choose whether you would like sites in your WordPress install to use sub-domains or sub-directories. You cannot change this later.' ); ?></p>
<?php if ( ! $rewrite_enabled ) { ?>
<p><?php _e( '<strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.' ); ?></p>
<h3><?php printf( __( 'We recommend you change your siteurl to <code>%1$s</code> before enabling the network feature. It will still be possible to visit your site using the "www" prefix with an address like <code>%2$s</code> but any links will not have the "www" prefix.' ), $nowww, $hostname ); ?></h3>
<p><?php printf( __( 'Please <a href="%s">deactivate</a> your plugins before enabling WordPress Sites. Once WordPress Sites are enabled, you may reactivate your plugins.' ), admin_url( 'plugins.php' ) ); ?></p>
<?php
return false;
}
return true;
}
/**
* Checks for existing network data/tables.
*
* @since 3.0.0
*/
function network_domain_check() {
global $wpdb;
if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) == $wpdb->site )
return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" );
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites. <strong>Note:</strong> We recommend you make a backup copy of your existing <code>wp-config.php</code> and <code>.htaccess</code> files.' ); ?></p>
<ol>
<li><?php _e( 'Create a <code>blogs.dir</code> directory in your <code>wp-content</code> directory. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ); ?></li>
<?php step2_config(); ?>
<?php step2_htaccess(); ?>
</ol>
<?php
}
/**
* Prints configuration file component of step 2 for network settings.