Robin W (@robin-w)

Forum Replies Created

Viewing 25 replies - 7,351 through 7,375 (of 14,270 total)
  • @robin-w

    Moderator

    link to your site please

    @robin-w

    Moderator

    we got close though !

    if you do fix, come back with the solution 🙂

    @robin-w

    Moderator

    try re-adding my hook code as well !!

    @robin-w

    Moderator

    ok, let’s try something more basic

    this code just replaces the bbp_get_user_favorites_link, but puts the home url as the permalink

    function rew_get_user_favorites_link( $args = '', $user_id = 0, $wrap = true ) {
    		if ( ! bbp_is_favorites_active() ) {
    			return false;
    		}
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'favorite'  => __( 'Favorite',  'bbpress' ),
    			'favorited' => __( 'Favorited', 'bbpress' ),
    			'user_id'   => 0,
    			'topic_id'  => 0,
    			'before'    => '',
    			'after'     => ''
    		), 'get_user_favorites_link' );
    
    		// Validate user and topic ID's
    		$user_id  = bbp_get_user_id( $r['user_id'], true, true );
    		$topic_id = bbp_get_topic_id( $r['topic_id'] );
    		if ( empty( $user_id ) || empty( $topic_id ) ) {
    			return false;
    		}
    
    		// No link if you can't edit yourself
    		if ( ! current_user_can( 'edit_user', (int) $user_id ) ) {
    			return false;
    		}
    
    		// Decide which link to show
    		$is_fav = bbp_is_user_favorite( $user_id, $topic_id );
    		if ( ! empty( $is_fav ) ) {
    			$text       = $r['favorited'];
    			$query_args = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id );
    		} else {
    			$text       = $r['favorite'];
    			$query_args = array( 'action' => 'bbp_favorite_add',    'topic_id' => $topic_id );
    		}
    
    		$permalink = home_url() ;
    
    		$url  = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-favorite_' . $topic_id ) );
    		$sub  = $is_fav ? ' class="is-favorite"' : '';
    		$html = sprintf( '%s<span id="favorite-%d"  %s><a href="%s" class="favorite-toggle" data-topic="%d">%s</a></span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
    
    		// Initial output is wrapped in a span, ajax output is hooked to this
    		if ( ! empty( $wrap ) ) {
    			$html = '<span id="favorite-toggle">' . $html . '</span>';
    		}
    
    		// Return the link
    		return apply_filters( 'rew_get_user_favorites_link', $html, $r, $user_id, $topic_id );
    	}

    so remove my previous suggestion, and add the above function

    Then where you have

    bbp_user_favorites_link($fav_args); in your code

    replace with

    echo rew_get_user_favorites_link($fav_args);

    @robin-w

    Moderator

    Nice plugin, just loaded it to my site 🙂

    @robin-w

    Moderator

    ok, I registered, but cant see where to favorite a topic??

    @robin-w

    Moderator

    ok, this looks like it should work – add to your functions file – try it and come back

    add_action( 'bbp_favorites_handler', 'rew_redirect_to_home_page' ,10,1) ;
    
    function rew_redirect_to_home_page ($success) {
    	if ( true === $success && is_front_page()) {
    		$redirect = home_url() ;
    		wp_redirect( $redirect );
    
    		// For good measure
    		exit();
    	}		
    }

    @robin-w

    Moderator

    hmm… dug a bit further and the problem looks more complicated than I thought – I’ll play with it and come back

    @robin-w

    Moderator

    no problem – glad you are fixed

    @robin-w

    Moderator

    can you define what makes an ‘olds subcriptions’ – ie what is the logic?

    @robin-w

    Moderator

    Just had a look, and it should be possible to filter that function, but I really need to use the code you are using on the homepage to understand the issue.

    can you post that code?

    In reply to: Create new forum error

    @robin-w

    Moderator

    It could be a theme or plugin issue

    Themes

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

    Plugins

    If that deosnlt work, also deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    @robin-w

    Moderator

    If you can – I’d try it with a standard theme (eg twentyxx) and no other plugins and confirm that it is a bbpress issue

    @robin-w

    Moderator

    bbpress just uses wordpress registration, so this should work for you

    WP After Registration Redirect User Advanced

    come back and confirm

    In reply to: topic info widget

    @robin-w

    Moderator

    not a simple lift of code, so I’ve created the widget in my style pack plugin.

    bbp style pack

    Once activated, you’ll find the new widgets in the widgets section and can configure what they show there.

    Note : these widgets only appear on the relevant pages, so you won’t see the single topic information widget unless you are in a single topic!

    In reply to: topic info widget

    @robin-w

    Moderator

    I’m working on it – patience please

    @robin-w

    Moderator

    it’ll be in one of the next 3 releases, so keep the current code, and look at the ‘what’s new’ tab on updates

    @robin-w

    Moderator

    Alternate Forum template 1

    @robin-w

    Moderator

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>forum templates

    and select the alternate template

    In reply to: topic info widget

    @robin-w

    Moderator

    I’ll take a look shortly

    @robin-w

    Moderator

    Sorry, beyond my knowledge – Milan does paid support still I think

    https://support.dev4press.com/

    @robin-w

    Moderator

    I suspect these are theme or another plugin related

    @robin-w

    Moderator

    not totally sure what you are trying to do, but you could create a page and out the following shortcodes in it

    [bbp-single-topic id=$topic_id] 
    [bbp-forum-index]
    

    where $topic_id is the topic you want at the top.

    If you just want some basic rules, then you can create this as text and put it on a page above the [bbp-forum-index]

    @robin-w

    Moderator

    I’m not sure what you mean by ‘remove the bbPress menu from the toolbar’ – whereabouts are you seeing this and what ‘menu’ are you seeing ?

    In reply to: forum moderator role

    @robin-w

    Moderator

    do you mean that you would like admins to see forums in the dashboard ?

Viewing 25 replies - 7,351 through 7,375 (of 14,270 total)