Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Possible to display a real name instead of login name?

judgejjudgej
edited December 2008 in Vanilla 1.0 Help
Is it possible - without changing code in lots of places - to hide the login name of all users, displaying their real name, or some user-declared name instead? I would like to ensure logins are not exposed publicly, since they are an important half of the user's authentication details and should be kept as private as their passwords IMO.

Places this would need to happen is in all the search screens (searching users, and the display of authors of topics and comments), the sign-in message in the top-right, the profile pages, the topics listings, the category listings, the comments, etc.

-- Jason

Comments

  • Options
    Assuming then the answer to the question is "no", it isn't an easy thing to do, can anyone offer me any advice on how to get hold of a user's real name in the code, given the user's login or ID?

    I'm thinking about places like the participants list, search results, discussion thread etc. where the usernames are displayed. In the code the username is displayed from a 'user' record, which generally has a 'RealName' property that is blank (an empty string). What would be the best (simplest and most efficient) way to populate that RealName property?

    -- JJ
  • Options
    edited December 2008
    I'd be interested in knowing about this as well, but perhaps with a first name, last initial (for privacy reasons ).
  • Options
    judgejjudgej
    edited December 2008
    I've been working on this today, and learnt a lot about the way the delegates work (see the documentation for an overview - they are basically hooks into the functionality at various points).

    In principle it should be possible to display any alternative name in place of the username, just through the use of an extension plugin. Whether it is the 'full name' or initials or even some comletely custom 'display name' the user chooses, it does not matter - so long as a lookup can be performed to transform the user ID to some display name.

    This is fairly straightforward for discussions and users, but there seem to be a few 'delegates' missing for the comments. There are delegates for adding links after comments, but none for modifying the content of the comments before they are displayed (I could be wrong - looking in the wrong place - because it would make sense for such delegates in order for a plugin to transform comments in other ways, such as turning URLs into clickable links).

    Anyway - I've added some delegates to the comments rendering in the theme, and so far it seems to be working okay. I've named my module 'DisplayName', and am building it up from there.

    At some point I guess I will need to put in a request for additional delegates to be added pre-rendering of individual comments.

    -- Jason

    Edit: I also have not looked at the plugins yet - side bar links such as those that display contributors to a discussion also display login usernames, and I'm not yet sure how to hook thoses in. It depends where they get their details from, I suppose.

    The DisplayName extension should ultimately work theme-independant and without having to change any core files.
  • Options
    judgejjudgej
    edited December 2008
    Here is my DisplayName extension so far:

    http://www.consil.co.uk/downloads/DisplayName.zip

    It is very rough and ready, needs a lot more polishing, but works for me. If anyone would like to chip in with any updates to it, please post here or e-mail me directly.

    There are comments in the code that list two new Delegates that need to be added to the theme, each just before individual comments are rendered. Ideally these should be in the core Vanilla somewhere.

    This extension will display the 'FullName' in place of the username in the discussions, comments, and search (topics, comments and users). I have not yet tried applying it to any of the other popular extensions, and I'm not yet sure how that would work anyway. But have fun with this, and please feed back any comments.
This discussion has been closed.