Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bp_get_displayed_user_nav'

Viewing 25 results - 26 through 50 (of 120 total)
  • Author
    Search Results
  • shanebp
    Moderator

    You’re looking at the templates that render the content for tabs.
    But you want to remove tabs.
    Because ‘groups’ may be the only tab available, you need to make ‘groups’ the default component.
    You may need to add or remove one or more add_filter calls depending on your installation.
    Try this in your bp-custom.php file:

    
    define( 'BP_DEFAULT_COMPONENT', 'groups' );
    
    function izzy_adjust_profile_nav() {
      if ( ! is_user_logged_in() ) {
    	add_filter('bp_get_displayed_user_nav_activity', 'izzy_profile_nav_remove', 10, 1 );
    	add_filter('bp_get_displayed_user_nav_friends', 'izzy_profile_nav_remove', 10, 1 );
    	add_filter('bp_get_displayed_user_nav_forums', 'izzy_profile_nav_remove', 10, 1 );	
    	add_filter('bp_get_displayed_user_nav_xprofile', 'izzy_profile_nav_remove', 10, 1 );	
      }
    }
    add_action( 'bp_init', 'izzy_adjust_profile_nav' );
    
    function izzy_profile_nav_remove($nav_array) { 
      $nav_array = '';
      return $nav_array;
    }
    undergroundnetwork
    Participant

    Hi, I am running BP 2.1.1 and WP 4.0 and I am trying to tap into the filter of bp_get_displayed_user_nav and bp_get_options_nav to do something like:

    `echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], 
    array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '>
    <a href="' . $link . '#item-body" rel="nofollow">' . $user_nav_item['name'] . 
    '</a>', &$user_nav_item ) );
    `

    In other words, add a #item-body to the URL.

    Since I don’t know how to do it, I had to create a whole new function for MY_bp_get_displayed_user_nav and MY_bp_get_options_nav and then change all of my template files!

    Is there an easier way without having to change all of my template files?

    My site is at underground.net

    Thanks!

    Charles

    ChiefAlchemist
    Participant

    Quick – and quite possibly stupid – question.

    In bp_get_displayed_user_nav() is an apply_filters_ref_array().

    So shouldn’t my filter be receiving an array?

    Yet unless I’ve lost my mind – again? – best I can tell I’m getting a string. I was expecting array(‘<l1>…‘, array of args) but only seem to be getting the ‘<l1>…‘ bit.

    Specifically I want to change the value of $user_nav_item[‘name’] as defined by a plugin I’m using. Is there a way to pre-filter these before the ‘<l1>…‘ is setup?

    Thanks again
    mfs

    godavid33
    Participant

    Specifically, I need to edit the HTML output by bp_get_displayed_user_nav() so that there is an additional class in the markup.

    Thanks,
    Gabe

    #170977

    Topic: Menus

    trinzia
    Participant

    In my theme, I need to separate the links in the menu: bp_get_displayed_user_nav(). For example, I need ‘edit profile’ link to have a different name and be in a completely different spot in the page.

    Accordingly, I was trying to create my own links, since I can’t find if they exist somewhere already as functions. I guess the link would look like:
    http://www.mydomain.com/members/{username}/profile/edit/

    Should make my own link or is there a function for each link type?

    If I need to make my own, how do I say “if user is logged in, and is also looking at his own page, then place an Edit link here.” I got the URL for currently logged-in user, but I think that I am going to have issues if someone’s looking at someone else’s page while logged in. Then I don’t want the edit button to appear.

     $ttyurl = home_url();
     global $current_user;
     $username = $current_user->user_login;
     echo $ttyurl . '/members/' . $username; 

    How should I do this?
    Thanks!

    yannlossouarn
    Participant

    Hello,

    I use WP3.6+BP1.8.1 at http://fablab-lannion.org.

    I would like to display the equivalent of the /members/LOGIN/activity page for logged-in users that access to the home page. I copied various templates from /buddypress/members/single/ (activity.php, home.php…) and created a shortcode function that makes the following call :

    include( locate_template( array( '/buddypress/members/single/home.php' ), false ) );

    The template is loaded but inside of it, calls to various functions like bp_get_displayed_user_nav() return nothing. It seems that $bp->displayed_user data (especially domain and userdata) are empty, which seems to be a possible cause. Is there something I could do to force BP to load appropriate data about the logged-in user in this context ?

    Best regards,
    Yann

    #165664
    Kitefr
    Participant

    Hi everyone !

    I struggled some time with that so i’m finally asking for help ^^

    I want to modify the menu inside the members, groups etc… to add the submenu direclty within it !
    So basicaly to go to that :
    Version of the menu i got now

    To that :
    To that possibility !

    I currently copy the bp_get_displayed_user_nav() function into my theme’s functions.php but i don’t know if i’m doing in wrong…

    Wordpress version : 3.5.1
    Buddypress version : 1.7.2

    Thank you in advance ^^

    #165119
    denorm
    Participant

    Hi, (My second post in an hour, apologies if that’s too much!)

    I’m a developer just starting out on my first BuddyPress project. Really excited about it- after researching for a few weeks and trying out other solutions I determined BuddyPress was definitely the right way to go for creating a social network.

    I’m currently trying to adapt the bp-legacy templates to a Bootstrap-based theme. I’d really like to rely purely on the bootstrap css and not load any buddypress css. But some of the buddypress functions include css class names. I have been converting them to accept arguments but I really don’t want to update the buddypress core files.

    For example:

    from: function bp_get_options_nav() {…}
    to: function bp_get_options_nav($css_selected_class = “current selected”) {…}

    from: function bp_get_displayed_user_nav() {…}
    to: function bp_get_displayed_user_nav($css_selected_class = “current selected”) {…}

    It could be taken farther to include the html tags to use, but for now I just use the standard unordered lists.

    Is there a better way other than modifying the buddypress core files? Or should I just give in and make CSS classes to fit buddypress?

    (WordPress 3.5.1, BuddyPress 1.7.2)

    #164167
    nsbrown
    Participant

    I’ve had to another route, I’m trying to add a logged in users nav into all pages, I can do this by adding this code to my page template:

    <div class=”left-nav”>
    <?php bp_get_displayed_user_nav(); ?>
    <?php do_action( ‘bp_get_options_nav’ ); ?>
    </div>

    But all the links then rendered are relative it doesn’t work, is there a way of making this work globally?

    #145493
    Tammie Lister
    Moderator

    Links are added either by a plugin or by hooking into that menu.

    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-remove-and-add-items-in-bp_get_displayed_user_nav/ is quite a useful thread on adding to menus.

    As for deleting the sidebar, that would need a link to see your theme before saying if something was going to work or not.

    r-a-y
    Keymaster

    You’ll want to take a look at the bp_get_displayed_user_nav() function.

    There’s a filter there that applies to each menu item, which you can hook into and override.

    Tammie Lister
    Moderator
    creaturis
    Participant

    I’m using bp mag and bp mag classic as my main theme. brajesh recently updated his themes and everything works fine. however if i activate bp mag classic i have a problem in this else if statement. the code is this

    if(bp_is_home()){
    do_action(“bpmag_member_options_nav”);
    }
    else if(bp_is_member ())
    bp_get_displayed_user_nav ();
    else
    bp_get_options_nav ();

    i have an issue with this:

    else if(bp_is_member ())
    bp_get_displayed_user_nav ();

    when I go to another member of my site it skips this and immediately goes to

    else
    bp_get_options_nav ();

    is there a bug in this code or something else.

    here is an image of what i’m talking about

    http://i1060.photobucket.com/albums/t451/Bastani/bpmagclassicbug-1.jpg

    buddypress 1.5.5 wordpress 3.3.2. latests versions of bp mag and bp classic

    thanks in advance. hope someone can help me with this.

    p.s. yes i asked Brajesh also on his forum but just want to know if its a problem with this code or if it is more complicated.

    #28872
    igid26
    Participant

    I added user navigation menu in WordPress in header.php I put the code:
    <?php bp_get_displayed_user_nav(); ?

    But there is a bug in the slug.
    Shows only – myweb.com / profile
    myweb.com / activity
    myweb.com / friends
    myweb.com / groups
    myweb.com / settings
    And it has to be
    Myweb.com / members / user_name / profile
    myweb.com / members / user_name / activity
    myweb.com / members / user_name / friends
    myweb.com / members / user_name / messages
    myweb.com / members / user_name / groups
    myweb.com / members / user_name / settings
    Sorry about my English.

    James
    Participant

    Is it possible to display bp_get_displayed_user_nav in two or three organized columns, not as a line or vertical one-column list?

    thank you!

    Hi there i am wondering how to make bp_friend_total_requests_count(); update in real time rather than waiting for the page to refresh my current code used is

    ` `

    works fine however it requires the page to be refreshed before it updates…

    where as the same thing in bp_get_displayed_user_nav() updates in real time any suggestions ?

    leethompson
    Member

    This is a great post but what about moving sub links to a new parent item, this kinda works but if I remove the parent item the function stops. in my themes functions.php

    `function remove_blogs_nav() {
    bp_core_remove_nav_item( ‘privacy’ );
    bp_core_remove_nav_item( ‘settings’ );
    bp_core_remove_nav_item( ‘invite-anyone’ );
    }
    add_action( ‘bp_setup_nav’, ‘remove_blogs_nav’, 15 );

    function bp_add_create_group_subnav() {
    global $bp;
    $groups_link = ‘/groups-2/’;
    $settings_link = $bp->loggedin_user->domain ;

    /* Add the subnav items to the groups nav item */
    if (function_exists(‘bp_core_new_subnav_item’)) {
    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Create Clan’, ‘buddypress’ ),
    ‘slug’ => ‘create’,
    ‘parent_url’ => $groups_link,
    ‘parent_slug’ => $bp->groups->slug,
    ‘screen_function’ => ‘groups_screen_group_home’,
    ‘position’ => 40,
    ‘item_css_id’ => ‘home’ ) );

    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Settings’, ‘buddypress’ ),
    ‘slug’ => ‘settings’,
    ‘parent_url’ => $settings_link,
    ‘parent_slug’ => $bp->profile->slug,
    ‘screen_function’ => ‘profile-settings’,
    ‘position’ => 30,
    ‘item_css_id’ => ‘profile-settings’ ) );

    bp_core_new_subnav_item( array(
    ‘name’ => __( ‘Privacy’, ‘buddypress’ ),
    ‘slug’ => ‘privacy’,
    ‘parent_url’ => $settings_link,
    ‘parent_slug’ => $bp->profile->slug,
    ‘screen_function’ => ‘profile-privacy’,
    ‘position’ => 30,
    ‘item_css_id’ => ‘profile-privacy’ ) );

    }
    }
    add_action(‘bp_setup_nav’, ‘bp_add_create_group_subnav’);
    `
    If I comment out :
    `// bp_core_remove_nav_item( ‘privacy’ );
    // bp_core_remove_nav_item( ‘settings’ );`

    The sub links are in the Profile item, and functional, but still link to each original man item.

    thanks Boone you are a lot of help

    r-a-y
    Keymaster

    You’d need to get rid of `bp_get_displayed_user_nav()` and `bp_get_options_nav()` from your BP templates specifically in the /members/single/ folder of your theme.

    #120403
    exceil
    Member

    p.s im quite noob in programming :D

    #120402
    exceil
    Member

    Hi !
    I want to do the same thing what you defunctlif but i have a problem. I created bp-custom.php file with your settings and put it in buddypress main directory and it doesn’t work :( should i put it somewhere else?

    Brooker
    Member

    Hello,

    in the profile.php I have the bp_get_options_nav() which gives the subnav to edit your profile etc… and in home.php I have the bp_get_displayed_user_nav() which desplays the nav.. how can I mix them? I would like to have the bp_get_options_nav as a drop down under the “settings” option in the bp_get_displayed_user_nav()…

    HELP!

    AlexKalopsia
    Member

    Sorry, looks like I made triple thread -.-

    AlexKalopsia
    Member

    Hi, i’d like to change the bp_get_displayed_user_nav() strings with images (i’m talking about Activity Profile Friends(0) Settings). Instead of having text links, i’d love to have images. Is that possible? What should I do? I’m unable to find a way to edit the function and get different elements.

    Thanks for your help

    Nahum
    Participant

    @r-a-y thanks…I’ve been doing alot of display:none! Lately.

    r-a-y
    Keymaster

    @nahummadrid – This is a known bug. Using bp_core_remove_nav_item() will remove access to those pages as well. Right now, I’d suggest hiding the nav item via CSS or by hacking the $bp global to remove the item.

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