Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
beats23 Posted January 9 Posted January 9 (edited) Looking through the online status code, I see that V5 has a build in online status for the forum post but the feature is disabled by default. This is a cool feature, I'm wondering why it was hidden with CSS? It can be activated with this CSS code. /* Author Online Status */ .ipsEntry__author-online { display: block; } Edited January 9 by beats23 Drewfus and dmaidon1 2
beats23 Posted January 9 Author Posted January 9 The CSS code will make the online status pulse/flash like the hover card online status. /* Author Online Status */ .ipsEntry__author-online { border: 1.1em solid hsl(113deg 76.22% 37.79%); animation: ipsOnlineStatus 1s infinite; border-bottom-color: transparent; border-inline-end-color: transparent; display: block; }
beats23 Posted January 9 Author Posted January 9 (edited) You can have the online status showing in the whole IPSv5 suite, in the forums, private messages and all the location where members comments. This is pretty cool, such a great feature shouldn't be hidden 🤗. You only need to create a simple app to hook the default author online status code to the comment wrapper template. Activate IPSv5 dev mode and use the code below to hook into the commentWrap {{if $comment->author()->isOnline() AND ( !$comment->author()->isOnlineAnonymously() OR ( $comment->author()->isOnlineAnonymously() AND \IPS\Member::loggedIn()->isAdmin() ) )}} <span class='ipsEntry__author-online' data-ipsTooltip title='{{if $comment->author()->isOnlineAnonymously()}}{lang="online_now_anon" sprintf="$comment->author()->name"}{{elseif $comment->author()->isOnline()}}{lang="online_now" sprintf="$comment->author()->name"}{{endif}}'></span> {{endif}} Settings to use in dev mode app creation. Online status on all the comment areas and in the private messages. Edited January 9 by beats23 konon, Richard Arch, Gary and 1 other 3 1
beats23 Posted Monday at 05:06 AM Author Posted Monday at 05:06 AM (edited) Further inspection of the V5 online status code, revealed this in the CSS code file. /* ONLINE/OFFLINE */ .ipsOnlineStatus, .ipsOnlineStatus_online { color: #249168; } .ipsOnlineStatus_anonymous { color: #616161; } .ipsOnlineStatus_offline { color: #c7c7c7; } .ƒ { color: #bd9e22; } .ipsOnlineStatus_busy { color: #a03223; } This indicates that V5 has a much more advanced online status feature which will utilise different icon colours to indicate when a user is online, online anonymous, offline and busy. This feature is great, Is this a feature that was abandoned in v5 or is it a feature that we will receive later on in the future? You can use this code below and template hook settings instead of the one posted above when creating the app to activate the round online status indicator beside the user avatar and not at the top left corner of the comment message box. {{if $comment->author()->isOnline() AND ( !$comment->author()->isOnlineAnonymously() OR ( $comment->author()->isOnlineAnonymously() AND \IPS\Member::loggedIn()->isAdmin() ) )}} <span class='ipsOnlineStatus' data-ipsTooltip title='{{if $comment->author()->isOnlineAnonymously()}}{lang="online_now_anon" sprintf="$comment->author()->name"}{{elseif $comment->author()->isOnline()}}{lang="online_now" sprintf="$comment->author()->name"}{{endif}}'></span> {{endif}} Edited Monday at 05:08 AM by beats23 Joey_M 1
Management Matt Posted Monday at 10:09 AM Management Posted Monday at 10:09 AM It's something we're playing with. Any expansion on the status on not on the roadmap for 5.0.0. beats23, Joey_M and Mike G. 2 1
marklcfc Posted Monday at 11:12 AM Posted Monday at 11:12 AM (edited) It looks good with the green circle on the avatar, that's where it should be. Never understood why this feature was removed years ago (likewise a few other things that have made their way back eventually). I have always used a hook to have mine like this Edited Monday at 11:14 AM by marklcfc
Management Matt Posted Monday at 11:28 AM Management Posted Monday at 11:28 AM It can be unreliable when you're not using the Node (cloud) APIs as it is based on where the member last clicked, and for efficiency that is only updated once every three minutes or so.
Recommended Posts