Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 10,830 total)
  • In reply to: Help with Forum Roles

    Robin W
    Moderator

    @robin-w

    I’ve corrected the documentation 🙂

    In reply to: Help with Forum Roles

    Robin W
    Moderator

    @robin-w

    If that is not clear, post your code and I’ll give back the correct version.

    In reply to: Help with Forum Roles

    Robin W
    Moderator

    @robin-w

    ok, thanks.

    It is a load order issue, so we need to add the filters once everything is loaded.

    So for @techinbermudas example we would have

    add_action ('wp_loaded' , 'load_new_roles') ;
    
    function load_new_roles () {
    	add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
    	add_filter( 'bbp_get_caps_for_role', 'add_role_caps_filter', 10, 2 );
    }
    
    function add_new_roles( $bbp_roles )
    {
        $bbp_roles['bbp_gcamdev'] = array(
            'name' => 'GCam Developer',
            'capabilities' => custom_capabilities( 'bbp_gcamdev' )
            );
         $bbp_roles['bbp_romdev'] = array(
            'name' => 'ROM Developer',
            'capabilities' => custom_capabilities( 'bbp_romdev' )
            );
        $bbp_roles['bbp_kerneldev'] = array(
            'name' => 'Kernel Developer',
            'capabilities' => custom_capabilities( 'bbp_kerneldev' )
            );
        $bbp_roles['bbp_modder'] = array(
            'name' => 'Modder',
            'capabilities' => custom_capabilities( 'bbp_modder' )
            );
        $bbp_roles['bbp_member'] = array(
            'name' => 'Member',
            'capabilities' => custom_capabilities( 'bbp_member' )
            );
     
        return $bbp_roles;
    }
    
    function add_role_caps_filter( $caps, $role )
    {
        /* Only filter for roles we are interested in! */
        if( $role == 'bbp_gcamdev' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_romdev' )
            $caps = custom_capabilities( $role );
     
        if( $role == 'bbp_kerneldev' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_modder' )
            $caps = custom_capabilities( $role );
    
        if( $role == 'bbp_member' )
            $caps = custom_capabilities( $role );
    
        return $caps;
    }
     
    
     
    function custom_capabilities( $role )
    {
        switch ( $role )
        {
            case 'bbp_gcamdev':
                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'        => true,
                    '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,
                );
    
            case 'bbp_romdev':
                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'        => true,
                    '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,
                );
    
            case 'bbp_kerneldev':
                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'        => true,
                    '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,
                );
    
            case 'bbp_modder':
                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'        => true,
                    '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,
                );
     
    
            case 'bbp_member':
                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'           => false,
                    '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;
        }
    }

    which adds the filter once the theme and all plugins are loaded.

    In reply to: Help with Forum Roles

    Robin W
    Moderator

    @robin-w

    of your theme?

    In reply to: Help with Forum Roles

    Robin W
    Moderator

    @robin-w

    @techinbermudas @mairag where are you putting this code?


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed 🙂


    Robin W
    Moderator

    @robin-w

    only a keymaster can add another keymaster.

    If there are no keymasters left, then add this plugin

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>bug fixes

    and you will see that you can add yourself back as a keymaster

    you can then dcativate and delete this plugin, or maybe use the features on your site


    Robin W
    Moderator

    @robin-w

    nothing I know of doe this at the moment

    If it’s a fixed list then just cascade eg

    [bbp-single-topic id=4096]
    [bbp-single-topic id=4097]
    [bbp-single-topic id=4099]
    [bbp-single-topic id=4099]

    if you’re doing it programmatically then just do the ‘echo_shortcode’ in a foreach loop

    or crack open /inclues/common/shortcodes and you can use the code form there to create what you want


    Robin W
    Moderator

    @robin-w

    [bbp-single-topic id=$topic_id] – Display a single topic. eg. [bbp-single-topic id=4096]


    Robin W
    Moderator

    @robin-w

    ok, so what is the bbpress role for the user ID you are using to examine the dashboard?


    Robin W
    Moderator

    @robin-w

    ok try

    dashboard>settings>permalinks and just click save – this resets the permalinks and may help


    Robin W
    Moderator

    @robin-w

    I’ve just upgraded my test site to wordpress 5.8 and all looks ok.

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    Robin W
    Moderator

    @robin-w

    so has it stopped working in front end, or just disappeared from back end or both?

    In reply to: All Replies 502 Error

    Robin W
    Moderator

    @robin-w

    ok, those all look ok.

    All I can suggest is that bbpress has got corrupted on your installation.

    I’d suggest

    deactivate and delete bbpress
    reinstall

    You won’t lose any data if you do that.

    In reply to: All Replies 502 Error

    Robin W
    Moderator

    @robin-w

    what have you got set in

    dashboard>settings>forums and the various slugs are set to what names?


    Robin W
    Moderator

    @robin-w

    I suspect that this is a woocommerce issue. bbpress just uses wordoress login, so it looks like something (eg woocommerce) is hooking to the wordpress login and taking you to shop.

    May well be a setting in woocommerce as to what to do when a user logs in


    Robin W
    Moderator

    @robin-w

    🙂


    Robin W
    Moderator

    @robin-w

    secondary_item_id is a buddypress database item, so looks like a hook might be needed.

    Can I ask you to log the issue with the buddypress support to see if they already know this.

    https://buddypress.org/support/

    If they can’t help, then come back and I’ll try to take a look for you


    Robin W
    Moderator

    @robin-w

    the keymaster role is further down the profile – it is an additional role to the wordpress one.

    If you have keymaster set for you, then it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    Robin W
    Moderator

    @robin-w

    that’s not code from bbpress.

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back


    Robin W
    Moderator

    @robin-w

    This should do it

    add_filter( 'bbp_get_breadcrumb', 'rew_remove_xx_breadcrumb' , 10 , 4) ;
    
    function rew_remove_xx_breadcrumb ($trail, $crumbs, $r, $args) {
    	if (strpos($trail,  'Forum Name') !== false) {
        $trail = '' ;
    	}
    	return $trail;
    }

    replace ‘Forum Name’ with the name of the forum you want to exclude

    but it would also get rid of the breadcrumb in any forums for a topic with the forum name as the topic title – ie it is just searching for any occurrence of the text in the breadcrumb string !!


    Robin W
    Moderator

    @robin-w

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Forum Display


    Robin W
    Moderator

    @robin-w

    great – glad you are fixed !!

    In reply to: 404 on Forums

    Robin W
    Moderator

    @robin-w

    it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    If you cannot do this to your site (say because it is live) then use the ‘troubleshooting’ features of this plugin to let you test without affecting other users

    Health Check & Troubleshooting

    Then come back

    In reply to: 404 on Forums

    Robin W
    Moderator

    @robin-w

    try

    dashboard>settings>permalinks and just click save – this resets the permalinks and may help

Viewing 25 replies - 1 through 25 (of 10,830 total)