Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Page with restrictions

Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
Board Member

Joined: 26 Aug 2012

Posts: 1

PostPosted: Sun Aug 26, 2012 3:58 pm 
Post subject: Page with restrictions

Hi everyone, I hope you can help me because this is the first time I try to modify phpBB code and I have a lot of problems and questions. icon_redface.gif

I'm trying to create a new page only for users logged in in phpBB2+Nuke. I've found this code:

define('IN_PHPBB', true);
$phpbb_root_path = 'MyPathTophpBBroot';
$phpEx = "php";
include($phpbb_root_path . 'common.'.$phpEx);

// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
// End session management

// now a phpBB session is established for this page run and....
// we have access to some phpBB facilities and variables

if( $userdata['session_logged_in'] )
        echo "Welcome " . $userdata['username'];
        echo "You are Anonymous - please register or login.";


but it gets only a white page... icon_sad.gif

Could anyone tell me if it is correct, please?
"MyPathTophpBBroot", if my forum index page is MYSITE/forums.php and this page I'm trying to create is MYSITE/pagetest.php, needs to be changed with "./", right? icon_rolleyes.gif

Thank you in any case. =)
Back to top
Board Member

Joined: 24 Jul 2008

Posts: 668
Location: Texas

PostPosted: Mon Aug 27, 2012 8:57 pm 
Post subject: Re: Page with restrictions

What do you get if you dump (using the array print function print_r()) the $userdata array immediately after the call to session_pagestart?
phpBBDoctor Blog
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0272 seconds using 15 queries. (SQL 0.0020 Parse 0.0008 Other 0.0243)
phpBB Customizations by the
Template Design by DeLFlo and Moments of Light Logo