Can we display FullName + LastName in the online users list instead of user's Login Name? Or setting to toggle between the two?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fenda’s picture

I like the idea, but can you trust all your users to write a full name? if a user didn't fill out those fields on their user profile it would create a bug of blank online users. :O

deven_’s picture

We can trust our users. Infact, we have intranet site and the procedure of new user registration requires mandatory fields. I think in the settings of the module, we can have one checkbox asking the admin to put FullNames ON or OFF... ! !

jmrivero’s picture

You can do this with real name module, then use theme('username', $user, array('plain' => TRUE)) to replace $user->name and any other calls to some user object in the module.

Some lines use $result->name insted of $user->name.

PS: If you find the line that change the name of the other user in the chat box let me know please.

fenda’s picture

Referring back to this, maybe i'm blind but I don't see a First name or last name field on the user account settings for the default drupal 6 install. Only Username.

Are you using another module to allow the input of full names?

jmrivero’s picture

Yes, the core profile module.

yannickoo’s picture

Or the Content Profile

darklrd’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

The problem is how to hard-code it. I mean there are no default fields in D6 for this, so every site will have different fieldnames.

jmrivero’s picture

You dont hard-code the fields, but look if the realname module is installed and if it is you theme the user name with a call to theme('username', $user, array('plain' => TRUE)), if its not installed just show the user name. The fields used as first and last name are set in the realname module.

bacon’s picture

Status: Active » Needs review
FileSize
677 bytes

I've created a quick little patch that adds realnames to the buddylist if the RealName module is enabled. I'll see if I can improve it to add it to the subpanel and in the chat panel also.

bacon’s picture

I'm trying to attach the patch again. I hope it doesn't show up twice.

darklrd’s picture

Thanks, I will commit it :-)

darklrd’s picture

I have committed this change to the demonstration/test site. Can someone confirm if its working as intended?

bacon’s picture

I updated the patch to make sure the option in RealName to override the theme function is set.

bacon’s picture

Sorry. Having a little trouble today. The previous patch removes the fix. This patch adds the fix.

nikkubhai’s picture

sub

Lukka’s picture

Patch works good, but only for a main window of chat. Chat window (subpanel) still shows usernames instead of realnames.

Anonymous’s picture

FileSize
3.71 KB

This is my patch for the full realName integration