I have search here and found a topic about using PHPbb sessions on an existing site:
this link - http://www.phpbb.com/kb/article/phpbb3- ... tegration/
I followed the tutorial however I get an error "Call to a member function on a non-object",
It points to this line: $user->session_begin();
Here is the code I have used:
Code: Select all
<?php
Include("site_settings.php");
define('IN_PHPBB', true);
$phpbb_root_path = (defined('http://forum.world-recoded.co.uk')) ? http://forum.world-recoded.co.uk : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
The code I am using to check a logged in user is this:
(Modified to check whether or not it is disabled using $settings['EnableLogin'] )
Code: Select all
<?PHP
if ( $settings['EnableLogin'] == TRUE ) {
if ($user->data['user_id'] == ANONYMOUS)
{
echo 'Please login!';
}
else
{
echo 'Thanks for logging in, ' . $user->data['username_clean'];
}
} else {
Echo "Login Closed";
}
?>
This is a link to my sandbox testing page - You can see the error.. Here
Cheers,
Saldash