summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2001-07-25 12:21:49 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2001-07-25 12:21:49 +0000
commit491550531fbe1885a12693cecdf02a9970c2672d (patch)
tree24d4f52624f5a33fcf7666a15fd7e0ffcc4ab772 /includes/common.inc
parentd016fb14f43976ba184d3e0597065b15f5eca1f0 (diff)
downloadbrdo-491550531fbe1885a12693cecdf02a9970c2672d.tar.gz
brdo-491550531fbe1885a12693cecdf02a9970c2672d.tar.bz2
common.inc
- format_username() now takes a second optional parameter which gives the real name of the user. Rest - updated the calls to format_username() where appropriate to show the name of the user instead of the account id. Clicking on a name will still give you the account info etc. If you find a place where the real name is not shown let me know.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 19a79c375..4a6339114 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -204,8 +204,8 @@ function format_date($timestamp, $type = "medium", $format = "") {
return $date;
}
-function format_username($username) {
- if ($username) return (user_access("administer users") ? "<A HREF=\"admin.php?mod=account&op=view&name=". urlencode($username) ."\">$username</A>" : "<A HREF=\"account.php?op=view&name=". urlencode($username) ."\">$username</A>");
+function format_username($username, $realname="") {
+ if ($username) return (user_access("administer users") ? "<A HREF=\"admin.php?mod=account&op=view&name=". urlencode($username) ."\">". check_output($realname ? $realname : $username) ."</A>" : "<A HREF=\"account.php?op=view&name=". urlencode($username) ."\">". check_output($realname ? $realname : $username) ."</A>");
else return variable_get(anonymous, "Anonymous");
}