Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'add profile tab to nav bar'

Viewing 25 results - 26 through 50 (of 76 total)
  • Author
    Search Results
  • #256750
    danbp
    Moderator

    Documentation for this is in bp-core-buddybar.php

    Some working examples for navigation (since 2.6) here.

    And here a working example for:

    1. remove Delete Account on user profile settings tab
    2. add a new sub-nav item for “Memberships” to Profile > Settings

    1 )

    function bpex_remove_profile_settings_sub_tab() {   
    	// remove Delete Account from Profile Settings
    	bp_core_remove_subnav_item( BP_SETTINGS_SLUG, 'delete-account' );
    }
    add_action( 'bp_actions', 'bpex_remove_profile_settings_sub_tab' );

    2 )

    function bpex_add_sub_nav_to_profile_settings() {
    global $bp;
    $parent_slug = 'settings';
    $child_slug = 'memberships';
    		
    		//Add subnav item 	 
    		bp_core_new_subnav_item( array( 
    			'name'			=> __( 'My Memberships', 'textdomain' ),
    			'slug'			=> $child_slug, 
    			'parent_url'		=> $bp->loggedin_user->domain . $parent_slug.'/', 
    			'parent_slug'		=> $parent_slug, 
    			'screen_function'	=> 'bpex_profile_membership_screen'
    		) );
    }
    
    		function bpex_profile_membership_screen() {	
    			add_action( 'bp_template_content', 'bpex_profile_membership_screen_content' );
    			bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    		}
    
    		function bpex_profile_membership_screen_content() {
    			do_action( 'my_membership_post' );
    		}
    add_action( 'bp_setup_nav', 'bpex_add_sub_nav_to_profile_settings', 100 );
    
    function bpex_membership_stuff() {
    echo 'Some stuff here ?'; ?>
    <h2>Lorem Ipsum for ever !</h2>
    <p>Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.</p>
    <?php
    }
    add_action( 'my_membership_post', 'bpex_membership_stuff' );

    Add this to bp-custom.php

    Jeremy Pry
    Participant

    Under certain circumstances, there is an infinite loop inside the bp_legacy_theme_new_activity_comment() function. Specifically, when all of the secondary_item_id fields are zero, the $parent_id will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.

    This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/

    For information:

    • WordPress 4.5.3
    • BuddyPress 2.6.1.1
    • Single site install in web root
    • There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
    • We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
    • The core BuddyPress files have not been modified to my knowledge.
    • The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
    • The live site is http://www.lifeofdad.com/

    I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned bp_legacy_theme_new_activity_comment() function.

    My specific concern is this loop:

    
    	// Load the new activity item into the $activities_template global.
    	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
    
    	// Swap the current comment with the activity item we just loaded.
    	if ( isset( $activities_template->activities[0] ) ) {
    		$activities_template->activity = new stdClass();
    		$activities_template->activity->id              = $activities_template->activities[0]->item_id;
    		$activities_template->activity->current_comment = $activities_template->activities[0];
    
    		// Because the whole tree has not been loaded, we manually
    		// determine depth.
    		$depth = 1;
    		$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
    		while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    			$depth++;
    			$p_obj = new BP_Activity_Activity( $parent_id );
    			$parent_id = (int) $p_obj->secondary_item_id;
    		}
    		$activities_template->activity->current_comment->depth = $depth;
    	}
    

    I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.

    I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.

    I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.

    
    +--------------------------------------+--------+-----------+---------+
    | name                                 | status | update    | version |
    +--------------------------------------+--------+-----------+---------+
    | akismet                              | active | none      | 3.1.11  |
    | all-in-one-seo-pack                  | active | available | 2.3.7   |
    | appbuddy                             | active | available | 2.0.7   |
    | appcamera                            | active | available | 2.0.0   |
    | appfbconnect                         | active | none      | 2.3.0   |
    | apppresser                           | active | none      | 2.5.0   |
    | apppush                              | active | available | 2.1.0   |
    | appshare                             | active | none      | 2.1.0   |
    | appswiper                            | active | available | 2.2.1   |
    | bp-profile-search                    | active | none      | 4.5.2   |
    | buddypress                           | active | none      | 2.6.1.1 |
    | buddypress-activity-plus             | active | none      | 1.6.4   |
    | bp-moderation                        | active | none      | 0.1.7   |
    | buddypress-nocaptcha-register-box    | active | none      | 1.1.3   |
    | buddypress-toolbar                   | active | none      | 1.6.0   |
    | buddypress-wall                      | active | none      | 0.9.4   |
    | buddypress-xprofile-image-field      | active | none      | 2.0.1   |
    | category-posts                       | active | none      | 4.6.1   |
    | contact-form-7                       | active | none      | 4.4.2   |
    | contact-form-7-to-database-extension | active | none      | 2.10.20 |
    | cubell-themes-functionality          | active | none      | 3.1     |
    | envato-wordpress-toolkit             | active | none      | 1.7.3   |
    | hashbuddy                            | active | none      | 1.5.2   |
    | login-with-ajax                      | active | none      | 3.1.6   |
    | mailchimp-for-wp                     | active | none      | 3.1.11  |
    | nav-menu-roles                       | active | none      | 1.8.2   |
    | nextend-facebook-connect             | active | none      | 1.5.9   |
    | buddypress-media                     | active | none      | 4.0.4   |
    | vine-embed                           | active | none      | 0.2     |
    | wds-lod-automatic-friends            | active | none      | 0.1.0   |
    | wds-lod-base                         | active | none      | 0.1.0   |
    | wds-lod-bp                           | active | none      | 0.1.0   |
    | wds-lod-post-types                   | active | none      | 0.1.0   |
    | wds-lod-widgets                      | active | none      | 0.1.0   |
    | wordpress-importer                   | active | none      | 0.6.1   |
    +--------------------------------------+--------+-----------+---------+
    
    danbp
    Moderator

    Merci @imath !

    The old way

    The following syntax to change the tab order is deprecated since 2.6 and will throw an error notice:

    function rt_change_profile_tab_order() {
    global $bp;
    $bp->bp_nav['profile']['position'] = 10;
    $bp->bp_nav['activity']['position'] = 20;
    }
    add_action( 'bp_setup_nav', 'rt_change_profile_tab_order', 999 );

    The new way

    Now the correct syntax to use for modifying – since 2.6 – the tabs position on the buddybar when you’re on a profile.

    This example list all BP related items who appear by default on a profile nav, in order of appearance and include also the forum tab (if you use bbPress for group forums).
    By default, activity tab comes as 1st. The snippet will move it to 4th position.

    To modify a position you simply change the numeric value.
    If you want to move only one item, you remove or comment (add // at begin of the line) the ones you don’t want to move.

    function bpex_primary_nav_tabs_position() {
    	buddypress()->members->nav->edit_nav( array( 'position' => 4,	), 'activity' 		);
    	buddypress()->members->nav->edit_nav( array( 'position' => 5, 	), 'profile' 		); 
    	buddypress()->members->nav->edit_nav( array( 'position' => 7, 	), 'notifications'	); 
    	buddypress()->members->nav->edit_nav( array( 'position' => 9,	), 'messages' 	  	);
    	buddypress()->members->nav->edit_nav( array( 'position' => 2,	), 'friends' 	  	);
    	buddypress()->members->nav->edit_nav( array( 'position' => 6,	), 'groups' 		);
    	buddypress()->members->nav->edit_nav( array( 'position' => 3, 	), 'forums' 		);
    	buddypress()->members->nav->edit_nav( array( 'position' => 1, 	), 'settings' 		);
    }
    add_action( 'bp_setup_nav', 'bpex_primary_nav_tabs_position', 999 );

    That’s it for the buddybar nav menu order on profile.

    danbp
    Moderator

    Give this a try: (add to bp-custom.php) 1) & 2):

    function bpfr_hide_tabs() {
    global $bp;
    
    	if ( bp_is_user() && !is_super_admin() ) {
    		bp_core_remove_nav_item( 'notifications' );
    		bp_core_remove_subnav_item( 'messages', 'compose' );
    	}
    	
    }
    add_action( 'bp_setup_nav', 'bpfr_hide_tabs', 15 );

    3) With BP and xprofile component activated, a user doesn’t need access to WP dashboard. He can change his profile credentials from front-end.
    Easiest way would be to use this plugin.

    Retrieving them the possibility to change their email is anyway not a good idea. What happen when a user changed from yahoo to gmail, but can’t login because he lost his password ? Where will the new pwd be sent ?

    Perhaps you have also to remove this from the BP usermenu on toolbar ?
    Here’s how you can do it:

    function admin_bar_remove_this(){
    global $wp_admin_bar;
    	$wp_admin_bar->remove_node('my-account-messages-compose');
    }
    add_action('wp_before_admin_bar_render','admin_bar_remove_this');
    #253437
    danbp
    Moderator

    Hi @famous,

    anything directly related to URL for bp is listed here:
    http://hookr.io/plugins/buddypress/#index=l&search=url

    In most case, you can built a link by array, which generally extend pre existing parameters. It’s very variable and depend where and how the link shoud work.

    Here some exemple snippets to add a link to a member’s profile.

    /* add external link on buddy menu bar */
    function bpfr_menubar_link() {
    global $bp;
    
    if ( !is_user_logged_in() )
        return false;
    
    $link = bp_get_loggedin_user_link();
    
    	$bp->bp_nav[$slug] = array(
    			'name'                    => 'View my profile',
    			'slug'                    => 'super_link',
    			'link'                    => $link,
    			'css_id'                  => 'super-link',	
    			'position'                => 20
    		);
    }
    add_action( 'bp_core_new_nav_item', 'bpfr_menubar_link', 999 );
    
    /* link to profile on SWA page */
    function goto_my_profile_tab() {
      if ( !is_user_logged_in() )
        return false;
    
      if ( bp_is_active( 'xprofile' ) )
    
        echo '<li><a href="'. bp_get_loggedin_user_link() .'">View my profile</a></li>';
      
    }
    add_action( 'bp_activity_type_tabs', 'goto_my_profile_tab' ); // SWA page
    add_action( 'bp_members_directory_member_types', 'goto_my_profile_tab' ); // members directory page
    
    /* shortcode linking to profile [xyz] */
    function bpfr_link_to_profile() {	
    return '<a href="'. bp_get_loggedin_user_link() .'">View my profile</a>';			
    }
    add_shortcode( 'xyz', 'bpfr_link_to_profile' );

    Another technique for groups here.

    In hope this will help you to go further.

    #253221
    bertl11
    Participant

    Hello,

    I managed to add a new tab to the bp menu with the following code:

    function bpfr_menubar_link() {
    	global $bp;
    
    	$bp->bp_nav[$slug] = array(
    			
    			'name'     => 'Fotos, Videos',
    			'slug'     => 'super_link',
    			'link'     => 'http://test.com/test',
    			'css_id'   => 'super-link',	
    			'position' => 30
    		);
    }
    add_action( 'bp_core_new_nav_item', 'bpfr_menubar_link', 999 );

    But now I want to add this code as link:
    <a href="<?php echo home_url() . '/' . get_the_author_meta( 'user_login', wp_get_current_user()->ID ). '-kalender' ; ?>" >Kalender</a>

    How can I add this link so that it’s displayed as tab in the menu?

    Thanks a lot for your help

    #243147
    danbp
    Moderator

    @seore, please search a bit before asking ! For example “add profile tab to nav bar”
    https://buddypress.org/support/search/add+profile+tab+to+nav+bar/

    BP use slgihtly same technique as WordPress to build menus.
    https://codex.wordpress.org/Function_Reference/wp_nav_menu

    Seore
    Participant

    I’m looking how to add profile tabs on the nav bar for logged in users plus a logout one too, depending if they’re logged in and if they’re not a log in button is there.

    Just curious on how i would do this with php i assume.

    Any help would be great thanks.

    Site: cgonline.co
    Theme: Divi
    WordPress 4.2.4
    BuddyPress Version 2.3.2.1

    mhawksey
    Participant

    I was struggling with this and saw some old posts in the forums here but none appeared to work for BP > 1.5. The problem remove the Setting > General tab from the users profile settings and wp_admin_bar (we have single sign-on and this would have screwed it. The code

    function alt_bp_change_settings_default() {
    	global $bp;
    	// switch the settings default to notifications 
    	$args = array(  'parent_slug' => 'settings',
    			'screen_function' => 'bp_core_screen_notification_settings',
    			'subnav_slug' => 'notifications'
    			);
    	bp_core_new_nav_default( $args );
    	// remove settings > general from wp_admin_bar
    	if ( bp_use_wp_admin_bar() ) {
    		add_action( 'wp_before_admin_bar_render', create_function(
    		'', 'global $wp_admin_bar; $wp_admin_bar->remove_menu( "my-account-settings-general" );' ) );
    	}
    }
    add_action( 'bp_setup_nav','alt_bp_change_settings_default', 5);
    
    function alt_bp_remove_general() {
    	global $bp;
    	bp_core_remove_subnav_item( $bp->settings->slug, 'general' );
    }
    add_action( 'bp_setup_nav', 'alt_bp_remove_general', 200);
    
    #241429
    danbp
    Moderator
    function bpfr_remove_change_avatar_tab() {
    global $bp;
    	bp_core_remove_subnav_item( 'profile', 'change-avatar' );
    
    }
    add_action( 'bp_ready', 'bpfr_remove_change_avatar_tab', 15 );

    BuddyBar items

    Source: bp-core-buddybar.php
    function bp_core_remove_subnav_item( $parent_id, $slug )
    and to remove a nav item
    function bp_core_remove_nav_item( $parent_id )

    @mcuk
    Participant

    Hi all,

    I’m attempting to have nav tabs in the standard buddybar that displays the feed/loop for Favorites and Mentions, as seen in the pic on this page:

    Activity dropdown filters in templates

    1. I’ve managed to duplicate the activity loop on a tab with the code below, but the CSS is wrong. I’ve fiddled with the code a little as it was originally setup for blog posts and i think this is the reason the CSS i’ve written for activity loop isn’t being called. Is the hook my_profile_post() where the issue lies?

    2. I’m fine with setting up the navs and subnavs as desired, but I’m still being unsuccessful in loading a user favorites and user mentions feed/loop (want to duplicate what is shown on the subnav tabs under the default activity tab). Looked through the Buddypress code files and found and tried various things but none have worked. Any help/directions?

    (Code below thanks to Dan and Henry here: https://buddypress.org/support/topic/calling-a-post-authors-activity-stream/)

    function bpfr_post_profile_setup_nav() {
    	global $bp;
    	$parent_slug = 'test';
    	$child_slug = 'posts_sub';	
    	
    	//Add nav item
    	bp_core_new_nav_item( array(
    	'name' 					=> __( 'TEST' ),
    	'slug' 					=> $parent_slug,
    	'screen_function' 		=> 'bpfr_profile_post_screen',
    	'position' 				=> 100,
    	'default_subnav_slug' 	=> $child_slug 
    	) );
    	
    	//Add subnav item 	 
    	bp_core_new_subnav_item( array( 
    	'name' 					=> __( 'SUBTEST' ), 
    	'slug' 					=> $child_slug, 
    	'parent_url' 			=> $bp->loggedin_user->domain . $parent_slug.'/', 
    	'parent_slug' 			=> $parent_slug, 
    	'screen_function' 		=> 'bpfr_profile_post_screen'
    	) );
    }
    
    	function bpfr_profile_post_screen() {	
    		add_action( 'bp_template_content', 'bpfr_profile_post_screen_content' );
    		bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    	}
    
    	function bpfr_profile_post_screen_content() {
    		do_action( my_profile_post);
    	}
    
    add_action( 'bp_setup_nav', 'bpfr_post_profile_setup_nav' );
    
    function bpfr_get_stuff() {
    
    	$activity_id = bp_activity_get_activity_id( array(
    		'user_id' 	      => bp_loggedin_user_id(),
    		//'component'         => $bp->activity->id,
    		//'item_id'           => get_current_activity_id(),
    		//'type'              => 'activity_comment',
    		//'secondary_item_id' => $post->ID, 
    		//'type'              => $activity_post_object->action_id,
    	) );
    	
    	if ( ! $activity_id ) {
    		return '';
    	}
    // this is the activity loop, with some options.
    	if ( bp_has_activities( $activity_id . '&action=activity_update&max=5' )  ) :
    		while ( bp_activities() ) : bp_the_activity();
    			bp_get_template_part( 'activity/entry');
    		endwhile;
    	endif;
    }
    
    add_action ( 'my_profile_post', 'bpfr_get_stuff' );

    bp 2.2.3.1
    wp 4.1.2
    Website is being created locally, not online.

    #232729
    modemlooper
    Moderator

    This is for the admin bar:

    function custom_adminbar_titles() {
        global $wp_admin_bar;
    
            $wp_admin_bar->add_menu( array(
                    'id'    => 'my-account-groups-memberships',
                    'title' => 'new title here',
                )
    
            );
    }
    add_action( 'wp_before_admin_bar_render', 'custom_adminbar_titles' );

    This is for profile menu:

    function change_profile_submenu_tabs(){
    	global $bp;
    
    	$bp->bp_options_nav['groups']['my-groups']['name'] = 'new name here';
    }
    add_action('bp_setup_nav', 'change_profile_submenu_tabs', 999);
    izzyian
    Participant

    How can I make ONLY one tab Visible (the groups tab, so others can still see publicly the groups that user is a part of) to users who are not logged in on a user profile? And when a user logs in then the whole navigation bar (#object-nav)becomes visible again for all user profiles?

    I see no plugins for this , so maybe there is some code I could add to my functions?

    Thank you for any help

    #228945
    jessy
    Participant
    function bp_change_default_profile_sub_nav() {
    	if ( bp_is_user_settings() ) {
    		global $bp;
    		$args = array(
    			'parent_slug'     => $bp->settings->slug, // Slug of the parent
    			'subnav_slug'     => 'profile',  // The slug of the subnav item to select when clicked
    		);
    	bp_core_new_nav_default($args);
     	}
    }
    
    // Change default sub navigation of profile settings main tab navigation
    add_action( 'bp_setup_nav', 'bp_change_default_profile_sub_nav', 5);
    

    My Error:
    Notice: Undefined index: settings in /opt/wordpress-4.0-0/apps/wordpress/htdocs/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php on line 144

    #190937
    danbp
    Moderator

    @durkk,

    IMHO you do it overcomplicated.

    Create a new page; call it “extra”
    Create eventually a template for it. Basically, you made a copy of your theme “page.php”, you rename it “my-extra_page.php” and in the file header, you remove the original page comment and replace it with the new template comment.

    /*
    * Template name: my extra page
    */

    Save !

    Back to the page “extra” > edit and asign it the new template.

    Now you can add a this page to each profile by using the abose snippet from the child-theme functions.php

    
    function bpfr_my_setup_nav() {
        global $bp;
    	
    	$mytab=array(
    	'name'            => 'My Tab',
    	'link'      	  => 'permalink_to_your_page', // the one under the page title on page editor
    	'slug'         	  => 'my-tab',
    	'css_id'          => 'my_custom_tab',
    	'position'        => 100,
    	'user_has_access' => 1,
        'screen_function' => 'xprofile_screen_my_tab'
    	);
    	$bp->bp_options_nav['profile']['my-tab'] = $mytab; 	
    }
    add_action('bp_setup_nav', 'bpfr_my_setup_nav');

    You can now add into this page template any code you want. To call a plugin, a specific content or what else.

    To avoid this page to be shown in the menu bar, you can use this old plugin (it still works with 4.0)

    To use a shortcode from within the text widget (this is not possible by default)
    you can add this to your child-theme functions.php add_filter('widget_text', 'do_shortcode', 11);
    Now you can use a shortcode in this widget !

    #185458
    danbp
    Moderator

    @jejemo

    try by adding this at the begin of your function
    $user_id = bp_get_activity_user_id();

    If you’re working on the Toolbar, the correct way to add a menu is like on this example:

    
    /* add links/menus to the admin bar*/
    /* more details here: http://wpengineer.com/2113/add-menus-to-the-admin-bar-of-wordpress/ */
    
    function mytheme_admin_bar_render() {
    global $wp_admin_bar;
    
    	$wp_admin_bar->add_menu( array(
    		'parent' => 'new-content', // use 'false' for a root menu, or pass the ID of the parent menu
    		'id' => 'new_media', // link ID, defaults to a sanitized title value
    		'title' => __('Media'), // link title
    		'href' => admin_url( 'media-new.php') // name of file
    		'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
    		)
    	);
    }
    add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); 

    A similar method is used to add a tab. Here on a user profile.

    function bpfr_my_setup_nav() {
        global $bp;
    	
    	$mytab=array(
    	'name'            => 'My Tab',
    	'link'      	  => 'http://example.com/wp-content/themes/twentythirteen/my_extra_page.php',
    	'slug'         	  => 'my-tab',
    	'css_id'          => 'my_custom_tab',
    	'position'        => 100,
    	'user_has_access' => 1,
        'screen_function' => 'xprofile_screen_my_tab'
    	);
    	$bp->bp_options_nav['profile']['my-tab']=$mytab; 	
    }
    add_action('bp_setup_nav', 'bpfr_my_setup_nav');
    #180141
    shanebp
    Moderator

    For renaming things, the recommended practice is to use a language file:

    Customizing Labels, Messages, and URLs

    If you make a lot of changes, you should use that approach.

    The ‘counting bubble’ is filled using sprintf.
    You’re missing that call from your change.
    You could try
    $bp->bp_nav['messages']['name']='Mails <span>%d</span>';
    But I’d be surprised if it works.

    Here’s another method, that you can paste in your functions.php:

    function sundev_change_buddypress_profile_tabs( $translated, $original_text, $domain ) {
    
        if ( 'buddypress' !== $domain )  {
            return $translated; 
        }
    
        switch ( $original_text ) {
        
            case 'Messages <span>%d</span>':
                return 'Mails <span>%d</span>';
    
            case 'Messages':
                return 'Mails';
                			
            default:
                return $translated;
        }
    }
    add_filter( 'gettext', 'sundev_change_buddypress_profile_tabs', 10, 3 );

    Untested, but that should change the label in both a profile and the buddy-bar.

    bp-help
    Participant

    @fpats
    To comment out that block of code in your function just add /* after the opening php tag and before your function. After the last } then add */ before the closing php tag.
    Note comments basically prevents php from reading the function.
    Here is your function commented:

    
    <?php
    /* //Begin comment
    function redirect_group_home() {
      global $bp;
      $path = clean_url( $_SERVER['REQUEST_URI'] );
      $path = apply_filters( 'bp_uri', $path );
      if (bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false ) {
        
        echo "HERE WE GO...";
        echo "<PRE>"; print_r($bp->groups->current_group); echo "</PRE>";
        echo $bp->groups->current_group->status;
        echo $bp->groups->current_group->is_user_member;
        
        if ($bp->groups->current_group->is_user_member || $bp->groups->current_group->status == 'public') {
          echo "<PRE>"; print_r($bp->bp_options_nav); echo "</pre>";
          exit();
          if ($bp->bp_options_nav['groups']['announcements']['slug']) {
            bp_core_redirect( $path . $bp->bp_options_nav['groups']['announcements']['slug'] . '/' );
          } else {
            bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
          }
          bp_core_redirect( $path . 'welcome/' ); //quick hack for some other tab
        }
      }
    }
    */ //END COMMENT
    
    ?>
    
    azchipka
    Participant

    Ok so I managed to find a backwards way of doing it because I needed to be able to do the same thing. Your going to need two plugins.

    1. Your Preferred Role Management Plugin. I like Capacity Manager Enhanced
    2. Buddypress xProfiles ACL

    STEPS
    1. Use your role manager to create some new roles. Name them what ever you want.
    2. Go into the Users -> Profile Fields
    3. Create a Field Group for your Restricted Items (not the primary one).
    4. Go to the Settings -> xProfile ACL
    5. Put your Field Group that you only want the Admin to be able to edit for the admin only.
    6. Now this is important you need to modify the xProfile ACL php file (yes I know this makes it a hack, if xProfile ACL is updated you will lose this setting.)
    6a. Go to line 240 of the buddypress-xprofiles-acl.php file. Comment out lines 240 – 249, the code you are commenting out is:

    `
    function filter_xprofile_groups_with_acl() {
    global $bp, $profile_template, $current_user;
    get_currentuserinfo();
    foreach($profile_template->groups as $key => $profile_group) {
    if( ! in_array($profile_group->id, $this->user_allowed_xprofile_groups) ) {
    unset($profile_template->groups[$key]);
    }
    }
    }
    `

    6b. Below the code you just commented out add:
    ` function filter_xprofile_groups_with_acl() {}`

    7. Save your changes to the buddypress-xprofiles-acl.php file.

    8. Now when ever you need to modify the fields log in with your admin account navigate to the user profile in buddy press and select Edit Member Profile from the tool bar. You will see the fields from the private group. Users will see the fields but when they select edit they will not be displayed.

    Hope this helps.

    #155143
    wtravis
    Participant

    Hi folks!

    I’m new to Buddypress, so my apologies for any noob-ish-ness on my part. Trying to troubleshoot a problem and seeking some guidance on what’s going wrong.

    I’m looking to make the Profile tab the default when opening up a member’s page, rather than their activity feed. I’d also like to make the Profile tab come before the Activity tab in the submenu list, but that’s as not crucial.

    Based on some other threads I found here, I’ve created a “bp-custom.php” file, stuck that in the root of the Buddypress plugin folder. Right now bp-custom.php looks like this:

    `
    bp_nav[‘profile’][‘position’] = 10;
    $bp->bp_nav[‘forum’][‘position’] = 30;
    $bp->bp_nav[‘posts’][‘position’] = 40;
    $bp->bp_nav[‘activity’][‘position’] = 20;
    $bp->bp_nav[‘blogs’][‘position’] = 60;
    $bp->bp_nav[‘friends’][‘position’] = 70;
    $bp->bp_nav[‘messages’][‘position’] = 80;
    $bp->bp_nav[‘groups’][‘position’] = 50;
    $bp->bp_nav[‘settings’][‘position’] = 90;
    }

    add_action( ‘bp_init’, ‘tricks_change_bp_tag_position’, 999 );

    add_action( ‘wp_head’, ‘tricks_change_bp_tag_position’, 9 );

    ?>
    `

    However that hasn’t accomplished either of the things I’m attempting to do. The Activity tab still appears when you go to a member’s page, and is listed before Profile in the submenu.

    I’m using Buddypress 1.6.4, and the default Buddypress theme (1.6.4), on WordPress 3.5.1.

    I have the following plugins installed and active:

    • BP Labs 1.3
    • BP User Profile Map 1.4.1
    • Breadcrumbs Everywhere 1.4
    • Contact Form 7 3.3.3
    • Really Simple Captcha 1.5
    • WP Custom Admin Bar 1.3.5

    If there’s a step I’ve missed, I’d really appreciate letting me know! Any help troubleshooting what the problems is would also be appreciated.

    Thanks!

    #150947
    danbpfr
    Participant

    hi @diondeville,

    to change the profile menu (on the top right of the ToolBar)
    <code>
    function my_change_profile_tab_order() {
    global $bp;

    $bp->bp_nav[‘settings’][‘position’] = 10;
    $bp->bp_nav[‘activity’][‘position’] = 20;
    $bp->bp_nav[‘friends’][‘position’] = 30;
    $bp->bp_nav[‘groups’][‘position’] = 40;
    $bp->bp_nav[‘blogs’][‘position’] = 50;
    $bp->bp_nav[‘messages’][‘position’] = 60;
    $bp->bp_nav[‘profile’][‘position’] = 70;
    }
    add_action( ‘bp_setup_nav’, ‘my_change_profile_tab_order’, 999 );</code>

    Take care with quotes when copy/pasting from here ! 😉

    rwkiii
    Participant

    I have read all of the topics similar to this question here, on wordpress.org and even on Google. I’ve tried dozens upon dozens of suggestions, but am still stuck.

    My installation is WordPress v3.4.2 with Multisite using subfolders, BuddyPress v1.6.1, bbPress v2.1.3 using Groups and Sitewide forums.

    The problem I have is that BuddyPress Group Forums will not display. The mydomain.com/forums/ page is blank. I’ve seen some people have included the bbPress shortcode in the Forums page and have said that fixed their problem. In my configuration, I have a Sitewide Forums button on my top navigation bar and it shows the sitewide bbPress forums correctly. I can go into wp-admin -> Forums and I can see all of the bbPress sitewide forums. I can add them, delete them and even post topics to them. Adding the bbPress shortcode to my Forums page just duplicates the forums I already have on my Sitewide Forums page.

    From what I can tell, the rest of BuddyPress is working – the Activity, Members, and Groups buttons display correct pages. It seems like only the Group Forums are not working.

    I’ve gone into wp-admin -> Settings -> Forums of my main site and changed the bbPress Forums Base to sitewide-forums. Also on this settings page I have BuddyPress Enable Group Forums enabled and Group Forums Parent set to (Forum Root).

    In Network Admin -> Settings -> BuddyPress, I think I see a problem. Initially I had all Components enabled. On the Pages tab I don’t have any settings for the Forums page and so I can’t change it. Activity Streams, Site Tracking, User Groups, Members, Register and Activate. It just seems odd that I don’t have a setting for the Forums page. I’ve disabled and re-enabled Discussion Forums component, but still no setting for Forums page on the Page tab.

    Logged in as admin on my main site (mydomain.com/) I can click on my username and it brings up mydomain.com/members/admin just fine. I see tabs for Activity, Profile, Sites, Messages, Friends, Groups, Forums and Settings. All of these tabs work and I can view/change data. There is no option on the Settings tab to enable/disable Group forums as I’ve seen some articles refer to. When I click on the Forums tab I am surprised to see that there are articles in Forum Topics that I created from within wp-admin -> Forums -> Add New.

    Now I am confused… It seems that what I thought were Sitewide Forums are also being displayed in what I thought were the Group Forums and I’m starting to think I have not just one problem, but at least two!

    What I am wondering:

    1) There is a problem with BuddyPress that is forcing me to disable the Discussion Forums component in Network Admin -> Settings -> BuddyPress.

    2) The theme I am using (Frisco for BuddyPress) is not compatible with a multisite configuration.

    Unfortunately, I have only limited experience with either of these two things – multisite and BuddyPress et al. So I don’t really know how it’s SUPPOSE to function.

    Questions:

    Is anyone aware of a theme that is compatible with a Networked multisite (subfolder) configuration and also compatible with Group Forums AND Sitewide Forums? Or would you think Frisco for BuddyPress should be compatible?

    Is anyone aware of a way of testing that I have both Group Forums and Sitewide Forums enabled and working without using the Frisco theme?

    Exactly where do I add a Group Forum? Apparently wp-admin only allows me to add Sitewide Forums/Topics.

    Any thoughts? Anyone have any bookmarks on articles specific to multisite install using both Group and Sitewide forums?

    Thank you!

    #139174
    modemlooper
    Moderator

    Are you using a custom theme? Do you have a menu created in the admin and placed in the primary slot?

    Btw you can always get old versions of plugins by going to WordPress.org and on the plugins page there is a developer tab with links

    #139154
    charlietech
    Participant

    i updated the plugin from 1.6 to 1.6.1and the profile tab in my navigation bar disappeared. how can i downgrade to the previous one or fix the problem?

    #138930
    charlietech
    Participant

    I put the code at the bottom of the function.php in the parent theme and nothing happened. All i want is to add the profile tab to my original nav menu and its becoming an arduous task. I dont understand why the option isn’t built in the buddypress from the jump(just a check box option) but anyhow, can you suggest something please?

Viewing 25 results - 26 through 50 (of 76 total)
Skip to toolbar