MyBB Community Forums

Full Version: MyBB Integration ... users never logged in
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I am trying to integrate MyBB into my website. So fare this is what
I got:

<?
// MyBB Stuff
chdir('board/');
define('IN_MYBB',1);
include("./global.php");
chdir('../');

// If the UID is not = to 1 we redirect the user to the board untile the website is over
if ($mybb->user["uid"]!="1"){
    //header("location:/board/");
}

$page = "<html>
<head>
<title>{$title}</title>
{$headerinclude}
</head>
<body>
{$header}
Your content here...
{$footer}
</body>
</html>";

output_page($page);

echo "<pre>";
print_r($mybb->user);
echo "</pre>";
?>

The page works fine but the problem I have is that the $mybb->user["uid"] is always = to 0 like if the user was not logged in even thought that he is. When i open up the board the user is recognised.

What am I missing?

I found my problem. You need to change the path of the cookie in the board settings to / and not to the path of the board.
Hmm so if they are not logged in, does it rederict them?