summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-08-22 21:35:25 +0000
committerDries Buytaert <dries@buytaert.net>2003-08-22 21:35:25 +0000
commit4d16c7c65bdd9833b6e6852c49f029ab003f8e2e (patch)
tree0fe9c2a0bb33b04f211520b95ca719983b14a10e /includes/common.inc
parentea86b76c9a6c126e892f8b904a49f35f8e4bff2b (diff)
downloadbrdo-4d16c7c65bdd9833b6e6852c49f029ab003f8e2e.tar.gz
brdo-4d16c7c65bdd9833b6e6852c49f029ab003f8e2e.tar.bz2
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.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc16
1 files changed, 14 insertions, 2 deletions
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) {