Large code cleanups:
[mailer.git] / inc / libs / register_functions.php
index 16d16fd7aa7102ad202872562edf8e63ec952403..480e65dbd60726342392d3fc0ef51e6c3fdcf814 100644 (file)
@@ -288,7 +288,7 @@ 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_columns'] .= ',`curr_theme`';
                $GLOBALS['register_sql_data']    .= ", '{%%pipe,getCurrentTheme%%}'";
        } // END - if
 
@@ -296,13 +296,13 @@ function doRegistration () {
        //
        // First comes first: begging rallye
        if ((isExtensionInstalledAndNewer('beg', '0.2.7')) && (!isBegNewMemberNotifyEnabled())) {
-               $GLOBALS['register_sql_columns'] .= ', `beg_rallye_enable_notify`,`beg_rallye_disable_notify`';
+               $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 ((isExtensionActive('bonus')) && (!isBonusNewMemberNotifyEnabled())) {
-               $GLOBALS['register_sql_columns'] .= ', `bonus_rallye_enable_notify`,`bonus_rallye_disable_notify`';
+               $GLOBALS['register_sql_columns'] .= ',`bonus_rallye_enable_notify`,`bonus_rallye_disable_notify`';
                $GLOBALS['register_sql_data']    .= ', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()';
        } // END - if
 
@@ -316,9 +316,52 @@ function doRegistration () {
        // Create user's account...
        SQL_QUERY_ESC("INSERT INTO
        `{?_MYSQL_PREFIX?}_user_data`
-(`gender`,`surname`,`family`,`street_nr`,%s, `zip`,`city`,`email`,`birth_day`,`birth_month`,`birth_year`,`password`,`max_mails`,`receive_mails`,`refid`,`status`,`user_hash`,`REMOTE_ADDR`,`joined`,`last_update`,`ref_payout`".$GLOBALS['register_sql_columns'].")
-       VALUES
-('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','{%%pipe,detectRemoteAddr%%}', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), {?ref_payout?}".$GLOBALS['register_sql_data'].")",
+(
+       `gender`,
+       `surname`,
+       `family`,
+       `street_nr`,
+       %s,
+       `zip`,
+       `city`,
+       `email`,
+       `birth_day`,
+       `birth_month`,
+       `birth_year`,
+       `password`,
+       `max_mails`,
+       `receive_mails`,
+       `refid`,
+       `status`,
+       `user_hash`,
+       `REMOTE_ADDR`,
+       `joined`,
+       `last_update`,
+       `ref_payout`
+       ".$GLOBALS['register_sql_columns']."
+) VALUES (
+       '%s'
+       '%s'
+       '%s'
+       '%s'
+       '%s',
+       %s,
+       '%s',
+       '%s',
+       %s,
+       %s,
+       %s,
+       '%s',
+       %s,
+       %s,
+       %s,
+       'UNCONFIRMED',
+       '%s',
+       '{%%pipe,detectRemoteAddr%%}',
+       UNIX_TIMESTAMP(),
+       UNIX_TIMESTAMP(),
+       {?ref_payout?}
+       ".$GLOBALS['register_sql_data'].")",
        array(
                $countryRow,
                substr(postRequestElement('gender'), 0, 1),
@@ -357,12 +400,12 @@ function doRegistration () {
                SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `rand_confirmed`=0', __FUNCTION__, __LINE__);
        } // END - if
 
-       // Update referal table
-       updateReferalCounter($userid);
+       // Update referral table
+       updateReferralCounter($userid);
 
        // Write his welcome-points
-       initReferalSystem();
-       addPointsThroughReferalSystem('register_welcome', $userid, getPointsRegister());
+       initReferralSystem();
+       addPointsThroughReferralSystem('register_welcome', $userid, getPointsRegister());
 
        // Write catgories
        if ((is_array(postRequestElement('cat'))) && (count(postRequestElement('cat')))) {
@@ -378,7 +421,7 @@ function doRegistration () {
                } // END - foreach
        } // END - if
 
-       // ... rewrite a zero referal id to the main title
+       // ... rewrite a zero referral id to the main title
        if (!isValidUserId(postRequestElement('refid'))) {
                setPostRequestElement('refid', getMainTitle());
        } // END - if