Basic integration screencast
I’ve created a screencast which covers how to setup the most basic form of integration with WordPress.
bbPress and WordPress basic integration
- Shared cookies (single sign-on)
- Shared user tables in a shared database
- bbPress installed in a sub-directory of WordPress
I just watched the basic integration screencast and tried integration again. I ran into some of the same problems mentioned above so I did a little testing.
1. Sam, thanks for the screencast.
2. Using a subdirectory of forums, and then making a WordPress Page called “Forums” with a slug of “forums” works just fine. The page will show up in your WordPress page menu like any other Page, but the real ‘forums’ subdirectory you installed bbPress into is what is displayed to visitors, NOT the content of the WordPress Page called “Forums.” I used to install a redirect plugin at WordPress to redirect the “Forums” Page to the http://example.com/forums/ real subdirectory, but I guess this works just fine like this. Good to know.
3. When using PHP4 (4.4.9) I encountered the “Forum could not be created!” error mentioned above. I thought it was possibly the MySQL version (which was 4.0.27 I believe) but it turned out that by using PHP5 (5.2.6) it installed fine, into the same database. I added this to my .htaccess file in the site root (for WordPress and bbPress):
AddType x-mapp-php5 .php
That forced .php files to be processed as PHP5. I did that before installing WordPress. I confirmed with phpinfo that PHP5 was being used for both the blog and the forum. The 2nd time through (actually, the 3rd time, but that’s a different story), using PHP5, the forum was created properly.
After that, following the screencast pretty closely resulted in an installation where I can log in as Admin (key master) at either bbPress or WordPress, and I am logged in on the other side, as expected. Logging out of one logs me out of both. It’s what I expect user integration to be.
Waiting for the next screencast, Sam. Thanks.
p.s. Did I miss it, or is the NONCE key for bbPress never set in the video? I have one in wp-config.php, since the keys were generated by the WordPress.org API, but did I miss setting that in bbPress? Should I just make it the same as it is in bbPress? Will not having it prevent me from administering the forum or something? I didn’t test any functionality of the forum, just the logins.
Followed the tutorial and thought everything was working, but I see now that when new users register on WP, they are added as users in bbP – but they have no role defined. All my roles are set in WordPress Integration. Here’s the error I get when I click on edit for the User – under USER TYPE
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/account/public_html/forums/bb-includes/functions.bb-template.php on line 2009
under ALLOW THIS USER TO:
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/account/public_html/forums/bb-includes/functions.bb-template.php on line 2036
Great tutorial, btw!
very helpful screencast. thanks!
i’m having the same problem as maxwellfir with user roles not being assigned correctly and the error when trying to assign them.
for existing users (from wordpress) i get the error mentioned above when trying to edit that user’s role in bbpress.
for new users (signed up via bbpress) their role in wordpress is set to “none” and therefore can’t login to wordpress.
not sure if the second issue has anything to do with having registration disabled in wordpress.
thanks for any additional help with this.
@maxwellfir and asymmetrik
Your problem is fixed in trunk now.
thanks sam. i’m able now to change user roles in bbpress which is great.
had to manually change user roles in wordpress from “none” to actual roles but everything else seems to be going smoothly.
changing a user’s role in bbpress doesn’t seem to effect the wordpress roles nor vise versa, (though i’m not sure this is expected yet).
also had to define the BB_NONCE_KEY to make logout work correctly (logged in via bbpress, logout via wordpress) and once it was defined it worked as expected.
either way, this is a great start. thanks again.
Roles are only applied by bbPress to users who are missing roles in the DB completely. It doesn’t try to keep them in synch beyond the initial setting of the role. This is intentional as the alternative is far too restrictive in most cases.
Great video & very useful, but…
Followed the info with WPMU 2.7 & bbPress Alpha & ok except cookies not working… Logging into WP as admin I get the 3 bbPress cookies set (I do get others set as well – these are just examples):
Name: wordpress_ Path: /wpmu/bb-forums/bb-admin
Name: wordpress_ Path: /wpmu/bb-forums/bb-plugins
Name: wordpress_ Path: /wpmu/bb-forums/my-plugins
Then moving to bbPress I don’t get logged in. I can manually log in as admin (the db integration works fine) but if I look at the cookies set by bbPress they include:
Name: wordpress_31f5b4f2f1336e7259bb25056b62d533 Path: /wpmu/bb-forums/bb-admin
Name: wordpress_31f5b4f2f1336e7259bb25056b62d533 Path: /wpmu/bb-forums/bb-plugins
Name: wordpress_31f5b4f2f1336e7259bb25056b62d533 Path: /wpmu/bb-forums/my-plugins
Despite the keys & salt between bbPress & WP being the same, the names & content of the above cookies are different between WP & bbPress.
So, looking at the above it’s not surprising the login between WP & bbPress isn’t successful. So, where did I go wrong or what is the problem?
Wow — I love you!! Thank you so much for doing this! (What screencast software are you using? It’s fabulous!)
Perhaps I am taking a liberty here but please, o please could you make a WPMU + bbPress integration video because I cannot, I repeat cannot get cookie integration to work no matter what I do and no one else seems to have much luck either.
Thanks for the screencast Sam! I installed BBpress 1.0 Alpha with WP 2.7 but didn’t get the integration to work fully. I followed your screencast as well as I could but my setup is a bit different:
1. I already had wp 2.7 installed with a custom prefix (which I filled out in the set up)
2. My host has safe mode on so I got some errors and had to manually modify and upload the config file.
I was not able to log in to the forum since Firefox got in to a loop so I couldn’t finnish the installation process. So I deleted the BBpress db tables and reinstalled but did the Worpress integration after the installation was done. Most things works fine, I can login to WP and BBpress just fine. I can create users in WP that can log in to BBpress and the other way around. What doesn’t work is sharing the cookies. Users must still login when switching from WP to BBpress or the other way around.
I have set everything with the BB_AUTH_KEY, BB_SECURE_AUTH_KEY, BB_LOGGED_IN_KEY as described and double checked with the wp-config file that everything is the same.
Any pointers to how I can get the cookie sharing to work?
Got everything to Integrate with no errors and everything seem to of went fine.
When someone registers, the username and password is good in both the forum and wordpress.
But is the integration supposed to work for login and logout, I mean if a person logs into WordPress are they supposed to be logged into bbpress at the same time.
If they are it seems to not be working for me, I can log into the forums and still have to log into WordPress same thing logging out am I missing something.
I know it was a clean and no error install and followed the tutorial completely.
Thanks for all your hard work man.
I am having the problem where logging into WP logs you out of bbPress and visa-versa. I’ve checked the Keys and salts. they appear to be the same. I’ve even gotten new ones to make sure… dunno why it doesn’t work. Worked fine 24 hrs ago.
Thank you for the screencast it worked initially. I’ve deleted my cookies and restarted my browsers, too of course.
bardthebowman – The KEYs are named AUTH etc on WP but BB_AUTH on bb, right?
This only works if you install wordpress in a “root” folder and it has to be a clean install, cookies will not push to subfolders, and if you already have wordpress installed in a subfolder of a current website forget it.
As of release 2.7 it only uses one cookie hens even if you do get this loaded when you return to wordpress or your forums you will have to refresh the page for the login to even show.
Great video but really not any good for anyone that already has wordpress installed on a current website it has to be a fresh install in the root of the website.
Plus I believe this modification has been abandon as there has not been a post from the author for over 3 weeks.
I have to disagree there, chrisgoat
I have WordPress in
/blogand bbPress in
/forumsand I have had WordPress on my site for a couple years before integration.
I did set my cookies to all be treated as from root, mind you, but I do that for both bbPress and WordPress, and it works fine.
I bet that is it. I recall copy/paste between the config files…. I bet I copied the entire lines instead of just the values… I will check when I get home.
Thank you, Ipstenu.
I enjoyed the screencast and found it very easy to follow. However, I tried it with BBPress 0.9.0.4 and WP 2.6.3. The bb-config setup was inconsistent with both the video and with what is in my wp-config file. I added a SECRET_KEY in wp-config and used it in the bb-config setup, but things haven’t quite worked out. At first, it was just that being logged into one place didn’t log me into the other. Then all of a sudden it looked like BB cookies were staying around even though I’d logged out of both — and when that happened, I couldn’t log into BBPress at all until I manually removed those cookies.
I’m a bit puzzled why the screencast and the integration plugin would only seem to be valid for an unstable release of BBPress. Yet reviewing http://bbpress.org/documentation/integration-with-wordpress/ it appears that everything should work even the way I did it, and without a plugin at all. Except that it didn’t. Can this be clarified?
The documentation is out of date, basically.
Ah, well, that’s good to know. But then I’m in a quandary — there seems no obvious way to get bbPress running with WP 2.6.3, because:
–bbPress 0.9.04 seeks the SECRET_KEY and the WP database “secret” — the “secret” appears to be available on the relevant wp-admin page, but WP 2.6.3 required no SECRET_KEY in its wp-config file. It’s only there now because I manually added it in, and I’m not sure if that’s legit. In any case, it’s certainly not working now!
–If I switch to the latest bbPress, not only is it unstable and therefore shouldn’t be recommended as a solution, but it needs the three items from wp-config plus all their “salts.” On that relevant wp-admin page in WP 2.6.3, there simply is no SECURE_AUTH_KEY salt. It’s not clear to me whether the WP database “secret” is the same thing or not, but it’s certainly not labeled as such.
In other words, there just seems to be a mismatch no matter what. Is there no version of bbPress whose integration settings will jibe obviously with the fields actually available in the various places in WP 2.6.3?
Why not just upgrade to 2.7 or 2.7.1 (imminently)?
Even if I had the patience to upgrade every single time a new WP version came out (which I don’t), that wouldn’t resolve the issue here. The screencast itself said that WP 2.7 will not integrate properly with the latest stable bbPress. If I’m going to undertake upgrades/installs, I’m going to do it with stable versions, not unstable ones.
If there’s a way to integrate a stable version of WP with a stable version of bbPress, I’m game for whatever upgrading I may have to do with either component. If that’s not available yet, then I’d rather wait and do whatever I have to do at that point.
First, you can’t use bb .9 with WP 2.6. It won’t work right becuase they changed login stuff (I’m vague cause I need more coffee). So you have to use bb 1.0-alpha6 with WP 2.6 (or 2.7 etc).
If you don’t have a SECRET_KEY that’s okay.
What you MUST have are:
It’s okay that your KEYs are in the options page. You can set those in wp-config.php if they’re not already there. Which I think they should be.
The latest stable version of bbPress that integrates with WordPress is 0.9.0.4. That works with WordPress 2.5.x which is fairly old and you’re already past.
I don’t think there is a current stable version of bbPress that integrates with anything current from WordPress. WordPress is moving faster than bbPress right now.
What do you need out of integration that makes it important to integrate bbPress with WordPress? I’m asking honestly because I don’t understand why people do it. Thanks.
Thanks for all the feedback. It wasn’t clear to me just what was the latest version of WP that would work properly with bb 0.9.0.4. Now I’m clear that I’m past that point.
I have plans to eventually have certain forum members do blogging at the main site. That is down the road, though, so technically I don’t need the integration right at this moment. But that integration would be useful at that point, and I thought I’d just set it up now.
But it sounds like maybe what I ought to do is remove the integration for now, let the forum exist on its own, and then integrate later once there is a stable version of bbPress that can integrate with WP 2.6.3 or later.
Any particular advice about undoing the integration stuff I already did?
Totally über super-fantastic video, sambauers. I couldn’t have integrated bbPress and WP without it! Thanks a ton! I’m now running WordPress 2.7 and bbPress-1.0-alpha-6.
There are 2 specific things that got me past the “Forum could not be created” screen when I tried to install bbPress the first time:
As the post above explains, I added the following line to the .htaccess files for my WordPress and bbPress installations:
AddType x-mapp-php5 .php
Thanks a bunch, chrishajer. It’s ALWAYS a .htaccess addition that makes my installation life easier – LOL.
Thank you asymmetrik. This helped me discover that my WP 2.7 installation didn’t actually have a NONCE_KEY in the wp_config.php file at all. So, I ran the security key generator and got it.
BTW, sambauers , I’m totally diggin’ on your blog’s design/layout: http://unlettered.org/
You must be logged in to reply to this topic.