Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Question


  • kdumas123
    Participant

    @kdumas123

    I have a client who wants a forum where tutors can discuss things amongst themselves. They want to create a topic where they can add information for their tutors. They don’t want anyone to be able to add topics to this.

    Can bbpress do this? If so, how?

    What do you recommend in this scenario?

    Thanks!

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

  • kdumas123
    Participant

    @kdumas123

    To be more clear, I’m looking for an area to supply information to the tutors. We want them to be able to read the information we give them. We just don’t want them to leave replies. It’s an informational area only, not for open discussion.

    We’d like to add a topic but just not allow replies.


    Robin W
    Moderator

    @robin-w

    You could do this.

    Presuming you only want tutors to see the forum (not the general public), basically you would set the forum as private, this restricts visibility to logged on users with higher than spectator privaledge to see them.

    You would then create a new bbpress role, which has visibility but no access. I think that would be fairly easy – I know how to go about it but have never tested

    If you want to go down this route and test, come back and I’ll make a quick function to set this up for you.

    You would have full rights – keymaster
    Then your clients would have keymaster or moderator role – lets them create forums and new topics (and indeed replies for supplementaries to topics)
    You clients’ tutors would have say “tutor” role, which is the spectator role with visibility to private forums added in.
    Public would see no forums, topics or replies


    kdumas123
    Participant

    @kdumas123

    Hi Robin,

    Thanks for your reply. Yes, let’s try this please.

    Let me know what I need to do first.

    Kim


    Robin W
    Moderator

    @robin-w

    ok, I’ll do some code tomorrow and come back !


    Robin W
    Moderator

    @robin-w

    ok, so create the forum as ‘private’ – you see a visibility setting on the forum page when you create it.

    Then drop this code into your (child)themes functions file.

    //code to add tutor role 
    
    function add_tutor_role( $bbp_roles )
    {
    	/* Add a role called Tutor */
    	$bbp_roles['bbp_tutor'] = array(
    		'name' => 'Tutor',
    		'capabilities' => custom_capabilities( 'bbp_tutor' )
    		);
    	return $bbp_roles;
    }
     
    add_filter( 'bbp_get_dynamic_roles', 'add_tutor_role', 1 );
    
    function tutor_role_caps_filter( $caps, $role )
    {
    	/* Only filter for roles we are interested in! */
    	if( $role == 'bbp_tutor' )
    		$caps = custom_capabilities( $role );
     
    	return $caps;
    }
     
    add_filter( 'bbp_get_caps_for_role', 'tutor_role_caps_filter', 10, 2 );
    
    function custom_capabilities( $role )
    {
    	switch ( $role )
    	{
    		 
    		/* Capabilities for 'tutor' role */
    		case 'bbp_tutor':
    			return array(
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => false,
    				'moderate'              => false,
    				'throttle'              => false,
    				'view_trash'            => false,
     
    				// Forum caps
    				'publish_forums'        => false,
    				'edit_forums'           => false,
    				'edit_others_forums'    => false,
    				'delete_forums'         => false,
    				'delete_others_forums'  => false,
    				'read_private_forums'   => true,
    				'read_hidden_forums'    => false,
     
    				// Topic caps
    				'publish_topics'        => false,
    				'edit_topics'           => false,
    				'edit_others_topics'    => false,
    				'delete_topics'         => false,
    				'delete_others_topics'  => false,
    				'read_private_topics'   => true,
     
    				// Reply caps
    				'publish_replies'       => false,
    				'edit_replies'          => false,
    				'edit_others_replies'   => false,
    				'delete_replies'        => false,
    				'delete_others_replies' => false,
    				'read_private_replies'  => true,
     
    				// Topic tag caps
    				'manage_topic_tags'     => false,
    				'edit_topic_tags'       => false,
    				'delete_topic_tags'     => false,
    				'assign_topic_tags'     => false,
    			);
    			break;
     
    		default :
    			return $role;
    	}
    }
    

    The set any tutors up with the tutor role in dashboard>users> user and at the bottom of the set up you’ll see forum role.

    If any of that’s not clear or beyond your knowledge, do come back, and I’ll help further


    kdumas123
    Participant

    @kdumas123

    Hi Robin,

    I got stuck on your step: “Then drop this code into your (child)themes functions file.”

    I haven’t been using a child theme. I looked up directions on how to create a child theme for the theme I’m using but when I activated that child theme, it removed all the customizations I have made to the template using the template’s layout features and built in Custom CSS area.

    http://para.llel.us/support/tutorials/making-an-incentive-child-theme/

    After searching Incentive’s forum some more, I saw this post:

    It’s up to you and will depend on how you intend to use the theme. I don’t usually setup a child theme until it becomes necessary.

    I’ll offer this word of caution. The way Incentive stores its data under a unique identifier based on the theme name, any theme specific settings will not show up in a child theme created after you’ve already started customizing. This means if you start building your site and create 20 custom layouts then later add a child theme you won’t see those layouts in the child theme admin. Each theme has its own set of data so it’s possible to have several installs of Incentive on one site with different settings. It’s not typical for a theme to do this but we find it much safer because it ensures you don’t get data crossover, ever, when there is another install of the theme on the same site.

    What I’m saying, in a very long and complicated way is, if you think there is a chance you’ll need a child theme at some point, create it now and start working that way from the beginning. :)

    So, now I’m thinking I can’t do what you want me to do… Any suggestions?


    Robin W
    Moderator

    @robin-w

    There is no reason that you shouldn’t use the main theme APART from the danger that on an update of the theme you’ll lose the changes. But as you’ve done changes, you have that risk now with your existing changes, and hopefully have a note of them ! As long as you keep a copy of the functions file, you should be able to just add this code to the theme’s functions file at the end.

    If that doesn’t work, come back, and I’ll cut the code into a plugin for you, but would prefer not to do that if I don’t have to (time!)


    kdumas123
    Participant

    @kdumas123

    Hi Robin,

    I was able to edit the functions file with your code. Thank you very much. I figured out how to change a role of a user to “tutor”.

    I’m a little confused as to how I can achieve everything now.

    Our first thing is that we want a private forum where our administrator can populate information for the tutors. This is the forum where we want our tutors to be able to view but we don’t want them to be able to add topics or reply. It’s an informational only forum.

    The second thing is that we would like to have other forums where we would like the tutors to be able to interact with each other and with our admins.

    Is this possible?

    When I went to one of our private forums, logged in as a tutor with the “tutor role”, it still let me post something.

    Do you want me to set you up with 2 different roles (an admin and a tutor) for you to see how it works. Not sure if you have a way for me to private message you with this.

    Thanks!

    Kim


    Robin W
    Moderator

    @robin-w

    no, this site doesn’t have a private message capability – your problem may well be someone else’s as well, so public answers help others !

    ‘When I went to one of our private forums, logged in as a tutor with the “tutor role”, it still let me post something. ‘ I’d try that again, and make sure you have logged out of the forum first in all your browser windows. If it still doesn’t work, come back and I’ll cut the code into a plugin.

    As to your desired set-up, this is getting complicated from a technical perspective.

    In essence you want
    Group a to have full permissions to participate across the site – the admins – no problem
    Group b to have spectator rights to some forums, but participation rights to others – ow!
    Public to see none of this – that is easy – forums set to private

    Is that correct? and if so I’ll have another think.


    kdumas123
    Participant

    @kdumas123

    Yes, I suppose that is exactly what I would like.

    If it can’t be done, I suppose we could just have a separate password protected page for the tutors not connected to bbpress.

    Just trying to figure out a solution.


    Robin W
    Moderator

    @robin-w

    There is one, but I need to document it, as it’s a bit of a cobble together of two plugins.

    I’ll do that shortly, and give it a final test to prove it works !


    Robin W
    Moderator

    @robin-w

    No, there isn’t one I can work out, just tried it and failed ! Would have been neat if it worked, but it didn’t.

    so we’re back to square 1

    Now if you use forums for interaction, and posts for information, then this becomes an easy solution

    Admins create posts in categories, so you get a flow for instance
    Exams
    Classes
    Math
    Economics

    These categories are then set in the menu structure, so they look cascade as you need them to.

    So admins can create and edits these pseudo topics and you turn off comments to prevent replies. You can the use the content permissions from the forum setup bit below (it’s a plugin you’ll be adding) to limit access to registered users only (and indeed which – you can have a group to access say math and another to access say economics and a third group who can access both).

    Then you use forums for admins and tutors

    These can be separate forums ie some for admins which tutors don’t see, and some where both can interact – see http://www.rewweb.co.uk/creating-bbpress-groups/ for how to do this.

    Sorry I can’t get a neater solution !

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

You must be logged in to reply to this topic.