Changeset 4961
- Timestamp:
- 08/10/2011 06:32:02 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 68 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r4958 r4961 468 468 // array of prepared integers or quoted strings 469 469 $items_prepared = array(); 470 470 471 471 // clean up and format each item 472 472 foreach ( $items_dirty as $item ) { -
trunk/bp-activity/bp-activity-filters.php
r4907 r4961 74 74 add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' ); 75 75 76 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' ); 77 add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' ); 78 add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' ); 76 add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' ); 77 add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' ); 78 add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' ); 79 79 80 80 add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' ); … … 113 113 * 114 114 * @param string $content The activity content 115 * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id, 115 * @param int $activity_id When $adjust_mention_count is true, you must provide an $activity_id, 116 116 * which will be added to the list of the user's unread mentions 117 117 */ … … 136 136 } 137 137 138 // Adjust the activity count for this item 138 // Adjust the activity count for this item 139 139 if ( $activity_id ) 140 140 bp_activity_adjust_mention_count( $activity_id, 'add' ); 141 141 142 142 return $content; 143 } 143 } 144 144 145 145 /** … … 154 154 // Only run this function once for a given activity item 155 155 remove_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' ); 156 156 157 157 // Run the content through the linking filter, making sure to increment mention count 158 158 $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id ); 159 159 160 160 // Resave the activity with the new content 161 161 $activity->save(); -
trunk/bp-activity/bp-activity-functions.php
r4951 r4961 1053 1053 $bp->activity->read_more_id = $activity->id; 1054 1054 1055 add_filter( 'embed_post_id', create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) ); 1055 add_filter( 'embed_post_id', create_function( '', 'global $bp; return $bp->activity->read_more_id;' ) ); 1056 1056 add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 ); 1057 1057 add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 ); -
trunk/bp-activity/bp-activity-notifications.php
r4817 r4961 7 7 * 8 8 * @package BuddyPress Activity 9 * @param str $content The content of the activity update 9 * @param str $content The content of the activity update 10 10 * @param int $poster_user_id The unique user_id of the user who sent the update 11 11 * @param int $activity_id The id of the activity update … … 18 18 $subject = ''; 19 19 $message = ''; 20 20 21 21 // Add the BP notification 22 22 bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id ); 23 23 24 24 // Now email the user with the contents of the message (if they have enabled email notifications) 25 25 if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { … … 69 69 wp_mail( $to, $subject, $message ); 70 70 } 71 71 72 72 do_action( 'bp_activity_sent_mention_email', $activity, $subject, $message, $content ); 73 73 } -
trunk/bp-activity/bp-activity-screens.php
r4907 r4961 79 79 * @uses bp_is_my_profile() 80 80 */ 81 function bp_activity_reset_my_new_mentions() { 81 function bp_activity_reset_my_new_mentions() { 82 82 if ( bp_is_my_profile() ) 83 83 bp_activity_clear_new_mentions( bp_loggedin_user_id() ); … … 91 91 if ( !bp_is_activity_component() ) 92 92 return false; 93 94 if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) ) 95 return false; 96 93 94 if ( empty( $bp->current_action ) || !is_numeric( $bp->current_action ) ) 95 return false; 96 97 97 // Get the activity details 98 98 $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true ) ); -
trunk/bp-blogs/bp-blogs-functions.php
r4959 r4961 35 35 36 36 /** 37 * Populates the BP blogs table with existing blogs. 37 * Populates the BP blogs table with existing blogs. 38 38 * 39 39 * @package BuddyPress Blogs … … 56 56 $users = get_users( array( 'blog_id' => $blog_id ) ); 57 57 $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) ); 58 58 59 59 if ( $users ) { 60 60 foreach ( (array)$users as $user ) { … … 103 103 104 104 $is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true; 105 $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 105 $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); 106 106 107 107 // Only record this activity if the blog is public … … 166 166 return false; 167 167 168 $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); 168 $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); 169 169 170 170 if ( 'publish' == $post->post_status && empty( $post->post_password ) ) { -
trunk/bp-core/admin/bp-core-admin.php
r4920 r4961 19 19 * @since {@internal Unknown}} 20 20 */ 21 function bp_core_admin_dashboard() { 21 function bp_core_admin_dashboard() { 22 22 $base_url = bp_get_admin_url( 'admin.php' ); 23 23 $action = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url ); … … 331 331 function bp_core_admin_component_options() { 332 332 global $bp_wizard; 333 333 334 334 // Load core functions, if needed 335 335 if ( !function_exists( 'bp_get_option' ) ) … … 337 337 338 338 $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); 339 339 340 340 // An array of strings looped over to create component setup markup 341 341 $optional_components = apply_filters( 'bp_admin_optional_components', array( … … 388 388 ), 389 389 ) ); 390 390 391 391 // On new install, set all components to be active by default 392 392 if ( !empty( $bp_wizard ) && 'install' == $bp_wizard->setup_type && empty( $active_components ) ) … … 394 394 395 395 ?> 396 396 397 397 <?php /* The setup wizard uses different, more descriptive text here */ ?> 398 398 <?php if ( empty( $bp_wizard ) ) : ?> 399 399 400 400 <h3><?php _e( 'Available Components', 'buddypress' ); ?></h3> 401 401 402 402 <p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p> 403 403 404 404 <?php endif ?> 405 405 406 406 <table class="form-table"> 407 407 <tbody> … … 480 480 function bp_core_admin_page_options() { 481 481 global $bp; 482 482 483 483 // Get the existing WP pages 484 484 $existing_pages = bp_core_get_directory_page_ids(); … … 492 492 // Only components that need directories should be listed here 493 493 if ( isset( $bp->{$component_id} ) && !empty( $bp->{$component_id}->has_directory ) ) { 494 494 495 495 // component->name was introduced in BP 1.5, so we must provide a fallback 496 496 $component_name = !empty( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $component_id ); 497 497 498 498 $directory_pages[$component_id] = $component_name; 499 499 } 500 500 } 501 501 502 502 $directory_pages = apply_filters( 'bp_directory_pages', $directory_pages ); 503 503 504 504 ?> 505 505 506 506 <h3><?php _e( 'Directories', 'buddypress' ); ?></h3> 507 507 508 508 <p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p> 509 509 … … 513 513 <?php foreach ( $directory_pages as $name => $label ) : ?> 514 514 <?php $disabled = !bp_is_active( $name ) ? ' disabled="disabled"' : ''; ?> 515 515 516 516 <tr valign="top"> 517 517 <th scope="row"> … … 520 520 521 521 <td> 522 <?php if ( !bp_is_root_blog() ) 522 <?php if ( !bp_is_root_blog() ) 523 523 switch_to_blog( bp_get_root_blog_id() ) ?> 524 524 525 525 <?php echo wp_dropdown_pages( array( 526 526 'name' => 'bp_pages[' . esc_attr( $name ) . ']', … … 538 538 539 539 <?php endif; ?> 540 541 <?php if ( !bp_is_root_blog() ) 540 541 <?php if ( !bp_is_root_blog() ) 542 542 restore_current_blog() ?> 543 543 … … 552 552 </tbody> 553 553 </table> 554 554 555 555 <?php 556 556 -
trunk/bp-core/admin/bp-core-update.php
r4948 r4961 263 263 } 264 264 265 function step_ms_update() { 265 function step_ms_update() { 266 266 if ( !current_user_can( 'activate_plugins' ) ) 267 267 return false; … … 371 371 372 372 $existing_pages = bp_core_update_get_page_meta(); 373 373 374 374 // Provide empty indexes to avoid PHP errors with wp_dropdown_pages() 375 375 $indexes = array( 'members', 'activity', 'groups', 'forums', 'blogs', 'register', 'activate' ); … … 378 378 $existing_pages[$index] = ''; 379 379 } 380 380 381 381 if ( !empty( $existing_pages['blogs'] ) ) 382 382 $existing_blog_page = '&selected=' . $existing_pages['blogs']; … … 1272 1272 function bp_core_update_do_network_admin() { 1273 1273 $do_network_admin = false; 1274 1274 1275 1275 if ( is_multisite() && ( !defined( 'BP_ENABLE_MULTIBLOG' ) || !BP_ENABLE_MULTIBLOG ) ) 1276 1276 $do_network_admin = true; 1277 1277 1278 1278 return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); 1279 1279 } … … 1281 1281 function bp_core_update_admin_hook() { 1282 1282 $hook = bp_core_update_do_network_admin() ? 'network_admin_menu' : 'admin_menu'; 1283 1283 1284 1284 return apply_filters( 'bp_core_admin_hook', $hook ); 1285 1285 } -
trunk/bp-core/bp-core-catchuri.php
r4920 r4961 181 181 } 182 182 } 183 184 // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above 183 184 // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above 185 185 if ( empty( $matches ) && defined( 'BP_ENABLE_ROOT_PROFILES' ) && BP_ENABLE_ROOT_PROFILES ) { 186 186 187 187 // Make sure there's a user corresponding to $bp_uri[0] 188 188 if ( !empty( $bp_uri[0] ) && $root_profile = get_userdatabylogin( $bp_uri[0] ) ) { 189 189 190 190 // Force BP to recognize that this is a members page 191 191 $matches[] = 1; 192 192 $match = $bp->pages->members; 193 193 $match->key = 'members'; 194 194 195 195 // Without the 'members' URL chunk, WordPress won't know which page to load 196 196 // This filter intercepts the WP query and tells it to load the members page 197 197 add_filter( 'request', create_function( '$query_args', '$query_args["pagename"] = "' . $match->name . '"; return $query_args;' ) ); 198 199 } 200 198 199 } 200 201 201 } 202 202 … … 224 224 225 225 // Global the unfiltered offset to use in bp_core_load_template(). 226 // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0 226 // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0 227 227 $bp_unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0; 228 228 … … 238 238 // Viewing a specific user 239 239 if ( !empty( $bp_uri[$uri_offset + 1] ) ) { 240 240 241 241 // Switch the displayed_user based on compatbility mode 242 242 if ( bp_is_username_compatibility_mode() ) … … 247 247 if ( empty( $bp->displayed_user->id ) ) { 248 248 // Prevent components from loading their templates 249 $bp->current_component = ''; 249 $bp->current_component = ''; 250 250 251 251 bp_do_404(); … … 263 263 $bp->current_component = ''; 264 264 } 265 265 266 266 // Reset the offset 267 267 $uri_offset = 0; -
trunk/bp-core/bp-core-component.php
r4920 r4961 34 34 */ 35 35 var $slug; 36 37 /** 38 * @var bool Does this component need a top-level directory? 36 37 /** 38 * @var bool Does this component need a top-level directory? 39 39 */ 40 40 var $has_directory; … … 139 139 foreach ( $r['global_tables'] as $global_name => $table_name ) 140 140 $this->$global_name = $table_name; 141 141 142 142 /** BuddyPress ********************************************************/ 143 143 -
trunk/bp-core/bp-core-cssjs.php
r4820 r4961 78 78 $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) ); 79 79 $aspect_ratio = 1; 80 80 81 81 $full_height = bp_core_avatar_full_height(); 82 82 $full_width = bp_core_avatar_full_width(); 83 83 84 84 // Calculate Aspect Ratio 85 85 if ( $full_height && ( $full_width != $full_height ) ) -
trunk/bp-core/bp-core-filters.php
r4915 r4961 77 77 $themes['bp-default'] = 1; 78 78 } 79 79 80 80 return $themes; 81 81 } … … 279 279 if ( !empty( $bp->displayed_user->fullname ) && !is_404() ) { 280 280 // translators: "displayed user's name | canonicalised component name" 281 $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( bp_current_component() ) ) ); 281 $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( bp_current_component() ) ) ); 282 282 283 283 // A single group … … 314 314 } elseif ( bp_is_create_blog() ) { 315 315 $title = __( 'Create a Site', 'buddypress' ); 316 } 316 } 317 317 318 318 // Some BP nav items contain item counts. Remove them -
trunk/bp-core/bp-core-functions.php
r4933 r4961 130 130 function bp_core_get_directory_pages() { 131 131 global $wpdb, $bp; 132 132 133 133 // Set pages as standard class 134 134 $pages = new stdClass; … … 979 979 function bp_core_get_root_options() { 980 980 global $wpdb; 981 981 982 982 // These options come from the root blog options table 983 983 $root_blog_options = apply_filters( 'bp_core_site_options', array( 984 984 985 985 // BuddyPress core settings 986 986 'bp-deactivated-components' => serialize( array( ) ), … … 995 995 'bb-config-location' => ABSPATH, 996 996 'hide-loggedout-adminbar' => '0', 997 997 998 998 // Useful WordPress settings 999 999 'registration' => '0', 1000 1000 'avatar_default' => 'mysteryman' 1001 1001 ) ); 1002 1002 1003 1003 $root_blog_option_keys = array_keys( $root_blog_options ); 1004 1004 $blog_options_keys = implode( "', '", (array) $root_blog_option_keys ); 1005 1005 $blog_options_query = sprintf( "SELECT option_name AS name, option_value AS value FROM {$wpdb->options} WHERE option_name IN ('%s')", $blog_options_keys ); 1006 1006 $root_blog_options_meta = $wpdb->get_results( $blog_options_query ); 1007 1007 1008 1008 // On Multisite installations, some options must always be fetched from sitemeta 1009 1009 if ( is_multisite() ) { … … 1013 1013 'fileupload_maxk' => '1500' 1014 1014 ) ); 1015 1015 1016 1016 $network_option_keys = array_keys( $network_options ); 1017 1017 $sitemeta_options_keys = implode( "','", (array) $network_option_keys ); 1018 1018 $sitemeta_options_query = sprintf( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ('%s')", $sitemeta_options_keys ); 1019 1019 $network_options_meta = $wpdb->get_results( $sitemeta_options_query ); 1020 1020 1021 1021 // Sitemeta comes second in the merge, so that network 'registration' value wins 1022 1022 $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta ); 1023 1023 } 1024 1024 1025 1025 // Missing some options, so do some one-time fixing 1026 1026 if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) { 1027 1027 1028 1028 // Unset the query - We'll be resetting it soon 1029 1029 unset( $root_blog_options_meta ); 1030 1030 1031 1031 // Loop through options 1032 1032 foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) { 1033 1033 // Clear out the value from the last time around 1034 1034 unset( $old_meta_value ); 1035 1035 1036 1036 // Get old site option 1037 1037 if ( is_multisite() ) 1038 1038 $old_meta_value = get_site_option( $old_meta_key ); 1039 1039 1040 1040 // No site option so look in root blog 1041 1041 if ( empty( $old_meta_value ) ) 1042 1042 $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default ); 1043 1043 1044 1044 // Update the root blog option 1045 1045 bp_update_option( $old_meta_key, $old_meta_value ); 1046 1046 1047 1047 // Update the global array 1048 1048 $root_blog_options_meta[$old_meta_key] = $old_meta_value; 1049 1049 } 1050 1050 1051 1051 // We're all matched up 1052 1052 } else { … … 1054 1054 foreach ( $root_blog_options_meta as $root_blog_option ) 1055 1055 $root_blog_options[$root_blog_option->name] = $root_blog_option->value; 1056 1056 1057 1057 // Copy the options no the return val 1058 1058 $root_blog_options_meta = $root_blog_options; 1059 1059 1060 1060 // Clean up our temporary copy 1061 1061 unset( $root_blog_options ); 1062 1062 } 1063 1063 1064 1064 return apply_filters( 'bp_core_get_root_options', $root_blog_options_meta ); 1065 1065 } … … 1091 1091 $bp->add_root[] = $slug; 1092 1092 } 1093 1093 1094 1094 // Make sure that this component is registered as requiring a top-level directory 1095 1095 if ( isset( $bp->{$slug} ) ) { -
trunk/bp-core/bp-core-hooks.php
r4820 r4961 35 35 // Setup widgets 36 36 add_action( 'bp_loaded', 'bp_setup_widgets' ); 37 37 38 38 // Setup admin bar 39 39 add_action( 'bp_loaded', 'bp_core_load_admin_bar' ); -
trunk/bp-core/bp-core-loader.php
r4920 r4961 25 25 26 26 // Move active components from sitemeta, if necessary 27 // Provides backpat with earlier versions of BP 27 // Provides backpat with earlier versions of BP 28 28 if ( is_multisite() && $active_components = get_site_option( 'bp-active-components' ) ) 29 29 bp_update_option( 'bp-active-components', $active_components ); -
trunk/bp-core/bp-core-template.php
r4907 r4961 495 495 function bp_action_variable( $position = 0 ) { 496 496 $action_variables = bp_action_variables(); 497 497 498 498 $action_variable = isset( $action_variables[$position] ) ? $action_variables[$position] : false; 499 499 500 500 return apply_filters( 'bp_action_variable', $action_variable, $position ); 501 501 } … … 669 669 } elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) { 670 670 $is_current_component = true; 671 671 672 672 // Next, check to see whether $component is a canonical, 673 673 // non-translatable component name. If so, we can return its … … 677 677 $is_current_component = true; 678 678 679 // If we haven't found a match yet, check against the root_slugs 679 // If we haven't found a match yet, check against the root_slugs 680 680 // created by $bp->pages, as well as the regular slugs 681 681 } else { … … 752 752 * the function will return true if the $action_variable is found *anywhere* in the action 753 753 * variables array. 754 * @return bool 754 * @return bool 755 755 */ 756 756 function bp_is_action_variable( $action_variable = '', $position = false ) { 757 757 $is_action_variable = false; 758 758 759 759 if ( false !== $position ) { 760 // When a $position is specified, check that slot in the action_variables array 760 // When a $position is specified, check that slot in the action_variables array 761 761 if ( $action_variable ) { 762 762 $is_action_variable = $action_variable == bp_action_variable( $position ); … … 770 770 $is_action_variable = in_array( $action_variable, (array)bp_action_variables() ); 771 771 } 772 772 773 773 return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position ); 774 774 } … … 829 829 function bp_is_root_component( $component_name ) { 830 830 global $bp; 831 831 832 832 if ( !isset( $bp->active_components ) ) 833 833 return false; … … 1030 1030 if ( bp_is_current_component( 'xprofile' ) && bp_is_current_action( 'edit' ) ) 1031 1031 return true; 1032 1032 1033 1033 return false; 1034 1034 } -
trunk/bp-core/css/admin.dev.css
r4487 r4961 92 92 top: 5px; 93 93 } 94 94 95 95 div#bp-admin div.prev-next, div#bp-admin div.prev-next p, 96 96 div#bp-admin div.submit, div#bp-admin div.submit p { -
trunk/bp-core/deprecated/1.5.php
r4907 r4961 218 218 */ 219 219 function bp_page_title() { 220 echo bp_get_page_title(); 220 echo bp_get_page_title(); 221 221 } 222 222 /** … … 260 260 function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) { 261 261 global $bp; 262 262 263 263 _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' ); 264 264 … … 337 337 * In BP 1.5, these functions were renamed for greater consistency 338 338 */ 339 function bp_forum_directory_permalink() { 339 function bp_forum_directory_permalink() { 340 340 _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' ); 341 341 bp_forums_directory_permalink(); 342 } 343 function bp_get_forum_directory_permalink() { 342 } 343 function bp_get_forum_directory_permalink() { 344 344 _deprecated_function( __FUNCTION__, '1.5', 'bp_get_forums_directory_permalink()' ); 345 345 return bp_get_forums_directory_permalink(); 346 346 } 347 347 348 348 /** Theme *********************************************************************/ 349 349 -
trunk/bp-forums/bp-forums-admin.php
r4920 r4961 16 16 17 17 function bp_forums_bbpress_admin() { 18 global $bp; 19 18 global $bp; 19 20 20 $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); 21 21 ?> … … 100 100 // Just write the contents to screen 101 101 _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?> 102 102 103 103 <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars( $result ); ?></textarea> 104 104 -
trunk/bp-forums/bp-forums-filters.php
r4907 r4961 157 157 function bp_forums_add_replied_distinct_sql( $sql ) { 158 158 global $wpdb; 159 159 160 160 $sql = $wpdb->prepare( "DISTINCT t.topic_id, " ); 161 161 162 162 return $sql; 163 163 } … … 178 178 function bp_forums_add_replied_join_sql( $sql ) { 179 179 global $bbdb, $wpdb; 180 180 181 181 $sql .= $wpdb->prepare( " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id " ); 182 182 183 183 return $sql; 184 184 } … … 198 198 function bp_forums_add_replied_where_sql( $sql ) { 199 199 global $wpdb; 200 200 201 201 $sql .= $wpdb->prepare( " AND p.poster_id = %s ", bp_displayed_user_id() ); 202 202 -
trunk/bp-forums/bp-forums-loader.php
r4920 r4961 106 106 if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) ) 107 107 return; 108 108 109 109 // Add 'Forums' to the main navigation 110 110 $main_nav = array( -
trunk/bp-friends/bp-friends-activity.php
r4822 r4961 71 71 case 'friendship_accepted': 72 72 $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/newest'; 73 73 74 74 // Set up the string and the filter 75 75 if ( (int)$total_items > 1 ) { … … 80 80 $filter = 'bp_friends_single_friendship_accepted_notification'; 81 81 } 82 82 83 83 break; 84 84 85 85 case 'friendship_request': 86 86 $link = bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests?new'; 87 87 88 88 // Set up the string and the filter 89 89 if ( (int)$total_items > 1 ) { … … 94 94 $filter = 'bp_friends_single_friendship_request_notification'; 95 95 } 96 96 97 97 break; 98 98 } 99 99 100 100 // Return either an HTML link or an array, depending on the requested format 101 101 if ( 'string' == $format ) { -
trunk/bp-friends/bp-friends-functions.php
r4822 r4961 257 257 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 258 258 global $bp; 259 259 260 260 if ( 'add' == $status ) { 261 261 bp_update_user_meta( $initiator_user_id, 'total_friend_count', (int)bp_get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 ); -
trunk/bp-friends/bp-friends-notifications.php
r4822 r4961 35 35 36 36 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 37 37 38 38 /* Send the message */ 39 39 $to = apply_filters( 'friends_notification_new_request_to', $to ); -
trunk/bp-friends/bp-friends-template.php
r4907 r4961 76 76 function bp_friends_filter_title() { 77 77 $current_filter = bp_action_variable( 0 ); 78 78 79 79 switch ( $current_filter ) { 80 80 case 'recently-active': default: … … 144 144 wp_cache_set( 'friends_random_users', $user_ids, 'bp' ); 145 145 } 146 146 147 147 ?> 148 148 -
trunk/bp-groups/bp-groups-actions.php
r4872 r4961 103 103 bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' ); 104 104 } 105 106 // Set the invite status 105 106 // Set the invite status 107 107 // Checked against a whitelist for security 108 108 $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); 109 109 $invite_status = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; 110 110 111 111 groups_update_groupmeta( $bp->groups->new_group_id, 'invite_status', $invite_status ); 112 112 } -
trunk/bp-groups/bp-groups-activity.php
r4954 r4961 94 94 $filter = 'bp_groups_multiple_new_membership_requests_notification'; 95 95 $notification_link = $group_link . 'admin/membership-requests/?n=1'; 96 96 97 97 if ( 'string' == $format ) { 98 98 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Membership Requests', 'buddypress' ) . '">' . $text . '</a>', $group_link, $total_items, $group->name, $text, $notification_link ); … … 108 108 $filter = 'bp_groups_single_new_membership_request_notification'; 109 109 $notification_link = $group_link . 'admin/membership-requests/?n=1'; 110 110 111 111 if ( 'string' == $format ) { 112 112 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . sprintf( __( '%s requests group membership', 'buddypress' ), $user_fullname ) . '">' . $text . '</a>', $group_link, $user_fullname, $group->name, $text, $notification_link ); … … 118 118 } 119 119 } 120 120 121 121 break; 122 122 … … 129 129 if ( (int)$total_items > 1 ) { 130 130 $text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int)$total_items, $group->name ); 131 $filter = 'bp_groups_multiple_membership_request_accepted_notification'; 131 $filter = 'bp_groups_multiple_membership_request_accepted_notification'; 132 132 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1'; 133 133 134 134 if ( 'string' == $format ) { 135 135 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name, $text, $notification_link ); … … 144 144 $filter = 'bp_groups_single_membership_request_accepted_notification'; 145 145 $notification_link = $group_link . '?n=1'; 146 146 147 147 if ( 'string' == $format ) { 148 148 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); … … 162 162 $group = new BP_Groups_Group( $group_id ); 163 163 $group_link = bp_get_group_permalink( $group ); 164 164 165 165 if ( (int)$total_items > 1 ) { 166 166 $text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int)$total_items, $group->name ); 167 167 $filter = 'bp_groups_multiple_membership_request_rejected_notification'; 168 168 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1'; 169 169 170 170 if ( 'string' == $format ) { 171 171 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $group->name ); … … 180 180 $filter = 'bp_groups_single_membership_request_rejected_notification'; 181 181 $notification_link = $group_link . '?n=1'; 182 182 183 183 if ( 'string' == $format ) { 184 184 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); … … 203 203 $filter = 'bp_groups_multiple_member_promoted_to_admin_notification'; 204 204 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1'; 205 205 206 206 if ( 'string' == $format ) { 207 207 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); … … 216 216 $filter = 'bp_groups_single_member_promoted_to_admin_notification'; 217 217 $notification_link = $group_link . '?n=1'; 218 218 219 219 if ( 'string' == $format ) { 220 220 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); … … 239 239 $filter = 'bp_groups_multiple_member_promoted_to_mod_notification'; 240 240 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1'; 241 241 242 242 if ( 'string' == $format ) { 243 243 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Groups', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); … … 252 252 $filter = 'bp_groups_single_member_promoted_to_mod_notification'; 253 253 $notification_link = $group_link . '?n=1'; 254 254 255 255 if ( 'string' == $format ) { 256 256 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); … … 267 267 case 'group_invite': 268 268 $group_id = $item_id; 269 $group = new BP_Groups_Group( $group_id ); 270 $group_link = bp_get_group_permalink( $group ); 271 269 $group = new BP_Groups_Group( $group_id ); 270 $group_link = bp_get_group_permalink( $group ); 271 272 272 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/?n=1'; 273 273 … … 275 275 $text = sprintf( __( 'You have %d new group invitations', 'buddypress' ), (int)$total_items ); 276 276 $filter = 'bp_groups_multiple_group_invite_notification'; 277 277 278 278 if ( 'string' == $format ) { 279 279 return apply_filters( $filter, '<a href="' . $notification_link . '" title="' . __( 'Group Invites', 'buddypress' ) . '">' . $text . '</a>', $total_items, $text, $notification_link ); … … 287 287 $text = sprintf( __( 'You have an invitation to the group: %s', 'buddypress' ), $group->name ); 288 288 $filter = 'bp_groups_single_group_invite_notification'; 289 289 290 290 if ( 'string' == $format ) { 291 291 return apply_filters( $filter, '<a href="' . $notification_link . '">' . $text . '</a>', $group_link, $group->name, $text, $notification_link ); -
trunk/bp-groups/bp-groups-adminbar.php
r4907 r4961 50 50 'href' => bp_get_group_permalink( $bp->groups->current_group ) 51 51 ) ); 52 52 53 53 // Group Admin > Edit details 54 54 $wp_admin_bar->add_menu( array( … … 58 58 'href' => bp_get_groups_action_link( 'admin/edit-details' ) 59 59 ) ); 60 60 61 61 // Group Admin > Group settings 62 62 $wp_admin_bar->add_menu( array( … … 66 66 'href' => bp_get_groups_action_link( 'admin/group-settings' ) 67 67 ) ); 68 68 69 69 // Group Admin > Group avatar 70 70 $wp_admin_bar->add_menu( array( … … 74 74 'href' => bp_get_groups_action_link( 'admin/group-avatar' ) 75 75 ) ); 76 76 77 77 // Group Admin > Manage invitations 78 78 if ( bp_is_active( 'friends' ) ) { … … 84 84 ) ); 85 85 } 86 86 87 87 // Group Admin > Manage members 88 88 $wp_admin_bar->add_menu( array( … … 92 92 'href' => bp_get_groups_action_link( 'admin/manage-members' ) 93 93 ) ); 94 94 95 95 // Group Admin > Membership Requests 96 96 if ( bp_get_group_status( $bp->groups->current_group ) == 'private' ) { … … 101 101 'href' => bp_get_groups_action_link( 'admin/membership-requests' ) 102 102 ) ); 103 } 104 103 } 104 105 105 // Delete Group 106 106 $wp_admin_bar->add_menu( array( -
trunk/bp-groups/bp-groups-buddybar.php
r4823 r4961 18 18 <ul> 19 19 <li><a href="<?php bp_groups_action_link( 'admin/edit-details' ); ?>"><?php _e( 'Edit Details', 'buddypress' ); ?></a></li> 20 20 21 21 <li><a href="<?php bp_groups_action_link( 'admin/group-settings' ); ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li> 22 22 23 23 <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li> 24 24 -
trunk/bp-groups/bp-groups-classes.php
r4907 r4961 294 294 if ( is_array( $include ) ) 295 295 $include = implode( ',', $include ); 296 296 297 297 $include = $wpdb->escape( $include ); 298 298 $sql['include'] = " AND g.id IN ({$include})"; … … 302 302 if ( is_array( $exclude ) ) 303 303 $exclude = implode( ',', $exclude ); 304 304 305 305 $exclude = $wpdb->escape( $exclude ); 306 306 $sql['exclude'] = " AND g.id NOT IN ({$exclude})"; … … 598 598 return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) ); 599 599 } 600 601 600 601 602 602 /** 603 603 * Get a total count of all topics of a given status, across groups/forums … … 611 611 function get_global_topic_count( $status = 'public', $search_terms = false ) { 612 612 global $bbdb, $wpdb, $bp; 613 613 614 614 switch ( $status ) { 615 615 case 'all' : 616 616 $status_sql = ''; 617 617 break; 618 618 619 619 case 'hidden' : 620 620 $status_sql = $wpdb->prepare( "AND g.status = 'hidden'" ); 621 621 break; 622 622 623 623 case 'private' : 624 624 $status_sql = $wpdb->prepare( "AND g.status = 'private'" ); 625 625 break; 626 626 627 627 case 'public' : 628 628 default : … … 630 630 break; 631 631 } 632 632 633 633 $sql = array(); 634 634 635 635 $sql['select'] = "SELECT COUNT(t.topic_id)"; 636 636 637 637 $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id"; 638 638 639 639 $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'"; 640 640 641 641 if ( $search_terms ) { 642 642 $st = like_escape( $search_terms ); 643 643 $sql['where'] .= " AND ( t.topic_title LIKE '%{$st}%' )"; 644 644 } 645 645 646 646 return $wpdb->get_var( implode( ' ', $sql ) ); 647 647 } … … 667 667 $this->__construct($user_id,$group_id,$id,$populate); 668 668 } 669 669 670 670 function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) { 671 671 if ( $user_id && $group_id && !$id ) { … … 772 772 function ban() { 773 773 global $bp; 774 774 775 775 if ( $this->is_admin ) 776 776 return false; … … 790 790 function unban() { 791 791 global $bp; 792 792 793 793 if ( $this->is_admin ) 794 794 return false; … … 804 804 function accept_invite() { 805 805 global $bp; 806 806 807 807 $this->inviter_id = 0; 808 808 $this->is_confirmed = 1; … … 814 814 function accept_request() { 815 815 global $bp; 816 816 817 817 $this->is_confirmed = 1; 818 818 $this->date_modified = bp_core_current_time(); … … 958 958 if ( !$user_id ) 959 959 return false; 960 960 961 961 $sql = "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND inviter_id != 0"; 962 962 963 963 if ( 'sent' == $type ) 964 964 $sql .= " AND invite_sent = 1"; … … 1215 1215 function _register() { 1216 1216 global $bp; 1217 1217 1218 1218 if ( !empty( $this->enable_create_step ) ) { 1219 1219 // Insert the group creation step for the new group extension … … 1245 1245 add_action( $this->display_hook, array( &$this, 'widget_display' ) ); 1246 1246 } 1247 1247 1248 1248 // Construct the admin edit tab for the new group extension 1249 1249 if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) { -
trunk/bp-groups/bp-groups-filters.php
r4907 r4961 80 80 function groups_add_forum_tables_sql( $sql = '' ) { 81 81 global $bp; 82 82 83 83 $sql .= 'JOIN ' . $bp->groups->table_name . ' AS g LEFT JOIN ' . $bp->groups->table_name_groupmeta . ' AS gm ON g.id = gm.group_id '; 84 84 85 85 return $sql; 86 86 } -
trunk/bp-groups/bp-groups-forums.php
r4941 r4961 214 214 // The activity item for the initial topic 215 215 bp_activity_delete( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic' ) ); 216 216 217 217 // The activity item for each post 218 218 foreach ( (array)$posts as $post ) { -
trunk/bp-groups/bp-groups-functions.php
r4907 r4961 427 427 function groups_get_current_group() { 428 428 global $bp; 429 429 430 430 $current_group = isset( $bp->groups->current_group ) ? $bp->groups->current_group : false; 431 431 432 432 return apply_filters( 'groups_get_current_group', $current_group ); 433 433 } -
trunk/bp-groups/bp-groups-loader.php
r4920 r4961 94 94 95 95 $bp->is_single_item = true; 96 $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' ); 96 $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Group' ); 97 97 $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) ); 98 98 … … 163 163 return; 164 164 } 165 165 166 166 // Group access control 167 167 if ( bp_is_groups_component() && !empty( $this->current_group ) && !empty( $bp->current_action ) && !$this->current_group->user_has_access ) { 168 168 if ( is_user_logged_in() ) { 169 169 // Off-limits to this user. Throw an error and redirect to the 170 // group's home page 170 // group's home page 171 171 bp_core_no_access( array( 172 172 'message' => __( 'You do not have access to this group.', 'buddypress' ), -
trunk/bp-groups/bp-groups-notifications.php
r4823 r4961 247 247 248 248 wp_mail( $to, $subject, $message ); 249 249 250 250 do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group ); 251 251 } -
trunk/bp-groups/bp-groups-screens.php
r4844 r4961 509 509 if ( isset( $_POST['save'] ) ) { 510 510 $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0; 511 511 512 512 // Checked against a whitelist for security 513 513 $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); 514 514 $status = ( in_array( $_POST['group-status'], (array)$allowed_status ) ) ? $_POST['group-status'] : 'public'; 515 515 516 516 // Checked against a whitelist for security 517 517 $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); … … 615 615 $user_id = bp_action_variable( 3 ); 616 616 $status = bp_action_variable( 2 ); 617 617 618 618 // Check the nonce first. 619 619 if ( !check_admin_referer( 'groups_promote_member' ) ) … … 653 653 if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 654 654 $user_id = bp_action_variable( 2 ); 655 655 656 656 // Check the nonce first. 657 657 if ( !check_admin_referer( 'groups_ban_member' ) ) … … 671 671 if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 672 672 $user_id = bp_action_variable( 2 ); 673 673 674 674 // Check the nonce first. 675 675 if ( !check_admin_referer( 'groups_unban_member' ) ) … … 689 689 if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 690 690 $user_id = bp_action_variable( 2 ); 691 691 692 692 // Check the nonce first. 693 693 if ( !check_admin_referer( 'groups_remove_member' ) ) -
trunk/bp-loader.php
r4926 r4961 31 31 // Define on which blog ID BuddyPress should run 32 32 if ( !defined( 'BP_ROOT_BLOG' ) ) { 33 33 34 34 // Root blog is the main site on this network 35 35 if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) { 36 36 $current_site = get_current_site(); 37 37 $root_blog_id = $current_site->blog_id; 38 38 39 39 // Root blog is every site on this network 40 40 } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) { 41 41 $root_blog_id = get_current_blog_id(); 42 42 43 43 // Root blog is the only blog on this network 44 44 } elseif( !is_multisite() ) { … … 98 98 if ( !function_exists( 'bp_loader_activate' ) ) : 99 99 /** 100 * Defines BP's activation routine. 101 * 102 * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some 103 * issues with incompatible legacy themes, and provides a hook for other functions to know that 104 * BP has been activated. 105 * 106 * @package BuddyPress Core 107 */ 100 * Defines BP's activation routine. 101 * 102 * Most of BP's crucial setup is handled by the setup wizard. This function takes care of some 103 * issues with incompatible legacy themes, and provides a hook for other functions to know that 104 * BP has been activated. 105 * 106 * @package BuddyPress Core 107 */ 108 108 function bp_loader_activate() { 109 109 // Force refresh theme roots. -
trunk/bp-members/bp-members-actions.php
r4946 r4961 107 107 // Allow plugins to do neat things 108 108 do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam ); 109 109 110 110 // Redirect back to where we came from 111 111 bp_core_redirect( wp_get_referer() ); -
trunk/bp-members/bp-members-adminbar.php
r4920 r4961 111 111 'href' => bp_get_members_component_link( 'profile', 'edit' ) 112 112 ) ); 113 113 114 114 // User Admin > Edit this user's avatar 115 115 $wp_admin_bar->add_menu( array( … … 119 119 'href' => bp_get_members_component_link( 'profile', 'change-avatar' ) 120 120 ) ); 121 121 122 122 // User Admin > Spam/unspam 123 123 if ( !bp_core_is_user_spammer( bp_displayed_user_id() ) ) { … … 127 127 'title' => __( 'Mark as Spammer', 'buddypress' ), 128 128 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ), 129 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' ) 130 ) ); 129 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as a spammer?', 'buddypress' ) . '");' ) 130 ) ); 131 131 } else { 132 132 $wp_admin_bar->add_menu( array( … … 135 135 'title' => __( 'Not a Spammer', 'buddypress' ), 136 136 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ), 137 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' ) 138 ) ); 139 } 140 137 'meta' => array( 'onclick' => 'confirm(" ' . __( 'Are you sure you want to mark this user as not a spammer?', 'buddypress' ) . '");' ) 138 ) ); 139 } 140 141 141 // User Admin > Delete Account 142 142 $wp_admin_bar->add_menu( array( … … 145 145 'title' => __( 'Delete Account', 'buddypress' ), 146 146 'href' => wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ), 147 'meta' => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' ) 147 'meta' => array( 'onclick' => 'confirm(" ' . __( "Are you sure you want to delete this user's account?", 'buddypress' ) . '");' ) 148 148 ) ); 149 149 } … … 161 161 if ( !is_user_logged_in() ) 162 162 return false; 163 163 164 164 if ( $notifications = bp_core_get_notifications_for_user( bp_loggedin_user_id(), 'object' ) ) { 165 165 $menu_title = sprintf( __( 'Notifications <span id="ab-pending-notifications" class="pending-count">%s</span>', 'buddypress' ), count( $notifications ) ); … … 167 167 $menu_title = __( 'Notifications', 'buddypress' ); 168 168 } 169 169 170 170 // Add the top-level Notifications button 171 171 $wp_admin_bar->add_menu( array( … … 174 174 'href' => bp_loggedin_user_domain() 175 175 ) ); 176 176 177 177 if ( !empty( $notifications ) ) { 178 178 foreach ( (array)$notifications as $notification ) { … … 192 192 ) ); 193 193 } 194 194 195 195 return; 196 196 } -
trunk/bp-members/bp-members-buddybar.php
r4824 r4961 100 100 101 101 <li id="bp-adminbar-adminoptions-menu"> 102 102 103 103 <a href=""><?php _e( 'Admin Options', 'buddypress' ) ?></a> 104 104 … … 109 109 110 110 <?php endif ?> 111 111 112 112 <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ) ?></a></li> 113 113 114 114 <?php if ( !bp_core_is_user_spammer( $bp->displayed_user->id ) ) : ?> 115 115 … … 120 120 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li> 121 121 122 <?php endif; ?> 123 122 <?php endif; ?> 123 124 124 <li><a href="<?php echo wp_nonce_url( $bp->displayed_user->domain . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( $bp->displayed_user->fullname ) ); ?></a></li> 125 125 -
trunk/bp-members/bp-members-functions.php
r4945 r4961 510 510 if ( empty( $user ) ) { 511 511 $is_spammer = false; 512 512 513 513 // User found 514 514 } else { … … 548 548 if ( empty( $user ) ) { 549 549 $is_deleted = true; 550 550 551 551 // User found 552 552 } else { -
trunk/bp-members/bp-members-notifications.php
r4907 r4961 59 59 if ( empty( $grouped_notifications ) ) 60 60 return false; 61 61 62 62 $renderable = array(); 63 63 64 64 // Calculate a renderable output for each notification type 65 65 foreach ( (array)$grouped_notifications as $component_name => $action_arrays ) { … … 76 76 if ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) { 77 77 $renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); 78 } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) { 78 } elseif ( isset( $bp->{$component_name}->notification_callback ) && function_exists( $bp->{$component_name}->notification_callback ) ) { 79 79 if ( 'object' == $format ) { 80 80 $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count, 'array' ); 81 81 82 82 $notification_object = new stdClass; 83 83 84 84 // Minimal backpat with non-compatible notification 85 85 // callback functions … … 91 91 $notification_object->href = $content['link']; 92 92 } 93 93 94 94 $notification_object->id = $component_action_items[0]->id; 95 95 96 96 $renderable[] = $notification_object; 97 97 } else { -
trunk/bp-members/bp-members-signup.php
r4830 r4961 374 374 if ( is_multisite() ) { 375 375 wpmu_signup_user( $user_login, $user_email, $usermeta ); 376 376 377 377 // On multisite, the user id is not created until the user activates the account 378 378 // but we need to cast $user_id to pass to the filters -
trunk/bp-members/bp-members-template.php
r4955 r4961 896 896 function bp_get_displayed_user_username() { 897 897 global $bp; 898 898 899 899 if ( !empty( $bp->displayed_user->id ) ) { 900 900 $username = bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ); … … 902 902 $username = ''; 903 903 } 904 904 905 905 return apply_filters( 'bp_get_displayed_user_username', $username ); 906 906 } … … 911 911 function bp_get_loggedin_user_username() { 912 912 global $bp; 913 913 914 914 if ( !empty( $bp->loggedin_user->id ) ) { 915 915 $username = bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ); … … 917 917 $username = ''; 918 918 } 919 919 920 920 return apply_filters( 'bp_get_loggedin_user_username', $username ); 921 921 } -
trunk/bp-messages/bp-messages-actions.php
r4902 r4961 16 16 17 17 $thread_id = (int)bp_action_variable( 0 ); 18 18 19 19 if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !is_super_admin() ) ) 20 20 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() ); … … 37 37 // Mark message read 38 38 messages_mark_thread_read( $thread_id ); 39 39 40 40 // Decrease the unread count in the nav before it's rendered 41 41 $name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() ); 42 42 43 43 $bp->bp_nav[$bp->messages->slug]['name'] = $name; 44 44 … … 67 67 68 68 $thread_id = bp_action_variable( 1 ); 69 69 70 70 if ( !$thread_id || !is_numeric( $thread_id ) || !messages_check_thread_access( $thread_id ) ) { 71 71 bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ); -
trunk/bp-messages/bp-messages-classes.php
r4825 r4961 95 95 elseif ( $type == 'read' ) 96 96 $type_sql = $wpdb->prepare( " AND r.unread_count = 0 " ); 97 97 98 98 if ( 'sentbox' == $box ) { 99 99 $thread_ids = $wpdb->get_results( $wpdb->prepare( "SELECT m.thread_id, MAX(m.date_sent) AS date_sent FROM {$bp->messages->table_name_recipients} r, {$bp->messages->table_name_messages} m WHERE m.thread_id = r.thread_id AND m.sender_id = r.user_id AND m.sender_id = %d AND r.is_deleted = 0 GROUP BY m.thread_id ORDER BY date_sent DESC {$pag_sql}", $user_id ) ); … … 254 254 $this->__construct( $id ); 255 255 } 256 256 257 257 function __construct( $id = null ) { 258 258 global $bp; … … 379 379 $this->__construct($id); 380 380 } 381 381 382 382 function __construct( $id = null ) { 383 383 if ( $id ) { -
trunk/bp-messages/bp-messages-functions.php
r4928 r4961 57 57 58 58 $recipient_ids = array(); 59 59 60 60 // Invalid recipients are added to an array, for future enhancements 61 61 $invalid_recipients = array(); … … 72 72 73 73 } else { 74 if ( bp_is_username_compatibility_mode() ) 75 $recipient_id = bp_core_get_userid( $recipient ); 74 if ( bp_is_username_compatibility_mode() ) 75 $recipient_id = bp_core_get_userid( $recipient ); 76 76 else 77 77 $recipient_id = bp_core_get_userid_from_nicename( $recipient ); 78 78 } 79 79 80 80 if ( !$recipient_id ) 81 81 $invalid_recipients[] = $recipient; … … 236 236 $link = bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox'; 237 237 $title = __( 'Inbox', 'buddypress' ); 238 238 239 239 if ( (int)$total_items > 1 ) { 240 240 $text = sprintf( __('You have %d new messages', 'buddypress' ), (int)$total_items ); -
trunk/bp-messages/bp-messages-loader.php
r4928 r4961 69 69 'table_name_recipients' => $bp->table_prefix . 'bp_messages_recipients' 70 70 ); 71 71 72 72 // All globals for messaging component. 73 73 // Note that global_tables is included in this array. -
trunk/bp-messages/bp-messages-screens.php
r4842 r4961 92 92 93 93 $notice_id = (int)bp_action_variable( 1 ); 94 94 95 95 if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) { 96 96 $notice = new BP_Messages_Notice( $notice_id ); -
trunk/bp-themes/bp-default/_inc/css/default-rtl.css
r4916 r4961 1 1 /*-------------------------------------------------------------- 2 2 Hello, this is the BuddyPress Default rtl stylesheet. 3 Right to left styles. This will transform the theme to read from 3 Right to left styles. This will transform the theme to read from 4 4 right to left for languages that support this method. 5 5 ---------------------------------------------------------------- … … 34 34 5.7 - Topics and Tables - Forums and General 35 35 5.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums 36 5.9 - Private Messaging Threads 36 5.9 - Private Messaging Threads 37 37 --------------------------------------------------------------*/ 38 38 /*-------------------------------------------------------------- … … 239 239 float: right; 240 240 } 241 #nav li li { 241 #nav li li { 242 242 margin-left: auto; 243 margin-right: 0; 243 margin-right: 0; 244 244 } 245 245 #nav ul, -
trunk/bp-themes/bp-default/_inc/css/default.css
r4916 r4961 1307 1307 border-radius: 3px; 1308 1308 color: #fff; 1309 font-size: 90%; 1309 font-size: 90%; 1310 1310 margin-left: 2px; 1311 1311 padding: 0 5px; … … 2188 2188 } 2189 2189 div.item-list-tabs ul li a span { 2190 background: #1fb3dd; 2190 background: #1fb3dd; 2191 2191 -moz-border-radius: 3px; 2192 2192 -webkit-border-radius: 3px; … … 2194 2194 color: #fff; 2195 2195 display: inline; 2196 font-size: 90%; 2196 font-size: 90%; 2197 2197 margin-left: 2px; 2198 2198 padding: 1px 6px; -
trunk/bp-themes/bp-default/_inc/global.js
r4956 r4961 929 929 930 930 jq('a#user-messages span').html( inboxcount ); 931 931 932 932 if ( i != checkboxes.length - 1 ) { 933 933 checkboxes_tosend += ',' -
trunk/bp-themes/bp-default/activity/comment.php
r4930 r4961 10 10 * @subpackage bp-default 11 11 */ 12 12 13 13 ?> 14 14 -
trunk/bp-themes/bp-default/activity/entry.php
r4849 r4961 91 91 92 92 <div class="activity-comments"> 93 93 94 94 <?php bp_activity_comments(); ?> 95 95 -
trunk/bp-themes/bp-default/groups/create.php
r4722 r4961 108 108 109 109 <hr /> 110 111 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 112 113 <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p> 114 115 <div class="radio"> 116 <label> 117 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> /> 118 <strong><?php _e( 'All group members', 'buddypress' ) ?></strong> 119 </label> 120 121 <label> 122 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> /> 123 <strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong> 124 </label> 125 126 <label> 127 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> /> 128 <strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong> 129 </label> 130 </div> 131 132 <hr /> 110 111 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 112 113 <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ) ?></p> 114 115 <div class="radio"> 116 <label> 117 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ) ?> /> 118 <strong><?php _e( 'All group members', 'buddypress' ) ?></strong> 119 </label> 120 121 <label> 122 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ) ?> /> 123 <strong><?php _e( 'Group admins and mods only', 'buddypress' ) ?></strong> 124 </label> 125 126 <label> 127 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ) ?> /> 128 <strong><?php _e( 'Group admins only', 'buddypress' ) ?></strong> 129 </label> 130 </div> 131 132 <hr /> 133 133 134 134 <?php do_action( 'bp_after_group_settings_creation_step' ); ?> -
trunk/bp-themes/bp-default/groups/single/forum/edit.php
r4803 r4961 52 52 <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> 53 53 <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea> 54 54 55 55 <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label> 56 56 <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list() ?>" /> -
trunk/bp-themes/bp-default/groups/single/forum/topic.php
r4812 r4961 24 24 <div id="topic-meta"> 25 25 <h3><?php bp_the_topic_title() ?> (<?php bp_the_topic_total_post_count() ?>)</h3> 26 26 27 27 <?php if ( bp_forum_topic_has_tags() ) : ?> 28 28 29 29 <div class="topic-tags"> 30 30 31 31 <?php _e( 'Topic tags:', 'buddypress' ) ?> <?php bp_forum_topic_tag_list() ?> 32 32 33 33 </div> 34 34 35 35 <?php endif; ?> 36 36 -
trunk/bp-themes/bp-default/groups/single/home.php
r4347 r4961 39 39 locate_template( array( 'groups/single/send-invites.php' ), true ); 40 40 41 elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) : 41 elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) : 42 42 locate_template( array( 'groups/single/forum.php' ), true ); 43 43 -
trunk/bp-themes/bp-default/index.php
r4854 r4961 5 5 6 6 <?php do_action( 'bp_before_blog_home' ) ?> 7 7 8 8 <?php do_action( 'template_notices' ) ?> 9 9 -
trunk/bp-themes/bp-default/members/single/activity.php
r4466 r4961 16 16 17 17 <li id="activity-filter-select" class="last"> 18 <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 18 <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 19 19 <select id="activity-filter-by"> 20 20 <option value="-1"><?php _e( 'Everything', 'buddypress' ) ?></option> -
trunk/bp-themes/bp-default/members/single/forums/topics.php
r3933 r4961 1 1 <?php 2 /* 2 /* 3 3 * To change this template, choose Tools | Templates 4 4 * and open the template in the editor. -
trunk/bp-themes/bp-default/members/single/home.php
r4347 r4961 38 38 39 39 <?php do_action( 'bp_before_member_body' ); 40 40 41 41 if ( bp_is_user_activity() || !bp_current_component() ) : 42 42 locate_template( array( 'members/single/activity.php' ), true ); -
trunk/bp-xprofile/bp-xprofile-actions.php
r4840 r4961 23 23 function xprofile_action_delete_avatar() { 24 24 global $bp; 25 25 26 26 if ( !bp_is_current_component( 'profile' ) || !bp_is_current_action( 'change-avatar' ) || !bp_is_action_variable( 'delete-avatar', 0 ) ) 27 27 return false; -
trunk/bp-xprofile/bp-xprofile-activity.php
r4827 r4961 116 116 function bp_xprofile_new_avatar_activity() { 117 117 global $bp; 118 118 119 119 if ( !bp_is_active( 'activity' ) ) 120 120 return false; -
trunk/bp-xprofile/bp-xprofile-classes.php
r4920 r4961 168 168 if ( !empty( $field_ids ) ) 169 169 $field_data = $wpdb->get_results( $wpdb->prepare( "SELECT field_id, value FROM {$bp->profile->table_name_data} WHERE field_id IN ( {$field_ids_sql} ) AND user_id = %d", $user_id ) ); 170 170 171 171 // Remove data-less fields, if necessary 172 172 if ( $hide_empty_fields ) { 173 173 174 174 // Loop through the results and find the fields that have data. 175 175 foreach( (array)$field_data as $data ) { … … 179 179 } 180 180 } 181 181 182 182 // The remaining members of $field_ids are empty. Remove them. 183 183 foreach( $fields as $field_key => $field ) { … … 186 186 } 187 187 } 188 188 189 189 // Reset indexes 190 190 $fields = array_values( $fields ); 191 192 } 193 191 192 } 193 194 194 // Field data was found 195 195 if ( !empty( $field_data ) && !is_wp_error( $field_data ) ) { 196 196 197 197 // Loop through fields 198 198 foreach( (array)$fields as $field_key => $field ) { 199 199 200 200 // Loop throught the data in each field 201 201 foreach( (array)$field_data as $data ) { 202 202 203 203 // Assign correct data value to the field 204 204 if ( $field->id == $data->field_id ) 205 205 $fields[$field_key]->data->value = $data->value; 206 } 207 } 206 } 207 } 208 208 } 209 209 } … … 215 215 $groups[$group_key]->fields[] = $field; 216 216 } 217 217 218 218 // When we unset fields above, we may have created empty groups. 219 219 // Remove them, if necessary. … … 221 221 unset( $groups[$group_key] ); 222 222 } 223 223 224 224 // Reset indexes 225 225 $groups = array_values( $groups ); … … 328 328 var $message = null; 329 329 var $message_type = 'err'; 330 330 331 331 function bp_xprofile_field( $id = null, $user_id = null, $get_data = true ) { 332 332 $this->__construct( $id, $user_id, $get_data ); 333 333 } 334 334 335 335 function __construct( $id = null, $user_id = null, $get_data = true ) { 336 336 if ( $id ) … … 794 794 var $value; 795 795 var $last_updated; 796 796 797 797 function bp_xprofile_profiledata( $field_id = null, $user_id = null ) { 798 $this->__construct( $field_id, $user_id ); 799 } 800 798 $this->__construct( $field_id, $user_id ); 799 } 800 801 801 function __construct( $field_id = null, $user_id = null ) { 802 802 if ( $field_id ) -
trunk/bp-xprofile/bp-xprofile-filters.php
r4827 r4961 98 98 $filtered_value = wp_rel_nofollow( force_balance_tags( $kses_field_value ) ); 99 99 $filtered_values[] = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_value, $value ); 100 100 101 101 } 102 102 -
trunk/bp-xprofile/bp-xprofile-screens.php
r4840 r4961 15 15 * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) 16 16 */ 17 function xprofile_screen_display_profile() { 17 function xprofile_screen_display_profile() { 18 18 $new = isset( $_GET['new'] ) ? $_GET['new'] : ''; 19 19 -
trunk/bp-xprofile/bp-xprofile-template.php
r4958 r4961 196 196 function bp_get_field_css_class( $class = false ) { 197 197 global $profile_template; 198 198 199 199 $css_classes = array(); 200 200 … … 710 710 if ( !$group_id = bp_action_variable( 1 ) ) 711 711 $group_id = 1; 712 712 713 713 if ( !is_numeric( $group_id ) ) 714 714 $group_id = 1;
Note: See TracChangeset
for help on using the changeset viewer.