BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21596

    Thanks Brajesh! Case solved.

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21575

    Hi,

    just to polish little more. What about printing user avatar image with link ?

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21574

    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 );

    }

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21573

    Hi,

    we are getting pretty close now. Thanks a lot.

    I got now list of users printed but how can I print those users with link to their member page automatically.
    That loop now prints just user names.

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21550

    Actually code need to work outside of BuddyPress. On theme page.

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21549

    Ok,

    can I have example 🙂 – I’m bit of confused right now.

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21546

    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;
    ?>

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21534

    Ok.

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21503

    Hi,

    any solutions for this yet?

  • Participant
    Level: Initiated
    Posts: 10
    Pause on #21428

    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.