The MU forums have moved to WordPress.org

BBPress & WPMU integration information (33 posts)

  1. omonk
    Member
    Posted 17 years ago #

    There was a thread here previously that explained this question, but it was lost aparently. (Should have wrote it down!!!)

    After setting up bbpress to use the wordpress users table, there was some specfic information that needed to be inserted into the user tables to allow for an admin account, as well as any existing users. Then there was a line that was to be entered into WPMU's functions.php so that the data that allows users to post in bbpress will be added upon new user registration.

    I've been searching for days for this info searching googles cache and everything all to no success. I would extremely apreciate any info/code/advice anyone can give. (Or if the need for this has now become moot?) Thanks!

  2. ergate
    Member
    Posted 17 years ago #

    I tried tried to retrieve the data via google cache and no luck. I am going through the notes and files on my computer at home in hopes to find that info, but I don't think I have it.
    I was one half of the discussion, obviously the un-informed half, I am hoping the other half will return. Unfortunately I do not remember who the user is.

  3. quenting
    Member
    Posted 17 years ago #

    Here's what i've done. Surely not perfect, but works for me:
    in wpmu-functions.php, around line 222, I've added this:

    $wpdb->query( "INSERT INTO $wpdb->usermeta ( user_id , meta_key , meta_value ) VALUES ( '$userID', 'bb_capabilities' , 'a:1:{s:6:\"member\";b:1;}')" );

    makes user be recognized by bbpress. A little extra work on cookies and authentication can be shared (don't have to log back in).

  4. omonk
    Member
    Posted 17 years ago #

    Awesome! That's what I've been missing, thanks!

  5. samchng
    Member
    Posted 17 years ago #

    Could someone share step by step how to integrate BBPress into MU? Or perhaps putting it in,
    http://codex.wordpress.org/User:Ergate/WPMU_Docs

    So far here's what I know.

    1. Upload bbpress into a folder domain.com/forum/
    2. Drop an .htaccess file into the folder
    3. Turn off rewrite with "RewriteEngine Off" in .htaccess.
    5. Done.
    6. To only share users between WP (WPMU) and bbPRess, courtesy of ergate.
    Open bb-config.php file and after
    $bb->gmt_offset = -5;

    add

    // use the WP user table for your bbpress user list
    define('CUSTOM_USER_TABLE', 'wp_users');

    Am I on the right track? omonk, may I know what the above code does? I don't understand what you mean by allow admin and existing users. Thanks!

  6. omonk
    Member
    Posted 17 years ago #

    This is what I have in my bb-config.php file right after the "$bb->gmt_offset = -5;" and before the "stop editing" thing:

    define('CUSTOM_USER_TABLE', 'wp_users');
    $myhash = md5('http://yourdomain.com');

    $bb->usercookie = 'wordpressuser_' . $myhash;
    $bb->passcookie = 'wordpresspass_' . $myhash;
    $bb->cookiepath = '/';

    This will make bbpress use wp's user tables and wp's cookies. That code above I was asking for has to do with new users having posting permissions. It seems that might be moot in the newer nightlies of bbpress though because it seems bbpress has already asssigned my wordpress admin account admin privlages in bbpress too. (might have something to do with both accounts having the same name and password though too.) Also new users seem to be able to post fine so I'm not sure if that's needed anymore.

    Right now I'm trying to get cookies global so that users won't have to re-login once they leave thier wp and go into bbpress. As far as I can tell that can be done by going into wp-settings.php and changing this: "define('COOKIE_DOMAIN', false);" to reflect your domain instead of false. I'm pretty sure doing that will cause all kinds of security issues and whatnot though so be warned. I'm still experimenting...

  7. ergate
    Member
    Posted 17 years ago #

    I had used the code mentioned above by omonk, I could never get it to behave properly. A double login, once in wp and another in bbpress, always happened, and sometimes with bbpress there would be some strangeness in the admin links (they wouldnt work). I ended up switching back to the code that samchng mentioned.

    I have started a bbpress integration page at http://codex.wordpress.org/Ergate/wpmu_bbPress_integration It branches off of the page listed above. I think it is a good idea to start getting this stuff documented somewhere other than the forum, something that is quick and easy to point to. I started that section in my userspace in the codex with hopes that if enough documentation can be started there maybe we can get it listed in the regular codex.

  8. myteatro
    Member
    Posted 17 years ago #

    How about sharing also the user metadata?

    maybe somehow like that:

    require_once "../wp-config.php";
    require_once "../wp-settings.php"; // ???

    define('CUSTOM_USER_TABLE', 'wp_users');
    defined('CUSTOM_USER_META_TABLE', 'wp_sermeta');

    any ideas??

  9. drmike
    Member
    Posted 17 years ago #

    I don't think you would want to be sharing metadata else everybody for be admins for your forums. :)

  10. mickemus
    Member
    Posted 17 years ago #

    ergate... I've followed your instructions to the point but I'm getting an annoying error:

    Fatal error: Cannot redeclare get_locale() (previously declared in /.../.../public_html/blog/wp-includes/l10n.php:9) in /.../.../public_html/blog/forum/bb-includes/l10n.php on line 24

    If I remove
    if(file_exists("../wp-settings.php")) {

    // loads the functions and wp config
    require_once "../wp-config.php";
    require_once "../wp-settings.php";

    The user integration works but still have to log in twice!!

    Any clues?

  11. mickemus
    Member
    Posted 17 years ago #

    figured it out... replace "../wp-config.php" with "./wp-config" I guess it's cause I call the forum from a virtual host!

    ie. support.blog.domain.com but wpmu is in blog.domain.com and forum in blog.domain.com/forum

    Still not carrying the login over... any clue? What should I write in the cookie path??

  12. modifiedcontent
    Member
    Posted 17 years ago #

    The above thread looks confusing... What's the final word on BBpress+WPMU integration? What's the best approach?

  13. suleiman
    Member
    Posted 17 years ago #

    ditto to modifiedcontent's post. Is there an easy way to do this? Is the info in eargate's link on the codex up to date?

  14. andrewbillits
    Member
    Posted 17 years ago #

    The best approach is described by ergate here:

    http://codex.wordpress.org/Ergate/wpmu_bbPress_integration

  15. suleiman
    Member
    Posted 17 years ago #

    thanks andrew, just checking to make sure it was also the most current.

  16. andrea_r
    Moderator
    Posted 17 years ago #

    ARGH. I'm trying to get this up and running and having issues.
    I can get bbpress running fine alongside MU. What I'm stuck on now is getting bbpress to use MU users. I don't care if peopel have to login twice; I don't want them to have to re-register. :-/

    Site: http://homeschooljournal.net
    Forum: http://forums.homeschooljournal.net
    Both on seperate dbs.

    In all the variations of code snips out there to add to config, I either get a redirect to signup for a forums blog, or an SQL error:

    bbPress database error: [Table 'homescho_bbpress.wp_users' doesn't exist]
    SELECT * FROM wp_users WHERE user_login = 'admin'

    Any ideas? I'll do a write-up when I'm done, I swear. :)

  17. suleiman
    Member
    Posted 17 years ago #

    yepp, that's exactly the same error I was experiencing andrea. It's frustrating because I'm sure there are people that have gotten this to work. One thing I would advise is trying a nightly from early August, as there seems to have been some changes to bbpress after then which affect this hack.

    For more info see: http://comox.textdrive.com/pipermail/bbdev/2006-August/000617.html

  18. ergate
    Member
    Posted 17 years ago #

    I have been experiencing some strangeness with the integration lately as well.
    I am working on a new install of bbpress with an existing install of standard wp (current version 2.0.4). The oddness that I am having is sometimes when the user logs in at bbpress the front page does not reflect that the user is logged in, until you browse into one page, any page, then it shows the user as logged in. This usually happens with FF on windows.

    I am swampped (as usual), but I am actively watching the bbpress dev mailing list, and when time permits I am going to start searching other forums and resources for a solution.

    If someone finds an answer post back and I will update my page in the codex.

  19. andrea_r
    Moderator
    Posted 17 years ago #

    Can someone verify that it was okay for me to use two seperate databases? :)

  20. drmike
    Member
    Posted 17 years ago #

    Sorry, mine are in the same database.

  21. suleiman
    Member
    Posted 17 years ago #

    I was wondering about that. So when you installed your bbpress drmike, you just dropped the bbpress tables into you wpmu database with no problems? I've been afraid to do that because I'm afraid to touch anything that starts with PHP or ends in MySQL.

  22. ergate
    Member
    Posted 17 years ago #

    I think there was a discussion about this on the bbpress mailing list, and if I remember correctly they have to be in the same db.

    All the installs with these two pieces of software have all been in the same db.

  23. andrea_r
    Moderator
    Posted 17 years ago #

    Any way to do join up the info from the 2 dbs?

  24. ergate
    Member
    Posted 17 years ago #

    Check this out. This should be better than what I have on my page in the codex.

    http://bbpress.org/blog/2006/09/simpler-integration-with-wordpress

  25. andrewbillits
    Member
    Posted 17 years ago #

    Someone should add that link to either the codex or a sticky.

  26. ergate
    Member
    Posted 17 years ago #

    I updated my stuff in the codex, hopefully someone will "officially" update the codex.

  27. andrea_r
    Moderator
    Posted 17 years ago #

    ergate, you should be able to add it in the codex somewhere under the MU stuff.

  28. ergate
    Member
    Posted 17 years ago #

    andrea_r: I will look into that. I just havnt given it much thought until I have started to see how often my little page started being referenced. Thank goodness there has been an official response so the burden of whether my info works or not is lifted. Whew.

    Also I remember you were asking about multiple db's with bbpress. I ran across this article on the bbpress blog
    http://bbpress.org/blog/2006/06/external-dbs/
    it is about using seperate dbs for users, data, wp etc.

  29. andrea_r
    Moderator
    Posted 17 years ago #

    Thanks ergate, you're awesome. When I get a chance to sit and tear my hair out over it, I'll be sure to come back here & post.

    Edit: in case anyone else is curious and wants to poke aroudn while I try and figure it out, the file (other than config) is \bbpress\bb-includes\db.php

  30. suleiman
    Member
    Posted 17 years ago #

    andrea did you get this working? If so could you post the relevant portions of your config.php and/or db.php files? Thanks!

About this Topic