phpBB2Refugees.com Logo
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
EragonItalia
Board Member



Joined: 26 Aug 2012

Posts: 1



PostPosted: Sun Aug 26, 2012 11:58 am 
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:
Code:
<?php

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);
init_userprefs($userdata);
//
// 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'];
    }
else
    {
        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
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 729
Location: Texas


flag
PostPosted: Mon Aug 27, 2012 4: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 - 4 Hours
 
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.0406 seconds using 16 queries. (SQL 0.0111 Parse 0.0009 Other 0.0286)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo