2013-03-06, 02:54 PM
Hey guys, I am trying to integrate MyBB into my website. So fare this is what
I got:
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.
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.