// Get total ...
// ... confirmed, ...
- $confirmedUsers = countSumTotalData('CONFIRMED' , 'user_data', 'userid', 'status', true);
+ $confirmedUsers = getTotalConfirmedUser();
// ... unconfirmed ...
- $unconfirmedUsers = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
+ $unconfirmedUsers = getTotalUnconfirmedUser();
// ... and locked users!
- $lockedUsers = countSumTotalData('LOCKED' , 'user_data', 'userid', 'status', true);
+ $lockedUsers = getTotalLockedUser();
// Generate hash which will be inserted into confirmation mail
$hash = generateHash(sha1(
} // END - if
// Unconfirmed accounts
- $value = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
+ $value = getTotalUnconfirmedUser();
if ($value > 0) {
$content['unconfirmed_members'] = '<a href="{%url=modules.php?module=admin&what=chk_regs%}">' . $value . '</a>';
// And locked accounts
- $value = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true);
+ $value = getTotalLockedUser();
if ($value > 0) {
$content['locked_members'] = '<a href="{%url=modules.php?module=admin&what=list_user&status=locked%}">' . $value . '</a>';
} // END - if
} // END - if
// Get total confirmed user ids...
-$content['user_confirmed'] = round(countSumTotalData('CONFIRMED' , 'user_data', 'userid', 'status', true));
-$content['user_unconfirmed'] = round(countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true));
-$content['user_locked'] = round(countSumTotalData('LOCKED' , 'user_data', 'userid', 'status', true));
+$content['user_confirmed'] = getTotalConfirmedUser();
+$content['user_unconfirmed'] = getTotalUnconfirmedUser();
+$content['user_locked'] = getTotalLockedUser();
$content['user_count'] = ($content['user_confirmed'] + $content['user_unconfirmed'] + $content['user_locked']);
// Start of this exchange
} // END - if
// Check total amount of users
- $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, ' AND max_mails > 0');
-
- if ($totalUsers >= getConfig('activate_xchange')) {
+ if (getTotalConfirmedUser() >= getConfig('activate_xchange')) {
// Activate System
setSqlsArray(array(
"UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1",
return $GLOBALS['total_confirmed_users'];
}
+// "Getter" for total unconfirmed user accounts
+function getTotalUnconfirmedUser () {
+ // Is it cached?
+ if (!isset($GLOBALS['total_unconfirmed_users'])) {
+ // Then do it
+ $GLOBALS['total_unconfirmed_users'] = countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true);
+ } // END - if
+
+ // Return cached value
+ return $GLOBALS['total_unconfirmed_users'];
+}
+
+// "Getter" for total locked user accounts
+function getTotalLockedUser () {
+ // Is it cached?
+ if (!isset($GLOBALS['total_locked_users'])) {
+ // Then do it
+ $GLOBALS['total_locked_users'] = countSumTotalData('LOCKED', 'user_data', 'userid', 'status', true);
+ } // END - if
+
+ // Return cached value
+ return $GLOBALS['total_locked_users'];
+}
+
// Is given userid valid?
function isValidUserId ($userid) {
// Do we have cache?