MyBB Community Forums

Full Version: If Variable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone. Smile

I'm adding a "tab" in my profiles just for moderation options, and I was wondering if there was a variable I could put before the <div> that would check if the user is currently a moderator so that the tab would not show to anyone unless they are in a certain usergroup. Thanks. Smile
If you want to add another tab to the Moderator Options in the profiles you can edit "member_profile_modoptions" in the Members template of Templates & Styles.

It is the mod menu that is already in the profiles.
I meant putting the moderation options into a tab, not adding another tab. (It doesn't even have tabs to begin with?)

<div class="panel panel-3">
					<h2>Signature</h2>
					<p>{$signature}</p>
				</div>

The above is my code which is the third tab of the profile, which looks like so:

[Image: Gkuxaeh.png?1]

Now I want to add another tab, which I can do. However what I need help with is trying to figure out how I can restrict that tab to a certain member group only, I figured ya'll have a {if} statement of some kind.
This should tell you everything about template conditioning.

http://mybbhacks.zingaburga.com/showthread.php?tid=260
Use this rather than the one mentioned above: http://mybbhacks.zingaburga.com/showthread.php?tid=464

its the simple/lite version of "PHP in Templates" which is linked in above post...

then you can use a conditional like this....

<if $mybb->user['usergroup'] == 4 then>
//content to show only for admin
</if>


<if in_array($GLOBALS['mybb']->user['usergroup'], array(3,4,6)) then>
//content to show for all default mod/admin groups
</if> 
You are awesome mmadhankumar!! Thank you! Smile