Support Forum » Your Members Support » Developers Section

New Developer Tutorial - Integrating Your Members with BBPress

(8 posts)

Tags:

  1. Tim
    Technical Monkey

    http://www.newmedias.co.uk/featured/your-members-bbpress/
    Brief tutorial on how to access some Your Members data when using BBPress and I have included a modified BBPress Plugin to get you started enjoy.

    Tim Nash (tim@newmedias.co.uk) - NewMedias.co.uk
    Posted 2 years ago #
  2. blankpoint
    Member

    Thanks for getting to this. I am waiting until 1.4.2 comes out with all of its bug fixes and changes before I get back onto developing with it, but I looked over the tutorial in the mean time, and it looks good. Thanks. I noticed you mentioned issues with 1.0 alpha 2 -- what issue are you talking about in particular? I upgraded to alpha 2 from alpha 1, hoping it would have solved some of the cookie integration issues with WP 2.6.2 that alpha 1 has. Alas, it did not. Right now, I'm doing as you said, and redirecting all registration, login, and logout functions through WP. It's a little awkward that my users can't log in on the forum itself, but since I try to make my forum look like a normal part of the site, it was better to do that than have them log in on the forum and wonder why other parts of the site were then not responding as expected. Essentially, the problem seems to be that users have to log out of the site they logged in through. So if they log in on wordpress, they can logout with the bbpress method. Redirecting bbpress's logout link to wordpress's solves this.

    Posted 2 years ago #
  3. Tim
    Technical Monkey

    I was suffering from the same issues as http://bbpress.org/forums/topic/login-issue-with-bbpress-alpha-2-and-wordpress-262-integration so I dropped back to the alpha 1 build in the end, I'm hoping they fix this soon since the only reason I recommend using BBPress is for the seamless wordpress integration and if its not there then not much reason to use it over many of the other far more mature scripts out there.

    Tim Nash (tim@newmedias.co.uk) - NewMedias.co.uk
    Posted 2 years ago #
  4. malawimama
    Member

    I'm having trouble integrating bbPress under the memberships. I followed the instructions and downloaded the ym_hidden-forums plugin, made the changes to the php file according to the instructions, but it seems to be doing absolutely nothing. bbPress is using the same database as WP, and the installation went fine with no errors.

    Under the Your Members plugin I have the following:

    Subscription Options:
    - Platinum (paid membership)
    - Gold (paid membership)
    - Free

    Account Types:
    - Guest
    - Trial
    - Free
    - Member
    - Platinum
    - Gold
    - Silver

    The entire WordPress blog is only accessible for paid memberships, as should be the Forums.

    This is the .php file:

    $ym_hidden_forums['ym_hidden_forums']=array(1,2,3,4,5,6,7,8);	// hide these forums, list by comma seperated number
    
    $ym_hidden_forums['ym_allow_roles']['all_forums']=array('keymaster');		// these roles can always see ALL forums regardless
    $ym_hidden_forums['ym_allow_roles'][2]=array('member');	// exact Your Member Account type (in lowercase)
    
    $ym_hidden_forums['allow_users']['all_forums']=array(1);		// these users can always see ALL forums regardless
    $ym_hidden_forums['allow_users'][500]=array(5432,7654);	// list of users by number
    $ym_hidden_forums['allow_users'][501]=array(5432,7654);	// list of users by number
    
    $ym_hidden_forums['label']="[Members Only] ";	// text, html, css or image to indicate hidden forums/topics, make it =""; if you don't want any label at all

    PROBLEMS:
    1. You can still see the forum topics when you're not logged in.
    2. Paid members log in to WP, but are still asked to log in on the bbPress page. I was going to remove the login form completely, but bbPress is not recognizing the member that is already logged in through WP.

    What am I doing wrong???

    Posted 1 year ago #
  5. Callan
    Member

    Edit - user error.

    Posted 1 year ago #
  6. mediatician
    Member

    Hi, I'm trying to the follow the tutorial at http://www.newmedias.co.uk/featured/your-members-bbpress/ but having problems.

    1) the first section of code in the tutorial is:

    function bb_ym_get_user_account_type() {
    global $wp_users_object, $bb_current_user;
    $account_type = 'Guest';
    if ($bb_current_user) {
    $user = $bb_current_user->ID;

    foreach ($bb_current_user->ym_user as $key=>$value) {
    if ($key == 'account_type') {
    $account_type = strtolower($value);
    }
    }
    }
    return $account_type;
    }

    Where does this go? I can't find any mention of which file it should be added to or a new file created etc. I'm guessing this is the key to solving the problems but have no idea where to put this code.

    2) The the user isnt being automatically logged in to bbPress from the login at WP - they have to login to both seperately.

    3) I'm aiming to keep it simple just by having a 'members only' forum which is accessible only to paid members with the YM roles of 'individual', 'institution' or 'student'. I have this written into the code as below however all this does it to hide the members only forum (forum id #2). It visible to the one user id I've added (the admin account id #1). Again, I'm guessing that the YM roles aren't kicking in because of the code from point 1) above isnt where it should be.

    The code I am using in the YM hiden forum plugin is as follows:

    $ym_hidden_forums['ym_hidden_forums']=array(2); // hide these forums, list by comma seperated number

    $ym_hidden_forums['ym_allow_roles']['all_forums']=array('keymaster'); // these roles can always see ALL forums regardless
    $ym_hidden_forums['ym_allow_roles'][2]=array('individual','institution','student'); // exact Your Member Account type (in lowercase)

    $ym_hidden_forums['allow_users']['all_forums']=array(1); // these users can always see ALL forums regardless
    $ym_hidden_forums['allow_users'][500]=array(1); // list of users by number
    $ym_hidden_forums['allow_users'][501]=array(1); // list of users by number

    $ym_hidden_forums['label']="[Private] "; // text, html, css or image to indicate hidden forums/topics, make it =""; if you don't want any label at all

    You're help would be appreciated!

    Thanks,

    Mick

    Posted 1 year ago #
  7. Tim
    Technical Monkey

    Hi Mick I think you may have misunderstood the point of the tutorial, it was meant for developers to understand the code in the plugin (which is for bbpress), if you downloaded the plugin (included at the end of the file) then you do not need to add any code anywhere else, but you will need to just edit the arrays with the correct forums and account types.

    So to answer your questions

    1) You don't need to do anything just download the plugin and edit the arrays at the top.
    2) Did you follow the integration guides, used same tables and did the secret key cookie integration bits? If your still having problems with getting the two working togeather then the bbpress forums are a good place to ask for help.
    3) assuming your using the plugin as given yes that should work what is the error message if any its producing and

    Tim Nash (tim@newmedias.co.uk) - NewMedias.co.uk
    Posted 1 year ago #
  8. slee
    Member

    Will you ever extend the plugin so there is a form to edit the settings etc rather than having to edit the code?

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.