MyBB Community Forums

Full Version: Show content to specific usergroups
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all.

I want to show/hide some content in the template I am using only to specific usergroups. Like

if {Usergroup_of_loggedin_user} == "4"
{This content}
else
{This content}

How to translate this to template script/variables?
Install PHP in Templates plugin: http://community.mybb.com/thread-31860.html

Then use the following code;
<if $mybb->user['usergroup'] == "X" then>
// Show content to usergroup ID = X
<elseif $mybb->user['usergroup'] == "Y" then>
// Show content to usergroup ID = Y
</if>
Thanx! So mybb forum doesn't have it's own function to use if/else functions in templates?

I am gonna try the pluging than
No, MyBB doesn't allow PHP in templates by default.