MyBB Community Forums

Full Version: Display icon if online
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey community ,

I wanna display icon if user is online and another if offline , with if condition but I don't know variables .

<if $post['onlinestatus'] == "????" then> Icon <else> another icon </if>
Hi,

do you need to use a condition?

There are 2 templates for that:
postbit_offline / postbit_online

Change them as you want and save coding  Wink
I already customized them before to print this words "postbit_offline" or "postbit_online"
and I wanna display an icon on mobiles

so , I tried to make it with if condition like this for example

<if $post['onlinestatus'] == "text printerd" then>Icon</if>

I need help to make this condition true , that's all
Hi,

(2020-05-07, 09:45 AM)Proton Wrote: [ -> ]and I wanna display an icon on mobiles

That could be done with CSS only, but if you want to go your way:
https://community.mybb.com/thread-121616...#pid877989

Change line to 2569 and 2595 of the current member.php file.
If you want another style try this

postbit_online
<div class="postbitonlinestatus" title="Online" alt="Online"></div>

css
.postbitonlinestatus {
    border-top: 10px solid #348423;
    border-left: 10px solid #348423;
    position: relative;
    z-index: 2;
    border-bottom: 10px solid transparent;
    border-right: 10px solid transparent;
    width: 0;
    margin-bottom: -14px;
    margin-left: -189px;
    margin-top: -7px;
}
Thank you so much for your help ♥ @NoRules @Mastersly
I customized postbit_offline / postbit_online templates and it's work now .