Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to make a new function or change output with HTML?

  • Not sure if the title makes sense. Anyway here is what I am trying to do. The following function calls up the username and adds a link to the user profile. I am using this in my login script under the Avatar. I have navigation links in the same script and I want to add this function there as well, but I don’t want the link title to be the “username”….I simply want it to say “Profile”. How can I have both? I dont want to start changing a lot of stuff I am not sure about and make this not funnction, thanks! I can post the complete code if necessary.

    bp_loggedinuser_link ()

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    <a href="<?php echo bp_core_get_userlink( $bp['loggedin_userid'], false, true ) ?>">Profile</a>

    I put that in and when you click the link it takes you to the homepage. I need it to take you to the User profile page. I think maybe I gave you the wrong info.

    Avatar of Andy Peatling
    Andy Peatling
    Keymaster

    @apeatling

    Try this:

    <a href="<?php echo bp_core_get_userlink( $current_user->ID, false, true ) ?>/profile">Profile</a>

    sorry, that just gets a 404.

    i had this working the way it was supposed to, that was not the issue. the only thing I wanted to make happen was instead of displaying the username of the person who is logged in, I just wanted the text to read “Profile”, but still take you to your personal profile page.

    to see what I mean you can go to http://www.ex-brief.com and login with this info:

    User ID: help

    Pass: help

    Thsi is a fake test account so you can get an idea of what I am trying to do here.

    P.S. on some pages the widgets are bulleted, but not on all of them…Whats up with that?

    Avatar of Nicola Greco
    nicolagreco
    Participant

    @nicolagreco

    If you don’t globalize $current_user or $bp it will never work..

    ok. This script works perfectly, when you log in it takes you to a navigation area. There are links to various pages, including a link to your profile. The link to your profile simply says your username. Example. If you log in as help, there is a link in the navigation that says “help”. clicking on it takes you to your personal profile. That works well, there are 0 issues with the function. All I want to have happen is for the text that reads “help” if you log in as help to read “Profile”. thats the only change, I need no change at all to the actual function, just to the name of the link that appears, I want that to still have the same function, but just say “Profile” rather than the username.

    anyone???

    anyone know how to do this?

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

The topic ‘How to make a new function or change output with HTML?’ is closed to new replies.