Changeset 2209 for trunk/bp-core.php
- Timestamp:
- 12/27/2009 10:41:10 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r2200 r2209 11 11 define( 'BP_PLUGIN_DIR', WP_PLUGIN_DIR . '/buddypress' ); 12 12 define( 'BP_PLUGIN_URL', plugins_url( $path = '/buddypress' ) ); 13 14 /* Load the WP abstraction file so BuddyPress can run on all WordPress setups. */ 15 require ( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' ); 13 16 14 17 /* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it will be loaded before anything else. */ … … 63 66 define( 'BP_HOME_BLOG_SLUG', 'blog' ); 64 67 65 /* Register BuddyPress themes contained within the theme folder */66 if ( function_exists( 'register_theme_ folder') )67 register_theme_ folder( 'buddypress/bp-themes' );68 /* Register BuddyPress themes contained within the bp-theme folder */ 69 if ( function_exists( 'register_theme_directory') ) 70 register_theme_directory( WP_PLUGIN_DIR . '/buddypress/bp-themes' ); 68 71 69 72 … … 414 417 */ 415 418 function bp_core_action_set_spammer_status() { 416 global $bp ;419 global $bp, $wpdb; 417 420 418 421 if ( !is_site_admin() || bp_is_home() || !$bp->displayed_user->id ) … … 424 427 425 428 /* Get the functions file */ 426 require( ABSPATH . 'wp-admin/includes/mu.php' ); 429 if ( file_exists( ABSPATH . 'wp-admin/includes/mu.php' ) && bp_core_is_multiblog_install() ) 430 require( ABSPATH . 'wp-admin/includes/mu.php' ); 427 431 428 432 if ( 'mark-spammer' == $bp->current_action ) … … 447 451 448 452 /* Finally, mark this user as a spammer */ 449 update_user_status( $bp->displayed_user->id, 'spam', $is_spam, 1 ); 453 if ( bp_core_is_multiblog_install() ) 454 $wpdb->update( $wpdb->users, array( 'spam' => $is_spam ), array( 'ID' => $bp->displayed_user->id ) ); 455 456 $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $bp->displayed_user->id ) ); 450 457 451 458 if ( $is_spam ) … … 1169 1176 */ 1170 1177 function bp_core_get_total_member_count() { 1171 global $wpdb; 1172 1173 $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM " . CUSTOM_USER_TABLE . " WHERE spam = 0" ) ); 1178 global $wpdb, $bp; 1179 1180 $status_sql = bp_core_get_status_sql(); 1181 1182 $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql}" ) ); 1174 1183 return apply_filters( 'bp_core_get_total_member_count', $count ); 1175 1184 } … … 1187 1196 global $wpdb; 1188 1197 1189 return apply_filters( 'bp_core_is_user_spammer', (int) $wpdb->get_var( $wpdb->prepare( "SELECT spam FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) ) ); 1198 if ( bp_core_is_multiblog_install() ) 1199 $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT spam FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) ); 1200 else 1201 $is_spammer = (int) $wpdb->get_var( $wpdb->prepare( "SELECT user_status FROM " . CUSTOM_USER_TABLE . " WHERE ID = %d", $user_id ) ); 1202 1203 return apply_filters( 'bp_core_is_user_spammer', $is_spammer ); 1190 1204 } 1191 1205
Note: See TracChangeset
for help on using the changeset viewer.