Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 1,976 through 2,000 (of 14,120 total)
  • @robin-w

    Moderator

    great 🙂

    @robin-w

    Moderator

    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

    @codejp3 thanks for all your efforts on this, much appreciated.

    I have now incorportated your code into my plugin.

    Great work 🙂

    @robin-w

    Moderator

    bbpress cannot tell the subject matter, so either you don’t allow uploads or you risk users uploading unsuitable images

    In reply to: Forum Page Title

    @robin-w

    Moderator

    🙂

    In reply to: Multiple Views

    @robin-w

    Moderator

    link to an example on your site please

    In reply to: Help me

    @robin-w

    Moderator
    In reply to: No pagination controls

    @robin-w

    Moderator

    I’m not a bbpress author, just someone who helps out here. I can’t remember fully, but I have it in the back of my mind that there is an issue with that many forums, but don’t have time to set up 79 test forums to find out what it was.

    Then simplest solution would be to amend the page to show all the forums

    install

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Forum Display

    and set item 11

    @robin-w

    Moderator

    sorry, ! can’t get to our site as ssl cert is not valid.

    what theme are you using ?

    In reply to: Forum Page Title

    @robin-w

    Moderator

    took me a few minutes to work it out !!

    Try

    .post-type-archive-forum p {
    	display: none ;
    }

    @robin-w

    Moderator

    this might hep

    https://pmgarman.me/delete-users-without-posts-from-wordpress/

    bbpress just uses worpdress posts, so it should work.

    BUT ensure you can restore if it does something funny !!

    @robin-w

    Moderator

    great, glad you are fixed 🙂

    @robin-w

    Moderator

    bbpress has roles of keymaster, moderator, participant, spectator and blocked – see

    bbPress User Roles and Capabilities

    The rest of the above is either roles that you have created or come with memberpress, or roles that don’t exist but that you want – it’s not quite clear which 🙂 – please come back with further info.

    so is a ‘secondary keymaster’ a concept you want, or something that you have created or exists in memberpress???

    If you want to create a new memberpress role then the capabilities in the link above might help.

    @robin-w

    Moderator

    single login, so not sure why @billz88 has a problem.

    Woocomerce, bbpress and wordpress all use same login

    @robin-w

    Moderator

    only so much I can do for free 🙁

    In reply to: FORUM PERMALINK

    @robin-w

    Moderator

    dashboard>settings>forums>forum root slug>Forum Prefix

    @robin-w

    Moderator

    can’t remember, try it

    In reply to: Remove Separator

    @robin-w

    Moderator

    it’s a lot of code to learn.

    There are hundreds of filters and actions.

    most of it is detective work.

    I have bbpress in a folder on my laptop/

    I use

    https://notepad-plus-plus.org/

    as my main tool, it understands all the file types and displays them in a very readable way.

    It has a ‘search on files’, so in your case I looked for ‘subscribe’ as this was the word that had the | before it.

    that got me to the subscribe link function, which has the ' | ' in it, which got me to the filter

    When you came back with it changing when you click, I then searched for ' | ' and found it in the core function.

    For the ‘before_xx_parse_args’ and other filter stuff see

    Step by step guide to setting up a bbPress forum – part 5

    In reply to: Remove Separator

    @robin-w

    Moderator

    ah, found the function that the ajax call is doing.

    this code works on my test site

    function remove_sep ($args) {
    $args['before'] = '  ' ;
    return $args ;
    }
    
    add_filter ('bbp_before_get_topic_subscribe_link_parse_args', 'remove_sep') ;
    
    remove_action( 'bbp_ajax_subscription', array( 'BBP_Default', 'ajax_subscription' ) );
    
    add_action ( 'bbp_ajax_subscription', 'new_ajax_subscription');
    
    function new_ajax_subscription() {
    
    		// Bail if subscriptions are not active
    		if ( ! bbp_is_subscriptions_active() ) {
    			bbp_ajax_response( false, esc_html__( 'Subscriptions are no longer active.', 'bbpress' ), 300 );
    		}
    
    		// Bail if user is not logged in
    		if ( ! is_user_logged_in() ) {
    			bbp_ajax_response( false, esc_html__( 'Please login to subscribe.', 'bbpress' ), 301 );
    		}
    
    		// Get user and topic data
    		$user_id = bbp_get_current_user_id();
    		$id      = ! empty( $_POST['id']   ) ? intval( $_POST['id'] )         : 0;
    		$type    = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : 'post';
    
    		// Bail if user cannot add favorites for this user
    		if ( ! current_user_can( 'edit_user', $user_id ) ) {
    			bbp_ajax_response( false, esc_html__( 'You do not have permission to do this.', 'bbpress' ), 302 );
    		}
    
    		// Get the object
    		if ( 'post' === $type ) {
    			$object = get_post( $id );
    		}
    
    		// Bail if topic cannot be found
    		if ( empty( $object ) ) {
    			bbp_ajax_response( false, esc_html__( 'Subscription failed.', 'bbpress' ), 303 );
    		}
    
    		// Bail if user did not take this action
    		if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $object->ID ) ) {
    			bbp_ajax_response( false, esc_html__( 'Are you sure you meant to do that?', 'bbpress' ), 304 );
    		}
    
    		// Take action
    		$status = bbp_is_user_subscribed( $user_id, $object->ID )
    			? bbp_remove_user_subscription( $user_id, $object->ID )
    			:    bbp_add_user_subscription( $user_id, $object->ID );
    
    		// Bail if action failed
    		if ( empty( $status ) ) {
    			bbp_ajax_response( false, esc_html__( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );
    		}
    
    		// Put subscription attributes in convenient array
    		$attrs = array(
    			'object_id'   => $object->ID,
    			'object_type' => $type,
    			'user_id'     => $user_id
    		);
    
    		// Add separator to topic if favorites is active
    		if ( ( 'post' === $type ) && ( bbp_get_topic_post_type() === get_post_type( $object ) ) && bbp_is_favorites_active() ) {
    			$attrs['before'] = '  ';
    		}
    
    		// Action succeeded
    		bbp_ajax_response( true, bbp_get_user_subscribe_link( $attrs, $user_id, false ), 200 );
    }

    @robin-w

    Moderator

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>login failures

    @robin-w

    Moderator

    not really possible – sorry

    @robin-w

    Moderator

    can I just ask why you need to change this class ame, rather than just style the class to what you want

    @robin-w

    Moderator
    add_filter ('bbp_get_topic_class', 'rew_author_current' , 100 , 3) ;
    add_filter ('bbp_get_reply_class', 'rew_author_current' , 100 , 3) ;
    
    function rew_author_current ($post_classes, $topic_id, $classes) {
    	$author_id = bbp_get_topic_author_id( $topic_id );
    	$current_id = get_current_user_id() ;
    	if ($author_id == $current_id) {
    		$post_classes[] = 'rew-current-user' ;
    		$post_classes = array_merge( (array) $post_classes);
    	}
    return $post_classes ;
    }

    will give you ‘rew-current-user’ as a style to add css

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

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

    or use

    Code Snippets

    In reply to: Remove Separator

    @robin-w

    Moderator
    function remove_sep ($args) {
    $args['before'] = ' ' ;
    return $args ;
    }
    
    add_filter ('bbp_before_get_topic_subscribe_link_parse_args', 'remove_sep') ;

      is the code for space, so if you want 2 spaces put

    $args['before'] = '  ' ;

    @robin-w

    Moderator

    ok, let’s just redo the whole thing

    function custom_callback( $args=array()) {
    
            // Parse arguments against default values
            $r = bbp_parse_args( $args, array(
                'select_id'    => 'bbp_topic_status',
                'select_class' => 'my-class',
                'tab'          => false,
                'topic_id'     => 0,
                'selected'     => false
            ), 'topic_open_close_select' );
    
            // Filter & return
            return apply_filters( 'custom_callback', ob_get_clean(), $r, $args );
        }
    	
    
    add_filter( 'bbp_get_form_topic_status_dropdown', 'custom_callback');
Viewing 25 replies - 1,976 through 2,000 (of 14,120 total)