jessicana (@jessicana)

Forum Replies Created

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

  • jessicana
    Participant

    @jessicana

    Hello

    Thanks. Just to confirm with you, suppose the role tutor is a role that can not create topics but can edit the reply s/he creates. Accordingly, is the code below be correct?

    
    //code to add tutor role 
     
    function add_new_roles( $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_new_roles', 1 );
     
    function add_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', 'add_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'           => true,
                    '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'           => true,
                    'edit_others_topics'    => false,
                    'delete_topics'         => false,
                    'delete_others_topics'  => false,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    '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'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }

    Thanks


    jessicana
    Participant

    @jessicana

    @casiepa
    but any way, I should not receive any message when I use categories>parent forums>child foums>topics.
    This is a deficiency in bbpress to show such messages.


    jessicana
    Participant

    @jessicana

    I will revise the structure of the forums to make them: Category>forum>topics


    jessicana
    Participant

    @jessicana

    @casiepa
    ‘bbP Toolkit’ did not work for multisite for me. Does it work for multisites?


    jessicana
    Participant

    @jessicana

    *Resolved*


    jessicana
    Participant

    @jessicana

    That is because I didn’t enter the registration link inside the widget.


    jessicana
    Participant

    @jessicana

    No it’s not four. I am really trying to do this using fuctions.php but don’t know how.

    Thanks for your help.

    Regards


    jessicana
    Participant

    @jessicana

    I knew the reason and I will share it with you. There was an empty folder in the files along with the wp-admin and wp-content under the name of forums and this what created the problem. I simply deleted it and everything went just fine.

    I hope this helps!

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