Changeset 12755
- Timestamp:
- 01/18/2010 11:34:36 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/theme.php
r12752 r12755 118 118 119 119 /** 120 * Get the allowed themes for the current blog. 121 * 122 * @since 3.0 123 * 124 * @uses get_themes() 125 * @uses current_theme_info() 126 * @uses get_site_allowed_themes() 127 * @uses wpmu_get_blog_allowedthemes 128 * 129 * @return array $themes Array of allowed themes. 130 */ 131 function get_allowed_themes() { 132 if ( !is_multisite() ) 133 return get_themes(); 134 135 $themes = get_themes(); 136 $ct = current_theme_info(); 137 $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); 138 if ( $allowed_themes == false ) 139 $allowed_themes = array(); 140 141 $blog_allowed_themes = wpmu_get_blog_allowedthemes(); 142 if ( is_array( $blog_allowed_themes ) ) 143 $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes ); 144 145 if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false ) 146 $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true; 147 148 reset( $themes ); 149 foreach ( $themes as $key => $theme ) { 150 if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) 151 unset( $themes[ $key ] ); 152 } 153 reset( $themes ); 154 155 return $themes; 156 } 157 158 /** 120 159 * Get the Page Templates available in this theme 121 160 * -
trunk/wp-admin/includes/user.php
r12726 r12755 198 198 function get_author_user_ids() { 199 199 global $wpdb; 200 if ( !is_multisite() ) {200 if ( !is_multisite() ) 201 201 $level_key = $wpdb->get_blog_prefix() . 'user_level'; 202 } else {202 else 203 203 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels 204 } 204 205 205 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) ); 206 206 } … … 221 221 $editable = get_editable_user_ids( $user_id ); 222 222 223 if ( !$editable ) {223 if ( !$editable ) { 224 224 return false; 225 225 } else { … … 253 253 return array(); 254 254 } 255 if( !is_multisite() ) { 255 256 if ( !is_multisite() ) 256 257 $level_key = $wpdb->get_blog_prefix() . 'user_level'; 257 } else {258 else 258 259 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels 259 }260 260 261 261 $query = $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s", $level_key); … … 303 303 global $wpdb; 304 304 305 if ( !is_multisite() ) {305 if ( !is_multisite() ) 306 306 $level_key = $wpdb->get_blog_prefix() . 'user_level'; 307 } else {307 else 308 308 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels 309 }310 309 311 310 return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value = '0'", $level_key) ); … … 333 332 $dir = ( 'pending' == $type ) ? 'ASC' : 'DESC'; 334 333 335 if ( !$editable ) {334 if ( !$editable ) { 336 335 $other_unpubs = ''; 337 336 } else { … … 676 675 677 676 $this->query_from_where = "FROM $wpdb->users"; 678 if ( $this->role ) 677 if ( $this->role ) { 679 678 $this->query_from_where .= $wpdb->prepare(" INNER JOIN $wpdb->usermeta ON $wpdb->users.ID = $wpdb->usermeta.user_id WHERE $wpdb->usermeta.meta_key = '{$wpdb->prefix}capabilities' AND $wpdb->usermeta.meta_value LIKE %s", '%' . $this->role . '%'); 680 elseif ( !is_multisite() )679 } elseif ( !is_multisite() ) { 681 680 $this->query_from_where .= " WHERE 1=1"; 682 else {681 } else { 683 682 $level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels 684 683 $this->query_from_where .= ", $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '{$level_key}'"; -
trunk/wp-admin/themes.php
r12754 r12755 13 13 wp_die( __( 'Cheatin’ uh?' ) ); 14 14 15 if ( is_multisite() ) {16 $themes = get_themes();17 $ct = current_theme_info();18 $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() );19 if ( $allowed_themes == false )20 $allowed_themes = array();21 22 $blog_allowed_themes = wpmu_get_blog_allowedthemes();23 if ( is_array( $blog_allowed_themes ) )24 $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );25 if ( $blog_id != 1 )26 unset( $allowed_themes[ "h3" ] );27 28 if ( isset( $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] ) == false )29 $allowed_themes[ wp_specialchars( $ct->stylesheet ) ] = true;30 31 reset( $themes );32 foreach ( $themes as $key => $theme ) {33 if ( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {34 unset( $themes[ $key ] );35 }36 }37 reset( $themes );38 }39 15 if ( isset($_GET['action']) ) { 40 16 if ( 'activate' == $_GET['action'] ) { … … 86 62 87 63 <?php 88 if ( !is_multisite() ) 89 $themes = get_themes(); 64 $themes = get_allowed_themes(); 90 65 $ct = current_theme_info(); 91 66 unset($themes[$ct->name]); -
trunk/wp-includes/load.php
r12734 r12755 261 261 262 262 wp_cache_init(); 263 263 264 if ( function_exists('wp_cache_add_global_groups') ) { 264 if( is_multisite() ) { 265 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss')); 266 } else { 267 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient')); 268 } 265 wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta', 'site-transient', 'site-options', 'site-lookup', 'blog-lookup', 'blog-details', 'rss')); 269 266 wp_cache_add_non_persistent_groups(array( 'comment', 'counts', 'plugins' )); 270 267 } … … 273 270 function wp_not_installed() { 274 271 if ( is_multisite() ) { 275 276 die( __( 'The blog you have requested is not installed properly. Please contact the system administrator.' ) ); // have to die here ~ Mark272 if ( !is_blog_installed() && !defined('WP_INSTALLING') ) 273 die( __( 'The blog you have requested is not installed properly. Please contact the system administrator.' ) ); // have to die here 277 274 } elseif ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { 278 275 if ( defined('WP_SITEURL') ) … … 294 291 if ( $dh = opendir( WPMU_PLUGIN_DIR ) ) { 295 292 $mu_plugins = array (); 296 while ( ( $plugin = readdir( $dh ) ) !== false ) 293 while ( ( $plugin = readdir( $dh ) ) !== false ) { 297 294 if ( substr( $plugin, -4 ) == '.php' ) 298 295 $mu_plugins[] = $plugin; 296 } 299 297 closedir( $dh ); 300 if( is_multisite() ) 301 sort( $mu_plugins ); 302 foreach( $mu_plugins as $mu_plugin ) 298 sort( $mu_plugins ); 299 foreach ( $mu_plugins as $mu_plugin ) 303 300 include_once( WPMU_PLUGIN_DIR . '/' . $mu_plugin ); 304 301 }
Note: See TracChangeset
for help on using the changeset viewer.