mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
When a user is online an additional CSS class is automatically added to the user avatar: user-avatar-online
This commit is contained in:
parent
fe43a6eebf
commit
3c81473ccc
@ -1869,6 +1869,7 @@ function init_session()
|
||||
define('USERIMAGE', $user->get('user_image'));
|
||||
define('USERPHOTO', $user->get('user_sess'));
|
||||
define('USERJOINED', $user->get('user_join'));
|
||||
define('USERCURRENTVISIT', $user->get('user_currentvisit'));
|
||||
define('USERVISITS', $user->get('user_visits'));
|
||||
define('USERSIGNATURE', $user->get('user_signature'));
|
||||
|
||||
|
@ -3660,7 +3660,8 @@ class e_parser
|
||||
$userData = array();
|
||||
$userData['user_id'] = USERID;
|
||||
$userData['user_image'] = USERIMAGE;
|
||||
$userData['user_name'] = USERNAME;
|
||||
$userData['user_name'] = USERNAME;
|
||||
$userData['user_currentvisit'] = USERCURRENTVISIT;
|
||||
}
|
||||
|
||||
|
||||
@ -3714,8 +3715,10 @@ class e_parser
|
||||
$heightInsert = empty($height) ? '' : "height='".$height."'";
|
||||
$id = (!empty($options['id'])) ? "id='".$options['id']."' " : "";
|
||||
|
||||
$classOnline = (!empty($userData['user_currentvisit']) && intval($userData['user_currentvisit']) > (time() - 300)) ? " user-avatar-online" : '';
|
||||
|
||||
$text = $linkStart;
|
||||
$text .= "<img ".$id."class='".$shape." user-avatar' alt=\"".$title."\" src='".$img."' width='".$width."' ".$heightInsert." />";
|
||||
$text .= "<img ".$id."class='".$shape." user-avatar".$classOnline."' alt=\"".$title."\" src='".$img."' width='".$width."' ".$heightInsert." />";
|
||||
$text .= $linkEnd;
|
||||
// return $img;
|
||||
return $text;
|
||||
|
Loading…
x
Reference in New Issue
Block a user