polar

Integration with PHPBB3 Forum System

The latest incarnation of the PHPBB forum system has been released for a short time now. Unfortunately there is still little in the way of an API for manipulating the user base of the forum system to allow it to synch with an external application.

To this end, we produced a small class that takes care of pushing manipulations to the PHPBB3 forum system.

The functionalities included are:

  • Add a user to PHPBB3
  • Change users password on PHPBB3
  • Disable/ban user on PHPBB3
  • Enable/un-ban user on PHPBB3

The class maintains an internal MySQL connection to avoid interfering with your applications connections.

Usage Examples

Add New User:

require (FILE_ROOT . ‘forumIntegration/PHPBB3Integration.php’);
$forum = new Phpbb3Integration ( );
$forum->connect ( BBDBSERVER, BBDBUSER, BBDBPASS, BBDBNAME );
$forum->addNewUser ( $user->getUsername (), $user->getPassword (), $user->getEmailAddress (), $user->getRegistrationIp () );

Change Users Password:

require (FILE_ROOT . ‘forumIntegration/PHPBB3Integration.php’);
$forum = new Phpbb3Integration ( );
$forum->connect ( BBDBSERVER, BBDBUSER, BBDBPASS,BBDBNAME);
$forum->changeUserPassword($user->getUsername (), $user->getPassword ());

Disable User:

require (FILE_ROOT . ‘forumIntegration/PHPBB3Integration.php’);
$forum = new Phpbb3Integration ( );
$forum->connect ( BBDBSERVER, BBDBUSER, BBDBPASS, BBDBNAME );
$forum->disableUser ( $user->getUsername (), $user->getEmailAddress () );

Enable User:

require (FILE_ROOT . ‘forumIntegration/PHPBB3Integration.php’);
$forum = new Phpbb3Integration ( );
$forum->connect ( BBDBSERVER, BBDBUSER, BBDBPASS, BBDBNAME );
$forum->enableUser ( $user->getUsername () );

Download the source code >>

Stumble it!

9 Responses to “Integration with PHPBB3 Forum System”

  1. K reeve Says:

    is it possible to get Login and Logout added to the class?

    Thanks for what there is so far :)

  2. Rashid Idris Says:

    Thanks for providing such a useful resource. I was looking for something like this.

  3. Zhoz Says:

    Wow great stuff!.. I agree with 1st poster totaly…

    Keep it going man!

  4. acctman Says:

    does anyone know how to automactically set auto login

  5. fara Says:

    i’m not very good in programming..cz i’m quite new in php..but i have to do this for my class project.. how to use this code actually? do i have to create class or anything?

  6. admin Says:

    Hello and thanks for your comments.

    @K Reeve: We let them use the forum login directly so we have no plans to do this currently.
    @acctman: Sorry no idea - but if you crack it please post a link here :-)
    @Fara: You can copy the usage examples pretty much as they are, you can download the source code at the bottom of the post too.

    Thanks

  7. bry Says:

    Awesome script, been looking all over for this. Only problem im having, one of many, is first of all, after placing the phpbb3integration.php file in the main directory, do i place the add user snippet you have above on my join.php page? any help would be apprec, thanks alot

  8. davernginzks Says:

    I’ve recently joined and wanted to introduce myself :)

  9. japdoofido Says:

    Hi all!
    Excellent site with fantastic references and reading…. well done indeed…!
    Excellent forum, added to favorites!
    Thank you!

Leave a Reply