]> git.mxchange.org Git - mailer.git/commitdiff
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 7976506243625b366d4a6e0c9453420b302b421d..ae4a18e4d655a9b8e40045beeec42e904ea9e3f6 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 a2c535a7de7e26c60e038c838f15e8299faadcba..92c54710a9d281443556f6d8f61b28ac5f6fd0dc 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 c70f8e9c85d5e56b29d4819627b86145cf4ff749..2ce11abc7965d6669f8e944549a71e69953402ba 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 />