Skip to:
Content
Pages
Categories
Search
Top
Bottom

TIME SENSITIVE!!! — How to Prevent \"Auto Join\" for a Forum/Group


  • Kate
    Participant

    @katendarcy

    Hate to point out that this is time sensitive, but it is. ;) Here goes:

    I know there are a lot of discussions on this forum about using groups for BBPress. Personally, I’ve come to appreciate the power of doing it the way the BP bbPress install uses groups…. However: Here’s my dilemma. I do want the forum to be attached to a particular group. But, I want other users to be able to post in that forum without joining it. I can’t give away details for the site I’m working on, but to illustrate, think of a school. It has students, teachers, and administrative staff. I want my students to be able to interact with the “Teachers” and “Admin Staff” on their forums to ask questions, etc., but I don’t want them auto-joining that group. Again, I do want the forum to be attached to that particular group. (Thus why I don’t want a standalone bbPress install.) Is this possible? If so, what functions could I call to accomplish it?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)

  • Pisanojm
    Participant

    @pisanojm

    This very question just popped up on our Launch… Please check this @r-a-y et. al… Seems like there was never an answer here….
    Using WP 3.0 and 1.2.5.2

    I think the only way to do this is by using an external bbPress install; I suppose you could hack the core, but I wouldn’t recommend it and I’m not sure without spending time looking to see if doing this would break anything else.


    Pisanojm
    Participant

    @pisanojm

    Possibly a Trac for 1.3+ enchancement then?


    Boone Gorges
    Keymaster

    @boonebgorges

    I can think of an easy way to do this with a plugin (essentially, by removing the poster from the group immediately after having auto-joined and posted, and cleaning up activity items), but it will require an action hook in BP core that isn’t there right now. Tonight or tomorrow I’ll write up a patch and post a message about it in this group.


    Boone Gorges
    Keymaster

    @boonebgorges

    OK, as promised. Here’s how to make it work. Two steps.
    1) You’ll have to patch your BuddyPress core files in the following way: https://trac.buddypress.org/attachment/ticket/2540/new_hooks_after_auto_group_join.patch. I’m hoping that the patch will go seamlessly into the core in the next version of BP (it’s less obtrusive than some of the less hackish fixes that Paul was probably thinking of above).
    2) Put the following code in your bp-custom.php file: http://pastebin.com/NPSRxG3C.

    In brief, here’s what happens: when a non-member posts to a group, he still joins the group (necessary in order to be able to post in the group forum). But the user is temporarily flagged as having been auto-joined, and immediately after the post goes through, the user is removed from the group. Also, a little cookie hack makes sure that the user doesn’t get a “You have successfully left the group” message after posting. Let me know if it works.


    Boone Gorges
    Keymaster

    @boonebgorges

    After submitting that patch, I realized that there was a much better way to do it that didn’t involve the hackiness. Check out the second patch on that trac ticket, and add the following line to wp-config.php:
    define( 'BP_DISABLE_AUTO_GROUP_JOIN', true );

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘TIME SENSITIVE!!! — How to Prevent \"Auto Join\" for a Forum/Group’ is closed to new replies.
Skip to toolbar