Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/22/2010 11:09:28 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2523 props cnorris23

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-friends.php

    r3142 r3145  
    156156                <td></td>
    157157                <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_usermeta( $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_usermeta( $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>
    160160            </tr>
    161161            <tr>
    162162                <td></td>
    163163                <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_usermeta( $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_usermeta( $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>
    166166            </tr>
    167167
     
    488488
    489489    if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) {
    490         $count = get_usermeta( $user_id, 'total_friend_count' );
     490        $count = get_user_meta( $user_id, 'total_friend_count', true );
    491491        if ( empty( $count ) ) $count = 0;
    492492        wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' );
     
    591591function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) {
    592592    if ( 'add' == $status ) {
    593         update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) + 1 );
    594         update_usermeta( $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 );
    595595    } else {
    596         update_usermeta( $initiator_user_id, 'total_friend_count', (int)get_usermeta( $initiator_user_id, 'total_friend_count' ) - 1 );
    597         update_usermeta( $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 );
    598598    }
    599599}
     
    603603
    604604    /* Remove usermeta */
    605     delete_usermeta( $user_id, 'total_friend_count' );
     605    delete_user_meta( $user_id, 'total_friend_count' );
    606606
    607607    /* Remove friendship requests FROM user */
Note: See TracChangeset for help on using the changeset viewer.