MyBB Community Forums

Full Version: content only shown if login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to put something into the header which only shows if the user is login.
Using the PHP in Templates plugin, this should work:

<if $mybb->user['usergroup'] > 0 then>
// Content
</if>
(2011-08-22, 05:36 PM)faviouz Wrote: [ -> ]Using the PHP in Templates plugin, this should work:

<if $mybb->user['usergroup'] > 0 then>
// Content
</if>

The content still shows for guests?

Maybe we need to change this.
> 0
into something else?

Thanks in advanced.
^ you can use any number in the code given by faviouz as per your requirement

default group IDs are like this :
1 → Guests
2 → Registered
3 → Super Moderators
4 → Administrators
5 → Awaiting Activation
6 → Moderators
7 → Banned

if you have custom groups then you may see : what are group id

<if $mybb->user['usergroup'] > 1 then>
// Content
</if> 

I never use this plugin, and I am not great at PHP, but I think it should be that. Toungue
Thanks a lot to both of you Big Grin