Home > Web Tutorials > Integration with PHPBB3 Forum System

Integration with PHPBB3 Forum System

Written by | April 3rd, 2008
View the conversation - Join the chat -

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

If you enjoyed this post then why not share it:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Faves
  • StumbleUpon
  • Symbaloo
  • LinkedIn
  • MisterWong
  • email
  • Reddit
  • Simpy

Related posts:

  1. Popular blog posts 2008

Web Tutorials

  • K reeve

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

    Thanks for what there is so far :)

  • Rashid Idris

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

  • Zhoz

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

    Keep it going man!

  • acctman

    does anyone know how to automactically set auto login

  • fara

    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?

  • admin

    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

  • http://www.freshexams.com bry

    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

  • davernginzks

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

  • japdoofido

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

  • HSCharles

    I have a flash site
    i’m looking for the script who makes google adsense with flash.
    can you give me the link?

  • Tim Charles

    Just installed this – many thanks for creating it. Looks like it will do exactly what I want. However, I ran it and it put the user onto my forum (phpbb3) and I could see it. However I could not log in as this user. Any ideas on what Im doing wrong?
    Thanks.

  • cemLalsesep

    Hi,

    I’ve just joined this website

    There are some great articles here to learn

    I’ve just created a website and am hoping to use these SEO methods

    will like to make some new friends along the way

    Thanks everyone

  • laxmi manoaharan

    i want a design for forum integration system

  • Rudy

    Very nice app… It would be useful if the AddUser function returned the user_id…

  • Rudy

    The “username_clean” in this script is incorrect…

    In createSqlToAddUserRow “username” & “username_clean” are both given the same value ($username) and it’s possible they are not…

  • MichaellaS

    tks for the effort you put in here I appreciate it!

  • Giulio Pons

    I've used your class to write a tutorial. It also deals with login and logout funcitons: http://www.barattalo.it/2010/0…/