Forum create only available to certain members
-
Is there a way or a plugin to limit forum creation to only the group administrators and moderators of the group but normal members can reply to forum topics created? So, members of the group cannot create forum topics unless they are moderators or admins but they can reply to topics.
-
@Anton
https://wordpress.org/extend/plugins/buddypress-restrict-group-creation/ requires PHP 5.2
https://buddypress.org/community/groups/bp-group-management/ for extra controlsThanks @mercime but I looked at those plugins and I believe they won’t work for my situation (am I missing something?)
I have a group “Sport News” with a couple of members and one administrator. I want to have the ability so that only the administrator or moderator(s) can create a new forum topic. Other members can reply to the forum topic that the administrator has started but they cannot start their own forum topics in that specific group.
@Anton, I beleive this will help you. Check the code link in the topic.
Replace current_user_can with only something a admin and mod can do, such as edit_post.. Check the user roles abilities.Edit: here’s a version for moderators: http://pastebin.com/YACKxvwn
Thanks @nit3watch
Wouldn’t it be simple to hide the option “create a forum” from members so that only admins and moderators can create forums? What is the code to check? Is it is_group_admin or is_group_mod?
Busy looking into that myself as im newb still Give me a shout if you find something, but should just be simple if else statement.
meh im being stupid, else {
wp_redirect( get_option(‘siteurl’) . ‘/about’);instead of redirecting them ( wp_redirect ) you could just hide it in the same statement.
ignore the above, “being stupid”.. Just woke up.
check this out:
http://wpmu.org/how-to-show-or-hide-content-in-wordpress-wpmu-based-on-user-authentication-roles-and-capabilities/Would this work to hide the “Create a Forum”
if(!is_admin || !is_mod)
{
blah blah hide create forum form or button
}Hi Anton, no you didn’t miss something, I did … missed the limit “topic” in post because of title “Forum create only available to certain members”
Change line 38 in https://trac.buddypress.org/browser/tags/1.2.5.2/bp-themes/bp-default/groups/single/group-header.php from
if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) :
to
if ( bp_is_group_forum() && current_user_can(‘level_7’) && !bp_is_group_forum_topic() ) :I was thinking that with @nuprn1‘s plugin activated, one can also use a conditional to target group admin and group mod specifically
Thanks a million @mercime
i’m confused – do you want to restrict the group settings->enable forum option (which restrict group creation plugin can do) or restrict creating a new topic within the group forum? if the later – don’t forget this theme file as well https://trac.buddypress.org/browser/tags/1.2.5.2/bp-themes/bp-default/groups/single/forum.php
@nuprn1 – I only want admins and moderators to create forums in their groups where members can only reply to those forum topics that they have started. Members shouldn’t be able to create their own forum topics unless they are admin or moderator. Does this make sense?
Thanks @nuprn1
@nuprn1 I have added your code to the post-form but now only Administrators of the site can add updates to the group. Not any Group admins.
just updated – sorry i forgot to swap in the proper templatetags and the option list
Thanks @nuprn1
Works with one problem. On the home page activity and member activity, the post to drop down only displays “My Profile” and not the groups you are admin at all.
Edit: admins of the site can see their groups in the dropdown but not members even if they are admins of a group
heh – what i get for one cup of coffee this morning. updated the code around the select option bit (just copied it in the wrong spot as it needs to be within the has_groups loop)
Thanks @nuprn1. It works like a charm!!!
- The topic ‘Forum create only available to certain members’ is closed to new replies.