[Resolved] How to add Online Offline Border to Avatar
-
I’ve been trying to figure out how to add Online Offline Border to user Avatar with user cover image upload enabled. I have it working fine if cover image upload is disabled in Settings:
Place this in member-header.php:
<?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 '<div id="item-header-avatar" class="online"></div>'; else{ echo '<div id="item-header-avatar" class="offline"></div>'; } ?>
But when I enable Cover image upload and give the Online div a green border color:
#buddypress #item-header-cover-image #item-header-avatar img.avatar { border: solid 2px #008000; background: rgba( 255, 255, 255, 0.8 ); }
and the Offline border a red color
#buddypress #item-header-cover-image #item-header-avatar img.avatar-offline { border: solid 2px #be3631; background: rgba( 255, 255, 255, 0.8 ); }
The green border shows while the red doesn’t show. Have anyone tried or know the solution to this?
The new div call in member-header.php
if ($is_online) echo '<div id="buddypress item-header-cover-image item-header-avatar" class="avatar">'; else{ echo '<div id="buddypress item-header-cover-image item-header-avatar" class="avatar-offline">';
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘[Resolved] How to add Online Offline Border to Avatar’ is closed to new replies.