MyBB Community Forums

Full Version: Conditional statement in header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've modified the header template of my mybb to fit the rest of my site, but I need to make a conditional modification now.

I'm basically trying to get mybb to print different options in the custom header, based on whether or not the user is logged in. The PHP code looks something like:

PHP Code:
if (isset($_COOKIE["mybbuser"])) {

          
// Echo the custom header, with an extra "Account" option

} else {

          
// Echo the standard header



Is there any way to do this from the Admin CP, or will I have to modify the PHP scripts themselves?

~ Wogan
OMG, no way.

I answered my own question. Never mind.

Maybe I should stop asking silly questions, heh...

~ Wogan
BTW, that's not difficult to trick - though probably not a big issue.

Generally recommend:
PHP Code:
if($mybb->user['uid']) {
 
// user is logged in
} else {
 
// we have a guest

Reference URL's