Closed (fixed)
Project:
Real Name
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
8 Jan 2012 at 09:18 UTC
Updated:
8 Sep 2017 at 10:13 UTC
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
Comment #1
dave reidYou should be using the proper function for this: