Skip to:
Content
Pages
Categories
Search
Top
Bottom

Integrate wp2.7 and bbp1.0a2


  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    Okay, I think I’ve experienced similar problems as most of you, and I just got mine working logging in and out from every angle with access to the admin panel on both. It still seems to hiccup a little when changing roles, so I am still trying to track that down, but I wanted to share where I am so far.

    I am using the WordPress 2.7 beta 3 nightly build, and the bbPress 1.0 alpha 2. I am using various plug-ins and what-not and have akismet active on both.

    My host is 1and1.com.

    There are a few things that are of the utmost importance:

    1. I recommend BEING LOGGED INTO WORDPRESS AS ‘admin’ with user_id of ‘1’ when you install bbPress. Any other Administrator account didn’t want to redirect to the admin panel properly. I assume the cookies will immediately conflict as they are shifted around, causing weird issues from the start.
    2. BOTH -config.php files need to have the AUTH, SECURE, and LOGGED_IN KEYS defined correctly.
    3. I personally also defined the SECRET_KEY in WordPress, although I’m not sure this is necessary yet.
    4. bbPress needs to have the salts entered correctly during installation so that they match WordPress. Fortunately the link to the hidden admin panel is provided during the install so you can get them pretty conveniently. I personally did not have a secure_salt so I left it empty.
    5. MUST add
      $bb->WP_BB = true;
      if (file_exists('../wp-blog-header.php'))
      require_once('../wp-blog-header.php');
      else
      if (file_exists('../../wp-blog-header.php'))
      require_once('../../wp-blog-header.php');

      or your personal equivalent to bb-config.php

    6. I personally had to add
      define('COOKIE_DOMAIN', '');
      define('COOKIEPATH', '');

      to my wp-config.php to make it go.

    7. Login to bbPress as ‘admin’ if you are already not, navigate to settings/wordpress integration, and adjust the role map accordingly.
    8. Visit bb-admin/rewrite-rules.php page and copy the code
    9. Put the following in a file named “.htaccess” file and place that file in the bbpress root directory:
      Options -MultiViews
      YOUR PREVIOUSLY COPIED CODE

      This is to make sure your URL’s are rewriting correctly.

    10. Logout.
    11. Clear all website cookies and attempt logging in either/or/both WordPress and bbPress. Access admin panels of both. Basically check for functionality.

    That’s how I got mine working. Like I said, I’m still having issues assigning user roles for some reason, so I’ll try and figure that out next.

Viewing 25 replies - 1 through 25 (of 33 total)

  • kevinjohngallagher
    Member

    @kevinjohngallagher

    Wow, i think you just nailed one of my niggling issues with the install.

    Well done and thanks.

    FYI, the roles don’t always match up right until the user logs in to both sides of the game.

    If I create an ID in bbPress, I have a WP role of ‘None’. When I subsequently login to WP, my role is flipped to whatever the default is. Done. Vice versa for bbPress.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Hmm…

    There should be a user-sync tool that does this without asking people to login twice, since the idea is to fully integrate them together seamlessly.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    I’ve logged into both sides with a test account and still run into this problem. It seems that integrating with WordPress interferes with some capabilities. Like, when viewing a topic logged in as Key Master, I can see the IP addresses of people that post, and I have the link to add that topic to my favorites, but I cannot post a reply, I cannot edit the tags, and I cannot see any other admin functions; all of their capabilities return no value.

    I haven’t given up yet! hah!

    This is a interesting post.

    Im currently running WP 2.5.1 and bbPress 0.9.2, and Im getting slightly worried on falling behind on WordPress upgrades. I think this the most success someones had with WP 2.7 and bbPress.

    Im sure I’ve seen a WP 2.6.3 and bbPress 1.0.2 installation and it didn’t like it at all, sent out a redirect loop.

    Thanks for sharing


    lorenzocoffee
    Member

    @lorenzocoffee

    Thank you very much for sharing this experience and your knowledge,

    at this point I have to take advantage (lol)

    with a simple question:

    given I (eventually) do not need to have registered users to let them post (as in WP ,it’s all ‘open’ ) ,and my only needs is to automatically import from WP to bbpress the posted articles (it’s like a mag) ,any chanches to ‘automate’ this quickly with the 2.7 and the 1.x ?

    thanks


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @lorenzo: Let me ask a question to clarify. If I understand correctly, it sounds like you want to import your blog posts from WordPress and make them topic posts in bbPress?

    @everyone: I am dedicating this evening to trying to work out where the process is failing. Right now, if you do NOT need to use ANY of the WordPress functions in your bbPress theme, the integration works perfectly. Logging in and out of either/or works perfectly with wp2.7 and bbp1.0a2. If you skip step 5 in my above process, there are no operational issues, only theme integration issues by not being able to use the WordPress functions.


    lorenzocoffee
    Member

    @lorenzocoffee

    @johnjamesjacoby:

    absolutely right,that is pure and simple:

    thanks


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @lorenzo: I’m not exactly sure if there is a modification to do that or not. It seems like it would be an easy enough process with a plug-in of some kind, but that isn’t the point of integration so unfortunately I have little experience with it. :/

    BBsync and BBpressLive is as close as I know how to get, lorenzo

    http://bbpress.org/plugins/topic/bbsync/

    http://wordpress.org/extend/plugins/bbpress-live/


    lorenzocoffee
    Member

    @lorenzocoffee

    @johnjamesjacoby: no worryes, I apreciate your effort for the community, and the attention you gave me.

    @Ipstenu : You light up my day (well almost a month..already)

    bthw bbsync have many issue in the 2.7+1.x ,but a new look afresh maybe will do

    thankyou both very much

    Admittedly, I couldn’t get BBPress-Live to work (I wanted to include recent forum posts on my WP front page), but I figured it may be worth a shot :) Good luck!


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    It seems like there are several issues here, and I’m not sure which is really the issue or which is a bug…

    Firstly, when integrated, bbPress wants to use the WordPress classes and functions where possible. Namely, the problem with capabilities lies currently with the difference in the WP_User->has_cap function.

    On the WordPress side of it, it is missing the global $wp_roles; and the corresponding check of those roles against the current capability to check.

    $caps = call_user_func_array( array(&$wp_roles, 'map_meta_cap'), $args );

    So I’m not sure if this is just a case of bbPress not keeping up with the WordPress user/role classes, or if this is WordPress not properly carrying over bbPress capabilities.

    Ugh…


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Short term, I was able to make this work by modifying 1 core WordPress file. This only allows for integration of the theme, but still does not allow access to the bbPress admin panel without changing the bb-config.php file back to original.

    It’s essentially a quick fix to get the theme working with all capabilities playing nicely.

    Basically I’m hard-coding the capability check from bbPress into WordPress. There should be a filter for this, but I’m not sure how to hook into it correctly without a mod or plug-in on the WordPress side.

    ~My fix is in no way a permanent solution. Auto-updating your WordPress installation will overwrite this fix.~


    In FILE wp-includes/capabilities.php:

    In the meta_map_cap function:

    Around Line 906:

    AFTER break;

    BEFORE default

    INSERT:

    /*
    
    */
    case 'write_post':
    $caps[] = 'write_posts';
    break;
    case 'edit_post':
    // edit_posts, edit_others_posts, edit_deleted, edit_closed, ignore_edit_lock
    if ( !$bb_post = bb_get_post( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( $user_id == $bb_post->poster_id )
    $caps[] = 'edit_posts';
    else
    $caps[] = 'edit_others_posts';
    if ( $bb_post->post_status == '1' )
    $caps[] = 'edit_deleted';
    if ( !topic_is_open( $bb_post->topic_id ) )
    $caps[] = 'edit_closed';
    $post_time = bb_gmtstrtotime( $bb_post->post_time );
    $curr_time = time() + 1;
    $edit_lock = bb_get_option( 'edit_lock' );
    if ( $edit_lock >= 0 && $curr_time - $post_time > $edit_lock * 60 )
    $caps[] = 'ignore_edit_lock';
    break;
    case 'delete_post' :
    // edit_deleted, delete_posts
    if ( !$bb_post = bb_get_post( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( 0 != $bb_post->post_status )
    $caps[] = 'edit_deleted';
    // NO BREAK
    case 'manage_posts' : // back compat
    $caps[] = 'delete_posts';
    break;
    case 'write_topic':
    $caps[] = 'write_topics';
    break;
    case 'edit_topic':
    // edit_closed, edit_deleted, edit_topics, edit_others_topics
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $args[0]) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    if ( $user_id == $topic->topic_poster )
    $caps[] = 'edit_topics';
    else
    $caps[] = 'edit_others_topics';
    break;
    case 'move_topic' :
    $caps[] = 'move_topics';
    break;
    case 'stick_topic' :
    $caps[] = 'stick_topics';
    break;
    case 'close_topic' :
    $caps[] = 'close_topics';
    break;
    case 'delete_topic' :
    $caps[] = 'delete_topics';
    add_filter( 'get_topic_where', 'no_where', 9999 );
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( 0 != $topic->topic_status )
    $caps[] = 'edit_deleted';
    remove_filter( 'get_topic_where', 'no_where', 9999 );
    break;
    case 'manage_topics' :
    // back compat
    $caps[] = 'move_topics';
    $caps[] = 'stick_topics';
    $caps[] = 'close_topics';
    $caps[] = 'delete_topics';
    break;
    case 'add_tag_to':
    // edit_closed, edit_deleted, edit_tags;
    if ( !$topic = get_topic( $args[0] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $topic->topic_id ) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    $caps[] = 'edit_tags';
    break;
    case 'edit_tag_by_on':
    // edit_closed, edit_deleted, edit_tags, edit_others_tags
    if ( !$topic = get_topic( $args[1] ) ) {
    $caps[] = 'magically_provide_data_given_bad_input';
    return $caps;
    }
    if ( !topic_is_open( $topic->topic_id ) )
    $caps[] = 'edit_closed';
    if ( '1' == $topic->topic_status )
    $caps[] = 'edit_deleted';
    if ( $user_id == $args[0] )
    $caps[] = 'edit_tags';
    else
    $caps[] = 'edit_others_tags';
    break;
    case 'edit_user':
    // edit_profile, edit_users;
    if ( $user_id == $args[0] )
    $caps[] = 'edit_profile';
    else
    $caps[] = 'edit_users';
    break;
    case 'edit_favorites_of':
    // edit_favorites, edit_others_favorites;
    if ( $user_id == $args[0] )
    $caps[] = 'edit_favorites';
    else
    $caps[] = 'edit_others_favorites';
    break;
    case 'delete_forum':
    $caps[] = 'delete_forums';
    break;
    case 'change_user_password':
    // change_password, edit_users
    $caps[] = 'change_password';
    if ( $user_id != $args[0] )
    $caps[] = 'edit_users';
    break;
    /*
    */

    Hi, I just upgraded WordPress to RC1 and used the newest trunk pf bbpress yesterday, and everything worked out fine…just as described during installation.


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Have you tried logging in and out of both your WordPress and bbPress installations and accessing both admin panels? I mean each combination each way.

    1. Log into WordPress; Check admin panel access and cookies; Log out of WordPress
    2. Log into bbPress; Check admin panel access and cookies; Log out of bbPress
    3. Log into WordPress; Check admin panel access and cookies; Log out of bbPress
    4. Log into bbPress; Check admin panel access and cookies; Log out of WordPress

    That is where the problem lies, and I have been running the most updated trunks of both bbPress and WordPress the entire time. :/

    :( I have just realized that…Bugfixing can be so frustrating…I will check again tonight…

    I am still kind of fighting with it…what i found was that initially new members added to bbpress via WP don´t get a role assigned…but on publishing their first post they will be assigned the proper role…

    As you mentioned bbpress live above: On install it says “not implemented” on the settings screen for the post to WP section. And I can´t get it work either. Is there any secret?


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @elwagar: Conversely, once they are registered you can assign them a role by going to the bbPress admin, WordPress Integration, and remapping. I feel like a plug-in could help this registration laziness along, but I also think this should just work correctly right away.

    I actually had a similar issue years ago integrating phpBB 2.x and osCommerce together, trying to get one to work inside the other with cookies and what-not was a really big problem, one that I never really did get working 100% correctly.

    I have no experience with bbPress Live, but it might be worth looking into. CK posted a really nice SQL example on how to grab information without a plug-in, so if you can’t get that to work, you could always put in a little manual labor. ;)

    I did as johnjamesj said (except that i left “secure auth” cookie salt as blank because I don’t see it anywhere) I am on wp 2.7rc1 and bb1.0a2. After installing, BB integrated and extracted the wp admin id to assign it the keymaster role. But I could not login in the newly created forum. On the WP side, I was stripped of my admin status and told that I don’t have the permissions.. bla bla. After initial panic, I edited wp_capabilities (under wp_usermeta). It was changed by BB to

    a:1:{s:9:"keymaster";b:1;}

    I changed it to

    a:1:{s:13:"administrator";b:1;}

    and got back admin powers in wp much to my relief.

    But the problem remains, I can’t login to BB. Something is seriously wrong.

    I can login it seems but the bb admin page wont open! I am using role managers plugin… is it to be blamed?


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    @Nipon: I had that plug-in installed at one point also, but I’m not sure if it is the culprit or not. I actually installed it hoping that it would pick up on the bbPress roles but it didn’t.

    If you integrate by modifying the config.php files, you won’t be able to access the bbPress admin regardless of where you login from.

    If you don’t integrate the config.php files, you can access the bbPress admin by logging in ONLY through the forum/bb-login.php.

    WordPress just isn’t aware of how to assign your session/role the forum admin rights. I am convinced this isn’t a cookie issue because all of us seem to have them pretty well synced up, and we’re able to login and stay logged in.

    @Nipon:

    I had the same problem. I had to manually add a row to the wp_usermeta table! For some reason, I lost the “wp_user_level” on my user… setting that to “10” fixed the problem! I had full admin rights to the WP install again, while keeping the “keymaster stuff” on wp_capabilities…

    Hope it helps…

    I’m still struggling with some stuff and wish I didn’t have to have my users sign in twice… I might come up with a solution for that or, at least, have the BB login look exactly like my WP’s custom login page. I’m actually contemplating of just taking punBB… It’s no more of a PITA to install and configure and it’s a much better solution!

    And I thought bbPress would be better and easier because of being from the same “ecosystem”… I was *sooooo* wrong… ;(

    I’m getting annoyed by bbPress already…

    Wouldn’t post my reply and then posted 3 times and then no way to delete them… :|


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    If you want to check out http://www.delsolownersclub.com, I am running wp2.7rc2 and bbpress1.0a2 right now. Logins are done through WordPress, and if I need to access the bbPress admin, I can login that way privately myself by typing the URL.

    Registrations are also forced through WordPress, as I need to use the register plus plugin or the facebook connect plugin to control registrations. All registered users have author access to WordPress, which conventionally is a horrible idea, but for our intentions it works alright. Unfortunately WordPress doesn’t automatically give the new user access to the forums because it isn’t aware of the roles for it. I have to manually run the map tool in bbPress when a new user registers. Again, it’s a small private group of about 90 users or so, and we all know each other.

Viewing 25 replies - 1 through 25 (of 33 total)

You must be logged in to reply to this topic.