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).
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.
Members automatically join a group when they post in the forum of it.
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.
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.
“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?
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 )
I tried but I couldn’t do it… Tsk tsk…
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.
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
@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?
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;
@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
@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)
So, there is no way to replace it, huh?