Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 9,251 through 9,275 (of 14,141 total)
  • @robin-w

    Moderator

    on the first one, can you clarify that accessing

    dashboard>forums just sends you to the homepage, or can you tell me exactly what actions are needed.

    @robin-w

    Moderator

    ok, whilst out I think I know what the issue is.

    Firstly can you confirm that apart from redirecting you to home, the code at the top of this thread works? ie redirection to the wrong place is the only outstanding issue.

    If so, the issue is that after you delete a topic, bbpress sends you to back to the topic, which as a moderator you are allowed to see trashed topics, but as a partyicipant you are not. This then will send you to a 404 page, which in your case I think just sends you to home.

    So let me look at ways to get around this.

    In reply to: Forum descriptions

    @robin-w

    Moderator

    thanks – I’ll take a look

    @robin-w

    Moderator

    though re-reading the thread this morning, I think I have not fixed anything, juts done it another way.

    and that doesn’t work either – forget the code above

    @robin-w

    Moderator

    ok, I’ve taken pity and kicked this round for an hour – I expect to be on your Christmas list !!!

    This seems to work, although please do some testing for all roles, and check it out.

    /*Customize the BBPress roles to allow Participants to trash topics*/
    add_filter( 'bbp_get_caps_for_role', 'ST_add_role_caps_filter', 10, 2 );
    
    function ST_add_role_caps_filter( $caps, $role ){
        // Only filter for roles we are interested in!
        if( $role == bbp_get_participant_role() ) {
    			
    			$caps = array(
    
    				// Primary caps
    				'spectate'              => true,
    				'participate'           => true,
    
    				// Forum caps
    				'read_private_forums'   => true,
    
    				// Topic caps
    				'publish_topics'        => true,
    				'edit_topics'           => true,
    				'delete_topics'         => true,
    				
    
    				// Reply caps
    				'publish_replies'       => true,
    				'edit_replies'          => true,
    				'delete_replies'        => true,
    
    				// Topic tag caps
    				'assign_topic_tags'     => true,
    			);
    
    	}
    	
        return $caps;
    }
    /*then only allow participants to trash their own topics*/
    
    add_filter( 'bbp_map_reply_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    add_filter( 'bbp_map_topic_meta_caps', 'ST_tweak_trash_meta_caps', 11, 4 );
    
    function ST_tweak_trash_meta_caps( $caps, $cap, $user_id, $args ){
    
    	// apply only to delete_reply and delete_topic
    	if ( $cap == "delete_reply" || $cap == "delete_topic" ){
    		// Get the post
    		$_post = get_post( $args[0] );
    		if ( !empty( $_post ) ) {
    
    			// Get caps for post type object
    			$post_type = get_post_type_object( $_post->post_type );
    			//$caps      = array();
    
    			// Add 'do_not_allow' cap if user is spam or deleted
    			if ( bbp_is_user_inactive( $user_id ) ) {
    				$caps[] = 'do_not_allow';
    
    			// Moderators can always edit forum content
    			} elseif ( user_can( $user_id, 'moderate' ) ) {
    				$caps[] = 'moderate';
    
    			// User is author so allow edit if not in admin
                } elseif ( user_can( $user_id, 'participate' ) && ( (int) $user_id === (int) $_post->post_author ) ) {
                    $caps      = array();
    				//$caps[] = $post_type->cap->delete_posts;
    
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    In reply to: Forum topic issue

    @robin-w

    Moderator

    can you tell us

    what theme you are using
    what other plugins you are using

    @robin-w

    Moderator

    no problem – not so long ago I was a newbie !!

    @robin-w

    Moderator

    the bbpress search widget does that – is there something particular that you want?

    In reply to: Change query

    @robin-w

    Moderator

    I am not sure I understand what it is you are asking

    wp-query is a wordpress function

    https://codex.wordpress.org/Class_Reference/WP_Query

    In reply to: User Role

    @robin-w

    Moderator

    Maybe you can take a look on my Site?

    sorry that is beyond free support.

    I have try it but bulk action doesn´t work.

    can you say what didn’t work – some detail would be useful

    In reply to: User Role

    @robin-w

    Moderator

    you can use the bulk action in dashboard>users to change current ones

    In reply to: User Role

    @robin-w

    Moderator

    it would only apply to new users.

    In reply to: Forum Root Issue

    @robin-w

    Moderator

    This theme uses the genesis framework, so I suspect you will need to add this plugin to make it all work

    bbPress Genesis Extend

    @robin-w

    Moderator

    In the bottom of my forum page there’s a ‘Suggest Category’ button

    Don’t know what is creating that.

    can we have a link please.

    In reply to: metadata for forums

    @robin-w

    Moderator

    I want to show a description for a forum in the forums list. Is there a way to enable this with bbPress, or a plugin that does it?

    use my style pack plugin

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>forum display and look at 6 & 7

    The forum description is put in the content of the forum dashboard>forums

    In reply to: User Role

    @robin-w

    Moderator

    try this – it should work but is untested

    Please come back and let us know if it does or doesn’t

    add_filter ('kal_get_user_role_map()' , 'bbp_get_user_role_map()' ) ;
    
    function kal_get_user_role_map() {
    
    	// Get the default role once here
    	$default_role = bbp_get_default_role();
    
    	return (array) apply_filters( 'kal_get_user_role_map', array (
    		'administrator' => bbp_get_keymaster_role(),
    		'editor'        => $default_role,
    		'author'        => bbp_get_spectator_role(),
    		'contributor'   => $default_role,
    		'subscriber'    => $default_role
    	) );
    }

    This goes in your function file

    In reply to: Forum descriptions

    @robin-w

    Moderator

    great !

    In reply to: Forum descriptions

    @robin-w

    Moderator

    my style pack plugin has an option for this

    install and activate and then go to
    dashboard>settings>bbp style pack>forum display items 6 & 7

    @robin-w

    Moderator

    great – glad you’re fixed

    @robin-w

    Moderator

    This link goes to forums, rather than a 500 error

    Forums

    try

    dashboard>settings>permalinks

    and just click save to refresh these

    @robin-w

    Moderator

    link to your site please

    @robin-w

    Moderator

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

    @robin-w

    Moderator

    @robin-w

    Moderator

    further thought – have you tried deleting the bbpress.php – it is only needed if the page.php isn’t doing what you want

    @robin-w

    Moderator

    sorry, I’ve taken a further look and I cannot work out why it is not working

Viewing 25 replies - 9,251 through 9,275 (of 14,141 total)