Online Status On Postbit 2.2.15

JustBrowsing90

Active member
Registered
Joined
Mar 25, 2024
Messages
40
Points
8

Reputation:

Well I'm back again with another question, I'd like to get rid of the green online indicator & replace it with a part in the postbit similar to the example but instead of saying Status Online or Offline has a clock icon & beside it have it say Online or Offline.

Example:
My postbit with example made using Inspect Element:
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
772
Points
153

Reputation:

So what exactly do you want?
 

JustBrowsing90

Active member
Registered
Joined
Mar 25, 2024
Messages
40
Points
8

Reputation:

So what exactly do you want?
SplichoI want to add an online status option to the postbit that says Online when you're online & Offline when you're offline with a clock icon on the right to represent it like in the second image.
 
Last edited:
View previous replies…

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
772
Points
153

Reputation:

I want to add an online status option to the postbit that says Online when you're online & Offline when you're offline with a clock icon on the right to represent it like in the second image.
JustBrowsing90What's your site? Need to see the layout so I can give you the exact code for your theme
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
772
Points
153

Reputation:

Like I said I don't feel comfortable giving access out because I'm just an admin on the site. I can tell you the name of the site in a DM but that's it.
JustBrowsing90Then it'll be hard to give out the entire code, too lazy to install your style now.

Here's a snippet for the XF logic. Take a look into message_macros for the postbit, there you can add the code + markup fitting your style.

HTML:
<xf:if is="$user.isOnline()">
  Show text if user is online
  <xf:elseif is="$user.activity_visible == '0'" />
  Show text if user is hidden
  <xf:else />
  Show text if user is offline
</xf:if>
 

JustBrowsing90

Active member
Registered
Joined
Mar 25, 2024
Messages
40
Points
8

Reputation:

Then it'll be hard to give out the entire code, too lazy to install your style now.

Here's a snippet for the XF logic. Take a look into message_macros for the postbit, there you can add the code + markup fitting your style.

HTML:
<xf:if is="$user.isOnline()">
  Show text if user is online
  <xf:elseif is="$user.activity_visible == '0'" />
  Show text if user is hidden
  <xf:else />
  Show text if user is offline
</xf:if>
SplichoUnfortunetly that didn't work but I appreciate the help nonetheless. It's really not that big of a deal just one of those little nit picky things :p
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
772
Points
153

Reputation:

Unfortunetly that didn't work but I appreciate the help nonetheless. It's really not that big of a deal just one of those little nit picky things :p
JustBrowsing90What didn't work lol? I literally copy pasted it from my site and it's working perfectly fine there
 

Splicho

Emudevs.gg Owner
Staff member
Moderator
Collaborate
Registered
Joined
Jan 21, 2022
Messages
772
Points
153

Reputation:

I copied the codes you posted & put them in message_macros & nothing showed up so rather than mess something up I'll just let it be :p
JustBrowsing90You have to paste it in the correct block.
Alright, then.. add this @ line 73 right under <div class="message-userExtras">

HTML:
<dl class="pairs pairs--justified">
                     <xf:if is="property('uix_postBitIcons')">
                        <dt>
                           <span data-xf-init="tooltip" title="Online Status">
                              <xf:fa icon="fa-clock" />
                           </span>
                        </dt>
                        <xf:else />
                        <dt>Online Status</dt>
                     </xf:if>
                     <dd>
                        <xf:if is="$user.isOnline()">
                           Online
                           <xf:elseif is="$user.activity_visible == '0'" />
                           Hidden
                           <xf:else />
                           Offline
                        </xf:if>
                     </dd>
                  </dl>

brave_W5ye82XjF2.png


Result

brave_WCutWTzzIn.png


HTML:
            <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
               <span class="message-avatar-online" tabindex="0" data-xf-init="tooltip" data-trigger="auto"
                  title="{{ phrase('online_now')|for_attr }}"></span>
            </xf:if>

Also remove this from line 22 - 25, you don't need it anymore. That indicator is your current online/offline indicator, but since you have a new one now, it makes no sense to have it twice displayed or indicated.
 

JustBrowsing90

Active member
Registered
Joined
Mar 25, 2024
Messages
40
Points
8

Reputation:

You have to paste it in the correct block.
Alright, then.. add this @ line 73 right under <div class="message-userExtras">

HTML:
<dl class="pairs pairs--justified">
                     <xf:if is="property('uix_postBitIcons')">
                        <dt>
                           <span data-xf-init="tooltip" title="Online Status">
                              <xf:fa icon="fa-clock" />
                           </span>
                        </dt>
                        <xf:else />
                        <dt>Online Status</dt>
                     </xf:if>
                     <dd>
                        <xf:if is="$user.isOnline()">
                           Online
                           <xf:elseif is="$user.activity_visible == '0'" />
                           Hidden
                           <xf:else />
                           Offline
                        </xf:if>
                     </dd>
                  </dl>

View attachment 40633

Result

View attachment 40634

HTML:
            <xf:if is="$xf.options.showMessageOnlineStatus && $user && $user.isOnline()">
               <span class="message-avatar-online" tabindex="0" data-xf-init="tooltip" data-trigger="auto"
                  title="{{ phrase('online_now')|for_attr }}"></span>
            </xf:if>

Also remove this from line 22 - 25, you don't need it anymore. That indicator is your current online/offline indicator, but since you have a new one now, it makes no sense to have it twice displayed or indicated.
SplichoWow you really didn't have to do that but I appreciate it nonetheless. Thanks again :)
 
Top