Skip to:
Content
Pages
Categories
Search
Top
Bottom

another function request


  • Anointed
    Participant

    @anointed

    I need to translate the following link for use within buddypress

    <a href="javascript: FC_invite_1to1_chat ('user name')">invite user name</a>

    Here is what I want to do.

    I am going to add a button to each members profile page within buddypress. I believe I can get the button in there properly, but I can’t find the buddypress variables that I should use.

    I need to replace ‘user name’ with the buddypress variable that returns the username of the user whose page is being viewed.

    I then need to replace ‘invite user name’ with the buddypress variable that returns the ‘pretty buddypress username’

    I think that one is bp_user_fullname

    so would example be:

    <a href="javascript: FC_invite_1to1_chat ('<? bp_user_name() ?>')"><? bp_user_fullname() ?></a>

    does that look like the proper syntax to return the user_login and user_nicename from the database for the members whose page it is?

    btw I’m guessing that it is bp_user_name and bp_user_fullname I am NOT SURE this is correct….

    sorry for such a generic question… it’s a learning experience for me

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

  • Anointed
    Participant

    @anointed

    ok maybe this would be easier if i ask the question like this.

    what is the ‘bp variable’ I use if i want to display ‘the current logged in username’ in any code that I write?

    meaning I need command that says ‘logged in user’ says hello

    what is the variable for ‘logged in user’ ?

    also:

    what is the variable used to display the ‘username’ of the member whose profile I am viewing?

    I don’t mean the ‘pretty username’ but the actual login username….

    thanks

    hope this results in replies as it may be easier to understand my question when put this way.


    r-a-y
    Keymaster

    @r-a-y

    Hey Anointed,

    Try this:

    global $current_user;

    echo $current_user->user_login;

    That will get you the current logged-in username and not the display name.

    You might want to wrap that around an is_user_logged_in() conditional.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘another function request’ is closed to new replies.
Skip to toolbar