Implemented Online status icon in postbit

This suggestion has been implemented. Votes are no longer accepted.
He means add something like this to the message_user_info template:
Code:
<xen:if is="{$post.last_activity} >= {$serverTime}-900">
    Online
<xen:else />
    Offline
</xen:if>

The 900 equates to 15 minutes.
The "Online" and "Offline" could be substituted with phrases, images, whatever you wish.

I'll knock a TM up later when I have time.
 
He means add something like this to the message_user_info template:
Code:
<xen:if is="{$post.last_activity} >= {$serverTime}-900">
    Online
<xen:else />
    Offline
</xen:if>

The 900 equates to 15 minutes.
The "Online" and "Offline" could be substituted with phrases, images, whatever you wish.

I'll knock a TM up later when I have time.
I don't suppose I can use that conditional in the message_user_info.css template? Looks like the avatar css is located there, making it tough to do what I was wanting to do with the image border.
 
You can't use a conditional statement such as that in a CSS template.

Just apply the HTML and CSS to the Online/Offline sections.

Or modify the template to use different CSS based on the conditional statement.
 
Actually, it's just showing everyone as offline, even though I'm online and should be viewed as online if that calculation is correct.
 
It works, I tested it.
It depends what value is stored in last_activity.
Not sure what I'm doing wrong then... here's what I have posted:
Code:
<xen:if is="{$post.last_activity} >= {$serverTime}-900">
                <div class="online-status-postbit">Online</div>
            <xen:else />
                <div class="offline-status-postbit">Offline</div>
            </xen:if>
If it was working I should see myself as being online, right?
 
The value will be wrong more often than not do to the batched updating of that field. Doing it properly really requires the session activity record.
 
I've used the add-on mentioned at the top of this thread, using a simple green, red (for online/hidden) or grey dot next to the avatar. It's been installed since 1.1 and we've never had to modify it in any way for 1.2 or 1.3. I prefer a simple dot rather than a word, or banner, as it is much cleaner and reduces clutter.


upload_2014-4-30_22-24-55.webp

Still would like to see an "official" online indicator though, preferably as simple and clutter-free as possible.
 
Last edited:
That addon has many issues.
It does, true...but for our purposes it works fine as-is. It need not be perfect, but if this feature were "official" I would be more confident knowing that it works properly, and is supported. I've gotten burned by too many add-ons that were abandoned. Can't afford it on a big board like ours. :)
 
It does, true...but for our purposes it works fine as-is. It need not be perfect, but if this feature were "official" I would be more confident knowing that it works properly, and is supported. I've gotten burned by too many add-ons that were abandoned. Can't afford it on a big board like ours. :)
The biggest problem seems to be the resource hog that it causes? Is it the case on your big board?
 
The biggest problem seems to be the resource hog that it causes? Is it the case on your big board?
I haven't noticed any slowdowns--we are well within our server's usage limits.

However, you have me wondering now. PHP memory has been through the roof. I've had to bump it way up over the months (up to 512M currently, to get errors to go away) and we still end up getting errors. Now this makes me wonder if this add-on is the culprit. Our number of online visitors has grown, and PHP memory usage has crept up with it.
 
I haven't noticed any slowdowns--we are well within our server's usage limits.

However, you have me wondering now. PHP memory has been through the roof. I've had to bump it way up over the months (up to 512M currently, to get errors to go away) and we still end up getting errors. Now this makes me wonder if this add-on is the culprit. Our number of online visitors has grown, and PHP memory usage has crept up with it.
Read on the addon thread, there is a discussion and some temp fix but we either need the author to fix it or look for alternative.
 
Will do, thanks! The add-on has apparently been working fine for us, so I've never thought of checking the original thread. We'd really miss it if we had to disable it.
 
Top Bottom