BuddyDev

Search

Replies

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35277

    Ok I see the issue, THANK YOU SO MUCH FOR YOUR HELP AND PATIENCE!!! I really appreciate it!!

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35276

    Ok I see the issue, THANK YOU SO MUCH FOR YOUR HELP AND PATIENCE!!!

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35272
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35270

    Yes, when I click on a user Im connected with it goes to 404 page, even though the url populates as https://youryous.com/members/username/.

    With the first code provided

    /**
     * Modify default tab.
     */
    function buddydev_modify_default_tab() {
    
    	if ( ! is_user_logged_in() || bp_is_my_profile() || ! bp_is_active( 'friends' ) ) {
    		return;
    	}
    
            // If both are friends set default tab to profile otherwise activity.
    	if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
    		define( 'BP_DEFAULT_COMPONENT', 'survey' );
    	} else {
    		define( 'BP_DEFAULT_COMPONENT', ‘profile’ );
    	}
    }
    
    add_action( 'bp_setup_globals', 'buddydev_modify_default_tab', 15 );

    It directed to profile correctly but I want it to direct to a specific tab on their profile.

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35267
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35263

    Hello, when I use the code as provided and go to the profile of someone I am connected with, I get a 404 error.

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35257

    I still cant seem to get this to work. Should I be replacing $tab with something else? here is what I pasted in php file.

    `/**
    * Modify default tab.
    */
    function buddydev_modify_default_tab( $tab ) {

    if ( ! is_user_logged_in() || bp_is_my_profile() || ! bp_is_active( ‘friends’ ) ) {
    return $tab;
    }

    // If both are friends set default tab to profile otherwise activity.
    if ( friends_check_friendship( bp_loggedin_user_id(), bp_displayed_user_id() ) ) {
    return ‘friends’;
    }

    return ‘my-survey’;
    }

    add_filter( ‘bp_member_default_component’, ‘buddydev_modify_default_tab’ );

    Sorry for all the confusion, I’m not great at php.

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35256

    Disregard the msg about the error. Still working on the issue.

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35255

    Actually that code gave me the following error. Parse error: syntax error, unexpected ‘ ‘ (T_STRING) in /home/customer/www/youryous.com/public_html/wp-content/plugins/bp-custom.php on line 10

  • Participant
    Level: Initiated
    Posts: 13
    Matthew Ling on #35254

    Ok, so should this replace the previous code or be in addition to the previous code?