MyBB Community Forums

Full Version: Conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I create conditions to display different banners to different usergroups. On my other site running vb (i know i'm always comparing vb and mybb), I use this type of code:

<if conditional="is_member_of($bbuserinfo, array(6,7))">
banner1
<else />
<if conditional="is_member_of($bbuserinfo, array(5,4))">
banner2
<else />
<if conditional="is_member_of($bbuserinfo, array(4,3))">
banner3
<else />
banner4
</if>
</if>
</if>
I think the vBulletin theme that someone posted here allows such conditionals within the templates, but in MyBB by default these conditionals do not exist in the templates.

You have to do the conditionals in PHP to the .php pages that you want it to show up on, and ask it to retrieve the various templates, or set a variable to whichever banner you want to show up and include the variable in the template.