Skip to:
Content

BuddyPress.org

Ticket #40: reference.patch

File reference.patch, 3.1 KB (added by da3rX, 13 years ago)

Fix

  • bp-friends.php

     
    210210 Return an array of friend objects for the current user.
    211211**************************************************************************/
    212212
    213 function friends_get_friendships( $user_id = false, $friendship_ids = false, $pag_num = 5, $pag_page = 1, $get_requests = false, $count = false ) {
     213function friends_get_friendships( $user_id = false, &$friendship_ids = false, $pag_num = 5, $pag_page = 1, $get_requests = false, $count = false ) {
    214214        global $current_userid;
    215215
    216216        if ( !$user_id )
  • bp-friends/bp-friends-ajax.php

     
    1414        $total_friend_count = 0;
    1515
    1616        if ( $_POST['friend-search-box'] == "" ) {
    17                 $friendships = friends_get_friendships( $creds['current_userid'], false, $pag_num, $pag_page, false );
     17                $friendships = friends_get_friendships( $creds['current_userid'], $ids = false, $pag_num, $pag_page, false );
    1818        } else {
    1919                $friendships = BP_Friends_Friendship::search_friends( $_POST['friend-search-box'], $creds['current_userid'], $pag_num, $pag_page );
    2020        }
  • bp-friends/bp-friends-classes.php

     
    152152                // Get the total number of friendships
    153153                $fs_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM $bp_friends_table_name WHERE (friend_user_id IN ($filtered_fids) AND initiator_user_id = %d) OR (initiator_user_id IN ($filtered_fids) AND friend_user_id = %d)", $user_id, $user_id ) );
    154154               
    155                 $friendships = friends_get_friendships( $user_id, &$fs_ids, 5, 1, false, $fs_count );
     155                $friendships = friends_get_friendships( $user_id, $fs_ids, 5, 1, false, $fs_count );
    156156
    157157                return $friendships;
    158158        }
  • bp-friends/bp-friends-templatetags.php

     
    2626                        $this->friendships = BP_Friends_Friendship::search_friends( $_POST['friend-search-box'], $current_userid, $this->pag_num, $this->pag_page );
    2727                } else if ( $current_action == 'requests' ) {
    2828                        // Friendship Requests
    29                         $this->friendships = friends_get_friendships( $current_userid, false, $this->pag_num, $this->pag_page, true );
     29                        $this->friendships = friends_get_friendships( $current_userid, $ids = false, $this->pag_num, $this->pag_page, true );
    3030                } else {
    3131                        // All confirmed friendships
    32                         $this->friendships = friends_get_friendships( $current_userid, false, $this->pag_num, $this->pag_page, false );
     32                        $this->friendships = friends_get_friendships( $current_userid, $ids = false, $this->pag_num, $this->pag_page, false );
    3333                }
    3434
    3535                $this->total_friend_count = (int)$this->friendships['count'];