Stop Advanced Forum cutting off the username? Im using the Advanced Forum module. Many of my users have long usernames which are being cut off (in the author information when they post a comment). Is it possible to lengten the limit before the text is cut off?

I cant see any settings for the Forum or Advanced Forum modules. Below is a theme hook that creates the author information (dont know if this is the right track or not).

/**
 * Theme function to show simple author pane when not using Author Pane.
 */
function theme_advanced_forum_simple_author_pane(&amp;$variables) {
  $context = $variables['context'];
  // Sending the context rather than the account makes it work for anon comments.
  $name = theme('username', array('account' =&gt; $context));

  $account = user_load($context-&gt;uid);
  $picture = theme('user_picture', array('account' =&gt; $account));

  return '&lt;div class="author-pane"&gt;' . $name . $picture . '&lt;/div&gt;';
}
It seems Drupal core truncates the username to 25 characters. I have not tried this but this seems to be the solution for Drupal 7 (code added below for reference).

function MYTHEME_preprocess_username(&amp;$vars) {

  // Update the username so it's the full name of the user.
  $account = $vars['account'];

  // Revise the name trimming done in template_preprocess_username.
  $name = $vars['name_raw'] = format_username($account);

  // Trim the altered name as core does, but with a higher character limit.
  if (drupal_strlen($name) &gt; 25) {
    $name = drupal_substr($name, 0, 20) . '...';
  }

  // Assign the altered name to $vars['name'].
  $vars['name'] = check_plain($name);

}


Add this code in your theme's template.php file, and change MYTHEME to the machine name of your theme, and change the number 25 to something that fits your theme.