Ticket #2581: get_user_meta.patch
File get_user_meta.patch, 34.0 KB (added by , 14 years ago) |
---|
-
bp-activity.php
193 193 <tr> 194 194 <td></td> 195 195 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ) ) ?></td> 196 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user meta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>197 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user meta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td>196 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td> 197 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention' ) ) { ?>checked="checked" <?php } ?>/></td> 198 198 </tr> 199 199 <tr> 200 200 <td></td> 201 201 <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login ) ?></td> 202 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user meta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) || 'yes' == get_usermeta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>203 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user meta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td>202 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td> 203 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply' ) ) { ?>checked="checked" <?php } ?>/></td> 204 204 </tr> 205 205 206 206 <?php do_action( 'bp_activity_screen_notification_settings' ) ?> … … 754 754 else 755 755 $user_id = $args['user_id']; 756 756 757 $latest_update = get_user meta( $user_id, 'bp_latest_update' );757 $latest_update = get_user_meta( $user_id, 'bp_latest_update' ); 758 758 if ( !empty( $latest_update ) ) { 759 759 if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) ) 760 760 delete_usermeta( $user_id, 'bp_latest_update' ); … … 908 908 } 909 909 910 910 function bp_activity_get_user_favorites( $user_id ) { 911 $my_favs = maybe_unserialize( get_user meta( $user_id, 'bp_favorite_activities' ) );911 $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities' ) ); 912 912 $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $my_favs ) ); 913 913 914 914 foreach( (array)$existing_favs['activities'] as $fav ) … … 927 927 $user_id = $bp->loggedin_user->id; 928 928 929 929 /* Update the user's personal favorites */ 930 $my_favs = maybe_unserialize( get_user meta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );930 $my_favs = maybe_unserialize( get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities' ) ); 931 931 $my_favs[] = $activity_id; 932 932 933 933 /* Update the total number of users who have favorited this activity */ … … 953 953 $user_id = $bp->loggedin_user->id; 954 954 955 955 /* Remove the fav from the user's favs */ 956 $my_favs = maybe_unserialize( get_user meta( $user_id, 'bp_favorite_activities' ) );956 $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities' ) ); 957 957 $my_favs = array_flip( (array) $my_favs ); 958 958 unset( $my_favs[$activity_id] ); 959 959 $my_favs = array_unique( array_flip( $my_favs ) ); -
bp-activity/bp-activity-classes.php
537 537 function total_favorite_count( $user_id ) { 538 538 global $bp; 539 539 540 if ( !$favorite_activity_entries = get_user meta( $user_id, 'bp_favorite_activities' ) )540 if ( !$favorite_activity_entries = get_user_meta( $user_id, 'bp_favorite_activities' ) ) 541 541 return 0; 542 542 543 543 return count( maybe_unserialize( $favorite_activity_entries ) ); -
bp-activity/bp-activity-filters.php
105 105 continue; 106 106 107 107 /* Increase the number of new @ mentions for the user */ 108 $new_mention_count = (int)get_user meta( $user_id, 'bp_new_mention_count' );108 $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count' ); 109 109 update_usermeta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 ); 110 110 111 111 $content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content ); -
bp-activity/bp-activity-notifications.php
16 16 continue; 17 17 18 18 // Now email the user with the contents of the message (if they have enabled email notifications) 19 if ( 'no' != get_user meta( $receiver_user_id, 'notification_activity_new_mention' ) ) {19 if ( 'no' != get_user_meta( $receiver_user_id, 'notification_activity_new_mention' ) ) { 20 20 $poster_name = bp_core_get_user_displayname( $poster_user_id ); 21 21 22 22 $message_link = bp_activity_get_permalink( $activity_id ); … … 60 60 61 61 $original_activity = new BP_Activity_Activity( $activity_id ); 62 62 63 if ( $original_activity->user_id != $commenter_id && 'no' != get_user meta( $original_activity->user_id, 'notification_activity_new_reply' ) ) {63 if ( $original_activity->user_id != $commenter_id && 'no' != get_user_meta( $original_activity->user_id, 'notification_activity_new_reply' ) ) { 64 64 $poster_name = bp_core_get_user_displayname( $commenter_id ); 65 65 $thread_link = bp_activity_get_permalink( $activity_id ); 66 66 $settings_link = bp_core_get_user_domain( $original_activity->user_id ) . BP_SETTINGS_SLUG . '/notifications/'; … … 102 102 103 103 $parent_comment = new BP_Activity_Activity( $parent_id ); 104 104 105 if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_user meta( $parent_comment->user_id, 'notification_activity_new_reply' ) ) {105 if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply' ) ) { 106 106 $poster_name = bp_core_get_user_displayname( $commenter_id ); 107 107 $thread_link = bp_activity_get_permalink( $activity_id ); 108 108 $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . BP_SETTINGS_SLUG . '/notifications/'; -
bp-activity/bp-activity-templatetags.php
25 25 $this->disable_blogforum_replies = $bp->site_options['bp-disable-blogforum-comments']; 26 26 27 27 /* Get an array of the logged in user's favorite activities */ 28 $this->my_favs = maybe_unserialize( get_user meta( $bp->loggedin_user->id, 'bp_favorite_activities' ) );28 $this->my_favs = maybe_unserialize( get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities' ) ); 29 29 30 30 if ( !empty( $include ) ) { 31 31 /* Fetch specific activity items based on ID's */ … … 734 734 if ( !$user_id ) 735 735 $user_id = $bp->displayed_user->id; 736 736 737 if ( !$update = get_user meta( $user_id, 'bp_latest_update' ) )737 if ( !$update = get_user_meta( $user_id, 'bp_latest_update' ) ) 738 738 return false; 739 739 740 740 $latest_update = '"' . trim( strip_tags( bp_create_excerpt( $update['content'], 40 ) ) ) . '"'; … … 836 836 echo bp_get_total_favorite_count_for_user( $user_id ); 837 837 } 838 838 function bp_get_total_mention_count_for_user( $user_id = false ) { 839 return apply_filters( 'bp_get_total_mention_count_for_user', get_user meta( $user_id, 'bp_new_mention_count' ) );839 return apply_filters( 'bp_get_total_mention_count_for_user', get_user_meta( $user_id, 'bp_new_mention_count' ) ); 840 840 } 841 841 842 842 function bp_send_public_message_link() { -
bp-core.php
517 517 * @package BuddyPress Core 518 518 * @global $current_user WordPress global variable containing current logged in user information 519 519 * @param user_id The ID of the user. 520 * @uses get_user meta() WordPress function to get the usermeta for a user.520 * @uses get_user_meta() WordPress function to get the usermeta for a user. 521 521 */ 522 522 function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) { 523 523 global $bp; … … 1413 1413 if ( !is_user_logged_in() ) 1414 1414 return false; 1415 1415 1416 $activity = get_user meta( $bp->loggedin_user->id, 'last_activity' );1416 $activity = get_user_meta( $bp->loggedin_user->id, 'last_activity' ); 1417 1417 1418 1418 if ( !is_numeric( $activity ) ) 1419 1419 $activity = strtotime( $activity ); -
bp-core/bp-core-classes.php
50 50 * @uses bp_core_get_userurl() Returns the URL with no HTML markup for a user based on their user id 51 51 * @uses bp_core_get_userlink() Returns a HTML formatted link for a user with the user's full name as the link text 52 52 * @uses bp_core_get_user_email() Returns the email address for the user based on user ID 53 * @uses get_user meta() WordPress function returns the value of passed usermeta name from usermeta table53 * @uses get_user_meta() WordPress function returns the value of passed usermeta name from usermeta table 54 54 * @uses bp_core_fetch_avatar() Returns HTML formatted avatar for a user 55 55 * @uses bp_profile_last_updated_date() Returns the last updated date for a user. 56 56 */ … … 79 79 $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb' ) ); 80 80 $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) ); 81 81 82 $this->last_active = bp_core_get_last_activity( get_user meta( $this->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );82 $this->last_active = bp_core_get_last_activity( get_user_meta( $this->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ); 83 83 } 84 84 85 85 function populate_extras() { -
bp-core/bp-core-signup.php
498 498 499 499 /* Add the user's fullname to Xprofile */ 500 500 if ( function_exists( 'xprofile_set_field_data' ) ) { 501 $firstname = get_user meta( $user_id, 'first_name' );502 $lastname = ' ' . get_user meta( $user_id, 'last_name' );501 $firstname = get_user_meta( $user_id, 'first_name' ); 502 $lastname = ' ' . get_user_meta( $user_id, 'last_name' ); 503 503 $name = $firstname . $lastname; 504 504 505 505 if ( empty( $name ) || ' ' == $name ) 506 $name = get_user meta( $user_id, 'nickname' );506 $name = get_user_meta( $user_id, 'nickname' ); 507 507 508 508 xprofile_set_field_data( 1, $user_id, $name ); 509 509 } -
bp-core/bp-core-templatetags.php
681 681 if ( !$user_id ) 682 682 $user_id = $bp->displayed_user->id; 683 683 684 $last_activity = bp_core_get_last_activity( get_user meta( $user_id, 'last_activity' ), __('active %s ago', 'buddypress') );684 $last_activity = bp_core_get_last_activity( get_user_meta( $user_id, 'last_activity' ), __('active %s ago', 'buddypress') ); 685 685 686 686 if ( $echo ) 687 687 echo apply_filters( 'bp_last_activity', $last_activity ); -
bp-forums.php
500 500 function bp_forums_filter_caps( $allcaps ) { 501 501 global $bp, $wp_roles, $bb_table_prefix; 502 502 503 $bb_cap = get_user meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' );503 $bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities' ); 504 504 505 505 if ( empty( $bb_cap ) ) 506 506 return $allcaps; -
bp-friends.php
112 112 <tr> 113 113 <td></td> 114 114 <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td> 115 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user meta( $current_user->id,'notification_friends_friendship_request') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_request') ) { ?>checked="checked" <?php } ?>/></td>116 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user meta( $current_user->id,'notification_friends_friendship_request') == 'no' ) { ?>checked="checked" <?php } ?>/></td>115 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user_meta( $current_user->id,'notification_friends_friendship_request') || 'yes' == get_user_meta( $current_user->id,'notification_friends_friendship_request') ) { ?>checked="checked" <?php } ?>/></td> 116 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user_meta( $current_user->id,'notification_friends_friendship_request') == 'no' ) { ?>checked="checked" <?php } ?>/></td> 117 117 </tr> 118 118 <tr> 119 119 <td></td> 120 120 <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td> 121 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user meta( $current_user->id,'notification_friends_friendship_accepted') || 'yes' == get_usermeta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>122 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user meta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td>121 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user_meta( $current_user->id,'notification_friends_friendship_accepted') || 'yes' == get_user_meta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td> 122 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id,'notification_friends_friendship_accepted') ) { ?>checked="checked" <?php } ?>/></td> 123 123 </tr> 124 124 125 125 <?php do_action( 'friends_screen_notification_settings' ); ?> … … 443 443 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 444 444 445 445 if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) { 446 $count = get_user meta( $user_id, 'total_friend_count' );446 $count = get_user_meta( $user_id, 'total_friend_count' ); 447 447 if ( empty( $count ) ) $count = 0; 448 448 wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' ); 449 449 } … … 546 546 547 547 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 548 548 if ( 'add' == $status ) { 549 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_user meta( $initiator_user_id, 'total_friend_count' ) + 1 );550 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_user meta( $friend_user_id, 'total_friend_count' ) + 1 );549 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count' ) + 1 ); 550 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count' ) + 1 ); 551 551 } else { 552 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_user meta( $initiator_user_id, 'total_friend_count' ) - 1 );553 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_user meta( $friend_user_id, 'total_friend_count' ) - 1 );552 update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count' ) - 1 ); 553 update_usermeta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count' ) - 1 ); 554 554 } 555 555 } 556 556 -
bp-friends/bp-friends-notifications.php
5 5 6 6 $initiator_name = bp_core_get_user_displayname( $initiator_id ); 7 7 8 if ( 'no' == get_user meta( (int)$friend_id, 'notification_friends_friendship_request' ) )8 if ( 'no' == get_user_meta( (int)$friend_id, 'notification_friends_friendship_request' ) ) 9 9 return false; 10 10 11 11 $ud = get_userdata( $friend_id ); … … 47 47 48 48 $friend_name = bp_core_get_user_displayname( $friend_id ); 49 49 50 if ( 'no' == get_user meta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) )50 if ( 'no' == get_user_meta( (int)$initiator_id, 'notification_friends_friendship_accepted' ) ) 51 51 return false; 52 52 53 53 $ud = get_userdata( $initiator_id ); -
bp-groups.php
897 897 <tr> 898 898 <td></td> 899 899 <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td> 900 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_groups_invite') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>901 <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td>900 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_invite') || 'yes' == get_user_meta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td> 901 <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_invite') ) { ?>checked="checked" <?php } ?>/></td> 902 902 </tr> 903 903 <tr> 904 904 <td></td> 905 905 <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td> 906 <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_groups_group_updated') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>907 <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td>906 <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_group_updated') || 'yes' == get_user_meta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td> 907 <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_group_updated') ) { ?>checked="checked" <?php } ?>/></td> 908 908 </tr> 909 909 <tr> 910 910 <td></td> 911 911 <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td> 912 <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_groups_admin_promotion') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>913 <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td>912 <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_admin_promotion') || 'yes' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td> 913 <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion') ) { ?>checked="checked" <?php } ?>/></td> 914 914 </tr> 915 915 <tr> 916 916 <td></td> 917 917 <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td> 918 <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_groups_membership_request') || 'yes' == get_usermeta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>919 <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td>918 <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_membership_request') || 'yes' == get_user_meta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td> 919 <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_membership_request') ) { ?>checked="checked" <?php } ?>/></td> 920 920 </tr> 921 921 922 922 <?php do_action( 'groups_screen_notification_settings' ); ?> … … 1570 1570 groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') - 1 ); 1571 1571 1572 1572 /* Modify user's group memberhip count */ 1573 update_usermeta( $user_id, 'total_group_count', (int) get_user meta( $user_id, 'total_group_count') - 1 );1573 update_usermeta( $user_id, 'total_group_count', (int) get_user_meta( $user_id, 'total_group_count') - 1 ); 1574 1574 1575 1575 /* If the user joined this group less than five minutes ago, remove the joined_group activity so 1576 1576 * users cannot flood the activity stream by joining/leaving the group in quick succession. -
bp-groups/bp-groups-classes.php
633 633 634 634 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) ); 635 635 636 $group_count = get_user meta( $this->user_id, 'total_group_count' );636 $group_count = get_user_meta( $this->user_id, 'total_group_count' ); 637 637 if ( !empty( $group_count ) ) 638 638 update_usermeta( $this->user_id, 'total_group_count', (int)$group_count - 1 ); 639 639 … … 647 647 $this->is_banned = 0; 648 648 649 649 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) ); 650 update_usermeta( $this->user_id, 'total_group_count', (int)get_user meta( $this->user_id, 'total_group_count' ) + 1 );650 update_usermeta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count' ) + 1 ); 651 651 652 652 return $this->save(); 653 653 } -
bp-groups/bp-groups-notifications.php
8 8 9 9 $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); 10 10 foreach ( (array)$user_ids as $user_id ) { 11 if ( 'no' == get_user meta( $user_id, 'notification_groups_group_updated' ) ) continue;11 if ( 'no' == get_user_meta( $user_id, 'notification_groups_group_updated' ) ) continue; 12 12 13 13 $ud = bp_core_get_core_userdata( $user_id ); 14 14 … … 44 44 45 45 bp_core_add_notification( $requesting_user_id, $admin_id, 'groups', 'new_membership_request', $group_id ); 46 46 47 if ( 'no' == get_user meta( $admin_id, 'notification_groups_membership_request' ) )47 if ( 'no' == get_user_meta( $admin_id, 'notification_groups_membership_request' ) ) 48 48 return false; 49 49 50 50 $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id ); … … 93 93 else 94 94 bp_core_add_notification( $group_id, $requesting_user_id, 'groups', 'membership_request_rejected' ); 95 95 96 if ( 'no' == get_user meta( $requesting_user_id, 'notification_membership_request_completed' ) )96 if ( 'no' == get_user_meta( $requesting_user_id, 'notification_membership_request_completed' ) ) 97 97 return false; 98 98 99 99 $group = new BP_Groups_Group( $group_id ); … … 151 151 // Post a screen notification first. 152 152 bp_core_add_notification( $group_id, $user_id, 'groups', $type ); 153 153 154 if ( 'no' == get_user meta( $user_id, 'notification_groups_admin_promotion' ) )154 if ( 'no' == get_user_meta( $user_id, 'notification_groups_admin_promotion' ) ) 155 155 return false; 156 156 157 157 $group = new BP_Groups_Group( $group_id ); … … 199 199 // Post a screen notification first. 200 200 bp_core_add_notification( $group->id, $invited_user_id, 'groups', 'group_invite' ); 201 201 202 if ( 'no' == get_user meta( $invited_user_id, 'notification_groups_invite' ) )202 if ( 'no' == get_user_meta( $invited_user_id, 'notification_groups_invite' ) ) 203 203 return false; 204 204 205 205 $invited_ud = bp_core_get_core_userdata($invited_user_id); … … 258 258 continue; 259 259 260 260 // Now email the user with the contents of the message (if they have enabled email notifications) 261 if ( 'no' != get_user meta( $user_id, 'notification_activity_new_mention' ) ) {261 if ( 'no' != get_user_meta( $user_id, 'notification_activity_new_mention' ) ) { 262 262 $poster_name = bp_core_get_user_displayname( $poster_user_id ); 263 263 264 264 $message_link = bp_activity_get_permalink( $activity_id ); -
bp-messages.php
175 175 <tr> 176 176 <td></td> 177 177 <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td> 178 <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_messages_new_message' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>179 <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td>178 <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_message' ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td> 179 <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_message' ) ) { ?>checked="checked" <?php } ?>/></td> 180 180 </tr> 181 181 <tr> 182 182 <td></td> 183 183 <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td> 184 <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user meta( $current_user->id, 'notification_messages_new_notice' ) || 'yes' == get_usermeta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>185 <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user meta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td>184 <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_notice' ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td> 185 <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_notice' ) ) { ?>checked="checked" <?php } ?>/></td> 186 186 </tr> 187 187 188 188 <?php do_action( 'messages_screen_notification_settings' ) ?> -
bp-messages/bp-messages-notifications.php
7 7 $sender_name = bp_core_get_user_displayname( $sender_id ); 8 8 9 9 foreach( $recipients as $recipient ) { 10 if ( $sender_id == $recipient->user_id || 'no' == get_user meta( $recipient->user_id, 'notification_messages_new_message' ) ) continue;10 if ( $sender_id == $recipient->user_id || 'no' == get_user_meta( $recipient->user_id, 'notification_messages_new_message' ) ) continue; 11 11 12 12 $ud = get_userdata( $recipient->user_id ); 13 13 $message_link = bp_core_get_user_domain( $recipient->user_id ) . BP_MESSAGES_SLUG .'/'; -
bp-messages/bp-messages-templatetags.php
455 455 if ( empty( $notice ) ) 456 456 return false; 457 457 458 $closed_notices = get_user meta( $userdata->ID, 'closed_notices' );458 $closed_notices = get_user_meta( $userdata->ID, 'closed_notices' ); 459 459 460 460 if ( !$closed_notices ) 461 461 $closed_notices = array(); -
bp-themes/bp-default/_inc/ajax.php
442 442 if ( !isset( $_POST['notice_id'] ) ) { 443 443 echo "-1<div id='message' class='error'><p>" . __('There was a problem closing the notice.', 'buddypress') . '</p></div>'; 444 444 } else { 445 $notice_ids = get_user meta( $userdata->ID, 'closed_notices' );445 $notice_ids = get_user_meta( $userdata->ID, 'closed_notices' ); 446 446 447 447 $notice_ids[] = (int) $_POST['notice_id']; 448 448 -
bp-xprofile.php
874 874 * 875 875 * @package BuddyPress XProfile 876 876 * @param $user_id The ID of the deleted user 877 * @uses get_user meta() Get a user meta value based on meta key from wp_usermeta877 * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta 878 878 * @uses delete_usermeta() Delete user meta value based on meta key from wp_usermeta 879 879 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user 880 880 */ … … 882 882 BP_XProfile_ProfileData::delete_data_for_user( $user_id ); 883 883 884 884 /* delete any avatar files. */ 885 @unlink( get_user meta( $user_id, 'bp_core_avatar_v1_path' ) );886 @unlink( get_user meta( $user_id, 'bp_core_avatar_v2_path' ) );885 @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path' ) ); 886 @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path' ) ); 887 887 888 888 /* unset the usermeta for avatars from the usermeta table. */ 889 889 delete_usermeta( $user_id, 'bp_core_avatar_v1' ); -
bp-xprofile/bp-xprofile-templatetags.php
637 637 function bp_get_profile_last_updated() { 638 638 global $bp; 639 639 640 $last_updated = get_user meta( $bp->displayed_user->id, 'profile_last_updated' );640 $last_updated = get_user_meta( $bp->displayed_user->id, 'profile_last_updated' ); 641 641 642 642 if ( $last_updated ) 643 643 return apply_filters( 'bp_get_profile_last_updated', sprintf( __('Profile updated %s ago', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) );