Drupal's forums not good enough?
While Drupal's forums function fine and provide simple forum functionality, many users want the advanced functionality and extra features that bulletin board applications such as phpBB provide. However, getting the two to work together can be a real pain. So here's a tutorial on integrating the two. In this example we use Drupal 4.7.x and phpBB 2.0.x. We can't guarantee that this tutorial will work for other versions, although it may be worth a shot. Finally, this tutorial assumes that you already have a working drupal installation.
Drupal settings - preparing Drupal for phpBB
The first thing you'll want to do is follow the below checklist to ensure that Drupal is ready for phpBB integration:
- Under administer -> settings -> general settings -> "clean url's" make sure clean URL's are enabled.
- Make sure your /files directory is accessible by chmod'ing its permissions to 777.
- Make sure you have the "profile" and "private message" (to take over phpBB's private messaging functionality) modules installed.
- Make sure you have avatars enabled: admin -> settings -> user -> pictures -> "enable"
- Drupal user 2 (accessible via /user/2) will be the super administrator of your phpBB forum, and they will need to have the same name in phpBB as they do in Drupal, so if at this time you need to change the name of user 2 do so (and remember the name for the phpBB installation below).
Obtaining and installing phpBB
Next you'll want to download phpBB from the phpBB siteand follow the steps below:
- Extract and upload the main forum directory (named "phpBB2" by default - you may change this to any name you wish, in this example we name it "forum") into your root Drupal directory.
- note: If you also have Drupal's native forum module installed don't name your phpBB installation "forum," as it will conflict.
- Within this directory, make the config.php configuration file write-able by chmod'ing it to 666.
- Browse to /<phpbb forum name>/install/install.php to begin phpBB installation.
phpBB Installation Steps
- Under "basic configuration," make sure the database type (ie. "MySQL 4.x/5.x") matches your Drupal database type.
- Under "database configuration," you'll want to use the same database, username, and password that your Drupal database uses.
- Leave the prefix for database tables as is ("phpbb_" by default).
- Under "admin configuration," enter an admin email address (usually the same as your Drupal admin)
- Important - if you are using .htaccess to specify a "www" vs. "non-www" redirect, that you enter the correct version here (otherwise you'll get redirect problems after installing)
- Enter the name and password of Drupal user 2 (/user/2) as your "Administrator Username" and "Administrator Password."
- Press "Start Install"
- If you see errors post below and we'll help you out.
- If installation was successful pat yourself on the back and proceed to delete your "install" and "contrib" directories before continuing.
Configure phpBB for integration with Drupal
Log into your phpBB administration panel, click "configuration" (under "general admin"), and change the following settings (leaving everything else as is):
- Note: If you have trouble logging in, access your phpBB forum installation directly by typing your forum name with a trailing slash (ie. example.com/forum/).
- Feel free to update "site name" and "site description" to reflect your site (optional).
- Enable account activation - change to "admin"
- Private messaging - set to "disabled" (we will be using Drupal's built-in PM module instead)
- Enable avatar uploading - change to "yes"
- Avatar storage path - change to "../"
- And finally - specify your email signature (optional).
- Click "submit" to save changes.
Installing and configuring Drupal's "phpbb" module
Next you'll want to download and install Drupal's phpbb module. Once installed:
- Browse to admin -> settings -> phpbb and adjust "location" and "absolute path" of phpbb to reflect your phpBB's installation directory.
- Browse to admin -> access control and grant access to "administer phpbb" for the admin role of user 2 (and whomever else you assign as administrator for the forum).
- Copy the file "phpbb.htaccess" from the phpbb module directory to your phpBB forums' root directory and rename it to ".htaccess".
Good to go!
At this point everything should be working. You can test the setup by logging out of your forum as well as your Drupal site; logging back into Drupal as user 2 and then accessing the forum. You should automatically be logged in as forum super admininstrator and see a link allowing you to access phpBB's administration panel.
Assigning Multiple Administrators (Optional)
At this point you can log in as user/2, go into your phpBB administration panel, and from there click on "Go to Administration Panel," and take the following steps to create an "Administrator" group:
- Click on "Management" under "Group Admin" at left
- Click "create new group", give the group name "Administrators," type the name of user/2 as moderator (since the super admin should moderate admins), and mark the group as "hidden." Click "submit."
- Browse to "Permissions" under "User Admin," type the name of a user you'd like to promote to administrator, and click "Look up user."
- On the next screen select "Administrator" from the "User Level" drop-down box at top left, and click "Submit."
- Voila - that user is now an admin, and upon logging in to Drupal and accessing your phpBB forum will see the "go to Administration Panel" link at bottom.
Troubleshooting
If you're having troubles, please post below.
How come my BBCode in Drupal
How come my BBCode in Drupal doesn't work after following this walkthrough? My users are Pi$$ed that they can't have nice signatures
Thanks for the guide btw its very clean and informative!
No troubles. Thanks
I installed following this steps and all works fine. I like it!!! cool
How can I get the avatar storage to change?
Thanks for the guide! Everything is working great for the integration except...
...I can't get the "avatar storage path" to stick with just ../ as it doesn't seem to like it for whatever reason. I put in the ../files/userpics (which is where I have drupal set to store avatars and it accepts that.
Except now, it views my user's pics as X boxes, because of course it thinks the links back to the pictures are *host*/files/userpics/files/userpics/example.jpg instead of what it should be.
Can you give me any advice on this problem?
Thanks!
How many directories down
How many directories down from your root is your forum located? For example, if your forum is at example.com/forum/ you can access the files directory via ../files. However, if your forum is at example.com/dir/forum, you'll need to go up two directories by using ../../files (you go up one directory for each ../).
If that doesn't work, have you tried using an absolute path - ie. http://www.example.com/files/userpics?
Include Errors
After saving the paths for the phpbb module, I login and get [function.include] errors.
I have drupal in the root of my site and the forum in /forum/ am I sposed to have the forum in /forum/phpBB2/ ?
warning: include(/forum/config.php) [function.include]: failed to open stream: No such file or directory in ...an.com/modules/phpbb/phpbb.module ... line 304
and
warning: include() [function.include]: Failed opening '/forum/config.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in ...an.com/modules/phpbb/phpbb.module on line 304.
i don't fully understand these, other than , it cannot find the file. Can someone please care to help me out.
Thanks
Drupal could be confusing
Drupal could be confusing the native Drupal forums at /forum/ with your phpBB2 installation. Try installing to an entirely separate directory such as /forum2/
PHP is new to me but I got
PHP is new to me but I got it fixed by manually including the variables from the config file into the .module. Though I wouldn't recommend this as it will brake if you move databases.
Does anyone know how exactly I put the forum into an iframe in drupal so it has better integration. I've seen it done on the Norwegian example sites.
thanks
phpbb iframe code
You'll want to place a div around it to control its location and positioning, and you'll probably want to get rid of the borders. Here's an example:
<div style="height: 600px;"><iframe width="100%" height="100%" frameborder="0" src="/phpbb/" border="0"> </iframe></div>But where?
I also want to know about how to make mine like the Norwegian example sites. I see the code, but where do I put that code? In the drupal template page.tpl.php file? Or...???
Placing the code
If you want it to appear on every page of the site you could place it in the page.tpl.php file. If you want it on one page only, place it in the node you'd like the iframe to appear in, making sure the input format is "full html" or higher to allow iframes.
You can also control its appearance by placing it in a block, or writing conditional statements in your page.tpl.php or node.tpl.php file. Finally, you could write a function and place it in your template file and call it from your theme files.
ERROR :( have tried twice
please help.. i really need this to work. i get this error message.
Query failed: Unknown column 'user_level' in 'field list' UPDATE phpbb_users SET `user_password`='3ee466638afdccd16da7a8314c7893da', `user_level`='1', `username`='admin_phpbb' WHERE `user_id`=2
this is what i get when i try to log into drupal as user number 2.
then if i hit the back button get a few more of similar errors and then get sent to the front page.
if i try to go to phpBB3 i am not logged in as admin_php.
where did i go wrong?
thanks
Richard
phpBB version?
What versions are you using of the following:
- Drupal
- phpBB
- phpBB drupal module
Cant see phpbb on drupal->settings
I am not able to see phpbb in the settings page. I have enabled it. I dont know where am I going wrong.
I am not able to do this step.
---- Browse to admin -> settings -> phpbb and adjust "location" and "absolute path" of phpbb to reflect your phpBB's installation directory.
Please help me.
Thanks,
Nithin.
-Bluminut.
Drupal and phpBB versions?
What versions of phpBB and Drupal are you using?
When I activate phpbb module
When I activate phpbb module I get this message:
user warning: Table 'mysite_db.phpbb_users' doesn't exist query: SELECT user_unread_privmsg FROM phpbb_users WHERE user_id = 2 in /home/mysite/public_html/includes/database.mysql.inc on line 172
What did I do wrong? I have 200 something users in my drupal website and I want to start new phpBB forum.
delete or shift existing phpbb users
Hi,
is is possible to shift the existing users in the db of phpbb and add 50 to all of them? E.g. user_id 3 is google bot. That should be user_id 53. Why these users already exists after installation?
Because I have already 20 user in my drupal installation and can't shift these.
Cheers
Belo