You can load a user like $account = user_load($uid). Currently, to output the actual name (real or old) you have to do this:
print isset($account->realname) && drupal_strlen($account->realname) ? $account->realname : $account->name
In case the realname is empty, you show the old user name. I would like to do this:
print $account->realname
If realname exists, it shows realname, otherwise old username.

Comments

dave reid’s picture

Status: Active » Fixed

You should be using the proper function for this:

print format_username($account);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.