Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 7,051 through 7,075 (of 14,141 total)
  • @robin-w

    Moderator

    suggest you start with

    dashboard>tools>forums>repair forums and run one at a time.

    In reply to: Comments Blacklist

    @robin-w

    Moderator

    ok, try this plugin

    bbp blacklist checker

    once activated go to tools>bbp blacklist checker

    This lets you switch off the code that is causing the issue.

    It’s just a bit of testing code, not intended for permanent live use, but may help confirm if it’s bbpress or something behind that is causing the issue.

    Try it for both anew post and an edited one

    In reply to: Layout for Categories

    @robin-w

    Moderator

    ok, no idea what your question is, you say you want them to look like what you have already solved.

    Have another go at phrasing the question

    In reply to: What’s in a name?

    @robin-w

    Moderator

    bulletin board press

    @robin-w

    Moderator

    You can achieve what you want if I have understood by the following

    Install the private groups plugin

    Private groups

    then

    a. Public discussion – just set up a public forum, and all users will be able to access this – no private groups settings needed

    b. Then for the keymaster only forum – do as follows

    1. Go into dashboard>settings>bbp private groups>topic permissions and activate this feature
    2. Create a group in dashboard>settings>bbp private groups>Group 1 (or whichever group you want)
    3. Create a new forum, set it as private (so only logged in users see it) and in the forum groups set group 1 with access

    4. Then click save and when then page refreshes, you will see topic permissions have appeared below the forum groups

    5. Now select Create/Edit OWN topics
    This then means that within that forum, users will only see topics they have created, and be able to reply. The keymaster can then see/reply to these topics. Any topic created by the keymaster will be visible to all users in this forum

    So from the user point of view they get a forum where they can post threads which only you and they see.

    I think this should achieve what you want – and given they can create multiple threads on what looks like to them as their own private forum, maybe is even better as they can create a new thread for a new topic !!

    In reply to: Layout for Categories

    @robin-w

    Moderator

    ok, now I can see – this is well beyond free help, buy suggest you start by looking at modifying

    wp-content/plugins/bbpress/templates/default/bbpress/content-archive-forum.php

    create a directory on your theme called ‘bbpress’
    ie wp-content/themes/%your-theme-name%/bbpress

    where %your-theme-name% is the name of your theme

    find
    wp-content/plugins/bbpress/templates/default/bbpress/content-archive-forum.php

    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/themes/%your-theme-name%/bbpress/content-archive-forum.php
    bbPress will now use this template instead of the original
    and you can amend this

    In reply to: Layout for Categories

    @robin-w

    Moderator

    seems I need login as well

    In reply to: Layout for Categories

    @robin-w

    Moderator

    ok, you just posted links to stuff that is not a forum and goes to the below

    https://zw660-f1e068.pages.infusionsoft.net/

    @robin-w

    Moderator

    for anyone finding this topic

    I kicked this code around to improve it and also stop the 404 error when a participant trashes a topic, so latest version is

    /*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() ) {
    			//only change delete topics 
    			$caps ['delete_topics']= true ;
    	}
    	return $caps;
    }
    /*then only allow participants to trash their own topics*/
    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_topic
    	if ( $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 );
    			
    			// 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();
    				
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    
    //then redirect to the forum after trashing topic
    add_action('bbp_template_redirect', 'ST_trash_topic_check', 8);
    
    //check if topic has been trashed by author and show forum if it has
    function ST_trash_topic_check() {
    	$topic_slug = get_option( '_bbp_topic_slug') ;
    	//quick check if we need to do this function, so bail if not a topic
    	if (strpos($_SERVER['REQUEST_URI'], $topic_slug) == FALSE) return ;
    	$forum_slug = bbp_get_root_slug() ;
    	//if check is set (ie we prefix forums with the forum slug) then part 1 will be forum slug and part 2 will be topic slug, if not part 1 will be topic slug
    	$check = bbp_include_root_slug() ;
    	$link = explode('/',$_SERVER['REQUEST_URI']);
    	//next we need the topic id (post id) of the topic so we need to check if it is a topic and if so, find the topic id
    	if (is_user_logged_in() && $check && $link[1] == $forum_slug && $link[2] == $topic_slug ) {
    		$post = bsp_get_page_by_slug( $link[3], OBJECT, 'topic' );
    		$login_check=1 ;
    		} 
    	elseif (is_user_logged_in() && empty($check) && $link[1] === $topic_slug) {
    		$post = bsp_get_page_by_slug( $link[2], OBJECT, 'topic' );
    		$login_check=1 ;
    	}
    	//now we need to check if the topic has been trashed by author
    	if (!empty ($login_check) && $post->post_status == 'trash' && $post->post_author == get_current_user_id() ) {
    		$topic_id =  $post->ID;
    		//then redirect to the forum we came from
    		$forum = bbp_get_forum_permalink (bbp_get_topic_forum_id (  $topic_id )) ;
    		wp_redirect ($forum) ;
    		exit ;
    	}
    	else return ;
    					
    }

    I’ll add this function into my style pack plugin shortly

    bbp style pack

    @robin-w

    Moderator

    I kicked this code around to improve it and also stop the 404 error when a participant trashes a topic, so latest version is

    /*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() ) {
    			//only change delete topics 
    			$caps ['delete_topics']= true ;
    	}
    	return $caps;
    }
    /*then only allow participants to trash their own topics*/
    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_topic
    	if ( $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 );
    			
    			// 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();
    				
    			// Unknown so do not allow
    			} else {
    				$caps[] = 'do_not_allow';
    			}
    		}
    	}	
    	// return the capabilities
    	return $caps;
    	}
    
    //then redirect to the forum after trashing topic
    add_action('bbp_template_redirect', 'ST_trash_topic_check', 8);
    
    //check if topic has been trashed by author and show forum if it has
    function ST_trash_topic_check() {
    	$topic_slug = get_option( '_bbp_topic_slug') ;
    	//quick check if we need to do this function, so bail if not a topic
    	if (strpos($_SERVER['REQUEST_URI'], $topic_slug) == FALSE) return ;
    	$forum_slug = bbp_get_root_slug() ;
    	//if check is set (ie we prefix forums with the forum slug) then part 1 will be forum slug and part 2 will be topic slug, if not part 1 will be topic slug
    	$check = bbp_include_root_slug() ;
    	$link = explode('/',$_SERVER['REQUEST_URI']);
    	//next we need the topic id (post id) of the topic so we need to check if it is a topic and if so, find the topic id
    	if (is_user_logged_in() && $check && $link[1] == $forum_slug && $link[2] == $topic_slug ) {
    		$post = bsp_get_page_by_slug( $link[3], OBJECT, 'topic' );
    		$login_check=1 ;
    		} 
    	elseif (is_user_logged_in() && empty($check) && $link[1] === $topic_slug) {
    		$post = bsp_get_page_by_slug( $link[2], OBJECT, 'topic' );
    		$login_check=1 ;
    	}
    	//now we need to check if the topic has been trashed by author
    	if (!empty ($login_check) && $post->post_status == 'trash' && $post->post_author == get_current_user_id() ) {
    		$topic_id =  $post->ID;
    		//then redirect to the forum we came from
    		$forum = bbp_get_forum_permalink (bbp_get_topic_forum_id (  $topic_id )) ;
    		wp_redirect ($forum) ;
    		exit ;
    	}
    	else return ;
    					
    }

    I’ll add this function into my style pack plugin shortly

    bbp style pack

    @robin-w

    Moderator

    this site only does this for the wordpress and bbpress sites.

    I’ll take a look at the plugin above soon, but tied up with other stuff at the moment

    In reply to: Comments Blacklist

    @robin-w

    Moderator

    Not sure why it does not for an edited post.

    In reply to: Comments Blacklist

    @robin-w

    Moderator

    ok, can you check if this happens with that word in a NEW post.

    I just want to understand if having blacklisted a post, it is having trouble reassessing it, or the issue is more core

    In reply to: Comments Blacklist

    @robin-w

    Moderator

    hmm…

    can you post the exact error message you are getting

    @robin-w

    Moderator

    glad you are fixed, but you have a tough ISP !!

    In reply to: Comments Blacklist

    @robin-w

    Moderator

    are you page caching ?

    @robin-w

    Moderator

    not an easy option.

    yes favorites are stored against a user.

    This gives the difficulty that you either:

    a) count favorites on then fly – ie on every page load you would cycle through each user and log the topics they have favorited and count them into an array – this will slow the site and it has to happen on every page load. you’d then store these into post meta.
    b) create some code that will count these using cron every so often, and update post meta
    c) link to the favorite button. So it would need to add when favorited and deduct when unfavorited. then you would need to allow for topics being trashed etc.

    a) is the easiest, but still a chunk of code and has site implications
    b) is probably the most practical, but will only be as current as you run cron, so could be say an hour out of date
    c) is a real bunch of code I suspect, but would be the best solution on a big website.

    @robin-w

    Moderator

    glad it’s working – I’ll take a look later 🙂

    @robin-w

    Moderator

    put this in your child theme’s functions file

    function rew_breadcrumbs ($args) {
    	
    	$args['home_text'] = 'your new words here';
    	return $args ;
    	
    }
    
    add_filter('bbp_before_get_breadcrumb_parse_args', 'rew_breadcrumbs');

    or use

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Breadcrumbs

    In reply to: Forum Messed up…

    @robin-w

    Moderator

    hmm…looks like the forums are displaying within a ccss element called title-box

    Otherwise not sure I can help.

    It is theme/css related

    @robin-w

    Moderator

    @robin-w

    Moderator

    great – glad you are fixed

    @robin-w

    Moderator

    insults – yeh that’ll work 🙂

    @robin-w

    Moderator

    that’s what spectator should do.

    Suggest you set up a test user and check that that works.

    @robin-w

    Moderator

    ok, I think your site has issues.

Viewing 25 replies - 7,051 through 7,075 (of 14,141 total)