MyBB Community Forums

Full Version: i need help with theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to check in my theme whether a user is logged in or not?

i need to hide this button if user is not loggedin


<li><a href="{$mybb->settings['bburl']}/misc.php?action=payments">Upgrade</a></li>
<if $mybb->user['uid'] then>Hide whatever you want</if>


You need the php conditionals plugin for this.
(2021-03-30, 10:43 AM)Ashley1 Wrote: [ -> ]
<if $mybb->user['uid'] then>Hide whatever you want</if>


You need the php conditionals plugin for this.
thx
Without conditionals plugin:

HTML Code:
<li class="notforguest{$mybb->user['uid']}"><a href="{$mybb->settings['bburl']}/misc.php?action=payments">Upgrade</a></li>


CSS:
.notforguest0 {
    display: none !important;
}