Changeset 5689 for trunk/bp-groups/bp-groups-classes.php
- Timestamp:
- 02/10/2012 01:17:51 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-classes.php (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r5687 r5689 59 59 $admin_mods = $wpdb->get_results( apply_filters( 'bp_group_admin_mods_user_join_filter', $wpdb->prepare( "SELECT u.ID as user_id, u.user_login, u.user_email, u.user_nicename, m.is_admin, m.is_mod FROM {$wpdb->users} u, {$bp->groups->table_name_members} m WHERE u.ID = m.user_id AND m.group_id = %d AND ( m.is_admin = 1 OR m.is_mod = 1 )", $this->id ) ) ); 60 60 foreach( (array)$admin_mods as $user ) { 61 if ( (int) $user->is_admin )61 if ( (int) $user->is_admin ) 62 62 $this->admins[] = $user; 63 63 else … … 191 191 global $wpdb, $bp; 192 192 193 if ( !$user_id)193 if ( empty( $user_id ) ) 194 194 $user_id = bp_displayed_user_id(); 195 195 … … 796 796 797 797 function ban() { 798 global $bp;799 798 800 799 if ( $this->is_admin ) … … 808 807 $group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true ); 809 808 if ( !empty( $group_count ) ) 810 bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );809 bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 ); 811 810 812 811 return $this->save(); … … 814 813 815 814 function unban() { 816 global $bp;817 815 818 816 if ( $this->is_admin ) … … 822 820 823 821 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) ); 824 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );822 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 ); 825 823 826 824 return $this->save(); … … 828 826 829 827 function accept_invite() { 830 global $bp;831 828 832 829 $this->inviter_id = 0; … … 834 831 $this->date_modified = bp_core_current_time(); 835 832 836 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );833 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 ); 837 834 } 838 835 839 836 function accept_request() { 840 global $bp;841 837 842 838 $this->is_confirmed = 1; 843 839 $this->date_modified = bp_core_current_time(); 844 840 845 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 );841 bp_update_user_meta( $this->user_id, 'total_group_count', (int) bp_get_user_meta( $this->user_id, 'total_group_count', true ) + 1 ); 846 842 } 847 843 … … 858 854 $group_count = bp_get_user_meta( $this->user_id, 'total_group_count', true ); 859 855 if ( !empty( $group_count ) ) 860 bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 );856 bp_update_user_meta( $this->user_id, 'total_group_count', (int) $group_count - 1 ); 861 857 862 858 return $result; … … 961 957 global $bp, $wpdb; 962 958 963 if ( !$user_id)959 if ( empty( $user_id ) ) 964 960 $user_id = bp_displayed_user_id(); 965 961 … … 987 983 global $wpdb, $bp; 988 984 989 if ( !$user_id)985 if ( empty( $user_id ) ) 990 986 return false; 991 987 … … 1001 997 global $wpdb, $bp; 1002 998 1003 if ( !$user_id)999 if ( empty( $user_id ) ) 1004 1000 return false; 1005 1001 … … 1010 1006 global $wpdb, $bp; 1011 1007 1012 if ( !$user_id)1008 if ( empty( $user_id ) ) 1013 1009 return false; 1014 1010 … … 1019 1015 global $wpdb, $bp; 1020 1016 1021 if ( !$user_id)1017 if ( empty( $user_id ) ) 1022 1018 return false; 1023 1019 … … 1028 1024 global $wpdb, $bp; 1029 1025 1030 if ( !$user_id)1026 if ( empty( $user_id ) ) 1031 1027 return false; 1032 1028 … … 1037 1033 global $wpdb, $bp; 1038 1034 1039 if ( !$user_id)1035 if ( empty( $user_id ) ) 1040 1036 return false; 1041 1037 … … 1046 1042 global $wpdb, $bp; 1047 1043 1048 if ( !$user_id)1044 if ( empty( $user_id ) ) 1049 1045 return false; 1050 1046 … … 1064 1060 global $bp, $wpdb; 1065 1061 1066 if ( !$user_id)1062 if ( empty( $user_id ) ) 1067 1063 return false; 1068 1064 … … 1073 1069 global $wpdb, $bp; 1074 1070 1075 if ( !$user_id)1071 if ( empty( $user_id ) ) 1076 1072 return false; 1077 1073 … … 1336 1332 return false; 1337 1333 1338 /* Register the group extension on the bp_init action so we have access to all plugins */ 1334 // Register the group extension on the bp_init action so we have access 1335 // to all plugins. 1339 1336 add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 ); 1340 1337 }
Note: See TracChangeset
for help on using the changeset viewer.