[drupal-devel] [feature] Adjustable username crop

com2 drupal-devel at drupal.org
Thu Jan 27 20:32:24 UTC 2005

 Project:      Drupal
 Version:      4.5.2
 Component:    node system
 Category:     feature requests
 Priority:     normal
 Assigned to:  com2
 Reported by:  com2
 Updated by:   com2
 Status:       patch
 Attachment:   http://drupal.org/files/issues/common_1.diff (544 bytes)

I had the numbers wrong. In the original code it was cropped at 15, not
at 10 like in my diff. I also changed it a bit to avoid negative
argaments. Attached the new diff from version 4.5.2. 

   if ($object->uid && $object->name) {
     // Shorten the name when it is too long or it will break many
    if (strlen($object->name) > variable_get('user_name_crop', 15)+5)
      $name = truncate_utf8($object->name,
variable_get('user_name_crop', 15)) .'...';
     else {
       $name = $object->name;


Previous comments:

January 27, 2005 - 17:11 : com2

Attachment: http://drupal.org/files/issues/common_0.diff (546 bytes)

Some people might not like it when long usernames are cropped in the
node haeder. This patch can be applied to includes/common.inc version
4.5.2 and creates a new variable 'user_name_crop' to adjust the crop

View: http://drupal.org/node/16299
Edit: http://drupal.org/project/comments/add/16299

More information about the drupal-devel mailing list