Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Profile settings url

  • Avatar of Fernon
    Fernon
    Participant

    @fernon

    Hi everyone,

    Where can I change the url of the profile settings tab? I’ve searched everywhere but I can’t find it. Instead of /settings I would like to give it another URL.

    Thanks a lot!

Viewing 22 replies - 1 through 22 (of 22 total)
  • Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon,

    add this to bp-custom.php  /plugins/bp-custom.php (i you don’t such file you have to create it first)
    define( 'BP_SETTINGS_SLUG', 'settings' );

    //Change "settings" to what you want.

    You can read here: http://codex.buddypress.org/developer/customizing/customizing-labels-messages-and-urls/

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 thanks a lot!! Is it possible to change it to notifications? I want to link that menu item to the notifications

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    Everything is possible if you know what you want.  But you must explain that clearly. ;-)

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 Haha sorry mate. What i mean is that I want the settings tab in the profile navigation to be linked to /notifications instead of /general. Thats because I disabled the general tab where people can edit their email and change their passwords.

    If you click on the settings tab a 404 error page shows up, because the page doesn’t exist. So I thought lets link that page to the notifications straight away.(since that is still possible)

    Hope its clear enough.

    THanks!

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    Can you pastebin the code you already made for this ?

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 Sure! I put this in my functions.php

    //Remove Settings->Notifications SubMenu
    function remove_general_subnav(){
    global $bp;
    if ( $bp->current_component == $bp->settings->slug ) {
    bp_core_remove_subnav_item($bp->settings->slug, ‘general’);
    }
    }
    add_action( ‘wp’, ‘remove_general_subnav’, 2 );

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon,

    notifications menu item is subnav dependant and a bit complicated to set.

    Anyway, here are 2 functions to make this work a little better as your function.
    One removes the setting page to avoid the 404 error
    And the other remove the “general > settings” submenu.

    Will see this week-end how to move “notifications” from sub to top level in the my_account group menu. Also how to get rid of the “settings” menu on the buddy navbar showing above the content.

    http://bp-fr.net/BuddyBin/?82cf558c7fc5cc10#/oXAizh+nvupA3fVOfRQ2E9WvEcLyTxRM/f+rv5+DEQ=

    Give a try and feedback too ! ;-)

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    Hi @chouf1 Thanks!!!!! Ill wait for your response about the notifications link.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon,

    here a better code for doing what you need. Code is commented, so i hope you understand how it works

    http://bp-fr.net/BuddyBin/?92674aed1b1c6efc#cEK0nMFiknQS0ozXwkKTOGqANlnGLuQdDIsxLi3cr7E=

     

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @chouf1 It works! Thanks for the effort, I really appreciate it. How can I also add the link to the profile buddypress navigation? It only shows up in the toolbar now.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 Im so sorry mate! I ment in the general navigation menu. A new item called settings.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 Yes it works! Where do I change the css? When I give it another ID in the php it doesn’t work. Example: Your code says css_id= “notif” And in my css I put in #notif, but that doesn’t seem to work.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon,

    as is, no, it doesn’t work. ;-)

    you have to learn a bit on your own. Geting a style element ID is ALWAYS written in the page source code, not absolutly in the function.

     

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    Ok thanks mate!

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @Chouf1 Sorry, last question. I can’t figure out where the css ID is coming from. I tried to look it up with firebug but the given ID there doesn’t seem to work. Where is the ID created? Not in the function right? (Since I already tried that)

    Thanks

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon

    sorry there is a little error in my code !

    replace ‘css_id’      => ‘notif’,
    by     ‘item_css_id’      => ‘notif’,

    css test to use in child theme styles.css
    li#notif-personal-li {
    font-weight: bold!important;
    }

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    ah thats why. Thank you!

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @chouf1 I noticed something. The settings link is visible on every profile page.

    So if you’re logged in as user 1, you’re able to see the settings link on user 2 his account. Is it possible to show it only on your own account and hide it on other people their account? User 2 is not allowed to see the settings link on user 1 his profile page. Only on his own profile page.

    Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    @fernon

    try this

    if (bp_is_my_profile( $userid )):
    bp_core_new_nav_item(array(

    bla bla code
    ) );
    endif;

    Avatar of Fernon
    Fernon
    Participant

    @fernon

    @chouf1 Where should I start en end this code exactly? Because when I end the code with the ) );
    endif; The line seems to be corrupt.

    I started the whole function with:

    if (bp_is_my_profile( $userid )):
    bp_core_new_nav_item(array(

    “the whole piece of code you gave me”

    ) );
    endif;

    Is this correct?

Viewing 22 replies - 1 through 22 (of 22 total)

You must be logged in to reply to this topic.