Phenex Posted June 17, 2007 Share Posted June 17, 2007 Ok. I found the info to create custom pages and add them onto the forum. But I want to add to the code on that page to check if the user is registered. I had figured out once a while back what code peaces to use but I lost the info and it is not on here any more. If someone either has that or can help me out that would be great cause honestly I don't remember how I managed to do it LOL. Here is the page I found and downloaded to add in custom pages: <? /-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-= * info.php * ------------------- * author : Roy Dings (Lithium * email : XGE_Lithium@hotmail.com * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // // // Start output of page // $page_title = $lang['Index']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'info_body.tpl') ); // // Generate the page // $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> I figure someplace right after the end session management I need to add this code in. Thanks Quote Link to comment Share on other sites More sharing options...
Phenex Posted June 26, 2007 Author Share Posted June 26, 2007 64 people have looked at this and no one has an idea??? *sigh* guess I am in the same boat as last time and will have to do it on my own again which took me weeks to figure out. I had hoped I could get this taken care of sooner as I kinda need it asap. thanks anyway I guess. =( Quote Link to comment Share on other sites More sharing options...
jhenary Posted July 6, 2007 Share Posted July 6, 2007 <?php define('IN_PHPBB', true); $phpbb_root_path = './phpBB2/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // if($userdata['session_logged_in'] and $userdata['user_active']=1) { echo('Hi ' . $userdata['username'] . '!'); } else { echo"Not authorized"; exit(); } ?> Here is the code I use at the top of all my pages using the phpbb login system. "user_active" is the field that lets you know if someone is registered, 0 for no and 1 for yes. This may or may not work, since I'm new that "=1" may be a problem, leave it out if it is. On the script I use I check that they are logged in AND what their user level is before displaying something rather than logged in and registered. User level being a field I added myself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.