BuddyDev

Search

create a directory of member types who are currently online?

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #33860

    Hi, how would i go about this? can’t seem to find a solution anywhere,

    i would like to create two separate member types and show them in a directory each for purely ‘online members’

    Many thanks,
    Nick

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #33877

    Hi Nick,
    Thank you for the question.

    Please allow me to check it. We might be able to update our shortcode and include the option for showing online users.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #33878

    That would be amazing!

    Thank you, Brajesh 🙂

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #33907

    Good morning, Brajesh.

    Would you have a timescale for this?

    Would love to implement this on my site 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #33918

    Hi Nick,
    Sorry for the delaye.

    @ravisharma
    checked the plugin today and found that you can use

    
    type=online
    

    in the current shortcode to find the online members(BuddyPress considers user online if they have been active in last 15 minutes. This duration can be customized via a hook).

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #34133

    Sorry, Brajesh, i didnt get back to you sooner to thank you (website troubles :D)

    I pasted this shortcode: [bpmtp-members-list member_type=male type=online] Didnt seem to work, have i done it wrong?

    Many thanks,
    Nick

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #34147

    Hi Nick,
    Thank you for the reply.

    By default BuddyPress will list any user who was active in last 15 minutes(even if logged out now) as online.

    Is that happening or is it not doing that?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #34151

    Yes, Brajesh, its doing it!

    I forgot about the last 15 minutes rule 😀 ( is it complicated to adjust that 15 mins down to say like 5 mins? )

    Great support as always!

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #34169

    Hi Bick,
    Thank you.

    Sure, you can use this code for changing the time.

    
    
    /**
     * Change the number of minutes used as interval for considering user online.
     */
    add_filter( 'bp_user_query_online_interval', function ( $interval_in_minutes ) {
    	return 5;// 5 minutes.
    } );
    

    Please put it in wp-content/plugins/bp-custom.php or your-current-active-theme/functions.php

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 13
    Nick Tomlinson on #34178

    Hi, Brajesh,

    Thanks so much for the code

    <?php
    // your php custom code goes below this line.
    /**
     * Change the number of minutes used as interval for considering user online.
     */
    add_filter( 'bp_user_query_online_interval', function ( $interval_in_minutes ) {
            return 5;// 5 minutes.
    } );

    Is this correct to make up the bp-custom.php file? Using Notepad +++ then saving as a php file & loading it to wp-content/plugins?

    Seems to give my site a critical error, i must be creating the file wrongly,

    Many thanks,
    Nick

You must be logged in to reply to this topic.

This topic is: not resolved