[ phpBB - phpBB3 - Facebook - MOD - Tutorial ]


As of phpBB 3.5, this procedure is DEPRECATED, instead configure the native OAuth mechanism in phpBB administration (user interactions will be pretty the same).


This short tutorial will explain how to configure and install the phpBB3 Facebook Connect MOD.

At the beginning, I just made this MOD as a working proof-of-concept for making a Facebook Authentication plugin on phpBB (you can do it for anything you want: Twitter, OpenID, etc), using the Authentication Layer facilities provided by phpBB API.

But nobody took that work to do a REAL Facebook Connect MOD (ie including users registration), and users wanted more a full working MOD than a how-to-implement tutorial. Okay, okay, as you want...

So, you will find below an updated version of the original tutorial, and an updated version (compatible with Facebook Graph API and new Facebook PHP SDK) of the code provided on the previous tutorial. As people seemed to dislike it, I will talk less in this tutorial, and limit it to the basis to install the MOD. The code provided with this tutorial is widely commented, and is also as simple and basic as possible, you should be able to understand it and make the changes you want.

However, if you are interested in this MOD, don't hesitate to ask any question about it on the Forum. You can ask me in french or in english.

At the end of the tutorial, you will find references and documentations that could help you modify and improve this MOD.

IMPORTANT: This MOD does not provide (yet) users registration facilities for the phpBB forum, the user must have an account on the forum to link his forum account with his Facebook account.


This MOD is made around the authentication plugin, wich does the most of this MOD job.

To install this plugin, you need:

The user authentication follows this flowchart:

Note: If you want to move these files, don't forget to fix the $phpbb_root_path, otherwise the files could not include API key files and Facebook SDK !


Get the files

Download the files associated with this tutorial here, and unzip the tarball.

Make the Facebook Application

Here we are, now we have to register our aplication on Facebook, go on the Facebook Developers Application and create an aplication.

Follow the steps, and give your application a name. It could be your website name or whatever, this is what will be shown to the user when he asks for Facebook Connect for the first time on your website.

Great ! We are almost done, you can get the Facebook API ID and secret showed at the top of this capture, keep it for later.

Don't forget to expand the "Website" section to add your forum URL and domain.

Edit config.php

Once you have the API key and secret, you can edit the file includes/facebook/config.php to add these informations.

Alter the phpBB users database

Execute the following query on your database in order to create the column in the phpBB users table. You have to adapt it to your tables schema, if your tables' prefix is not phpbb_.

ALTER TABLE `phpbb_users` ADD `facebook_id` BIGINT( 20 );
ALTER TABLE `phpbb_users` ADD UNIQUE (`facebook_id` );

Copy the files on your server

You are done ! Copy the files on your server, merging the existing directories. You should not overwrite anything, because every file is a new file.

The user should be able to link his Facebook account with facebook/facebook_linking.php and log in with facebook/facebook_login.php.

Templates considerations


Notes and References

Creative Commons License