+ Reply to Thread
Results 1 to 7 of 7

Thread: Integrating PHPBB 3

  1. #1
    xav0989's Avatar
    xav0989 is online now Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    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 11:58 AM. Reason: php code update/upgrade

  2. #2
    cowctcat's Avatar
    cowctcat is offline x10 Lieutenant cowctcat is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    In front of a computer
    Posts
    401

    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

  3. #3
    JuniorD's Avatar
    JuniorD is offline x10 Elder JuniorD is an unknown quantity at this point
    Join Date
    May 2008
    Location
    Behind you. Occupations: Student, Lazy Hobo, Homicidal Maniac.
    Posts
    563

    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

  4. #4
    LHVWB's Avatar
    LHVWB is offline Lord Of The Keys LHVWB is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    1,308

    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/

  5. #5
    jozef36 is offline x10Hosting Member jozef36 is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    1

    Re: Integrating PHPBB 3

    thank you very much!:D

  6. #6
    callumacrae's Avatar
    callumacrae is offline not alex mac callumacrae is just really nice
    Join Date
    Dec 2007
    Location
    Wellesbourne, England
    Posts
    5,162

    Re: Integrating PHPBB 3

    Nice tutorial.

    It took me 3 months to work that out, and then someone makes a tutorial on it
    I can customise your phpBB board. Send me a PM.
    lynxphp - info, tutorials and scripts
    "A forum post should be like a skirt; long enough to cover the subject but short enough to keep things interesting."

  7. #7
    LHVWB's Avatar
    LHVWB is offline Lord Of The Keys LHVWB is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    1,308

    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 to Thread

Similar Threads

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers