]> git.mxchange.org Git - mailer.git/commitdiff
Fix for bug #236
authorRoland Häder <roland@mxchange.org>
Sun, 21 Oct 2012 08:46:17 +0000 (08:46 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 21 Oct 2012 08:46:17 +0000 (08:46 +0000)
mailid_top.php

index 98fe721023078bf93a4ab3b21c00cf36b313b288..214a1252183d504e195d463052e1bdb90110b3ef 100644 (file)
@@ -117,7 +117,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
                                break;
 
                        case 'BONUS':
-                               $result_mailid = SQL_QUERY_ESC("SELECT `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+                               $result_mailid = SQL_QUERY_ESC("SELECT `id` AS `pool_id`, `is_notify` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
                                        array($urlId), __FILE__, __LINE__);
                                break;
 
@@ -138,7 +138,7 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
 
                        // Set sender to 0 when we have a bonus mail
                        if ($data['link_type'] == 'BONUS') {
-                               $data['sender'] = '0';
+                               $data['sender'] = NULL;
                        } // END - if
 
                        // Is the user id valid?
@@ -154,9 +154,9 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
 
                                                        // Entry found?
                                                        if (SQL_NUMROWS($result) == 1) {
-                                                               list($pay) = SQL_FETCHROW($result);
-                                                               $time      = getPaymentData($pay, 'time');
-                                                               $payment   = getPaymentData($pay, 'payment');
+                                                               list($paymentId) = SQL_FETCHROW($result);
+                                                               $time      = getPaymentData($paymentId, 'time');
+                                                               $payment   = getPaymentData($paymentId, 'payment');
                                                                $isValid   = TRUE;
                                                        } // END - if
 
@@ -185,7 +185,10 @@ if ((isValidUserId($userId)) && (($mailId > 0) || ($bonusId > 0)) && (!ifFatalEr
 
                                        // Is this entry valid?
                                        if ($isValid === TRUE) {
+                                               // Run at least one second
                                                if (($time == '0') && ($payment > 0)) $time = 1;
+
+                                               // Is time and payment set?
                                                if (($time > 0) && ($payment > 0)) {
                                                        $realCode = '0';
                                                        if (!empty($code)) {