]> 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 ea74ef7da46bb8f7d9477a368b7000353cf0b5e0..c10ec781d71edebef4de70d8331e55b80a0fb945 100644 (file)
@@ -253,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']);
 
@@ -364,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 {