]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/sponsor_functions.php
Some code cleanups/fixes:
[mailer.git] / inc / libs / sponsor_functions.php
index ea4a23b0396445742a888cdf416938ff935b412e..c225215424b2f79ef863463b1064ab67a70d5311 100644 (file)
@@ -216,7 +216,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(),
        return $ret;
 }
 
-//
+// Translate the account status
 function sponsorTranslateUserStatus ($status) {
        // Construct constant name
        $constantName = sprintf("ACCOUNT_STATUS_%s", $status);
@@ -229,7 +229,7 @@ function sponsorTranslateUserStatus ($status) {
                // Not found!
                //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
                logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status));
-               $ret = getMaskedMessage('ACCOUNT_STATUS_UNKNOWN_STATUS', $status);
+               $ret = getMaskedMessage('ACCOUNT_STATUS_UNKNOWN', $status);
        }
 
        // Return status
@@ -696,10 +696,10 @@ function fetchSponsorData ($sponsor_id, $column = 'id') {
                if (isset($GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure'])) {
                        // Backup the raw one and zero it
                        $GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure_raw'] = $GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure'];
-                       $GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure'] = '0';
+                       $GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure'] = null;
 
                        // Is it not zero?
-                       if ($GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure_raw'] != '0000-00-00 00:00:00') {
+                       if (!is_null($GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure_raw'])) {
                                // Seperate data/time
                                $array = explode(' ', $GLOBALS['sponsor_data'][getCurrentSponsorId()]['last_failure_raw']);