Displayname

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Saintless
    New Member
    • Nov 2005
    • 9
    • 3.5.x

    Displayname

    Is it possible for me to have a "displayname" used instead of a login name?

    I am trying to do it without "hacking" the code so to speak just replacing variables in the template.

    So i guess my question is what variables do i need to replace in order for the display name to override the login name in every context except PM's.
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    If the display name is a custom profile field, then you can reference that field in the templates with variables like these:

    postbit:

    Code:
    $post[field[color=red]X[/color]]
    MEMBERINFO:

    Code:
    $userinfo[field[color=red]X[/color]]
    In several other templates that show the name of the logged in user:

    Code:
    $bbuserinfo[field[color=red]X[/color]]
    Where X is the number of the field as shown in your:

    Admin CP -> User Profile Fields -> User Profile Field Manager

    If the display name field isn't filled out for all users, then you may want to use a template conditional to check if the field is defined. For example:

    Code:
    <if condition="$post[field[color=red]X[/color]]">
    	$post[field[color=red]X[/color]]
    <else />
    	$post[musername]
    </if>

    Comment

    • Saintless
      New Member
      • Nov 2005
      • 9
      • 3.5.x

      #3
      Hm i tried this it appears that it wont change the name under thread starter. Is there any way to do this or is that a hook that i would have to setup.

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        There are some locations where profile field information is not available, and the threadbit is one of them. A plugin or file hack would be required for those locations.

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...