MyBB Community Forums

Full Version: Showing template items to only members?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there. Mybb is great! But, it's also new to me. I used vBulletin for years, but it is so bad now I can't stand it. But I am used to their system, so some things seem familiar here, while others are completely foreign to me.

I see that the forums do indeed display dynamic information depending on if the user is logged in or not, but I don't understand how to do this sort of thing with my own template edits. I read that "conditionals" are not in the templates.

So, it seems I would need to make a plugin to decide the variables (member or not) and call upon the right template depending on which variable is met. But ... I don't actually KNOW that this is what one would do. Nor do I know HOW to do this if it were the case.

I'm not sure this is even in the right forum, since technically it's a theme question. But also a plugin question. And it's also kind of a general mybb question. See why I'm confused?

Anyway, thanks for the great product! Hope to learn how to use it better!
install and activate this plugin, http://mybbhacks.zingaburga.com/showthread.php?tid=260

use these conditionals as per your needs.

<if $GLOBALS['mybb']->user['usergroup'] == 4 || $GLOBALS['mybb']->user['usergroup'] == 5 || $GLOBALS['mybb']->user['usergroup'] == 6 then>Text will be shown to the usergroup ids declared in "if" clause" ie; 4,5,6</if>
Or
<if in_array($GLOBALS['mybb']->user['usergroup'], array(4,5,6)) then>
Text will be shown to the usergroup ids declared in "if" clause" ie; 4,5,6
</if>
-------------------------------------------------------------------------------------------
<if $GLOBALS['mybb']->user['usergroup'] != 4 && $GLOBALS['mybb']->user['usergroup'] != 5 && $GLOBALS['mybb']->user['usergroup'] != 6 then>Text will NOT be shown to the usergroup ids declared in "if" clause" ie; 4,5,6</if>
Or
<if !in_array($GLOBALS['mybb']->user['usergroup'], array(4,5,6)) then>
Text will NOT be shown to the usergroup ids declared in "if" clause" ie; 4,5,6
</if>
First of all, I was hoping for something I could do myself. But I tried it out, and just couldn't get the package to download properly from the site.
You need to register there. Sorry for that.