- Made a small improvement to format_name()

4.0.x
Dries Buytaert 2001-12-05 18:54:14 +00:00
parent 2db432e3d3
commit 91d1115768
1 changed files with 9 additions and 2 deletions

View File

@ -295,14 +295,21 @@ function format_date($timestamp, $type = "medium", $format = "") {
} }
function format_name($object) { function format_name($object) {
global $PHP_SELF;
if ($object->uid && $object->name) { if ($object->uid && $object->name) {
return "<a href=\"module.php?mod=user&op=view&id=$object->uid\">$object->name</a>"; if (strstr($PHP_SELF, "admin.php")) {
$output = "<a href=\"admin.php?mod=user&op=edit&id=$object->uid\">$object->name</a>";
}
else {
$output = "<a href=\"module.php?mod=user&op=view&id=$object->uid\">$object->name</a>";
}
} }
else { else {
return variable_get(anonymous, "Anonymous"); $output = variable_get(anonymous, "Anonymous");
} }
return $output;
} }
function format_email($address) { function format_email($address) {