Hello,

I'm not very experienced with PHP or Drupal but I'd like to try having Chat Room display a user's real name next to messages (which i have as $user->profile_name and am using for forum posts etc). I've tried editing the chatroom module with the function that renders the $msgs -- adding something like this in the loop:

$realname = user_load(array('uid', $msg->uid));
$name = $realname->profile_name;

This doesn't work though - I could be missing something on many levels (I'm tinkering with a non-live site). Could anyone suggest what I need to do in order to have this profile info ($user->profile_name) be displayed in Chat Room?

Comments

darren oh’s picture

Status: Active » Closed (works as designed)

array('uid', $msg->uid) should be array('uid' => $msg->uid).