WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] phpBB 3 sessions - How to? (4 posts)

  1. Scofield
    Member
    Posted 4 years ago #

    Hello all, I have a little question.
    How to use phpBB 3 sessions in to wordpress site?

    Where I must put this code ? I need phpBB3 sessions on every WP page

    <?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();
    ?>

    Thanks :)

  2. Scofield
    Member
    Posted 4 years ago #

    Now I have added this to pluggable.php
    On top

    define('IN_PHPBB', true);
    $phpbb_root_path = '../forum/';    //Path to forum
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    
    // Start session management
    $user->session_begin();
    $auth->acl($user->data);
    $user->setup();

    and of course phpBB funcion

    function phpBB() {
    global $phpbb_root_path, $phpEx, $user, $auth, $template, $cache, $db, $config;
    // Start session management
    //$user->session_begin();
    //$auth->acl($user->data);
    //$user->setup();
        if ($user->data['user_id'] == ANONYMOUS)
        {
           echo 'Please login!';
        }
        else
        {
           echo 'Thanks for logging in, ' . $user->data['username_clean'];
        }
    
    }

    And to my sidebar (template file) I add
    <?php echo phpBB();?>

    And now, when I am not logged in on the forum it display me on WP site
    Please login!
    But when I am logged in and then go to my WP site its automaticaly logged out me :(

    Why please? Thanks

  3. Scofield
    Member
    Posted 4 years ago #

    Bump
    Nobody knows how to add phpbb3 sessions to WP? :O

  4. kakajoe
    Member
    Posted 4 years ago #

    Bump

Topic Closed

This topic has been closed to new replies.

About this Topic