Changeset 12674
- Timestamp:
- 01/08/2010 09:25:01 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r12672 r12674 733 733 734 734 function avoid_blog_page_permalink_collision( $data, $postarr ) { 735 if( constant( 'VHOST' ) == 'yes')735 if( is_subdomain_install() ) 736 736 return $data; 737 737 if( $data[ 'post_type' ] != 'page' ) -
trunk/wp-admin/ms-edit.php
r12646 r12674 71 71 if ( is_numeric( $dashboard_blog ) ) 72 72 wp_die( __( 'Dashboard blog_id must be a blog that already exists' ) ); 73 if ( constant( 'VHOST' ) == 'yes') {73 if ( is_subdomain_install() ) { 74 74 $domain = $dashboard_blog . '.' . $current_site->domain; 75 75 $path = $current_site->path; … … 146 146 wp_die( __('Invalid email address') ); 147 147 148 if( constant( 'VHOST' ) == 'yes') {148 if( is_subdomain_install() ) { 149 149 $newdomain = $domain.".".$current_site->domain; 150 150 $path = $base; -
trunk/wp-admin/ms-options.php
r12632 r12674 56 56 <label><input name="registration" type="radio" id="registration4" value='blog' <?php echo get_site_option('registration') == 'blog' ? 'checked="checked"' : ''; ?> /> <?php _e('Only logged in users can create new blogs.'); ?></label><br /> 57 57 <p><?php _e('Disable or enable registration and who or what can be registered. (Default=all)'); ?></p> 58 <?php if( constant( 'VHOST' ) == 'yes') {58 <?php if( is_subdomain_install() ) { 59 59 echo "<p>" . __('If registration is disabled, please set "NOBLOGREDIRECT" in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . "</p>"; 60 60 } ?> -
trunk/wp-admin/ms-sites.php
r12646 r12674 402 402 <?php 403 403 // define the columns to display, the syntax is 'internal name' => 'display name' 404 $blogname_columns = ( constant( "VHOST" ) == 'yes') ? __('Domain') : __('Path');404 $blogname_columns = ( is_subdomain_install() ) ? __('Domain') : __('Path'); 405 405 $posts_columns = array( 406 406 'id' => __('ID'), … … 458 458 echo "<tr $bgcolour class='$class'>"; 459 459 460 $blogname = ( constant( "VHOST" ) == 'yes') ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];460 $blogname = ( is_subdomain_install() ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path']; 461 461 foreach( $posts_columns as $column_name=>$column_display_name ) { 462 462 switch($column_name) { … … 587 587 <th style="text-align:center;" scope='row'><?php _e('Blog Address') ?></th> 588 588 <td> 589 <?php if ( constant( "VHOST" ) == 'yes') { ?>589 <?php if ( is_subdomain_install() ) { ?> 590 590 <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?> 591 591 <?php } else { -
trunk/wp-config-sample.php
-
Property
svn:eol-style
changed from
CRLF
tonative
-
Property
svn:eol-style
changed from
-
trunk/wp-includes/ms-functions.php
r12673 r12674 32 32 global $current_site; 33 33 34 if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes') {34 if( is_subdomain_install() ) { 35 35 if( $blogname == 'main' ) 36 36 $blogname = 'www'; … … 42 42 43 43 function get_blogaddress_by_domain( $domain, $path ){ 44 if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes') {44 if( is_subdomain_install() ) { 45 45 $url = "http://".$domain.$path; 46 46 } else { … … 109 109 return $blog_id; 110 110 111 if ( defined('VHOST') && constant( 'VHOST' ) == 'yes') {111 if ( is_subdomain_install() ) { 112 112 $domain = $name . '.' . $current_site->domain; 113 113 $path = $current_site->path; … … 1034 1034 1035 1035 // do not allow users to create a blog that conflicts with a page on the main blog. 1036 if ( constant( "VHOST" ) == 'no'&& $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) {1036 if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) { 1037 1037 $errors->add( 'blogname', __( "Sorry, you may not use that blog name" ) ); 1038 1038 } … … 1052 1052 1053 1053 // Check if the domain/path has been used already. 1054 if( constant( "VHOST" ) == 'yes') {1054 if( is_subdomain_install() ) { 1055 1055 $mydomain = "$blogname.$domain"; 1056 1056 $path = $base; … … 1139 1139 1140 1140 // Send email with activation link. 1141 if( constant( "VHOST" ) == 'no'|| $current_site->id != 1 ) {1141 if( !is_subdomain_install() || $current_site->id != 1 ) { 1142 1142 $activate_url = "http://" . $current_site->domain . $current_site->path . "wp-activate.php?key=$key"; 1143 1143 } else { … … 1268 1268 function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) { 1269 1269 $domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) ); 1270 if( constant( 'VHOST' ) == 'yes')1270 if( is_subdomain_install() ) 1271 1271 $domain = str_replace( '@', '', $domain ); 1272 1272 $title = strip_tags( $title ); -
trunk/wp-includes/ms-settings.php
r12632 r12674 1 1 <?php 2 3 /** 4 * Whether a subdomain configuration is enabled 5 * 6 * @since 3.0 7 * 8 * @return bool True if subdomain configuration is enabled, false otherwise. 9 */ 10 function is_subdomain_install() { 11 if ( defined('VHOST') && VHOST == 'yes' ) 12 return true; 13 14 return false; 15 } 16 2 17 if( isset( $current_site ) && isset( $current_blog ) ) 3 18 return; … … 66 81 } 67 82 $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) ); 68 if( constant( 'VHOST' ) == 'yes') {83 if( is_subdomain_install() ) { 69 84 $current_site = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $domain, $path) ); 70 85 if( $current_site != null ) … … 114 129 $current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" ); 115 130 116 if( constant( 'VHOST' ) == 'yes') {131 if( is_subdomain_install() ) { 117 132 $current_blog = wp_cache_get( 'current_blog_' . $domain, 'site-options' ); 118 133 if( !$current_blog ) { … … 144 159 } 145 160 146 if( defined( "WP_INSTALLING" ) == false && constant( 'VHOST' ) == 'yes'&& !is_object( $current_blog ) ) {161 if( defined( "WP_INSTALLING" ) == false && is_subdomain_install() && !is_object( $current_blog ) ) { 147 162 if( defined( 'NOBLOGREDIRECT' ) ) { 148 163 $destination = constant( 'NOBLOGREDIRECT' ); -
trunk/wp-signup.php
r12672 r12674 57 57 global $current_site; 58 58 // Blog name 59 if( constant( "VHOST" ) == 'no')59 if( !is_subdomain_install() ) 60 60 echo '<label for="blogname">' . __('Blog Name:') . '</label>'; 61 61 else … … 66 66 <?php } 67 67 68 if( constant( "VHOST" ) == 'no') {68 if( !is_subdomain_install() ) { 69 69 echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />'; 70 70 } else { … … 73 73 if ( !is_user_logged_in() ) { 74 74 print '(<strong>' . __( 'Your address will be ' ); 75 if( constant( "VHOST" ) == 'no') {75 if( !is_subdomain_install() ) { 76 76 print $current_site->domain . $current_site->path . __( 'blogname' ); 77 77 } else { … … 421 421 } 422 422 if ($newblogname) { 423 if( constant( "VHOST" ) == 'no')423 if( !is_subdomain_install() ) 424 424 $newblog = 'http://' . $current_site->domain . $current_site->path . $newblogname . '/'; 425 425 else
Note: See TracChangeset
for help on using the changeset viewer.