<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12759] trunk/wp-admin/includes/schema.php: Formatting cleanups</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12759">12759</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-19 16:14:06 +0000 (Tue, 19 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Formatting cleanups</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesschemaphp">trunk/wp-admin/includes/schema.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/schema.php (12758 => 12759)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/schema.php        2010-01-19 10:59:43 UTC (rev 12758)
+++ trunk/wp-admin/includes/schema.php        2010-01-19 16:14:06 UTC (rev 12759)
</span><span class="lines">@@ -319,8 +319,8 @@
</span><span class="cx"> 
</span><span class="cx">         // 3.0 multisite
</span><span class="cx">         if ( is_multisite() ) {
</span><del>-                 $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site-&gt;site_name );
-                 $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';
</del><ins>+                $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site-&gt;site_name );
+                $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Set autoload to no for these options
</span><span class="lines">@@ -623,27 +623,27 @@
</span><span class="cx">         global $wpdb, $current_site, $wp_version, $wp_db_version, $wp_rewrite;
</span><span class="cx"> 
</span><span class="cx">         //@todo: turn these checks into returned messages
</span><del>-        if( $domain == '' )
</del><ins>+        if ( $domain == '' )
</ins><span class="cx">                 die( 'You must provide a domain name!' );
</span><del>-        if( $site_name == '' )
</del><ins>+        if ( $site_name == '' )
</ins><span class="cx">                 die( 'You must provide a site name!' );
</span><span class="cx"> 
</span><span class="cx">         // check for network collision
</span><span class="cx">         $existing_network = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT id FROM {$wpdb-&gt;site} WHERE id = %d&quot;, $network_id ) );
</span><del>-        if( $existing_network == $network_id )
</del><ins>+        if ( $existing_network == $network_id )
</ins><span class="cx">                 die( 'That network already exists!' );
</span><span class="cx"> 
</span><span class="cx">         $site_user = get_user_by_email( $email );
</span><del>-        if( !$site_user )
</del><ins>+        if ( !$site_user )
</ins><span class="cx">                 die( 'You must provide an email address!' );
</span><span class="cx">         // set up site tables
</span><span class="cx">         $template = get_option( 'template' );
</span><span class="cx">         $stylesheet = get_option( 'stylesheet' );
</span><del>-        if ( $template != $stylesheet ) {
</del><ins>+        if ( $template != $stylesheet )
</ins><span class="cx">                 $allowed_themes = array( $template, $stylesheet );
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 $allowed_themes = array( $stylesheet );
</span><del>-        }
</del><ins>+
</ins><span class="cx">         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;INSERT INTO &quot;.$wpdb-&gt;sitemeta.&quot; (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'site_name', %s)&quot;, $network_id, $site_name ) );
</span><span class="cx">         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;INSERT INTO &quot;.$wpdb-&gt;sitemeta.&quot; (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'admin_email', %s)&quot;, $network_id, $site_user-&gt;user_email ) );
</span><span class="cx">         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;INSERT INTO &quot;.$wpdb-&gt;sitemeta.&quot; (meta_id, site_id, meta_key, meta_value) VALUES (NULL, %d, 'admin_user_id', %d)&quot;, $network_id, $site_user-&gt;ID ) );
</span><span class="lines">@@ -661,9 +661,8 @@
</span><span class="cx">                 $users = get_users_of_blog();
</span><span class="cx">                 if ( $users ) {
</span><span class="cx">                         foreach ( $users as $user ) {
</span><del>-                                if ( is_super_admin( $user-&gt;ID ) &amp;&amp; !in_array( $user-&gt;user_login, $site_admins ) ) {
</del><ins>+                                if ( is_super_admin( $user-&gt;ID ) &amp;&amp; !in_array( $user-&gt;user_login, $site_admins ) )
</ins><span class="cx">                                         $site_admins[] = $user-&gt;user_login;
</span><del>-                                }
</del><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="lines">@@ -700,24 +699,25 @@
</span><span class="cx">                 update_usermeta( $site_user-&gt;ID, 'primary_blog', 1 );
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if( $vhost == 'yes' ) {
</del><ins>+        if ( $vhost == 'yes' )
</ins><span class="cx">                 update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%postname%/');
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 update_option( 'permalink_structure', '/blog/%year%/%monthnum%/%day%/%postname%/');
</span><del>-        }
</del><ins>+
</ins><span class="cx">         $wp_rewrite-&gt;flush_rules();
</span><span class="cx"> 
</span><span class="cx">         if ( $vhost == 'yes' ) {
</span><span class="cx">                 $vhost_ok = false;
</span><span class="cx">                 $hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname!
</span><span class="cx">                 $page = wp_remote_get( 'http://' . $hostname, array( 'timeout' =&gt; 5, 'httpversion' =&gt; '1.1' ) );
</span><del>-                if( is_object( $page ) &amp;&amp; is_wp_error( $page ) ) {
-                        foreach ( $page-&gt;get_error_messages() as $err )
</del><ins>+                if ( is_object( $page ) &amp;&amp; is_wp_error( $page ) ) {
+                        foreach ( $page-&gt;get_error_messages() as $err ) {
</ins><span class="cx">                                 $errstr = $err;
</span><ins>+                        }
</ins><span class="cx">                 } elseif( $page[ 'response' ][ 'code' ] == 200 ) {
</span><span class="cx">                                 $vhost_ok = true;
</span><span class="cx">                 }
</span><del>-                if( !$vhost_ok ) {
</del><ins>+                if ( !$vhost_ok ) {
</ins><span class="cx">                         $msg = &quot;&lt;h2&gt;Warning! Wildcard DNS may not be configured correctly!&lt;/h2&gt;&quot;;
</span><span class="cx">                         $msg .= &quot;&lt;p&gt;To use the subdomain feature of WordPress MU you must have a wildcard entry in your dns. The installer attempted to contact a random hostname ($hostname) on your domain but failed. It returned this error message:&lt;br /&gt; &lt;strong&gt;$errstr&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;From the README.txt:&lt;/p&gt;&quot;;
</span><span class="cx">                         $msg .= &quot;&lt;p&gt;&lt;blockquote&gt; If you want to host blogs of the form http://blog.domain.tld/ where domain.tld is the domain name of your machine then you must add a wildcard record to your DNS records.&lt;br /&gt;
</span><span class="lines">@@ -727,4 +727,5 @@
</span><span class="cx">         }
</span><span class="cx">         return $msg;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>