With RealName.module in place, the status updates block properly recognizes the Real Name username hook and displays real name, while other blocks like regular status only display username. Probably a difference in username hook coding (?)

Comments

icecreamyou’s picture

Assigned: Unassigned » icecreamyou

Yeah... will fix.

gausarts’s picture

I'd like to add a feature request, if you don't mind. When realname is considered, will this be possible to only display, say first name then? That'll make it more like facebook and above all, it'll save some space when dealing in a narrow block. Activitystream.module can split realname and grab only the firstname. I have tried to duplicate some function from it, but I am not a php geek:)

Here's for your consideration taken from line#317:

function theme_activitystream_username($user) {
  $arrnames = split(' ', $user->name);
  if (user_access('access user profiles')) {
    return l($arrnames[0], 'user/'. $user->uid);
  }
  else {
    return $arrnames[0];
  }
}

Thanks

icecreamyou’s picture

I think what I'll do is use the full name and make it themeable--that way you can override it in your theme if you want to use only the first name. Here's what you should put in your theme to override it (obviously it won't do anything until I get the code in the module):

function phptemplate_facebook_status_username($account) {
  //Separates first and last name.  However, if the first name has a space in it, only the part before the space will be used!
  $name_parts = explode(' ', $account->name);
  //Assigns the first name to the account name temporarily.
  $account->name = $name_parts[0];
  //Themes the username like your theme normally does it.
  return theme('username', $account);
}
gausarts’s picture

That's lovely. I can't wait to see it applied. Thanks for quick response.

icecreamyou’s picture

Actually, the Real Name module will already take care of this once I fix the original problem. There's no need to do any hack-ish theme overrides. You may have to use the dev version of Real Name for that to work, however. That also means I'm not going to add a separate, FBS-specific username theme function.

This is one of two remaining issues I need to solve before I release a 1.0-RC. It's not particularly difficult to do, I just have to find the time and motivation. But be assured it will be solved, and soon. After a full 1.0 release I'm going to start on a 2.x branch.

icecreamyou’s picture

Status: Active » Fixed

Fixed.

Status: Fixed » Closed (fixed)

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