From 2a0ea074fd3e85b3a1c3199680d3ade89004a1fa Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 8 Oct 2005 02:56:15 +0000 Subject: [PATCH] r506: Make construct_user_display() non-HTML compatible --- includes/functions.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index cc48d1e..5d1eda2 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -47,11 +47,27 @@ function construct_option_select($name, $array, $selected = 0, $valuekey = '', $ // ################### Start construct_user_display ################## // $userinfo needs userid, email, displayname, and showemail -function construct_user_display($userinfo, $userid = true) +function construct_user_display($userinfo, $html = true) { global $bugsys; fetch_user_display_name($userinfo); - eval('$username = "' . $bugsys->template->fetch('username_display') . '";'); + + if ($html) + { + eval('$username = "' . $bugsys->template->fetch('username_display') . '";'); + } + else + { + if ($userinfo['showemail']) + { + $username = sprintf($bugsys->lang->string('%1$s <%2$s>'), $userinfo['displayname'], $userinfo['email']); + } + else + { + $username = $userinfo['displayname']; + } + } + return $username; } -- 2.43.5