MyBB Community Forums

Full Version: template conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

How do I show items only to admins for pages which are not part of MyBB.

I do have the page integrated but it doesn't seem to work when I try it.
Assuming you're using template conditionals:

<if $mybb->user['gid'] == '4' then>
Content
</if>
^ Should be

(2013-01-06, 01:53 AM)Jordan L. Wrote: [ -> ]Assuming you're using template conditionals:

<if $mybb->user['usergroup'] == '4' then>
Content
</if>
Ah, my bad. Toungue
I'm afraid that didn't work on my integrated page.

It just output "$mybb->user['usergroup'] == '4' then" on the page.
If it is a custom PHP file why not just do
if($mybb->usergroup['cancp']==1)
{
// code here
}
?>
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4)) then>
//Anything here will only show the the group added above (gid : 4)
</if>
Competition time!

<if $mybb->usergroup['cancp'] then>
Hi admin!
</if>

If doesn't work, change $mybb with $GLOBALS[['mybb'] .
Thanks Omar, that did work but also wanted global moderators to see this information too. Smile

Sorry, I should have specified. Smile
Then,

<if $mybb->usergroup['cancp'] || $mybb->user['canmodcp'] then>
Hi admin/mod!
</if>
Pages: 1 2