MyBB Community Forums

Full Version: Need a bit of help with an if statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to write an if statement to place on the index page, so that if a guest is viewing the page they see a welcome box with information, just below the header, otherwise the box is not displayed.

I know how to check the usergroup, but can't figure out how to code for the welcome box display.

Any help would be appreciated. This is what I have now:

<?php
define("IN_MYBB", 1);
require_once "./global.php";
if(!$mybb->user['uid']){
I'M LOST HERE;}
?>
echo "<html><div id=\"welcomebox\">";
echo "Welcome text.";
echo "</div></html>";
I don't think you need the <html> tags in KuJoe's suggestion
You don't, it all depends on the location of the if statement (whether the if statement is already located in <html> tags or not).
Thanks guys! I'm not much of a coder, but don't know why the heck I didn't think to use the echo function. Blush