This article is a follow up to the article I wrote about integrating the phpBB 3 login with your site.You can find that article here. This time I'd like to take it a little bit further and take a look at what we can do once our user is logged in. I'm going to assume you have sufficient knowledge of PHP to understand the code and, at least, the basics of object orientated programming in PHP. I'm also assuming you have a fully functioning and installed phpBB 3 forum at the point.
To go further into the topic, we'll need to be able to access the data for our user(s). To do this, we have to use the user object and access it's data member which, predictably, holds all the user data. Here's the piece of code we'll need every time we want to use the phpBB user system in our pages. I'll explain the source code after.
0: define('IN_PHPBB', true);
1: $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '/PATH/TO/FORUMS';
2: $phpEx = substr(strrchr(__FILE__, '.'), 1);
3: include($phpbb_root_path . 'common.' . $phpEx);
4: include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
5: // Start session management
6: $user->session_begin();
7: $auth->acl($user->data);
More...