Forum Replies Created
-
To answer my own question for someone elses reference:
After following the event listeners back to
avatar.min.js
I found the regularavatar.js
which says the following:* Set the Attachment object
*
* You can run extra actions once the avatar is set using:
* bp.Avatar.Attachment.on( ‘change:url’, function( data ) { your code } );
*
* In this case data.attributes will include the url to the newly
* uploaded avatar, the object and the item_id concerned.So the following code will achieve the desired result:
$(window).load(function() { bp.Avatar.Attachment.on( 'change:url', function( data ) { window.location.replace("/URL-GOES-HERE/"); } ); });
Right fantastic, so
if ( bp_has_members( 'include=4112,1543,119' ) ) :
returns the 3 correct members.So the way round it was a mixture of the two things I tried… Being the end of the day – particularly monday I just completely missed it!
Instead of holding the values as an array you need to implode the list to follow the
'include=
not thearray(‘include’ => $matches)
SOLUTION
$MemImploded = implode(', ', $matches); if ( bp_has_members( 'include=' . $MemImploded ) ) : while ( bp_members() ) : bp_the_member();
Thanks very much to @shanebp for your help with this.
Just saw reply after post.
Array ( [0] => 4112 [1] => 1543 [2] => 119 )
is the exact output of $matches so not sure where the issues are coming from…Do you happen to know if
'include='
is a recent parameter added to BP as I don’t think this version is the latest.It seems to return a load of people who aren’t on either tickets or friend list for
$MemImploded = implode(“,”, $matches); if ( bp_has_members( array(‘include’ => $MemImploded))) :
OR
if ( bp_has_members( array(‘include’ => $matches))) :
and for
if ( bp_has_members( 'include=' . $matches ) ) :
It returns nothing unfortunately…
have also just tried
if ( bp_has_members( array(‘include’ => $matches))) : while ( bp_members() ) : bp_the_member();
No joy
@shanebp Thanks a lot that seems to work much better, or at least when I print the
$matches
array it seems to gives me the right user ID results.It doesn’t seem to loop though when I pass it through though…
if ( bp_has_members( 'include=' . $matches ) ) : while ( bp_members() ) : bp_the_member();
do I need to do anything to the $matches array first?
*Selecting notify me via email
Has there been any development on this in the last 4 years – I’ve had a couple of people say to me they clicked on the unfriend by accident and are too embarrassed to ask again in case they think they removed them on purpose!?
Would be nice to have some sort of confirmation