Display green border around avatar when user is online
-
Hi guys,
I was lookin for a green border on member’s search page that is shown when the user is online. If the user is offline, instead, show a red one.
Could anybody please help me with this? I was trying to use this code:
<div id="online"> <?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 "<img src='http://www.yourweb.com/wp-content/themes/yourtheme/_inc/images/online.png' />"; else{ echo "<img src='http://www.yourweb.com/wp-content/themes/yourtheme/_inc/images/offline.png' />";}
But seems I can’t get it to work or it doesn’t works at all.
Thanks in advance,
Very appreciate.Henry.
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Display green border around avatar when user is online’ is closed to new replies.