BuddyDev

Search

Have an idea for the circle..

  • Participant
    Level: Enlightened
    Posts: 60
    tangpage on #19578

    is there anyway to have a tab for circle, under this tab, user could create some content only can be viewed by members in the circle?

    also, i have question hope i could get an answer here…

    like if i have a string:

    $names = ‘aaa,bbb,ccc,ddd,eee’; (usernames.)
    is it posible to turn to the string to:

    $user_ids = ‘111,222,333,444,555’;

    ?

    How could i do that? I wish i could get some help here. ; )

    happy holidays!

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #19581

    Hi Tangape,
    No, this is not available.

    For the Circle, you will need someone to do a custom job for it as it need storing/editing/displaying and I am unable to assist you a few lines(It will take more lines).

    2. For your usernames, you can write a function like this

    
    function buddydev_custom_get_user_ids( $user_names ) {
    
    	$ids = array_map( 'bp_core_get_userlink_by_username', explode( ',', $user_names ) );
    
    	return array_filter( $ids );
    }
    
    

    and then use it like

    
    
    $user_ids = join(',', buddydev_custom_get_user_ids( 'aaa,bbb,ccc,ddd,eee' ) );
    
    

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 60
    tangpage on #19594

    thank you so much….

    so in any buddy circle, can i fetch all user ids in one circle?

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #19601

    Hi Kino,
    Sure, if you know the circle id, you can use

    
    
    $user_ids = bcircles_get_circle_users( $circle_id );
    

    It will give you an array of user ids for the given circle.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 60
    tangpage on #19617

    thank you so much , Brajesh. ; )

  • Keymaster
    (BuddyDev Team)
    Posts: 24623
    Brajesh Singh on #19631

    You are welcome 🙂

You must be logged in to reply to this topic.

This topic is: not resolved