I am trying to verify whether or not someone is logged into the forum from outside the forum. I found the following article for phpBB2 - however it doesn't seem to work for phpBB3. Any thoughts on what to do to get it to work in phpBB3? Thanks.
Thanks for the article. I don't quite think it solves my dilemna though. I need to access the variables outside the phpBB instance. The article seems to explain how to access them from within the instance. Am I missing something???
Thanks -- I think it's getting there. So, I used the "if ($user->data['user_id'] == ANONYMOUS)" code from the article - but it's still not working. Do I need to call an additional function? The totality ofthe code is re-produced below. Thanks!
Does anyone happen to know how to navigate up the file structure through? I am using "../" and its not working. Is it OK to have the phpBB3 folder be in a completely different folder than the folder that is trying to access the variables?
My code is below:
Yes. Each ../ would go up one folder level.
Whether it works for you or not depends on your host's permissions at that level. If you are trying toi jump to another user or domain, it will probably not work.
I have a problem which is close to challenge described here. I have to login user on the page which is not within PHPBB and moreover, the user when he clicks on PHPBB link from my page should enter PHPBB and be already logged in. So I found the way to login user on my page, but I didn't manage to start session properly so that when the user leave my page it entered PHPBB already logged in.
Here is my code for logging an user in:
<?php
define('IN_PHPBB', true);
define('PHPBB_DB_NEW_LINK',true);
$phpbb_root_path = PHPBB_ROOT_PATH;
$phpEx = 'php';
include($phpbb_root_path . 'common.' . $phpEx);
$auth->login('username','password');
//after this I can see user data in $user variable - it's ok. But if user goes to some PHPBB page than, it have to login again.
?>