Skip to:
Content

Opened 11 months ago

Last modified 10 months ago

#5007 new enhancement

Is @jjj online now?

Reported by: sooskriszta Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 1.2
Component: Members Keywords:
Cc: karmatosed@…

Description

"Online now" would be a good feature to have.

There are 2 aspects to it:
1) @username is online now (on the username's profile page, card etc)
2) Who's online now filter for member directory.

There would ideally be 2 checks built into the function:
1) Has admin of community disabled this feature - not all communities may want or need it.
2) Has username turned this feature off in her profile? Some users may want to work stealthily even if admin has enabled this feature.

Change History (6)

comment:1 sooskriszta11 months ago

At least it is infinitely more useful than "online since" which we currently have.

comment:2 sooskriszta11 months ago

I take it that something small and simple like this should do the trick (without the 2 checks mentioned above)
(Thanks, naijaping)

<?php
global $bp;
function check_is_user_online($user_id){
if ( bp_has_members( 'type=online&include='.$user_id) ) return true;
else return false;
}
$this_id = bp_displayed_user_id();
$is_online = check_is_user_online($this_id);
if ($is_online) echo "Online Now";
else{ echo "Offline";}

?>
Last edited 11 months ago by sooskriszta (previous) (diff)

comment:3 karmatosed11 months ago

I personally feel this is more a plugin as it requires a switch I'd love to see it as a plugin at least first.

comment:4 karmatosed11 months ago

  • Cc karmatosed@… added

comment:5 modemlooper11 months ago

Plugin territory for sure.

comment:6 johnjamesjacoby10 months ago

  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 1.0 to 1.2

We already sort of do this with the last_activity usermeta. We could continue using this, and switch the last-active members query to use a more performant transient array of last active user ID's, which would allow us to dial down the last_activity interval to something less 5 minutes.

Either way, to do any of this will take a significant rethink, so moving to future release.

Note: See TracTickets for help on using tickets.