Link in user profiles rewritten to use nickname, if set
authorRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 01:17:26 +0000 (01:17 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 29 Oct 2009 01:17:26 +0000 (01:17 +0000)
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_unconfirmed.php
templates/de/html/admin/admin_list_unconfirmed.tpl

index 7976506..ae4a18e 100644 (file)
@@ -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."<br />");
        return '[<a href="{?URL?}/modules.php?module=admin&amp;what=' . $what . '&amp;userid=' . $userid . '" title="{--ADMIN_USER_PROFILE_TITLE--}">' . $title . '</a>]';
 }
 
index a2c535a..92c5471 100644 (file)
@@ -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'  => "<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
@@ -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),
index c70f8e9..2ce11ab 100644 (file)
@@ -2,7 +2,7 @@
 <tr>
        <td width="260" align="center" class="bottom2 right2">
                {--EMAIL_SENDER--}:<br />
-               <strong><a href="$content[sender_link]">$content[sender_userid]</a></strong>
+               <strong>$content[sender_link]</strong>
        </td>
        <td width="260" align="center" class="bottom2">
                {--EMAIL_SUBJECT--}:<br />