]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/register_functions.php
Syntax errors fixed, naming convention applied, wrappers used:
[mailer.git] / inc / libs / register_functions.php
index 13be207a739286c5286cce380f0d5b55667d5bc1..8a3880c9405cd47ad2824b634de5d82f69e42eba 100644 (file)
@@ -92,18 +92,14 @@ function registerGenerateCategoryTable ($mode, $return=false) {
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare array for the template
-                       $content = array(
-                               'cat'   => $content['cat'],
-                               'def_y' => '',
-                               'def_n' => '',
-                               'id'    => $content['id'],
-                       );
+                       $content['default_yes'] = '';
+                       $content['default_no']  = '';
 
                        // Mark categories
                        if ((postRequestParameter('cat', $content['id']) == 'Y') || ((getConfig('register_default') == 'Y') && (!isPostRequestParameterSet('cat', $content['id'])))) {
-                               $content['def_y'] = ' checked="checked"';
+                               $content['default_yes'] = ' checked="checked"';
                        } else {
-                               $content['def_n'] = ' checked="checked"';
+                               $content['default_no']  = ' checked="checked"';
                        }
 
                        // Load template and switch color
@@ -149,7 +145,7 @@ function FILTER_REGISTER_MUST_FILLOUT ($content) {
                if ($row['field_required'] == 'Y') $value = '<span class="guest_failed">(*)</span>';
 
                // Add it
-               $content['must_fillout_'.strtolower($row['field_name']).''] = $value;
+               $content['must_fillout_' . strtolower($row['field_name']) . ''] = $value;
        } // END - while
 
        // Free memory
@@ -266,11 +262,11 @@ function doRegistration () {
 
        // 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(
@@ -298,28 +294,22 @@ function doRegistration () {
        $GLOBALS['register_sql_data'] = '';
        if (isExtensionInstalledAndNewer('theme', '0.0.8')) {
                // Okay, add design here
-               $GLOBALS['register_sql_columns'] = ', `curr_theme`';
-               $GLOBALS['register_sql_data'] = ", '" . getCurrentTheme() . "'";
+               $GLOBALS['register_sql_columns'] .= ', `curr_theme`';
+               $GLOBALS['register_sql_data']    .= ", '" . getCurrentTheme() . "'";
        } // END - if
 
        // Check if I shall disable sending mail to newly registered members out about active/begging rallye
        //
        // First comes first: begging rallye
-       if (isExtensionInstalledAndNewer('beg', '0.2.8')) {
-               // Okay, shall I disable now?
-               if (getConfig('beg_new_member_notify') != 'Y') {
-                       $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`, `beg_rallye_disable_notify`';
-                       $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
-               } // END - if
+       if (!isBegNewMemberNotifyEnabled()) {
+               $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`, `beg_rallye_disable_notify`';
+               $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
        } // END - if
 
        // Second: active rallye
-       if (isExtensionInstalledAndNewer('bonus', '0.9.2')) {
-               // Okay, shall I disable now?
-               if (getConfig('bonus_new_member_notify') != 'Y') {
-                       $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_enable_notify`, `bonus_rallye_disable_notify`';
-                       $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
-               } // END - if
+       if (!isBonusNewMemberNotifyEnabled()) {
+               $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_enable_notify`, `bonus_rallye_disable_notify`';
+               $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
        } // END - if
 
        // Write user data to table