user session of phpBB

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
bardosoft
Registered User
Posts: 69
Joined: Sat Dec 15, 2007 8:12 pm
Contact:

user session of phpBB

Post by bardosoft »

Hi

How can do the integration of user sessions of phpBB to my site?

thank's
BS Video Saver <=- Video downloader
BS Video Saver Community <=- Our Community
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: user session of phpBB

Post by Erik Frèrejean »

Include:

Code: Select all

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../forum/'; // Change in your own root path
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data); 
on top of your php file.
You can't send any data to the browser before this code!
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
bardosoft
Registered User
Posts: 69
Joined: Sat Dec 15, 2007 8:12 pm
Contact:

Re: user session of phpBB

Post by bardosoft »

how to use this code ?

(know the user name, for example)
BS Video Saver <=- Video downloader
BS Video Saver Community <=- Our Community
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: user session of phpBB

Post by Erik Frèrejean »

A little example code:

Code: Select all

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../forum/'; // Change in your own root path
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);

// Print all the user data
echo'<pre>';
print_r($user);
echo'<pre>';

// Print the user name
print ($user->data['username']); 
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
bardosoft
Registered User
Posts: 69
Joined: Sat Dec 15, 2007 8:12 pm
Contact:

Re: user session of phpBB

Post by bardosoft »

Thank's ;)
BS Video Saver <=- Video downloader
BS Video Saver Community <=- Our Community
bardosoft
Registered User
Posts: 69
Joined: Sat Dec 15, 2007 8:12 pm
Contact:

Re: user session of phpBB

Post by bardosoft »

I receive this error message:
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /media/160go/hebergement/bs.goldzoneweb.info/index.php:19)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /media/160go/hebergement/bs.goldzoneweb.info/index.php:19)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /media/160go/hebergement/bs.goldzoneweb.info/index.php:19)

why :?:
BS Video Saver <=- Video downloader
BS Video Saver Community <=- Our Community
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: user session of phpBB

Post by Erik Frèrejean »

Erik Frèrejean wrote:You can't send any data to the browser before this code!
You send some data to the browser before you start the phpbb session (empty lines are also data!). This happens in index.php on line 19.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
allanhardy
Registered User
Posts: 197
Joined: Sun Dec 15, 2002 4:20 am

Re: user session of phpBB

Post by allanhardy »

Erik

How on earth did you decipher this:
bardosoft wrote:Hi
How can do the integration of user sessions of phpBB to my site?
thank's
To know what was being asked for?
bardosoft
Registered User
Posts: 69
Joined: Sat Dec 15, 2007 8:12 pm
Contact:

Re: user session of phpBB

Post by bardosoft »

thank's
BS Video Saver <=- Video downloader
BS Video Saver Community <=- Our Community
User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: user session of phpBB

Post by Erik Frèrejean »

allanhardy wrote:Erik

How on earth did you decipher this:
bardosoft wrote:Hi
How can do the integration of user sessions of phpBB to my site?
thank's
To know what was being asked for?
Well it isn't such a strange sentance (for a non English person :))
And when people write about session of phpBB, integration and site in one sentence they mostly mean this :).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)
Locked

Return to “[3.0.x] Support Forum”