mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02: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:
@@ -1869,6 +1869,7 @@ function init_session()
|
|||||||
define('USERIMAGE', $user->get('user_image'));
|
define('USERIMAGE', $user->get('user_image'));
|
||||||
define('USERPHOTO', $user->get('user_sess'));
|
define('USERPHOTO', $user->get('user_sess'));
|
||||||
define('USERJOINED', $user->get('user_join'));
|
define('USERJOINED', $user->get('user_join'));
|
||||||
|
define('USERCURRENTVISIT', $user->get('user_currentvisit'));
|
||||||
define('USERVISITS', $user->get('user_visits'));
|
define('USERVISITS', $user->get('user_visits'));
|
||||||
define('USERSIGNATURE', $user->get('user_signature'));
|
define('USERSIGNATURE', $user->get('user_signature'));
|
||||||
|
|
||||||
|
@@ -3660,7 +3660,8 @@ class e_parser
|
|||||||
$userData = array();
|
$userData = array();
|
||||||
$userData['user_id'] = USERID;
|
$userData['user_id'] = USERID;
|
||||||
$userData['user_image'] = USERIMAGE;
|
$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."'";
|
$heightInsert = empty($height) ? '' : "height='".$height."'";
|
||||||
$id = (!empty($options['id'])) ? "id='".$options['id']."' " : "";
|
$id = (!empty($options['id'])) ? "id='".$options['id']."' " : "";
|
||||||
|
|
||||||
|
$classOnline = (!empty($userData['user_currentvisit']) && intval($userData['user_currentvisit']) > (time() - 300)) ? " user-avatar-online" : '';
|
||||||
|
|
||||||
$text = $linkStart;
|
$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;
|
$text .= $linkEnd;
|
||||||
// return $img;
|
// return $img;
|
||||||
return $text;
|
return $text;
|
||||||
|
Reference in New Issue
Block a user