Robin W (@robin-w)

Forum Replies Created

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

    Moderator

    @budget101 thanks for posting this – I hope it will help others and it’s great that you have detailed your experience

    In reply to: vbulletin 3.x import

    @robin-w

    Moderator

    @budget101 thanks for posting this – I hope it will help others and it’s great that you have detailed your experience

    In reply to: Import Hung?

    @robin-w

    Moderator

    @budget101 thanks for posting this – I hope it will help others and it’s great that you have detailed your experience

    @robin-w

    Moderator

    untested, but add this to your functions file or snippets

    add_filter ('bbp_before_insert_forum_parse_args' , 'rew_order' ) ;
    
    function rew_order ($args) {
    $args['menu_order'] = 10 ;
    return $args ;
    }

    Code Snippets

    @robin-w

    Moderator

    function bbp_get_reply_topic_title ($reply_id)

    @robin-w

    Moderator

    ok, bit of code that does redirect but this is via wordpress login- this will be added to my style pack plugin shortly, with some further features, such as bbpress login

    //add private forum check
    add_action( 'bbp_template_redirect', 'rew_access_if_logged_out', 3 );
    
    function rew_access_if_logged_out(){
    	$topic_slug = get_option( '_bbp_topic_slug') ;
    	//quick check if we need to do this function
    	if (strpos($_SERVER['REQUEST_URI'], $topic_slug) == FALSE) return ;
    	$login_check=0 ;
    	$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 to 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 = rew_get_page_by_slug( $link[3], OBJECT, 'topic' );
    		$topic_id =  $post->ID;
    		$login_check=1 ;
    		} 
    	elseif (!is_user_logged_in() && empty($check) && $link[1] === $topic_slug) {
    		$post = rew_get_page_by_slug( $link[2], OBJECT, 'topic' );
    		$topic_id =  $post->ID;		
    		$login_check=1 ;
    	}
    	//now we need to check if the topic belongs to a private forum, so can't be seen
    	if (!empty ($login_check)) {
    		$forum_id = bbp_get_topic_forum_id($topic_id);
    		//if forum is private...
    			if (bbp_get_forum_visibility( $forum_id ) == 'private' ) {
    				$redirect = home_url() . '/wp-login.php?redirect_to=' .  urlencode( $_SERVER['REQUEST_URI'] ); ;
    				wp_redirect( $redirect );
    				exit;
    			}
    	}
    }
    
    function rew_get_page_by_slug($page_slug, $output = OBJECT, $post_type = 'page', $status = 'publish' ) { 
      global $wpdb; 
       $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type= %s", $page_slug, $post_type) ); 
         if ( $page ) 
            return get_post($page, $output); 
        return null; 
    }

    @robin-w

    Moderator

    I’m looking at login and redirects at the moment, so I’ll add this to my list to see how to fix

    @robin-w

    Moderator

    there is a hook you can use

    add_action( 'bbp_template_before_forums_index', 'rew_add_text' ); 
    
    function rew_add_text () {
    echo 'hello' ;
    }

    @robin-w

    Moderator

    bbpress sends the notification as a single email, with the noreply address as the to/from an the recipients are then bcc’d in.

    So you can’t simply remove it.

    you can amend how bbpress sends using this plugin

    AsynCRONous bbPress Subscriptions

    @robin-w

    Moderator

    without a link to an example then there’s little we can do

    @robin-w

    Moderator

    great – glad you are fixed, and thanks for posting your solution

    @robin-w

    Moderator

    great – glad to have helped

    @robin-w

    Moderator

    it might be white writing on white page.

    is the site available to look at ?

    @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

    I’m looking at this

    @robin-w

    Moderator

    my only suggestion would be to lift the functions form the plugin 🙂

    @robin-w

    Moderator

    bbpress just uses wordpress registration, so the issue is with that.

    Firstly check that you have membership ticked in dashboard>settings>general so that anyone can register.

    If you are not receiving emails, then what is set in
    dashboard>settings>general>email address
    and does it match your site?
    1. You should be aware that many spam filters strip messages that do not come from the correct address. So if your site is mysite.com and your email address in wordpress settings>general is fred@gmail.comthen it is likely that messages will be dumped in transit. You need to set up email to come from your site eg fred@mysite.com, your hosting provider can help if needed.
    2. Just bbpress?
    Then you need to see if this is wordpress wide or just bbpress.
    Try https://wordpress.org/plugins/check-email/

    @robin-w

    Moderator

    no problem!

    @robin-w

    Moderator

    put this in your custom css

    li.bbp-forum-topic-count, li.bbp-topic-voice-count, li.bbp-forum-reply-count, li.bbp-topic-reply-count {
    word-wrap: break-word !important;
    }

    @robin-w

    Moderator

    looks fine on my mobile

    @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 🙂

Viewing 25 replies - 7,201 through 7,225 (of 14,141 total)