From b5c4533c99063b77da1655a1b023ffd0f81f12a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 29 Oct 2009 01:17:26 +0000 Subject: [PATCH] Link in user profiles rewritten to use nickname, if set --- inc/modules/admin/admin-inc.php | 11 ++++++++--- inc/modules/admin/what-list_unconfirmed.php | 5 ++--- templates/de/html/admin/admin_list_unconfirmed.tpl | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 7976506243..ae4a18e4d6 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -677,7 +677,7 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') { // Creates a user-profile link for the admin. This function can also be used for many other purposes function generateUserProfileLink ($userid, $title = '', $what = 'list_user') { - if (($title == '') && ($title != 0)) { + if (($title == '') && ($userid > 0)) { // Set userid as title $title = $userid; } // END - if @@ -685,10 +685,15 @@ function generateUserProfileLink ($userid, $title = '', $what = 'list_user') { if (($title == 0) && ($what == 'list_refs')) { // Return title again return $title; - } // END - if + } elseif (isExtensionActive('nickname')) { + // Get nickname + $nick = getNickname($userid); + + // Is it not empty, use it as title else the userid + if (!empty($nick)) $title = $nick . '(' . $userid . ')'; else $title = $userid; + } // Return link - //* DEBUG: */ outputHtml("a:".$title."
"); return '[' . $title . ']'; } diff --git a/inc/modules/admin/what-list_unconfirmed.php b/inc/modules/admin/what-list_unconfirmed.php index a2c535a7de..92c54710a9 100644 --- a/inc/modules/admin/what-list_unconfirmed.php +++ b/inc/modules/admin/what-list_unconfirmed.php @@ -130,7 +130,7 @@ WHERE $content = array( 'sw' => $SW, 'u_link' => generateUserProfileLink($content['userid']), - 'userid' => $content['userid'], + 'userid' => $content['userid'], 'link' => $LINK, 'id' => $ID, 'email' => "".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."", @@ -154,8 +154,7 @@ WHERE // Prepare content $content = array( - 'sender_link' => adminCreateUserLink($sender), - 'sender_userid' => $sender, + 'sender_link' => generateUserProfileLink($sender), 'subject' => $subj, 'text' => $text, 'url' => generateFrametesterUrl($url), diff --git a/templates/de/html/admin/admin_list_unconfirmed.tpl b/templates/de/html/admin/admin_list_unconfirmed.tpl index c70f8e9c85..2ce11abc79 100644 --- a/templates/de/html/admin/admin_list_unconfirmed.tpl +++ b/templates/de/html/admin/admin_list_unconfirmed.tpl @@ -2,7 +2,7 @@ {--EMAIL_SENDER--}:
- $content[sender_userid] + $content[sender_link] {--EMAIL_SUBJECT--}:
-- 2.39.5