Changeset 3145
- Timestamp:
- 07/22/2010 11:09:28 AM (14 years ago)
- Location:
- branches/1.2
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-activity.php
r3144 r3145 276 276 <td></td> 277 277 <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> 278 <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>279 <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>278 <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', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td> 279 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 280 280 </tr> 281 281 <tr> 282 282 <td></td> 283 283 <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login ) ?></td> 284 <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>285 <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>284 <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', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td> 285 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 286 286 </tr> 287 287 … … 711 711 712 712 /* Add this update to the "latest update" usermeta so it can be fetched anywhere. */ 713 update_user meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) );713 update_user_meta( $bp->loggedin_user->id, 'bp_latest_update', array( 'id' => $activity_id, 'content' => wp_filter_kses( $content ) ) ); 714 714 715 715 /* Require the notifications code so email notifications can be set on the 'bp_activity_posted_update' action. */ … … 838 838 $user_id = $args['user_id']; 839 839 840 $latest_update = get_user meta( $user_id, 'bp_latest_update');840 $latest_update = get_user_meta( $user_id, 'bp_latest_update', true ); 841 841 if ( !empty( $latest_update ) ) { 842 842 if ( in_array( (int)$latest_update['id'], (array)$activity_ids_deleted ) ) 843 delete_user meta( $user_id, 'bp_latest_update' );843 delete_user_meta( $user_id, 'bp_latest_update' ); 844 844 } 845 845 … … 992 992 993 993 function bp_activity_get_user_favorites( $user_id ) { 994 $my_favs = maybe_unserialize( get_user meta( $user_id, 'bp_favorite_activities') );994 $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities', true ) ); 995 995 $existing_favs = bp_activity_get_specific( array( 'activity_ids' => $my_favs ) ); 996 996 … … 999 999 1000 1000 $new_favs = array_unique( (array)$new_favs ); 1001 update_user meta( $user_id, 'bp_favorite_activities', $new_favs );1001 update_user_meta( $user_id, 'bp_favorite_activities', $new_favs ); 1002 1002 1003 1003 return apply_filters( 'bp_activity_get_user_favorites', $new_favs ); … … 1011 1011 1012 1012 /* Update the user's personal favorites */ 1013 $my_favs = maybe_unserialize( get_user meta( $bp->loggedin_user->id, 'bp_favorite_activities') );1013 $my_favs = maybe_unserialize( get_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', true ) ); 1014 1014 $my_favs[] = $activity_id; 1015 1015 … … 1022 1022 $fav_count = 1; 1023 1023 1024 update_user meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs );1024 update_user_meta( $bp->loggedin_user->id, 'bp_favorite_activities', $my_favs ); 1025 1025 bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ); 1026 1026 … … 1037 1037 1038 1038 /* Remove the fav from the user's favs */ 1039 $my_favs = maybe_unserialize( get_user meta( $user_id, 'bp_favorite_activities') );1039 $my_favs = maybe_unserialize( get_user_meta( $user_id, 'bp_favorite_activities', true ) ); 1040 1040 $my_favs = array_flip( (array) $my_favs ); 1041 1041 unset( $my_favs[$activity_id] ); … … 1050 1050 } 1051 1051 1052 update_user meta( $user_id, 'bp_favorite_activities', $my_favs );1052 update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ); 1053 1053 1054 1054 do_action( 'bp_activity_remove_user_favorite', $activity_id, $user_id ); … … 1172 1172 1173 1173 // Remove any usermeta 1174 delete_user meta( $user_id, 'bp_latest_update' );1175 delete_user meta( $user_id, 'bp_favorite_activities' );1174 delete_user_meta( $user_id, 'bp_latest_update' ); 1175 delete_user_meta( $user_id, 'bp_favorite_activities' ); 1176 1176 1177 1177 do_action( 'bp_activity_remove_data', $user_id ); -
branches/1.2/bp-activity/bp-activity-classes.php
r3115 r3145 532 532 global $bp; 533 533 534 if ( !$favorite_activity_entries = get_user meta( $user_id, 'bp_favorite_activities') )534 if ( !$favorite_activity_entries = get_user_meta( $user_id, 'bp_favorite_activities', true ) ) 535 535 return 0; 536 536 -
branches/1.2/bp-activity/bp-activity-filters.php
r3076 r3145 115 115 116 116 /* Increase the number of new @ mentions for the user */ 117 $new_mention_count = (int)get_user meta( $user_id, 'bp_new_mention_count');118 update_user meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 );117 $new_mention_count = (int)get_user_meta( $user_id, 'bp_new_mention_count', true ); 118 update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count + 1 ); 119 119 120 120 $content = str_replace( "@$username", "<a href='" . bp_core_get_user_domain( bp_core_get_userid( $username ) ) . "' rel='nofollow'>@$username</a>", $content ); -
branches/1.2/bp-activity/bp-activity-notifications.php
r2869 r3145 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', true ) ) { 20 20 $poster_name = bp_core_get_user_displayname( $poster_user_id ); 21 21 … … 29 29 $ud = bp_core_get_core_userdata( $receiver_user_id ); 30 30 $to = $ud->user_email; 31 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name );31 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ); 32 32 33 33 $message = sprintf( __( … … 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', true ) ) { 64 64 $poster_name = bp_core_get_user_displayname( $commenter_id ); 65 65 $thread_link = bp_activity_get_permalink( $activity_id ); … … 72 72 $ud = bp_core_get_core_userdata( $original_activity->user_id ); 73 73 $to = $ud->user_email; 74 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name );74 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ); 75 75 76 76 $message = sprintf( __( … … 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', true ) ) { 106 106 $poster_name = bp_core_get_user_displayname( $commenter_id ); 107 107 $thread_link = bp_activity_get_permalink( $activity_id ); … … 111 111 $ud = bp_core_get_core_userdata( $parent_comment->user_id ); 112 112 $to = $ud->user_email; 113 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name );113 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ); 114 114 115 115 $poster_name = stripslashes( $poster_name ); -
branches/1.2/bp-activity/bp-activity-templatetags.php
r3143 r3145 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', true ) ); 29 29 30 30 if ( !empty( $include ) ) { … … 730 730 $user_id = $bp->displayed_user->id; 731 731 732 if ( !$update = get_user meta( $user_id, 'bp_latest_update') )732 if ( !$update = get_user_meta( $user_id, 'bp_latest_update', true ) ) 733 733 return false; 734 734 … … 832 832 } 833 833 function bp_get_total_mention_count_for_user( $user_id = false ) { 834 return apply_filters( 'bp_get_total_mention_count_for_user', get_user meta( $user_id, 'bp_new_mention_count') );834 return apply_filters( 'bp_get_total_mention_count_for_user', get_user_meta( $user_id, 'bp_new_mention_count', true ) ); 835 835 } 836 836 -
branches/1.2/bp-core.php
r3143 r3145 557 557 * @global $current_user WordPress global variable containing current logged in user information 558 558 * @param user_id The ID of the user. 559 * @uses get_user meta() WordPress function to get the usermeta for a user.559 * @uses get_user_meta() WordPress function to get the usermeta for a user. 560 560 */ 561 561 function bp_core_get_user_domain( $user_id, $user_nicename = false, $user_login = false ) { … … 1475 1475 * @package BuddyPress Core 1476 1476 * @global $userdata WordPress user data for the current logged in user. 1477 * @uses update_user meta() WordPress function to update user metadata in the usermeta table.1477 * @uses update_user_meta() WordPress function to update user metadata in the usermeta table. 1478 1478 */ 1479 1479 function bp_core_record_activity() { … … 1483 1483 return false; 1484 1484 1485 $activity = get_user meta( $bp->loggedin_user->id, 'last_activity');1485 $activity = get_user_meta( $bp->loggedin_user->id, 'last_activity', true ); 1486 1486 1487 1487 if ( !is_numeric( $activity ) ) … … 1492 1492 1493 1493 if ( '' == $activity || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) 1494 update_user meta( $bp->loggedin_user->id, 'last_activity', $current_time );1494 update_user_meta( $bp->loggedin_user->id, 'last_activity', $current_time ); 1495 1495 } 1496 1496 add_action( 'wp_head', 'bp_core_record_activity' ); … … 1929 1929 * @package BuddyPress Core 1930 1930 * @param $user_id The user id for the user to delete usermeta for 1931 * @uses delete_user meta() deletes a row from the wp_usermeta table based on meta_key1931 * @uses delete_user_meta() deletes a row from the wp_usermeta table based on meta_key 1932 1932 */ 1933 1933 function bp_core_remove_data( $user_id ) { 1934 1934 /* Remove usermeta */ 1935 delete_user meta( $user_id, 'last_activity' );1935 delete_user_meta( $user_id, 'last_activity' ); 1936 1936 1937 1937 /* Flush the cache to remove the user from all cached objects */ -
branches/1.2/bp-core/bp-core-classes.php
r3143 r3145 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. … … 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', true ), __( 'active %s ago', 'buddypress' ) ); 83 83 } 84 84 -
branches/1.2/bp-core/bp-core-settings.php
r3143 r3145 115 115 if ( $_POST['notifications'] ) { 116 116 foreach ( (array)$_POST['notifications'] as $key => $value ) { 117 update_user meta( (int)$current_user->id, $key, $value );117 update_user_meta( (int)$current_user->id, $key, $value ); 118 118 } 119 119 } -
branches/1.2/bp-core/bp-core-signup.php
r3144 r3145 425 425 if ( !bp_core_is_multisite() ) { 426 426 $activation_key = wp_hash( $user_id ); 427 update_user meta( $user_id, 'activation_key', $activation_key );427 update_user_meta( $user_id, 'activation_key', $activation_key ); 428 428 bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key ); 429 429 } … … 488 488 489 489 /* Remove the activation key meta */ 490 delete_user meta( $user_id, 'activation_key' );490 delete_user_meta( $user_id, 'activation_key' ); 491 491 } 492 492 … … 495 495 496 496 /* Add a last active entry */ 497 update_user meta( $user_id, 'last_activity', bp_core_current_time() );497 update_user_meta( $user_id, 'last_activity', bp_core_current_time() ); 498 498 499 499 /* Set the password on multisite installs */ … … 538 538 539 539 /* Add a last active entry */ 540 update_user meta( $user_id, 'last_activity', bp_core_current_time() );540 update_user_meta( $user_id, 'last_activity', bp_core_current_time() ); 541 541 542 542 /* Add the user's fullname to Xprofile */ 543 543 if ( function_exists( 'xprofile_set_field_data' ) ) { 544 $firstname = get_user meta( $user_id, 'first_name');545 $lastname = ' ' . get_user meta( $user_id, 'last_name');544 $firstname = get_user_meta( $user_id, 'first_name', true ); 545 $lastname = ' ' . get_user_meta( $user_id, 'last_name', true ); 546 546 $name = $firstname . $lastname; 547 547 548 548 if ( empty( $name ) || ' ' == $name ) 549 $name = get_user meta( $user_id, 'nickname');549 $name = get_user_meta( $user_id, 'nickname', true ); 550 550 551 551 xprofile_set_field_data( 1, $user_id, $name ); -
branches/1.2/bp-core/bp-core-templatetags.php
r3143 r3145 1345 1345 $user_id = $bp->displayed_user->id; 1346 1346 1347 $last_activity = bp_core_get_last_activity( get_user meta( $user_id, 'last_activity'), __('active %s ago', 'buddypress') );1347 $last_activity = bp_core_get_last_activity( get_user_meta( $user_id, 'last_activity', true ), __('active %s ago', 'buddypress') ); 1348 1348 1349 1349 if ( $echo ) -
branches/1.2/bp-forums.php
r3118 r3145 528 528 global $bp, $wp_roles, $bb_table_prefix; 529 529 530 $bb_cap = get_user meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities');530 $bb_cap = get_user_meta( $bp->loggedin_user->id, $bb_table_prefix . 'capabilities', true ); 531 531 532 532 if ( empty( $bb_cap ) ) -
branches/1.2/bp-forums/bp-forums-bbpress.php
r2209 r3145 104 104 $site_admins = get_site_option( 'site_admins', array('admin') ); 105 105 foreach ( (array)$site_admins as $site_admin ) 106 update_user meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );106 update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) ); 107 107 108 108 // Create the first forum. … … 131 131 extract( $args, EXTR_SKIP ); 132 132 133 return update_user meta( $id, $meta_key, $meta_value );133 return update_user_meta( $id, $meta_key, $meta_value ); 134 134 } 135 135 } -
branches/1.2/bp-friends.php
r3142 r3145 156 156 <td></td> 157 157 <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td> 158 <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>159 <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>158 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) ) { ?>checked="checked" <?php } ?>/></td> 159 <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', true ) == 'no' ) { ?>checked="checked" <?php } ?>/></td> 160 160 </tr> 161 161 <tr> 162 162 <td></td> 163 163 <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td> 164 <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>165 <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>164 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td> 165 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 166 166 </tr> 167 167 … … 488 488 489 489 if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) { 490 $count = get_user meta( $user_id, 'total_friend_count');490 $count = get_user_meta( $user_id, 'total_friend_count', true ); 491 491 if ( empty( $count ) ) $count = 0; 492 492 wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' ); … … 591 591 function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { 592 592 if ( 'add' == $status ) { 593 update_user meta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count') + 1 );594 update_user meta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count') + 1 );593 update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) + 1 ); 594 update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) + 1 ); 595 595 } else { 596 update_user meta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count') - 1 );597 update_user meta( $friend_user_id, 'total_friend_count', (int)get_usermeta( $friend_user_id, 'total_friend_count') - 1 );596 update_user_meta( $initiator_user_id, 'total_friend_count', (int)get_user_meta( $initiator_user_id, 'total_friend_count', true ) - 1 ); 597 update_user_meta( $friend_user_id, 'total_friend_count', (int)get_user_meta( $friend_user_id, 'total_friend_count', true ) - 1 ); 598 598 } 599 599 } … … 603 603 604 604 /* Remove usermeta */ 605 delete_user meta( $user_id, 'total_friend_count' );605 delete_user_meta( $user_id, 'total_friend_count' ); 606 606 607 607 /* Remove friendship requests FROM user */ -
branches/1.2/bp-friends/bp-friends-classes.php
r3142 r3145 128 128 129 129 // Do not update meta if user has never had friends 130 if ( !$count && !get_user meta( $user_id, 'total_friend_count') )130 if ( !$count && !get_user_meta( $user_id, 'total_friend_count', true ) ) 131 131 return 0; 132 132 133 update_user meta( $user_id, 'total_friend_count', (int)$count );133 update_user_meta( $user_id, 'total_friend_count', (int)$count ); 134 134 return (int)$count; 135 135 } -
branches/1.2/bp-friends/bp-friends-notifications.php
r2719 r3145 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', true ) ) 9 9 return false; 10 10 … … 19 19 // Set up and send the message 20 20 $to = $ud->user_email; 21 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );21 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ); 22 22 23 23 $message = sprintf( __( … … 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', true ) ) 51 51 return false; 52 52 … … 58 58 // Set up and send the message 59 59 $to = $ud->user_email; 60 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );60 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ); 61 61 62 62 $message = sprintf( __( -
branches/1.2/bp-groups.php
r3143 r3145 975 975 <td></td> 976 976 <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td> 977 <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>978 <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>977 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_invite', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td> 978 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 979 979 </tr> 980 980 <tr> 981 981 <td></td> 982 982 <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td> 983 <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>984 <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>983 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td> 984 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 985 985 </tr> 986 986 <tr> 987 987 <td></td> 988 988 <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td> 989 <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>990 <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>989 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td> 990 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 991 991 </tr> 992 992 <tr> 993 993 <td></td> 994 994 <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td> 995 <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>996 <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>995 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td> 996 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 997 997 </tr> 998 998 … … 1688 1688 1689 1689 /* Modify user's group memberhip count */ 1690 update_user meta( $user_id, 'total_group_count', (int) get_usermeta( $user_id, 'total_group_count') - 1 );1690 update_user_meta( $user_id, 'total_group_count', (int) get_user_meta( $user_id, 'total_group_count', true ) - 1 ); 1691 1691 1692 1692 /* If the user joined this group less than five minutes ago, remove the joined_group activity so … … 2338 2338 return false; 2339 2339 2340 update_user meta( $user_id, 'total_group_count', (int)$total_count - 1 );2340 update_user_meta( $user_id, 'total_group_count', (int)$total_count - 1 ); 2341 2341 } 2342 2342 -
branches/1.2/bp-groups/bp-groups-classes.php
r3143 r3145 749 749 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) ); 750 750 751 $group_count = get_user meta( $this->user_id, 'total_group_count');751 $group_count = get_user_meta( $this->user_id, 'total_group_count', true ); 752 752 if ( !empty( $group_count ) ) 753 update_user meta( $this->user_id, 'total_group_count', (int)$group_count - 1 );753 update_user_meta( $this->user_id, 'total_group_count', (int)$group_count - 1 ); 754 754 755 755 return $this->save(); … … 763 763 764 764 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) ); 765 update_user meta( $this->user_id, 'total_group_count', (int)get_usermeta( $this->user_id, 'total_group_count') + 1 );765 update_user_meta( $this->user_id, 'total_group_count', (int)get_user_meta( $this->user_id, 'total_group_count', true ) + 1 ); 766 766 767 767 return $this->save(); -
branches/1.2/bp-groups/bp-groups-notifications.php
r2719 r3145 5 5 6 6 $group = new BP_Groups_Group( $group_id ); 7 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . __( 'Group Details Updated', 'buddypress' );7 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . __( 'Group Details Updated', 'buddypress' ); 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', true ) ) continue; 12 12 13 13 $ud = bp_core_get_core_userdata( $user_id ); … … 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', true ) ) 48 48 return false; 49 49 … … 60 60 // Set up and send the message 61 61 $to = $ud->user_email; 62 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name );62 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name ); 63 63 64 64 $message = sprintf( __( … … 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', true ) ) 97 97 return false; 98 98 … … 108 108 109 109 if ( $accepted ) { 110 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name );110 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ); 111 111 $message = sprintf( __( 112 112 'Your membership request for the group "%s" has been accepted. … … 118 118 119 119 } else { 120 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name );120 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name ); 121 121 $message = sprintf( __( 122 122 'Your membership request for the group "%s" has been rejected. … … 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', true ) ) 155 155 return false; 156 156 … … 164 164 $to = $ud->user_email; 165 165 166 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name );166 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ); 167 167 168 168 $message = sprintf( __( … … 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', true ) ) 203 203 return false; 204 204 … … 212 212 $to = $invited_ud->user_email; 213 213 214 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name );214 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ); 215 215 216 216 $message = sprintf( __( … … 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', true ) ) { 262 262 $poster_name = bp_core_get_user_displayname( $poster_user_id ); 263 263 … … 271 271 $ud = bp_core_get_core_userdata( $receiver_user_id ); 272 272 $to = $ud->user_email; 273 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( '%s mentioned you in the group "%s"', 'buddypress' ), $poster_name, $group->name );273 $subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( '%s mentioned you in the group "%s"', 'buddypress' ), $poster_name, $group->name ); 274 274 275 275 $message = sprintf( __( -
branches/1.2/bp-messages.php
r3142 r3145 250 250 <td></td> 251 251 <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td> 252 <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>253 <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>252 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td> 253 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 254 254 </tr> 255 255 <tr> 256 256 <td></td> 257 257 <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td> 258 <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>259 <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>258 <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', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td> 259 <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', true ) ) { ?>checked="checked" <?php } ?>/></td> 260 260 </tr> 261 261 -
branches/1.2/bp-messages/bp-messages-classes.php
r3142 r3145 402 402 $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_notices} SET is_active = 0 WHERE id != %d", $id ) ); 403 403 404 update_user meta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) );404 update_user_meta( $bp->loggedin_user->id, 'last_activity', date( 'Y-m-d H:i:s' ) ); 405 405 406 406 do_action( 'messages_notice_after_save', $this ); -
branches/1.2/bp-messages/bp-messages-notifications.php
r2871 r3145 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', true ) ) continue; 11 11 12 12 $ud = get_userdata( $recipient->user_id ); … … 20 20 // Set up and send the message 21 21 $email_to = $ud->user_email; 22 $email_subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name );22 $email_subject = '[' . wp_specialchars_decode( get_blog_option( BP_ROOT_BLOG, 'blogname' ) ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name ); 23 23 24 24 $email_content = sprintf( __( -
branches/1.2/bp-messages/bp-messages-templatetags.php
r3134 r3145 273 273 global $messages_template; 274 274 275 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date) ) );275 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( get_date_from_gmt( $messages_template->thread->last_message_date, 'U' ) ) ); 276 276 } 277 277 … … 457 457 return false; 458 458 459 $closed_notices = get_user meta( $userdata->ID, 'closed_notices');459 $closed_notices = get_user_meta( $userdata->ID, 'closed_notices', true ); 460 460 461 461 if ( !$closed_notices ) -
branches/1.2/bp-themes/bp-default/_inc/ajax.php
r3143 r3145 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', true ); 446 446 447 447 $notice_ids[] = (int) $_POST['notice_id']; 448 448 449 update_user meta( $userdata->ID, 'closed_notices', $notice_ids );449 update_user_meta( $userdata->ID, 'closed_notices', $notice_ids ); 450 450 } 451 451 } -
branches/1.2/bp-xprofile.php
r3143 r3145 909 909 } 910 910 911 update_user meta( $user_id, 'nickname', $fullname );912 update_user meta( $user_id, 'first_name', $firstname );913 update_user meta( $user_id, 'last_name', $lastname );911 update_user_meta( $user_id, 'nickname', $fullname ); 912 update_user_meta( $user_id, 'first_name', $firstname ); 913 update_user_meta( $user_id, 'last_name', $lastname ); 914 914 915 915 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) ); … … 963 963 * @package BuddyPress XProfile 964 964 * @param $user_id The ID of the deleted user 965 * @uses get_user meta() Get a user meta value based on meta key from wp_usermeta966 * @uses delete_user meta() Delete user meta value based on meta key from wp_usermeta965 * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta 966 * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta 967 967 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user 968 968 */ … … 971 971 972 972 // delete any avatar files. 973 @unlink( get_user meta( $user_id, 'bp_core_avatar_v1_path') );974 @unlink( get_user meta( $user_id, 'bp_core_avatar_v2_path') );973 @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) ); 974 @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) ); 975 975 976 976 // unset the usermeta for avatars from the usermeta table. 977 delete_user meta( $user_id, 'bp_core_avatar_v1' );978 delete_user meta( $user_id, 'bp_core_avatar_v1_path' );979 delete_user meta( $user_id, 'bp_core_avatar_v2' );980 delete_user meta( $user_id, 'bp_core_avatar_v2_path' );977 delete_user_meta( $user_id, 'bp_core_avatar_v1' ); 978 delete_user_meta( $user_id, 'bp_core_avatar_v1_path' ); 979 delete_user_meta( $user_id, 'bp_core_avatar_v2' ); 980 delete_user_meta( $user_id, 'bp_core_avatar_v2_path' ); 981 981 } 982 982 add_action( 'wpmu_delete_user', 'xprofile_remove_data' ); -
branches/1.2/bp-xprofile/bp-xprofile-templatetags.php
r3143 r3145 647 647 global $bp; 648 648 649 $last_updated = get_user meta( $bp->displayed_user->id, 'profile_last_updated');649 $last_updated = get_user_meta( $bp->displayed_user->id, 'profile_last_updated', true ); 650 650 651 651 if ( $last_updated )
Note: See TracChangeset
for help on using the changeset viewer.