diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php
index f446702..1c9de0e 100644
a
|
b
|
Class BP_Groups_Group { |
578 | 578 | if ( !is_super_admin() ) |
579 | 579 | $hidden_sql = "WHERE status != 'hidden'"; |
580 | 580 | |
581 | | return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" ) ); |
| 581 | $group_count_sql = "SELECT COUNT(id) FROM {$bp->groups->table_name} g {$hidden_sql}"; |
| 582 | $group_count_sql = apply_filters( 'bp_group_get_total_group_count', $group_count_sql ); |
| 583 | return $wpdb->get_var( $wpdb->prepare( $group_count_sql ) ); |
582 | 584 | } |
583 | 585 | |
584 | 586 | function get_global_forum_topic_count( $type ) { |
… |
… |
Class BP_Groups_Member { |
939 | 941 | $user_id = $bp->displayed_user->id; |
940 | 942 | |
941 | 943 | if ( $user_id != $bp->loggedin_user->id && !is_super_admin() ) { |
942 | | return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) ); |
| 944 | $group_count_sql = "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0"; |
943 | 945 | } else { |
944 | | return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0", $user_id ) ); |
| 946 | $group_count_sql = "SELECT COUNT(DISTINCT m.group_id) FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0"; |
945 | 947 | } |
| 948 | $group_count_sql = apply_filters( 'bp_group_member_get_total_group_count', $group_count_sql ); |
| 949 | return $wpdb->get_var( $wpdb->prepare( $group_count_sql, $user_id ) ); |
946 | 950 | } |
947 | 951 | |
948 | 952 | function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) { |