Jump to content

Recommended Posts

Posted (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; 
}

image.thumb.png.b15e05566ddd07b38dffeec16c12bec1.png

Edited by beats23
Posted

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; 
}

 

Posted (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.Screenshot2025-01-09at8_56_48pm.thumb.png.351be8876a492bd8b3e13a8592d2e880.png

 

 

Online status on all the comment areas and in the private messages.Screenshot2025-01-09at8_51_43pm.thumb.png.12b5d939dc06768c7ae90e55a670bd10.png

Screenshot2025-01-09at9_12_58pm.thumb.png.50a05ecf94001671c346d160e2aa49cb.png

Edited by beats23
Posted (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}}

image.thumb.png.ed2722e7434608efdad8a6995a15dd39.png

image.thumb.png.18365123d3e0698b855414b869be29d9.png

 

 

 

Edited by beats23
Posted (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

Screenshot 2025-01-13 at 11.12.05.png

Edited by marklcfc
  • Management
Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...