]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_user.php
More rewrites/templates swapped out:
[mailer.git] / inc / modules / admin / what-list_user.php
index b27461d4645e9e5c50346d5ac6b5fc11ffae6cc7..c10ec781d71edebef4de70d8331e55b80a0fb945 100644 (file)
@@ -140,11 +140,8 @@ LIMIT 1",
 
                // Prepare data for template
                $content['admin_links']       = generateMemberAdminActionLinks($userid, $content['status']);
-               $content['gender']            = translateGender($content['gender']);
                $content['email_link']        = generateEmailLink($content['email'], 'user_data');
-               $content['status']            = translateUserStatus($content['status']);
                $content['last_online']       = generateDateTime($content['last_online'], 0);
-               $content['used_points']       = translateComma($content['used_points']);
                if ($content['emails_sent'] > 0) $content['emails_sent'] = $base . '&amp;what=email_details&amp;userid=' . $userid . '%}">' . translateComma($content['emails_sent']) . '</a>]';
                $content['joined']            = generateDateTime($content['joined'], 0);
                $content['last_update']       = generateDateTime($content['last_update'], 0);
@@ -178,10 +175,6 @@ LIMIT 1",
                        $content['click_rate'] = translateComma($content['mails_confirmed'] / $content['emails_received'] * 100);
                } // END - if
 
-               // "Translate" more data
-               $content['mails_confirmed'] = translateComma($content['mails_confirmed']);
-               $content['emails_received'] = translateComma($content['emails_received']);
-
                // Is the extension 'country' installed?
                if (isExtensionActive('country')) {
                        // Then overwrite country information
@@ -260,42 +253,38 @@ LIMIT 1",
        if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('user_limit'));
 
        // Add limitation to SQL string and run him again
-       $sql .= " LIMIT ".(getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')).", ".getRequestParameter('offset');
+       $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset');
        $result = SQL_QUERY($sql, __FILE__, __LINE__);
 
-       // Count all confirmed users
-       $user_count = countSumTotalData('CONFIRMED','user_data','userid','status',true);
-
        // Are there some entries?
        if (SQL_NUMROWS($result_master) > 0) {
                // We have some (new?) registrations!
-               define('__COLSPAN2'  , ($colspan + 2));
-               define('__USER_CNT'  , $user_count);
+               $templateContent['colspan2']   = ($colspan + 2);
+               $templateContent['user_count'] = getTotalConfirmedUser();
 
                // Sorting links
-               define('__ALPHA_SORT', alpha(getRequestParameter('sortby'), $colspan, true));
-               define('__SORT_LINKS', addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), $colspan, true));
+               $templateContent['alpha_sort'] = alpha(getRequestParameter('sortby'), ($colspan + 1), true);
+               $templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), ($colspan + 1), true);
+               $templateContent['page_nav']   = '';
 
                if ($PAGES > 1) {
-                       define('__PAGE_NAV', addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true));
-               } else {
-                       // No page navigation is required
-                       define('__PAGE_NAV', '');
-               }
+                       $templateContent['page_nav'] = addPageNavigation($PAGES, getConfig('user_limit'), true, $colspan, true);
+               } // END - if
 
                // Column with nickname when nickname extension is present
-               // @TODO Rewrite this into a  filter
+               // @TODO Rewrite this into a filter
+               $templateContent['nickname_th'] = '';
                if (isExtensionActive('nickname')) {
                        // Nickname extension found
-                       define('__NICKNAME_TH', "  <td class=\"header_column bottom\" align=\"center\">{--NICKNAME--}</td>");
-               } else {
-                       // Not found
-                       define('__NICKNAME_TH', '');
-               }
+                       $templateContent['nickname_th'] = '<td class="header_column bottom" align="center">{--NICKNAME--}</td>';
+               } // END - if
 
                // Load all users
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
+                       // Merge more data in
+                       $content = merge_array($content, $templateContent);
+
                        // Set refid link
                        if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
 
@@ -371,6 +360,9 @@ LIMIT 1",
                        $content['title'] = getMessage(sprintf("ADMIN_LIST_MODE_%s_ACCOUNTS", strtoupper(getRequestParameter('mode'))));
                }
 
+               // Merge more data again
+               $content = merge_array($content, $templateContent);
+
                // Load main template
                loadTemplate('admin_list_user', false, $content);
        } else {