MyBB Community Forums

Full Version: Conditional Statements
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way to add conditional statements to my forum? For example, if a user is logged in I would like to display a mini control panel in the top right of the screen. If they're not logged in, a large prompt to either join now (or sign up).

Any documentation on this?

Thanks very much.
you can add it to the header_welcome_block_guest and header_welcome_block_member templates, but it would need either fit in that output.

perhaps you can make it work with Javascript so that the member template adds simple JS command to set the mini control panel to visible once the page loads
Yes, either use the header_welcomeblock templates or download and install PHP in Templates:

http://mybbhacks.zingaburga.com/showthread.php?tid=260
(2012-11-29, 03:34 AM)Tecca Wrote: [ -> ]Yes, either use the header_welcomeblock templates or download and install PHP in Templates:

http://mybbhacks.zingaburga.com/showthread.php?tid=260

he'd be better off with the simple Template Conditionals plugins instead of the full blown PHP in Templates
Ok, I will check these out - thank you. I'm looking at the templates and I notice that the panel div calls (I believe) something called $welcomeblock.

<div id="panel">
    {$welcomeblock}
</div>

What is this and where is it located? This changes based on whether the user is logged in or out, right? How does that work?

Thanks very much!!
$welcomeblock is defined in the code and selects from header_welcomeblock_guest and header_welcomeblock_member templates. the mod and admin links are optional based on permissions.