x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Reply
 
LinkBack Thread Tools Display Modes
x10 Sophmore

Join Date: Jul 2008
Posts: 144
Credits: 1,619
xav0989 is on a distinguished road
Quote  
07-09-2008, 12:53 PM
Integrating PHPBB 3

We can use the login/session manager in phpbb 3 as our main sitewide login system. This way, we only have to include the php to link our files with the phpbb session manager, and not write it ourself (hours of debuging spared... trust me!)

Here is the code that should be in the file config.php, placed in your root website directory (accessible on the web)
Place the following code in it and modify it so that it is configured for your installation.
PHP Code:
<?php
// config.php
define('IN_PHPBB'true);
$phpbb_root_path 'phpBB3/'//modify this to point to the root path of your phpbb 3 installation.
$phpEx substr(strrchr(__FILE__'.'), 1);
include(
$phpbb_root_path 'common.' $phpEx);
include(
$phpbb_root_path 'includes/functions_display.' $phpEx);

// Start session management

$user->session_begin();
$auth->acl($user->data);
$user->setup();
?>
Now this is the code of a page that displays some information to logged in users.
PHP Code:
<?php
//check_user.php
require_once 'config.php';
?>
<html>
<head>
</head>
<body>
Some content
<?php
if($user->data['is_registered'])
{
     
//user is logged in
     
echo 'Welcome back, ' $user->data['username'];
} else
{
     
//user is not logged in
?>
Please log in:<br />
<form method="POST" action="./<?php echo $phpbb_root_path ?>ucp.php?mode=login">
<p>Username: <input type="text" name="username" size="40"><br />
Password: <input type="password" name="password" size="40"><br />
Remember Me?: <input type="checkbox" name="autologin"><br />
<input type="submit" value="Submit" name="login"></p>
<input type="hidden" name="redirect" value="index.php">
<!-- The value off the redirect hidden input may be modified, 
but you need to keep in mind that the wording directory will 
be not the directory of the script, but of the forum. -->
</form>
<?php
}  
?>
More content
</body>
</html>
You find my post helpful, donate or add me rep.

Last edited by xav0989; 07-09-2008 at 12:58 PM. Reason: php code update/upgrade
Reply With Quote
xav0989 is offlineReport Post
x10 Lieutenant

cowctcat's Avatar

Join Date: Nov 2007
Posts: 392
Credits: 5,207
cowctcat will become famous soon enough
Location: In front of a computer

Send a message via AIM to cowctcat
Quote  
07-11-2008, 05:20 PM
Re: Integrating PHPBB 3

I moved it to Tutorials. Please post a new thread in Programming Help if you still need Programming Help. :D
__________________
--cowctcat
Senior Mod
Reply With Quote
cowctcat is offlineReport Post
x10 Elder

JuniorD's Avatar

Join Date: May 2008
Posts: 512
Credits: 15,602
JuniorD will become famous soon enough
Location: Behind you. Occupations: Student, Lazy Hobo, Homicidal Maniac.

Quote  
07-11-2008, 05:29 PM
Re: Integrating PHPBB 3

not bad. now if you make one of these tuts for smf I may be interested. :D

Nice tut. Im pretty bad at php myself but I give it a 8.5/10 (I personally hate tuts that give you all the coding you need.)
__________________


ExchangeCore is open! Get free website services from the link below!
http://exchangecore.com
Reply With Quote
JuniorD is offlineReport Post
Lord Of The Keys

LHVWB's Avatar

Join Date: Jan 2008
Posts: 1,280
Credits: 9,231
LHVWB is a jewel in the rough
Location: Australia

Send a message via MSN to LHVWB
Quote  
07-14-2008, 07:30 AM
Re: Integrating PHPBB 3

Quote:
Originally Posted by JuniorD View Post
not bad. now if you make one of these tuts for smf I may be interested. :D
If you need something for SMF, then I will be able to help you. Just give me a PM.

Have a look at this link for reference.

Here is a link to a very similar tutorial to this one on the phpbb3 website, for people who also want another reference.

http://www.phpbb.com/kb/article/add-...page-to-phpbb/
Reply With Quote
LHVWB is offlineReport Post
x10Hosting Member

Join Date: Jun 2008
Posts: 1
Credits: 208
jozef36 is on a distinguished road
Quote  
07-15-2008, 09:46 AM
Re: Integrating PHPBB 3

thank you very much!:D
Reply With Quote
jozef36 is offlineReport Post
x10 Elder

Join Date: Dec 2007
Posts: 529
Credits: 6,061
Alex Mac is just really nice
Location: Wellesbourne, England

Send a message via ICQ to Alex Mac Send a message via AIM to Alex Mac Send a message via MSN to Alex Mac Send a message via Yahoo to Alex Mac
Quote  
07-15-2008, 12:16 PM
Re: Integrating PHPBB 3

Nice tutorial.

It took me 3 months to work that out, and then someone makes a tutorial on it :(
__________________
Post on my forum: 1000 credits



Reply With Quote
Alex Mac is offlineReport Post
Lord Of The Keys

LHVWB's Avatar

Join Date: Jan 2008
Posts: 1,280
Credits: 9,231
LHVWB is a jewel in the rough
Location: Australia

Send a message via MSN to LHVWB
Quote  
07-24-2008, 06:47 AM
Re: Integrating PHPBB 3

Quote:
Originally Posted by Alex Mac View Post
Nice tutorial.

It took me 3 months to work that out, and then someone makes a tutorial on it :(
The trick with this sort of stuff is to ask someone or do a long search for it, because most of the time somebody else has done it. If you are really lucky they have made an awesome tutorial or mod to show you how to do it easily.
Reply With Quote
LHVWB is offlineReport Post
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
phpBB Installtion and Mod Installation sk1tL1L The Marketplace 5 12-15-2007 07:48 PM
phpBB3 Gold Released CrownVictoriaCop Computers & Technology 2 12-13-2007 05:05 PM
PHPBB Problem *Please Help* eportalstaff Free Hosting 3 10-14-2007 10:36 AM
phpBB 2.0.22 released monky91 Off Topic 5 12-26-2006 06:11 PM
phpBB 2.0.17 released n4tec Scripts & 3rd Party Apps 0 07-26-2005 08:38 AM


All times are GMT -5. The time now is 05:39 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Bad Credit Mortgages | Stardoll | Buy Shares | Loan | Myspace Codes