Changeset 2946
- Timestamp:
- 04/21/2010 11:34:12 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r2919 r2946 35 35 $this->component = $row->component; 36 36 $this->type = $row->type; 37 $this->action = $row-> type;37 $this->action = $row->action; 38 38 $this->content = $row->content; 39 39 $this->date_recorded = $row->date_recorded; … … 98 98 $where_conditions = array(); 99 99 100 /* Filtering */ 101 if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) ) 102 $where_conditions['filter_sql'] = $filter_sql; 103 104 /* Sorting */ 105 if ( $sort != 'ASC' && $sort != 'DESC' ) 106 $sort = 'DESC'; 107 108 /* Hide Hidden Items? */ 109 if ( !$show_hidden ) 110 $where_conditions['hidden_sql'] = "a.hide_sitewide = 0"; 111 112 /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */ 113 if ( !$display_comments || 'threaded' == $display_comments ) { 114 $where_conditions[] = "a.type != 'activity_comment'"; 115 } 116 117 $where_sql = 'WHERE ' . join( ' AND ', $where_conditions ); 118 100 119 /* Searching */ 101 120 if ( $search_terms ) { 102 121 $search_terms = $wpdb->escape( $search_terms ); 103 $where_conditions['search_sql'] = "a.content LIKE '%%" . like_escape( $search_terms ) . "%%'"; 104 } 105 106 /* Filtering */ 107 if ( $filter && $filter_sql = BP_Activity_Activity::get_filter_sql( $filter ) ) 108 $where_conditions['filter_sql'] = $filter_sql; 109 110 /* Sorting */ 111 if ( $sort != 'ASC' && $sort != 'DESC' ) 112 $sort = 'DESC'; 113 114 /* Hide Hidden Items? */ 115 if ( !$show_hidden ) 116 $where_conditions['hidden_sql'] = "a.hide_sitewide = 0"; 117 118 /* Alter the query based on whether we want to show activity item comments in the stream like normal comments or threaded below the activity */ 119 if ( !$display_comments || 'threaded' == $display_comments ) { 120 $where_conditions[] = "a.type != 'activity_comment'"; 121 } 122 123 $where_sql = 'WHERE ' . join( ' AND ', $where_conditions ); 122 123 if ( !empty( $filter['user_id'] ) ) 124 $where_sql .= ' OR '; 125 else if ( !empty( $where_conditions ) ) 126 $where_sql .= ' AND '; 127 128 $where_sql .= "a.content LIKE '%%" . like_escape( $search_terms ) . "%%'"; 129 } 124 130 125 131 if ( $per_page && $page ) { -
trunk/bp-blogs.php
r2941 r2946 648 648 do_action( 'bp_blogs_remove_data', $user_id ); 649 649 } 650 add_action( 'wpmu_delete_user', 'bp_blogs_remove_data', 1 ); 651 add_action( 'delete_user', 'bp_blogs_remove_data', 1 ); 650 add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' ); 651 add_action( 'delete_user', 'bp_blogs_remove_data' ); 652 add_action( 'make_spam_user', 'bp_blogs_remove_data' ); 652 653 653 654 -
trunk/bp-core.php
r2941 r2946 637 637 'css_id' => $item_css_id, 638 638 'show_for_displayed_user' => $show_for_displayed_user, 639 'position' => $position 639 'position' => $position, 640 'screen_function' => &$screen_function 640 641 ); 641 642 … … 685 686 $r = wp_parse_args( $args, $defaults ); 686 687 extract( $r, EXTR_SKIP ); 688 689 if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) { 690 if ( !is_object( $function[0] ) ) 691 remove_action( 'wp', $function, 3 ); 692 else 693 remove_action( 'wp', array( &$function[0], $function[1] ), 3 ); 694 } 695 696 $bp->bp_nav[$parent_slug]['screen_function'] = &$screen_function; 687 697 688 698 if ( $bp->current_component == $parent_slug && !$bp->current_action ) { … … 774 784 'css_id' => $item_css_id, 775 785 'position' => $position, 776 'user_has_access' => $user_has_access 786 'user_has_access' => $user_has_access, 787 'screen_function' => &$screen_function 777 788 ); 778 789 … … 834 845 } 835 846 847 if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) { 848 if ( !is_object( $function[0] ) ) 849 remove_action( 'wp', $function, 3 ); 850 else 851 remove_action( 'wp', array( &$function[0], $function[1] ), 3 ); 852 } 853 836 854 unset( $bp->bp_nav[$parent_id] ); 837 855 } … … 849 867 global $bp; 850 868 851 $function = $bp->bp_options_nav[$parent_id][$slug]['screen_function']; 852 853 if ( $function ) { 854 if ( !is_object( $screen_function[0] ) ) 855 remove_action( 'wp', $screen_function, 3 ); 869 if ( $function = $bp->bp_options_nav[$parent_id][$slug]['screen_function'] ) { 870 if ( !is_object( $function[0] ) ) 871 remove_action( 'wp', $function, 3 ); 856 872 else 857 remove_action( 'wp', array( &$ screen_function[0], $screen_function[1] ), 3 );873 remove_action( 'wp', array( &$function[0], $function[1] ), 3 ); 858 874 } 859 875 … … 1842 1858 wp_cache_flush(); 1843 1859 } 1844 add_action( 'wpmu_delete_user', 'bp_core_remove_data' , 1);1845 add_action( 'delete_user', 'bp_core_remove_data' , 1);1846 add_action( 'make_spam_user', 'bp_core_remove_data' , 1);1860 add_action( 'wpmu_delete_user', 'bp_core_remove_data' ); 1861 add_action( 'delete_user', 'bp_core_remove_data' ); 1862 add_action( 'make_spam_user', 'bp_core_remove_data' ); 1847 1863 1848 1864 /** -
trunk/bp-core/bp-core-adminbar.php
r2919 r2946 7 7 return false; 8 8 9 if ( (int) $bp->site_options['hide-loggedout-adminbar']&& !is_user_logged_in() )9 if ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) 10 10 return false; 11 11 -
trunk/bp-core/bp-core-avatars.php
r2925 r2946 131 131 132 132 if ( $avatar_url ) 133 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params );133 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$avatar_url}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 134 134 } 135 135 … … 163 163 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size; 164 164 165 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params ); 166 165 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 167 166 } else { 168 return false;167 return apply_filters( 'bp_core_fetch_avatar', false, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 169 168 } 170 169 } … … 230 229 function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { 231 230 global $bp; 231 232 /*** 233 * You may want to hook into this filter if you want to override this function. 234 * Make sure you return false. 235 */ 236 if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) ) 237 return true; 232 238 233 239 require_once( ABSPATH . '/wp-admin/includes/image.php' ); … … 304 310 305 311 $r = wp_parse_args( $args, $defaults ); 312 313 /*** 314 * You may want to hook into this filter if you want to override this function. 315 * Make sure you return false. 316 */ 317 if ( !apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) ) 318 return true; 319 306 320 extract( $r, EXTR_SKIP ); 307 321 -
trunk/bp-core/bp-core-cssjs.php
r2842 r2946 175 175 global $bp; 176 176 177 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( $bp->site_options['hide-loggedout-adminbar']&& !is_user_logged_in() ) ) {177 if ( defined( 'BP_DISABLE_ADMIN_BAR' ) || ( (int)get_site_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) ) { 178 178 ?> 179 179 <style type="text/css">body { padding-top: 0 !important; } #wp-admin-bar { display: none; }</style> -
trunk/bp-core/bp-core-signup.php
r2925 r2946 54 54 $bp->signup->email = $_POST['signup_email']; 55 55 56 if ( !empty( $_POST['signup_profile_field_ids'] ) && function_exists( 'xprofile_check_is_required_field' ) ) { 57 /* Now we've checked account details, we can check profile information */ 58 $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); 59 60 /* Loop through the posted fields formatting any datebox values then validate the field */ 61 foreach ( (array) $profile_field_ids as $field_id ) { 62 if ( !isset( $_POST['field_' . $field_id] ) ) { 63 if ( isset( $_POST['field_' . $field_id . '_day'] ) ) 64 $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ); 56 /* Now we've checked account details, we can check profile information */ 57 if ( function_exists( 'xprofile_check_is_required_field' ) ) { 58 59 /* Make sure hidden field is passed and populated */ 60 if ( isset( $_POST['signup_profile_field_ids'] ) && !empty( $_POST['signup_profile_field_ids'] ) ) { 61 62 /* Let's compact any profile field info into an array */ 63 $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); 64 65 /* Loop through the posted fields formatting any datebox values then validate the field */ 66 foreach ( (array) $profile_field_ids as $field_id ) { 67 if ( !isset( $_POST['field_' . $field_id] ) ) { 68 if ( isset( $_POST['field_' . $field_id . '_day'] ) ) 69 $_POST['field_' . $field_id] = strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ); 70 } 71 72 /* Create errors for required fields without values */ 73 if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) ) 74 $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' ); 65 75 } 66 76 67 if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) ) 68 $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' ); 77 /* This situation doesn't naturally occur so bounce to website root */ 78 } else { 79 bp_core_redirect( $bp->root_domain ); 69 80 } 70 81 } … … 252 263 253 264 if ( empty( $user_name ) ) 254 265 $errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) ); 255 266 256 267 $maybe = array(); … … 260 271 $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', BP_GROUPS_SLUG, $bp->members->slug, BP_FORUMS_SLUG, BP_BLOGS_SLUG, BP_REGISTER_SLUG, BP_ACTIVATION_SLUG ) ); 261 272 262 $illegal_names = array_merge( (array)$db_illegal_names, (array)$filtered_illegal_names ); 273 /* Safely merge our illegal names into existing site_option */ 274 $common_names = array_intersect( (array)$db_illegal_names, (array)$filtered_illegal_names ); 275 $diff_names = array_diff( (array)$db_illegal_names, (array)$filtered_illegal_names ); 276 $illegal_names = array_merge( (array)$diff_names, (array)$common_names ); 277 263 278 update_site_option( 'illegal_names', $illegal_names ); 264 279 … … 267 282 268 283 if ( !validate_username( $user_name ) || $user_name != $maybe[0] ) 269 284 $errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) ); 270 285 271 286 if( strlen( $user_name ) < 4 ) 272 287 $errors->add( 'user_name', __( 'Username must be at least 4 characters', 'buddypress' ) ); 273 288 274 289 if ( strpos( ' ' . $user_name, '_' ) != false ) … … 385 400 386 401 function bp_core_activate_signup( $key ) { 387 global $ wpdb;402 global $bp, $wpdb; 388 403 389 404 $user = false; … … 558 573 559 574 if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) ) 560 wp_redirect( bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/' );575 bp_core_redirect( bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/' ); 561 576 } 562 577 if ( bp_core_is_multisite() ) -
trunk/bp-forums/bp-forums-templatetags.php
r2842 r2946 254 254 255 255 $post = bb_get_first_post( (int)$forum_template->topic->topic_id, false ); 256 return apply_filters( 'bp_get_the_topic_text', $post->post_text);256 return apply_filters( 'bp_get_the_topic_text', attribute_escape( $post->post_text ) ); 257 257 } 258 258 … … 464 464 global $forum_template; 465 465 466 return $forum_template->topic->topic_posts;466 return apply_filters( 'bp_get_the_topic_total_posts', $forum_template->topic->topic_posts ); 467 467 } 468 468 … … 938 938 939 939 $post = bp_forums_get_post( $bp->action_variables[4] ); 940 return a ttribute_escape( $post->post_text);940 return apply_filters( 'bp_get_the_topic_post_edit_text', attribute_escape( $post->post_text ) ); 941 941 } 942 942 -
trunk/bp-friends.php
r2941 r2946 566 566 do_action( 'friends_remove_data', $user_id ); 567 567 } 568 add_action( 'wpmu_delete_user', 'friends_remove_data' , 1);569 add_action( 'delete_user', 'friends_remove_data' , 1);570 add_action( 'make_spam_user', 'friends_remove_data' , 1);568 add_action( 'wpmu_delete_user', 'friends_remove_data' ); 569 add_action( 'delete_user', 'friends_remove_data' ); 570 add_action( 'make_spam_user', 'friends_remove_data' ); 571 571 572 572 -
trunk/bp-groups.php
r2941 r2946 2417 2417 do_action( 'groups_remove_data_for_user', $user_id ); 2418 2418 } 2419 add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' , 1);2420 add_action( 'delete_user', 'groups_remove_data_for_user' , 1);2421 add_action( 'make_spam_user', 'groups_remove_data_for_user' , 1);2419 add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' ); 2420 add_action( 'delete_user', 'groups_remove_data_for_user' ); 2421 add_action( 'make_spam_user', 'groups_remove_data_for_user' ); 2422 2422 2423 2423 -
trunk/bp-groups/bp-groups-classes.php
r2925 r2946 129 129 130 130 /* Modify group count usermeta for members */ 131 $wpdb->query( $wpdb->prepare( "UPDATE {$ bp->groups->table_name_groupmeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_ids} )" ) );131 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_ids} )" ) ); 132 132 133 133 /* Now delete all group member entries */ -
trunk/bp-groups/bp-groups-templatetags.php
r2944 r2946 65 65 66 66 $this->pag_links = paginate_links( array( 67 'base' => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $ _REQUEST['s'], 'sortby' => $this->sort_by, 'order' => $this->order ) ),67 'base' => add_query_arg( array( 'grpage' => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ), 68 68 'format' => '', 69 69 'total' => ceil($this->total_group_count / $this->pag_num), -
trunk/bp-themes/bp-default/comments.php
r2576 r2946 20 20 21 21 <span class="title"><?php the_title() ?></span> 22 <h3 id="comments"><?php comments_number( ' No Comments', 'One Comment', $numComments . ' Comments');?></h3>22 <h3 id="comments"><?php comments_number( '', '', $numComments );?></h3> 23 23 24 24 <?php do_action( 'bp_before_blog_comment_list' ) ?> -
trunk/bp-xprofile.php
r2866 r2946 892 892 delete_usermeta( $user_id, 'bp_core_avatar_v2_path' ); 893 893 } 894 add_action( 'wpmu_delete_user', 'xprofile_remove_data', 1 ); 895 add_action( 'delete_user', 'xprofile_remove_data', 1 ); 894 add_action( 'wpmu_delete_user', 'xprofile_remove_data' ); 895 add_action( 'delete_user', 'xprofile_remove_data' ); 896 add_action( 'make_spam_user', 'xprofile_remove_data' ); 896 897 897 898
Note: See TracChangeset
for help on using the changeset viewer.