Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: have problem with SEND TO box


John James Jacoby
Keymaster

@johnjamesjacoby

How comfortable are you editing a file to help me test?

I have no way right now to validate if this is a fix for anything, but it hasn’t broken anything for me yet. :)

open mu-plugins/bp-friends/bp-friends-classes.php

Near line 157…

ABOVE

$filtered_friends = $wpdb->get_results( $sql, ARRAY_A );

INSERT

$filtered_fids = $wpdb->get_col($sql);

Upload and replace. Try again and let me know what happens. Be prepared for it to break something, just in case. :)


In the same file, same area, a better solution MIGHT be to…

FIND

$total_friends = $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 ) );

REPLACE WITH

$total_friends = $wpdb->get_var( $wpdb->prepare( "SELECT count(id) FROM {$bp->friends->table_name} WHERE (friend_user_id IN ($filtered_friends) AND initiator_user_id = %d) OR (initiator_user_id IN ($filtered_friends) AND friend_user_id = %d)", $user_id, $user_id ) );

Since $filtered_friends is an array, it seems to work that way also.

Try both ways, let me know what results you achieve?

Skip to toolbar