Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Integrating bbPress with WordPress

0 (0 Likes / 0 Dislikes)
Hi there. And welcome to what I hope is the first in a series of integration how-to's for bbPress. What I want to is show all different ways that we can integrate bbPress with WordPress and exactly the steps you need to do it. So, I'm going to start off with probably the most simple form of integration that we have and that's shared login, shared user database and with bbPress running in a subdirectory of WordPress. So what we have is a site, it's example.org, and what we want to do is to install WordPress into the root of example.org and we want to put bbPress in the subdirectory of "forums" Just like that. So, to achieve this, we need to of course install WordPress, set it up, get it running, and then install bbPress after that, with integration. I've got my example.org web site set up as you can see, it's just an empty index. and over here, I've got the connection by FTP already done so here's the steps we need to take First, we need to go to wordpress.org and download wordpress 2.7 I'm going to download the ZIPed version It's coming into my Downloads folder here. Okay... let's just pull that up in Finder and I'll just unzip that You can see all the files there and there is the folder. Let's grab all those and we're just going to upload those into the root of example.org site Now, this is probably going to take while so I might cut away and then come back ...last files just popping in there last one is xmlrpc.php. OK, so that's all in there So now, we've got all the WordPress files we need in the root directory. If we head back over to our Web site, and hit Refresh… OK; we're getting a typical installation error, which is asking us to create a configuration file. So, I'm going to give that a go. OK; so I need all my database details. Now, I've already set up a database for this. I'm on localhost, and I'm leaving my table prefix as "wp_"; Hit "Submit", and what it's done, if we just check over here, there it is—our config file. Now, before I run the installer, I'm just going to do a little something here. I'm going to be just adding a small detail, which is a collation type, and when you install we can use that. And you see down here, there's some authentication unique keys, which say "put your unique phrase here"; we're going to do that in a little while. We're not going to do that straight away. So, we'll save that, and that goes back to the Web site, and now I'm going to run the installer. OK; that's worked. My blog title will be "Example Blog"; my email ([email protected]); I'm not going to have this one appear in search engines, because it's just a test blog. Installing… and done. Let's grab that password, and log in. "admin", paste the password in… So, that's working. I've got a working WordPress 2.7 install. If I go over here, just for a second, I'm actually keeping track of the cookies which are turning up under example.org. This is going to be important a bit later on, because this are the exact cookies that we're going to need to replicate when we're doing cookie integration for bbPress. So, if I go over to my blog— that was a pretty tough password to remember; I'm just going to change it for myself—make life easier— to something horrible and insecure. Now, I'm going to log out. So what we're going to do now is set up those keys, which I showed you before briefly in the config area. Now, those keys actually add an extra level of security to WordPress, and they're there to protect you from all sorts of different hacking techniques against cookies. Now, the thing about them is that those keys actually need to be set the same in WordPress and bbPress. So, to achieve that, we need to know what they are. If we leave them on their defaults, then it's going to fail. So, it says "put your unique phase here" in these keys, but we actually have a handy little tool which is available via the Web which can create those secret keys for you. So, I'm going to go there now, and grab some secret keys. All we have to do is cut and paste those out of there and over the top of these. And there we go. Those are our secret keys. I'm going to leave that open—that config file open— and I'm going to go to the blog again. I'm going to make sure my login still works. OK; that's working fine. I'll log out again. OK; the next trick is to install bbPress. So if we go back to our folder here on the Web site, as I said earlier, we're going to install it into a folder called "forums". So I'm going to add that new folder— it's already typed in there for me— "forums". That will be empty to start with. What we need to do is put bbPress in there. So, I'm going to go to bbPress (bbpress.org), and this is the download page. What we're going to do—for 2.7, we can't integrate the current stable version of 0.9 bbPress with 2.7, but we can integrate the alpha version. So, just scroll down to the bottom of the download page and we'll grab that zipped version. There it is. Just extract it. There's all my bbPress files. And, just like before, we're going to grab all those files and copy them up to "forums". Now again, this is going to take a little while, so we'll cut away. It's a little bit quicker with bbPress because it's slightly less files. But I'll cut away in any case. And once again, the last few files just dropping into that folder. And the last one once again is the XML-RPC file. So, I've got bbPress in there now. Let's go to the directory and see how it's going. OK; so it's saying we don't have a config file, and and it wants to get us installed. So let's start that process. I'm going to share the same database, so it's the same database there, and in this case, the database user is the same. So that's enough actual information to get us going at this stage. We have to go through the Advanced Settings as well. "localhost" is the same and "utf8" is the same for the character set. We added a collation before, so we're going to pop that in here as well so bbPress uses the same collation as WordPress. Now, here for "auth" key, "secure auth", and "logged in" key, we're actually going to put these in twice, which seems a little bit backward, but we're going to do it here as well as once in the integration step next. So, what we can do is actually leave them blank here, which might seem counter-intuitive, and perhaps it is, so it might be something we change in the future. But for now, we can just skip that step and we can leave the "nonce" key out as well. So those settings have now been saved to a config file. Let's go over to our FTP site and we'll check that the config file is there. There it is. Let's go to step two. Now this is where the integration happens: the first question is, "Do you want to add integration settings?" We do, so let's click that, and there are two parts to integration. There's cookie and user database. Let's do the cookie first. You'll notice it's asked me a few questions about our WordPress install. So the first question is, "What's the URL?" Well, that's easy. And also, "What's the blog address?" Sometimes, they're separate things, so they're separate questions, but in our case they're the same. Now, here, you'll notice it's asking for the WordPress auth key, cookie salt, cookie key, secure auth key, secure auth salt, login key, login salt. Now it gives us some pretty clear instructions underneath each one. Where to find these things. The cookie keys we will find in wp-config.php in our WordPress install. The salts are actually in the database, and it gives us a link which it makes automatically once we've entered in the URL of our blog, telling us where we can get those cookie salts from. Let's do the keys first; let's do them all at once. So we'll go back to our WordPress config file and the first one is the auth key, which is the first one here. So just copy the part in-between the single quotes, and paste it in. Let's do the secure auth key next. Again, just the part in-between the single quotes. Paste it in. Login key; just the part in-between the single quotes; and paste it in. Now, let's grab the salts. Now, you'll see here it says, "look for the option labeled 'auth salt'" in this WordPress admin page. So I'm going to open that up in a new window, and it's taken me straight to that page, and, very high up on the list, actually, is auth salt. So we need that value. It's the second part of the secret. The secure auth—now, not all blogs will have a secure auth salt. And generally, on a new install, you won't. It's used for SSL installs. And I don't think we'll have one. Now, these are handily listed alphabetically. So there's no secure auth salt. So we can just leave that blank. Now, the logged in cookie salt; go back up the page, and there it is. "logged_in_salt". Copy that—close that window; I don't need that anymore— and paste that in. So that's all we need for the cookies. Let's add user database integration settings. Now in our case, we're sharing the database, so all we need is the user database table prefix. This is usually "wp_", and that's what we have left it at. There are some advanced settings, but you only need them if you have separate databases with separate logins. So we can move on; we've done our integration settings. OK; it's telling us that it's validated OK. Let's go to the last step. OK; let's give our site a name. I'll call it "Example Forums". Now, it's guessed the URL for us, and it's got it right in this case. (It usually gets it right.) Now, because we're integrating, and it's picked up our user database, it's going to give us a choice of who to make the Key Master. Now, all we've got so far is our original admin, so we'll set them up as a Key Master. The Key Master is like an admin for bbPress. Let's call that "First Forum". OK; it's saying it's ready to go. And it says it's done. Now, if you want to take a good look at what's happened, there's an installation log here, and you can see exactly what's gone on. Now, it's saying we can use our existing password and log in as "admin". Now, I'm actually already logged in to the WordPress site, so when I click this link, there's a good chance that it's going to be logged in already. Let's see if it works. And there I am—already logged in. And that's because over here, I was already logged in to WordPress, and I'm already sharing the cookies. So that's a big part of our job already done. There's one final step, though, that we need to do. Sorry—*two* final steps that we need to take. First, let's go into the admin area of bbPress. Here, you'll notice that didn't work. That's because we haven't quite finished with the cookies. Let's log out, and log in again with bbPress. You'll notice over here in the cookies section that I've got listed out that there's actually more cookies now. You'll see these extra three. Now they're actually the auth cookies required to get into the admin area, and also for plugins. Now, that's the reason that we couldn't get into the admin area before. Now that there's a set, I should be able to get in. OK; so I'm in. Now what I want to do is go to our WordPress integration settings and make sure that this is all set up properly. The very first thing that we have to do is set up a user role map. Now, what this does is it maps new registrations between WordPress and bbPress. So, what we do is we take each role that WordPress has and we assign it a role in bbPress. So, I want anyone who's an Administrator in WordPress to be a Key Master. I want anyone who's an Editor to be—let's say—a Moderator. And I want everybody else to just be a Member. This will synchronize the roles between bbPress and WordPress on new registrations. Save that user role map— you can see there it says it's saved— the rest of the settings down here are just the same settings that we put in in the installer. There's also some hints as to what you need to do to make it go a bit faster down here. Now, we're not going to do that yet. It's actually not a requirement. It's just a speed-up technique. So, let's leave that for now. I'm going to log out of the forums. I'll just check over here—you can see all my cookies have disappeared— And I'm going to switch across to the WordPress site. And I'm going to log in here as well. And this is the final step of integration. What we have to do is set up a new plugin. So, all you need to do is go into Plugins and click Add New. We're going to search for the term "bbPress". And you'll notice in that list is "bbPress integration". Let's install it. OK; so that's installed. Let's go to the Installed area of our plugins. And activate. OK; once that's activated, in the WordPress settings, you'll get a new menu item saying "bbPress Integration". Let's go in there. Now, all this wants from us is our forum URL. In our case, it's example.org/forums. (The full path.) Now, there's an option here to add your plugins URL. Ours is in the standard location of "my-plugins", so we don't have to put anything in there. Let's save that. OK; the settings are saved. Now, let's check down at the bottom here. It's giving us some manual cookie settings that it wants us to set up. Now, what we need to do is grab those settings, copy them, and then skip across to our WordPress config, scroll just down to underneath "WPLANG", and paste them in. So, that's going to define our cookie path to just a slash, which it probably is already, but that's just a little safety. All right. Now, we should have integration complete. I'm going to log out, and what we're going to do is we're going to make sure that all of the cookies turn up, just like in bbPress. "admin", password. OK; so login is still working; that's a good first sign. Let's hop across here, and you'll see those three cookies, which I pointed out before, and now being added to the cookie bundle. So now, when I go straight to the forum, It looks the same, but actually I can get into the admin area. So that's actually the last step that that plugin has completed for us. So that completes our integration. Now, just a couple little tests: these same cookies that were set by WordPress a second ago we're using for bbPress. Let's just make sure that we can log out and clear all those cookies from bbPress. So I'm just going to go back to the site, check over here again—you can see all those cookies still set— and we'll just choose "log out". Hop back across here, and you can see that they're all gone. These last remaining ones are just WordPress-specific ones, which are just test cookies and some settings cookies. You don't need to worry about those. They're not important for authentication. So that completes our bbPress integration on the basic level, with a subdirectory containing bbPress inside your WordPress install. Shared cookies, shared user database, single sign-on, login.

Video Details

Duration: 21 minutes and 26 seconds
Country: United States
Language: English
License: Dotsub - Standard License
Producer: Sam Bauers
Director: Sam Bauers
Views: 1,345
Posted by: wordpresstv on Mar 30, 2009

If you'd like to intergrate your WordPress blog with a bbPress forum, bbPress developer Sam Bauers shows you how in this video

Caption and Translate

    Sign In/Register for Dotsub to translate this video.