Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 8,101 through 8,125 (of 14,305 total)
  • @robin-w

    Moderator

    great – glad you’re fixed

    @robin-w

    Moderator

    This code will limit the topic title to 80 or whatever number you set $length to

    Put it in your child theme functions.php file

    add_filter ('bbp_new_topic_pre_title' , 'rew_limit_topic_length' ) ;
    add_filter ('bbp_edit_topic_pre_title' , 'rew_limit_topic_length' ) ;
    
    function rew_limit_topic_length  ($topic_title) {
    	$length = 80 ;
    	if (strlen($topic_title) > $length) {
    		$topic_title = substr($topic_title, 0, $length);
    	}
    return $topic_title ;
    }

    @robin-w

    Moderator

    so they seem to be saying that their plugin won’t let you change it.

    not sure I can help further without access, and that’s beyond free help

    @robin-w

    Moderator

    unfortunately it isn’t enough. Normally the title is just Forum, so without being able to examine a browser to see where this is coming from, I ma not able to help.

    It may be your theme is doing this.

    @robin-w

    Moderator

    The only solution I found was 8 years old

    may well still be valid – link to this please

    @robin-w

    Moderator

    can you say which shortcode(s) you are using on that page

    @robin-w

    Moderator

    my style pack plugin has a latest activity widget that lets you display the above

    bbp style pack

    @robin-w

    Moderator

    The 2nd function assumes that you only have the default roles.

    Put this first and it should work ie

    //BBpress Rename Roles //
         /* BBPress Renaming Roles */
        add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' , 1);
        function ntwb_bbpress_custom_role_names() {
        return array(
        // Keymaster
        bbp_get_keymaster_role() => array(
        'name' => 'Administrator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
        ),
        // Moderator
        bbp_get_moderator_role() => array(
        'name' => 'Moderator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_moderator_role() )
        ),
        // Participant
        bbp_get_participant_role() => array(
        'name' => 'Member',
        'capabilities' => bbp_get_caps_for_role( bbp_get_participant_role() )
        ),
        // Spectator
        bbp_get_spectator_role() => array(
        'name' => 'Spectator',
        'capabilities' => bbp_get_caps_for_role( bbp_get_spectator_role() )
        ),
        // Blocked
        bbp_get_blocked_role() => array(
        'name' => 'Blocked',
        'capabilities' => bbp_get_caps_for_role( bbp_get_blocked_role() )
        ));}
    //BBpress Rename Roles End //
    
    //BBpress Custom Roles // 
    function add_new_roles( $bbp_roles )
    {
        /* Add a role called tutor */
        $bbp_roles['bbp_lead'] = array(
            'name' => 'Community Lead',
            'capabilities' => custom_capabilities( 'bbp_lead' )
            );
     
        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_lead' )
            $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_lead':
                return array(
                    // Primary caps
                    'spectate'              => true,
                    'participate'           => true,
                    'moderate'              => true,
                    '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'    => true,
     
                    // Topic caps
                    'publish_topics'        => true,
                    'edit_topics'           => true,
                    'edit_others_topics'    => true,
                    'delete_topics'         => true,
                    'delete_others_topics'  => true,
                    'read_private_topics'   => true,
     
                    // Reply caps
                    'publish_replies'       => true,
                    'edit_replies'          => true,
                    'edit_others_replies'   => true,
                    'delete_replies'        => true,
                    'delete_others_replies' => true,
                    'read_private_replies'  => true,
     
                    // Topic tag caps
                    'manage_topic_tags'     => true,
                    'edit_topic_tags'       => true,
                    'delete_topic_tags'     => true,
                    'assign_topic_tags'     => true,
                );
     
                break;
     
            default :
                return $role;
        }
    }
    // End BBpress Custom Roles //

    @robin-w

    Moderator

    a link to a site where your desired layout is shown would be great

    @robin-w

    Moderator

    a link to the site where it is would be great

    @robin-w

    Moderator

    yes, it makes a gravity post and a topic post.

    You could code to remove the latter as part of this function by adding further code, but in all honesty I wouldn’t worry, you’d need to be creating thousands of topics a month to make an impact on performance

    @robin-w

    Moderator

    great – glad you are fixed

    @robin-w

    Moderator

    to only have it for a specified form, you add the form id

    eg

    add_action( 'gform_after_submission_5', 'set_post_content', 10, 2 );

    will make it fire only for gravity form ID 5

    @robin-w

    Moderator

    try this in your custom css

    .container {
    	width: 100%;
    }
    
    .et_pb_widget {
    word-wrap : normal ;
    }
    
    #sidebar .bbp-login-form label {
    	width: auto;
    }

    @robin-w

    Moderator

    I need a link to your site

    In reply to: Newsletter Integration

    @robin-w

    Moderator

    it integrates to buddypress I believe

    Available Integrations

    and this may help

    bbPress Integration

    In reply to: Test Topic

    @robin-w

    Moderator

    and did it work ?

    @robin-w

    Moderator

    It could be coded, but it would be an hours work and several calls. A plugin that relies on bbpress should check that when loaded, but whilst I know most of mine do, I couldn’t swear that they all do !!

    In reply to: list of all functions

    @robin-w

    Moderator

    would love to find the time to write it!!

    Like all open software bbpress relies on users to make it successful, and I’m not a bbpress author, just a user who got into it, and I wrote much of the ‘getting started’ guide as I installed my first bbpress site.

    If you want to help, then as above the key start point is the templates. Mapping these into a user understandable chart would be a great start, so go to

    bbpress/templates/default/bbress/content-archive-forum.php
    This is the first template called, and all the functions and templates you want to use will cascade from here.

    In reply to: signature separator

    @robin-w

    Moderator

    bbpress doesn’t have a signature field. Are you using another plugin to do this ?

    @robin-w

    Moderator

    this is a conditional statement

    basically it has 3 parts

    test
    ?
    true
    :
    false

    each in this case is a function

    so the test is bbp_show_lead_topic() – This will return false by default, but if you set it using a filter, then it would be true

    if this returns true then the ‘?’ function is executed which will show the reply count (just the number of replies)

    if false then the ‘:’ statement is executed which shows then post count (the count of topic + replies ie replies +1)

    @robin-w

    Moderator

    ok, so

    1. Save the attached code to your pc, as a new file called reply.js
    2. Create a directory on your theme called ‘js’, and copy the renamed file reply.js to it, so that you end up with wp-content/themes/%my-theme%/js/reply.js

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

    Let me know if this works

    addReply = {
    	moveForm : function(replyId, parentId, respondId, postId) {
    		var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
    
    		if ( ! reply || ! respond || ! cancel || ! parent )
    			return;
    
    		t.respondId = respondId;
    		postId = postId || false;
    
    		if ( ! t.I('bbp-temp-form-div') ) {
    			div = document.createElement('div');
    			div.id = 'bbp-temp-form-div';
    			div.style.display = 'none';
    			respond.parentNode.insertBefore(div, respond);
    		}
    
    		reply.parentNode.insertBefore(respond, reply);
    		if ( post && postId )
    			post.value = postId;
    		parent.value = parentId;
    		cancel.style.display = '';
    
    		cancel.onclick = function() {
    			var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
    
    			if ( ! temp || ! respond )
    				return;
    
    			t.I('bbp_reply_to').value = '0';
    			temp.parentNode.insertBefore(respond, temp);
    			temp.parentNode.removeChild(temp);
    			this.style.display = 'none';
    			this.onclick = null;
    			return false;
    		}
    				
    		try { t.I('bbp_reply_content').focus(); }
    		catch(e) {
    			
    
    			
    			
    		}
    		
    		
    
    		return false;
    	},
    
    	I : function(e) {
    		tinymce.execCommand('mceFocus',false,'bbp_reply_content');
    	}
    	
    	
    	
    }

    @robin-w

    Moderator

    ok, so

    1. Save the attached code to your pc, as a new file called reply.js
    2. Create a directory on your theme called ‘js’, and copy the renamed file reply.js to it, so that you end up with wp-content/themes/%my-theme%/js/reply.js

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

    Let me know if this works

    addReply = {
    	moveForm : function(replyId, parentId, respondId, postId) {
    		var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
    
    		if ( ! reply || ! respond || ! cancel || ! parent )
    			return;
    
    		t.respondId = respondId;
    		postId = postId || false;
    
    		if ( ! t.I('bbp-temp-form-div') ) {
    			div = document.createElement('div');
    			div.id = 'bbp-temp-form-div';
    			div.style.display = 'none';
    			respond.parentNode.insertBefore(div, respond);
    		}
    
    		reply.parentNode.insertBefore(respond, reply);
    		if ( post && postId )
    			post.value = postId;
    		parent.value = parentId;
    		cancel.style.display = '';
    
    		cancel.onclick = function() {
    			var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
    
    			if ( ! temp || ! respond )
    				return;
    
    			t.I('bbp_reply_to').value = '0';
    			temp.parentNode.insertBefore(respond, temp);
    			temp.parentNode.removeChild(temp);
    			this.style.display = 'none';
    			this.onclick = null;
    			return false;
    		}
    				
    		try { t.I('bbp_reply_content').focus(); }
    		catch(e) {
    			
    
    			
    			
    		}
    		
    		
    
    		return false;
    	},
    
    	I : function(e) {
    		tinymce.execCommand('mceFocus',false,'bbp_reply_content');
    	}
    	
    	
    	
    }

    @robin-w

    Moderator

    no problem, glad to have helped !

    @robin-w

    Moderator

    yes add this to your child theme function file

    add_filter ('bbp_get_do_not_reply_address', 'rew_no_reply') ;
    function rew_no_reply () {
    Return 'xxx@yyy.com' ;
    }

    changing xxx@yyy.com to wehatever address you want

Viewing 25 replies - 8,101 through 8,125 (of 14,305 total)