Constant Contact E-Newsletter Service - get 60 days free!

Constant Contact has been in business since 1996 is one of the most reliable and trusted email marketing services around. Click here to activate your free 60 day trial courtesy of CWD Community.

Restore Images on your Digital Camera Card

Uh oh - you just took a bucketful of honeymoon photos and towards the end of the trip your friend borrows the camera and accidentally formats the memory card.  Ahhhhh!!!  Don't freak out yet. Check out Disk Doctor and get $5 off as a CWD visitor. It just may save the day.



Jun 15 2007

Integrating phpBB with Drupal


Filed under: Content Management Systems » Drupal,
Tools:

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.

Average: 4.5 (11 votes)
Select your preferred way to display the comments and click "Save settings" to activate your changes.

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 Smiling

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="#" border="0"> </iframe></div></code>

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

Tweak Drupal's user

Tweak Drupal's user sequence. phpBB creates users for the different search engines. Their user id will overlap with users in Drupal, so we need to make sure Drupal does not overwrite them.

Use something like phpMyAdmin to look at the table "drupal_sequences", and update the row with name "drupal_users_uid" to have id = 1000:

UPDATE `databasename`.`drupal_sequences` SET `id` = '1000' WHERE `drupal_sequences`.`name` = 'drupal_users_uid' LIMIT 1 ;

Note: If you are starting with a database that already has users, just make sure the sequence number is set to something higher than the largest existing user id, and leave at least 50 to spare.

-Daniel

Thanks Daniel

Good tip! Thanks Daniel.

Cheers,
CWD Team

Auto Logging In/Out?

Heya,

I had this module installed and working properly. Our DNS was moved over from a .us to .com, and now phpBB will not keep me logged in, any ideas??

Thanks!

Check phpBB Settings

Hi there,

It sounds like the domain name is stored somewhere. Check your phpBB settings and make sure the domain extension is updated. You might also want to make sure your browser is allowing cookies for the .us domain.

vBulletin with Drupal?

phpBB is okay, but I prefer the stability and security of vBulletin. Is it possible to use vBulletin with Drupal as well?

vB to Drupal Import

The synchronization that is possible between phpBB and Drupal (ie. having users register in one place and automatically be signed in to both) does not yet exist with vBulletin. It is possible, however, to import your vBulletin data into native Drupal forum's using the vBulletin to Drupal module.

phpBB won't stay logged in?

I had this module installed and working properly. Our DNS was moved over from a .us to .com, and now phpBB will not keep me logged in. Any ideas?

phpBB and Drupal

Nice article, although I'm starting to get fed up with all the errors I'm getting. Has anyone tried integrating another forum software with Drupal? Any success?

Wordpress

I will opt for WordPress as it is most effective in Internet marketing...

Back to Wordpress

Well I'm thinking about moving back to Wordpress. Somebody says to me that Drupal is more expandable and has a large support and knowledge on the Net, but I'm facing one problem after another. Don't get me wrong, your post is great, but I'm getting a little confused in some places.

Back to Wordpress as well

Great post very useful info, but I'm agreeing with the last comment. After trying Drupal for two weeks I'm tired of these problems, problems and more problems. Even with all this support, when I fix something I get a new problem. I will go back to Wordpress now.

Drupal is the best CMS

I found this module really great! It works on me properly. I really prefer Drupal more than any other CMS. Great post!

bbpress?

What about bbPress (the relatively new Wordpress forum)? Is there a way to display bbPress forum comments/ posts in the sidebar of a Drupal site?

bbPress and Drupal

Great question - we actually use bbPress as you'll see if you visit our forum Smiling

It's a great, lightweight, and SEO-friendly forum. However, we're unaware of any Drupal plugins at this time, probably due to it being so new. But look for one to be developed soon!

I installed following this

I installed following this steps. It worked very easily. Thanks for the post.

Regards,
Earvin James

Thank you

This is great. Thanks so much for sharing. I loved the advice!

Easy Install

I installed following this steps. It worked very easily. Thanks for the post.

This is great.

This is great. Thanks so much for sharing. I loved the advice!

Who knows where to download XRumer 5.0 Palladium?

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

lol @ forum plug

bbPress conversation conveniently placed inside this topic by all anonymous users is an obvious plug for a new forum on a different site. I suggest each of those posts being deleted for irrelevancy, and a virtual middle finger to the author of this kind of recruiting tactic.

Spam

Considering the amount of spam we filter, it's likely that posts, after links have been stripped - look spammy because of their generic content (ie. "great post", etc.).

99% of comments are anonymous because people don't want to go through the registration process. That's why we allow anonymous comments. This community gets 50k+ visitors/ month, and we have at least a dozen comments in the queue to approve every few days, so there's no need for us to go in and post "fake" comments.

Great blog thanks for sharing

Great blog thanks for sharing this info with me. I will be using it really soon.

What's wrong with this board today?

Hello, I've registered because this board is running very slowly today. I would like to know if others also experience this?
Using this forum at this speed is very uncomfortable!

More spam...

It's uncomfortable for you because all you do is spam our site. We moderate all our comments, and most of yours, being flagged as spam, get deleted.

typo 3

I I have got it running but it still does not give you the same functionality that you can achieve with typo 3. I know it takes a little more learning but its worth it in the end if you want more than just a forum. Typo 3 gives you a full e commerce platform.

Typo 3 is better

I would definitely like to see some additional features and functionality. I agree that typo 3 has better functionality.

Update

Has this ever been updated? Drupal 4.7 and phpbb2 is nice but what about drupal 6? A link would be enough if anyone has one. It's ok if it's drupal 6 and phpbb2 or phpbb3. I know of the module that is supposed to work with drupal 6 but I see NO documentation on how to use it.

:/ phpbb2drupal

Thanks

User friendliness

I think it could definitely be a lot more user friendly and it needs more features for sure.

Php is a little complicated

PHP is a little complicated. But if you put your mind to it it can really simplify your site. Thanks for the post.

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.