Replies
Hi,
i got this working with links now. Thanks for your patience with this.So to sum up this the outcome is that i can now print all users who have checked option ‘tyres’ from checkbox and print their display name with link to their profile page.
bp_core_get_userlink( $user_id );
$url = bp_core_get_user_domain( $user_id );
$username = bp_core_get_username( $user_id );$user_query = new BP_User_Query(
array(
‘xprofile_query’ => array(
array(
‘field’ => 10,
‘value’ => ‘tyres’,
‘compare’ => ‘LIKE’,
),
),
‘populate_extras’ => false,
)
);$user_ids = $user_query->user_ids;
foreach ( $user_ids as $user_id ) { ?>
“>
<?php
echo ” “.bp_core_get_user_displayname( $user_id ). ‘<br>’ . xprofile_get_field_data(“”, $user_id );}
Ok,
how can I print something out ? I only get “Array” text printed.
I need to get this working outside of member page.<?php
$user_query = new BP_User_Query(
array(
‘xprofile_query’ => array(
array(
‘field’ => 81, // field id or name.
‘value’ => ‘Hammer’, // value.
‘compare’ => ‘LIKE’,
),
),
‘populate_extras’ => false,
)
);$user_ids = $user_query->user_ids;
?>1. Do you want to list all users who have selected(checked) some of these option and then show them as well as their choices.
– I want to list all users (and link to their member page) who have selected(checked) certain option, for example if users have checked option “milk” then list all users of that choice and show link to their member page.2. Or do you want to list all users who have checked a specific choice? This will be a bit difficult for large number of users(40 is fine).
– Yes, specific choice from checkbox group and then show link to their member page.PS:- Will you have a lot more users in future or is it going to be limited to few users? I am asking to help me provide you more efficient solution.
– max. 40-50 user will be total.