From 4d16c7c65bdd9833b6e6852c49f029ab003f8e2e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 22 Aug 2003 21:35:25 +0000 Subject: Implemented more suggestions by Keith: - Made sure the 'Topic' title is only shown above the topics, not the icons. - Automatically shorten the username when it is too long. I implemented this as part of format_name() and could therefore nuke some code in the statistics module. This is change is somewhat experimental and I'm willing to revert or change this if a number of people aren't too happy with this behavior. - Left align the dates and authors: makes it easier/faster to scan. - Made the little tablesort arrows clickable. --- includes/common.inc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'includes/common.inc') diff --git a/includes/common.inc b/includes/common.inc index 60a383603..e5c23fcab 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -822,11 +822,23 @@ function format_date($timestamp, $type = "medium", $format = "") { function format_name($object) { if ($object->uid && $object->name) { + /* + ** Shorten the name when it is too long or it will break many + ** tables. + */ + + if (strlen($object->name) > 20) { + $name = substr($object->name, 0, 15) ."..."; + } + else { + $name = $object->name; + } + if (arg(0) == "admin") { - $output = l($object->name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile."))); + $output = l($name, "admin/user/edit/$object->uid", array("title" => t("Administer user profile."))); } else { - $output = l($object->name, "user/view/$object->uid", array("title" => t("View user profile."))); + $output = l($name, "user/view/$object->uid", array("title" => t("View user profile."))); } } else if ($object->name) { -- cgit v1.2.3