So my users like to have long user names (not long like "supersuperlonglongname" where there are no spaces, but instead "super super long long name," with spaces. In most instances, like comments, and blog posts, their names are being truncated to just 14 characters, so instead their name is coming up as "super super lo..." How can I make it so that their entire name displays instead of the cuttoff version?

Comments

Tomi’s picture

The cutting off occurs in theme_username (http://api.drupal.org/api/4.7/function/theme_username). Assuming your theme uses PHPTemplate engine, you can change it: in the theme directory, create a template.php file and write this in it:

function (your-theme-name)_username($object) {

  if ($object->uid && $object->name) {
    $name = $object->name;

    if (user_access('access user profiles')) {
      $output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
    }
    else {
      $output = check_plain($name);
    }
  }
  else if ($object->name) {
    // Sometimes modules display content composed by people who are
    // not registered members of the site (e.g. mailing list or news
    // aggregator modules). This clause enables modules to display
    // the true author of the content.
    if ($object->homepage) {
      $output = l($object->name, $object->homepage);
    }
    else {
      $output = check_plain($object->name);
    }

    $output .= ' ('. t('not verified') .')';
  }
  else {
    $output = variable_get('anonymous', 'Anonymous');
  }

  return $output;
} 

If the theme already contains template.php file, append the function on its end.

Note: Drupal cuts off the username because long usernames may break some tables. Disabling it may result in unexpected behavior.