Changeset 1263
- Timestamp:
- 04/24/08 14:57:30 (2 months ago)
- Files:
-
- trunk/wp-includes/wpmu-functions.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/wpmu-functions.php
r1246 r1263 234 234 235 235 if ( $value == get_site_option( $key ) ) 236 return ;236 return false; 237 237 238 238 $exists = $wpdb->get_row("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = '$safe_key' AND site_id = '{$wpdb->siteid}'"); … … 246 246 $wpdb->query( "UPDATE $wpdb->sitemeta SET meta_value = '" . $wpdb->escape( $value ) . "' WHERE site_id='{$wpdb->siteid}' AND meta_key = '$safe_key'" ); 247 247 wp_cache_delete( $wpdb->siteid . $key, 'site-options' ); 248 return true; 248 249 } 249 250 … … 312 313 function update_blog_option( $id, $key, $value, $refresh = true ) { 313 314 switch_to_blog($id); 314 $opt =update_option( $key, $value );315 update_option( $key, $value ); 315 316 restore_current_blog(); 316 if( $refresh == true ) 317 318 if( $refresh == true ) { 317 319 refresh_blog_details( $id ); 318 $opt = $id."-".$key."-blog_option";319 wp_cache_set( $opt, $value, 'site-options');320 } 321 wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options'); 320 322 } 321 323 … … 431 433 return false; 432 434 433 $blogs = array(); 434 435 $i = 0; 435 $blogs = $match = array(); 436 436 foreach ( (array) $user as $key => $value ) { 437 437 if ( strstr( $key, '_capabilities') && strstr( $key, 'wp_') ) { … … 537 537 538 538 function get_most_active_blogs( $num = 10, $display = true ) { 539 global $wpdb;540 539 $most_active = get_site_option( "most_active" ); 541 540 $update = false; … … 597 596 $blogs = $wpdb->get_results( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", ARRAY_A ); 598 597 599 foreach ( (array) $blogs as $ key => $details ) {598 foreach ( (array) $blogs as $details ) { 600 599 $blog_list[ $details['blog_id'] ] = $details; 601 600 $blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT count(*) FROM " . $wpdb->base_prefix . $details['blog_id'] . "_posts WHERE post_status='publish' AND post_type='post'" ); … … 664 663 wp_cache_delete( $user_id, 'users' ); 665 664 restore_current_blog(); 665 return true; 666 666 } 667 667 668 668 function remove_user_from_blog($user_id, $blog_id = '') { 669 global $wpdb;670 671 669 switch_to_blog($blog_id); 672 673 670 $user_id = (int) $user_id; 674 675 671 do_action('remove_user_from_blog', $user_id, $blog_id); 676 672 … … 706 702 707 703 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { 708 global $wpdb;709 710 704 $domain = addslashes( $domain ); 711 705 $weblog_title = addslashes( $weblog_title ); … … 845 839 846 840 function wpmu_validate_user_signup($user_name, $user_email) { 847 global $wpdb , $current_site;841 global $wpdb; 848 842 849 843 $errors = new WP_Error(); … … 855 849 $errors->add('user_name', __("Please enter a username")); 856 850 851 $maybe = array(); 857 852 preg_match( "/[a-z0-9]+/", $user_name, $maybe ); 858 853 … … 881 876 882 877 // all numeric? 878 $match = array(); 883 879 preg_match( '/[0-9]*/', $user_name, $match ); 884 880 if ( $match[0] == $user_name ) … … 958 954 $errors->add('blog_id', __("Please enter a blog name")); 959 955 956 $maybe = array(); 960 957 preg_match( "/[a-z0-9]+/", $blog_id, $maybe ); 961 958 if( $blog_id != $maybe[0] ) { … … 973 970 974 971 // all numeric? 972 $match = array(); 975 973 preg_match( '/[0-9]*/', $blog_id, $match ); 976 974 if ( $match[0] == $blog_id ) … … 1099 1097 global $wpdb; 1100 1098 1101 $result = array();1102 1099 $signup = $wpdb->get_row("SELECT * FROM $wpdb->signups WHERE activation_key = '$key'"); 1103 1100 … … 1257 1254 global $current_site; 1258 1255 if( get_site_option( 'registrationnotification' ) != 'yes' ) 1259 return ;1256 return false; 1260 1257 1261 1258 $email = get_site_option( 'admin_email' ); … … 1272 1269 $msg = apply_filters( 'newuser_notify_siteadmin', $msg ); 1273 1270 wp_mail( $email, sprintf(__("New User Registration: %s"), $user->user_login), $msg ); 1271 return true; 1274 1272 } 1275 1273 add_action( "wpmu_new_user", "newuser_notify_siteadmin" ); … … 1569 1567 1570 1568 function upload_is_user_over_quota( $echo = true ) { 1571 global $wpdb;1572 1573 1569 // Default space allowed is 10 MB 1574 1570 $spaceAllowed = get_space_allowed(); … … 1689 1685 1690 1686 function plugin_content() { 1691 global $ wpdb, $current_blog, $current_site;1687 global $current_blog, $current_site; 1692 1688 $this->delete_blog_hash = get_settings('delete_blog_hash'); 1693 1689 echo '<div class="wrap"><h2>' . __('Delete Blog') . '</h2>'; … … 1870 1866 http://trac.mu.wordpress.org/attachment/ticket/551/xmlrpc-mu.php 1871 1867 */ 1872 1873 1868 function wpmu_blogger_getUsersBlogs($args) { 1874 1869 $site_details = get_blog_details( 1, true ); … … 1887 1882 return $blogs; 1888 1883 } else { 1889 foreach ( (array) $blogs as $blog _num => $blog) {1884 foreach ( (array) $blogs as $blog ) { 1890 1885 if ( strpos($blog['url'], $_SERVER['HTTP_HOST']) ) 1891 1886 return array($blog);
