Skip to:
Content
Pages
Categories
Search
Top
Bottom

Members cant post to groups that they didn’t join.Why?


  • Ali Erkurt
    Participant

    @alierkurt

    Hello. As an admin, I can post every group’s wire. But normal members cant do that. A member can see all the groups in the “Post in Group” list but when member clicks to share an error occurs.

    In the post-form.php I’ve changed the group list to:

    if ( bp_has_groups( ‘&type=alphabetical&max=1000&per_page=1000&populate_extras=0’ ) ) : while ( bp_groups() ) : bp_the_group();

    With that, every member can see all the groups. But can’t post to they didn’t join. I know solution is about “is_member” function. But I don’t know where to replace.

    What can I do? Thanks.

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

  • Ali Erkurt
    Participant

    @alierkurt

    I really need a solution…. I’m stuck.

    @alierkurt; I found your post here whilst taking a break from, well, breaking things in BP. ;)

    Not sure what you mean though. Why would members need to post in a group they haven’t joined? I’d have thought that’s the basic idea; you join one to post in it (and read too, if it’s hidden).


    Ali Erkurt
    Participant

    @alierkurt

    I’m developing a new project and you don’t have to be a member of the group. I need non-members to post to the group.


    rossagrant
    Participant

    @rossagrant

    Members automatically join a group when they post in the forum of it.


    Ali Erkurt
    Participant

    @alierkurt

    No, it’s not forum. It’s status update to the group’s wire. You can only update the groups you’re a member of. But what I want is to post non-members either.


    Ali Erkurt
    Participant

    @alierkurt

    I’ve tried to modify BP_Groups_Member and check_is_member but I couldn’t make it…

    I’m using the 1.2.5 version of BP and WP 3.0.

    Please help :)
    I’m really stuck.


    @mercime
    Participant

    @mercime

    “You can only update the groups you’re a member of.”
    That’s the idea, one way to prevent spammers from messing with your group.

    Do you mean you want to allow anyone to post status updates even in private (by invitation only) groups or only in public groups?


    Ali Erkurt
    Participant

    @alierkurt

    Yes @mercime. I want that. Everyone to post the groups even they’re not a member of. You give me the solution and I’ll take care with the spammers :))


    Ali Erkurt
    Participant

    @alierkurt

    I tried but I couldn’t do it… Tsk tsk…


    Ali Erkurt
    Participant

    @alierkurt

    I found something. If you’re admin, moderator and a member of the group, you can see the post-form.php on the group home page. is_admin works perfectly. But how can I see post updates to the groups without being a member?

    Thanks a lot again.


    Ali Erkurt
    Participant

    @alierkurt

    Murphy whispers: “When you need help, everyone disappears.”

    :)

    in the function groups_post_update a check is performed if someone is a member prior to posting an activity_update (there is no action hook prior to this conditional) – so you’ll need to find out how to join all your members to groups first. (another plugin or custom hook when someone registers, creates a new group, views a group, etc)

    the theme for /groups/single/activity.php contains a check for bp_group_is_member() around the post-forum.php include


    Ali Erkurt
    Participant

    @alierkurt

    @nuprn1 I know and I tried to remove it. When I remove the code, I can see the post-form but when a non-member tries to post something to the group, it says “couldnt update your status. please try again later. The problem is it’s still checking somewhere else to see whether the member joined or not.

    Where’s that?


    Ali Erkurt
    Participant

    @alierkurt

    But if you’re admin you can post with the same way.

    That is because the check within groups_post_update allows the site_admin


    /* Be sure the user is a member of the group before posting. */
    if ( !is_site_admin() && !groups_is_user_member( $user_id, $group_id ) )
    return false;


    Ali Erkurt
    Participant

    @alierkurt

    @nuprn1 Great! Finally I got where the function is. Thanks.

    But how can I redefine the function to skip group_is_member process for the non-members to post.

    I think I’ll add this to my function this:

    add_filter (‘groups_post_update’, ‘myfunction’);

    Right? But what’s the function :)


    Ali Erkurt
    Participant

    @alierkurt

    @nuprn1 Or is this about remove_action and add_action? I found the groups_post_update but I can’t change it with my theme’s functions.php file. Because there’s a problem with filter or action thing…

    Actually I don’t know how to replace functions with my_sample_function. For example I want to change something in the plugin’s function. But if I do that in the plugin’s file, I’ll lose changes when I upgrade. So what might be the solution to avoid this?

    add_action, add_filter etc… How can I do that?
    Thanks.

    groups_post_update is not pluggable – the only action (bp_groups_posted_update) within that function is after the activity update occurs. (which is after is_user_member check)


    Ali Erkurt
    Participant

    @alierkurt

    So, there is no way to replace it, huh?

Viewing 19 replies - 1 through 19 (of 19 total)
  • The topic ‘Members cant post to groups that they didn’t join.Why?’ is closed to new replies.
Skip to toolbar