Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Who is on

By: Naijaping on May 28th, 2013  |  syntax: None  |  size: 0.48 KB  |  views: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <div id="online">
  2. <?php
  3. global $bp;
  4. function check_is_user_online($user_id){
  5. if ( bp_has_members( 'type=online&include='.$user_id) ) return true;
  6. else return false;
  7. }
  8. $this_id = bp_displayed_user_id();
  9. $is_online = check_is_user_online($this_id);
  10. if ($is_online) echo "<img src='http://www.yourweb.com/wp-content/themes/yourtheme/_inc/images/online.png' />";
  11.  
  12. else{ echo "<img src='http://www.yourweb.com/wp-content/themes/yourtheme/_inc/images/offline.png' />";}
  13.  
  14. ?>
  15. </div>