]> git.mxchange.org Git - mailer.git/blobdiff - doubler.php
Added purging of subid and server_name logs
[mailer.git] / doubler.php
index b640d54d79e5640e47b1b084e6ee0eab61fdc48a..a9ab0c8ac952287c985acd9c704b3cb9571408de 100644 (file)
@@ -85,7 +85,7 @@ if (isFormSent()) {
                setPostRequestElement('points', bigintval(round(convertCommaToDot(postRequestElement('points')))));
 
                // Probe for enough points
-               $probe_points = ((postRequestElement('points') >= getConfig('doubler_min')) && (postRequestElement('points') <= getConfig('doubler_max')));
+               $probe_points = ((postRequestElement('points') >= getDoublerMin()) && (postRequestElement('points') <= getDoublerMax()));
 
                // Check all together
                if ((isUserDataValid()) && (getUserData('password') == generateHash(postRequestElement('password'), substr(getUserData('password'), 0, -40))) && (getUserData('status') == 'CONFIRMED') && ($probe_points)) {
@@ -96,7 +96,7 @@ if (isFormSent()) {
                        $points = getTotalPoints(getUserData('userid'));
 
                        // So let's continue with probing his points amount
-                       if (($points - getConfig('doubler_left') - postRequestElement('points') * getConfig('doubler_charge') / 100) >= 0) {
+                       if (($points - getConfig('doubler_left') - postRequestElement('points') * getDoublerCharge() / 100) >= 0) {
                                // Enough points are left so let's continue with the doubling process
                                // Create doubling "account" with *DOUBLED* points
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')",
@@ -111,7 +111,7 @@ if (isFormSent()) {
                                subtractPoints('doubler', getUserData('userid'), postRequestElement('points'));
 
                                // Add points to "total payed" including charge
-                               $points = postRequestElement('points') - postRequestElement('points') * getConfig('doubler_charge') / 100;
+                               $points = postRequestElement('points') - postRequestElement('points') * getDoublerCharge() / 100;
                                updateConfiguration('doubler_points', $points, '+');
                                incrementConfigEntry('doubler_points', $points);
 
@@ -121,7 +121,7 @@ if (isFormSent()) {
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')",
                                                array(
                                                        convertZeroToNull(determineReferralId()),
-                                                       (postRequestElement('points') * 2 * getConfig('doubler_ref') / 100),
+                                                       (postRequestElement('points') * 2 * getDoublerRef() / 100),
                                                        detectRemoteAddr()
                                                ), __FILE__, __LINE__);
 
@@ -146,10 +146,10 @@ if (isFormSent()) {
                } elseif (getUserData('status') == 'LOCKED') {
                        // Account is locked by admin / holiday!
                        $content['message'] = '{--DOUBLER_FORM_STATUS_LOCKED--}';
-               } elseif (postRequestElement('points') < getConfig('doubler_min')) {
+               } elseif (postRequestElement('points') < getDoublerMin()) {
                        // Not enougth points entered
                        $content['message'] = '{--DOUBLER_FORM_POINTS_MIN--}';
-               } elseif (postRequestElement('points') > getConfig('doubler_max')) {
+               } elseif (postRequestElement('points') > getDoublerMax()) {
                        // Too much points entered
                        $content['message'] = '{--DOUBLER_FORM_POINTS_MAX--}';
                } elseif (isNicknameUsed(postRequestElement('userid'))) {
@@ -172,7 +172,7 @@ if (isFormSent()) {
 } // END - if (isFormSet())
 
 // Shall I check for points immediately?
-if (getConfig('doubler_send_mode') == 'DIRECT') {
+if (getDoublerSendMode() == 'DIRECT') {
        loadInclude('inc/mails/doubler_mails.php');
 } // END - if
 
@@ -204,7 +204,7 @@ if (isExtensionActive('nickname')) {
 }
 
 // Which mail-send-mode did the admin setup?
-$content['payout_time'] = '{--DOUBLER_PAYOUT_TIME_' . getConfig('doubler_send_mode') . '--}';
+$content['payout_time'] = '{--DOUBLER_PAYOUT_TIME_' . getDoublerSendMode() . '--}';
 
 // Generate table with already payed out doubles
 $content['payout_history'] = generateDoublerTable(0, 'Y', 'N', 'DESC');