]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rallye_functions.php
Typo
[mailer.git] / inc / libs / rallye_functions.php
index a390b61829d3248efbc243abcdaf4365f96f8c87..02adccd8aa6f2a050ddfcb287c1f4b96655b0152 100644 (file)
@@ -59,9 +59,9 @@ function autostartReferalRallyes ($result) {
 
        // Transfer all neccessary data to the $DATA array
        $DATA['userid_cnt'] = countSumTotalData('CONFIRMED','user_data','userid','status',true);
-       $DATA['start']      = generateDateTime($start, '2');
-       $DATA['end']        = generateDateTime($end  , '2');
-       $DATA['now_t']      = generateDateTime(time(), '2');
+       $DATA['start']      = generateDateTime($start, 2);
+       $DATA['end']        = generateDateTime($end  , 2);
+       $DATA['now_t']      = generateDateTime(time(), 2);
        $DATA['title']      = $title;
        $DATA['id']         = $id;  // ID for the rallye details link
 
@@ -139,7 +139,7 @@ VALUES ('%s','%s','%s','%s')",
        if ($notify == 'Y') $templ = 'admin_rallye_notify';
 
        // Send email to admin
-       sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, '0');
+       sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, 0);
 
        // Free memory
        SQL_FREERESULT($result_user);
@@ -340,7 +340,7 @@ LIMIT 1", __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 0) {
                        // Add userid and his ref count to table
                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_rallye_users` (`rallye_id`, `userid`, `refs`)
-VALUES ('%s','%s','0')",
+VALUES ('%s','%s',0)",
                        array(bigintval($id), bigintval($userid)), __FUNCTION__, __LINE__);
                } // END - if
 
@@ -349,9 +349,9 @@ VALUES ('%s','%s','0')",
 
                if ($notify == 'Y') {
                        // Transfer all neccessary data to the global $DATA array
-                       $DATA['start'] = generateDateTime($start, '2');
-                       $DATA['end']   = generateDateTime($end  , '2');
-                       $DATA['now_t'] = generateDateTime(time(), '2');
+                       $DATA['start'] = generateDateTime($start, 2);
+                       $DATA['end']   = generateDateTime($end  , 2);
+                       $DATA['now_t'] = generateDateTime(time(), 2);
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
                        $DATA['ref']   = 0;
@@ -388,9 +388,9 @@ function markReferalRallyesAsExpired ($result) {
        $DATA = array(); $cnt = 0;
        $users = array();
        $DATA['title']  = $title;
-       $DATA['start']  = generateDateTime($start, '1');
-       $DATA['end']    = generateDateTime($end  , '1');
-       $DATA['now_t']  = generateDateTime(time(), '1');
+       $DATA['start']  = generateDateTime($start, 1);
+       $DATA['end']    = generateDateTime($end  , 1);
+       $DATA['now_t']  = generateDateTime(time(), 1);
 
        // Just count...
        $total = 0;
@@ -553,7 +553,7 @@ function getArrayFromReferalRallyePrices ($rallye) {
 //
 function getArrayFromReferalRallyeUsers ($rallye) {
        // Fix zero points to 0.00000
-       if (getConfig('ref_payout') == '0') setConfigEntry('ref_payout', '0.00000');
+       if (getConfig('ref_payout') == 0) setConfigEntry('ref_payout', '0.00000');
 
        // Init multi array
        $users = array(
@@ -649,7 +649,7 @@ function addReferalRallyeWinners ($rallye, $default=0) {
                $active = countSumTotalData($DATA['userid'][$idx], 'user_data', 'userid', 'userid', true, " AND `status`='CONFIRMED'");
 
                if (empty($DATA['userid'][$idx])) $DATA['userid'][$idx] = '---';
-               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == '0') || (empty($DATA['cpoints'][$idx]))) {
+               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == 0) || (empty($DATA['cpoints'][$idx]))) {
                        // Allow valid and active users with at least one ref to get points
                        $DATA['ref'][$idx]   = '---';
                        $DATA['userid'][$idx]   = '---';
@@ -709,9 +709,9 @@ WHERE end_time <= (UNIX_TIMESTAMP() - {?ONE_DAY?} - %s) AND expired='Y'",
                // Expire found rallyes and notify admin
                while ($content = SQL_FETCHARRAY($result_rallye)) {
                        // Prepare data for mail template
-                       $content['start_time']  = generateDateTime($content['start_time'], '1');
-                       $content['end_time']    = generateDateTime($content['end_time']  , '1');
-                       $content['now_time']    = generateDateTime(time(), '1');
+                       $content['start_time']  = generateDateTime($content['start_time'], 1);
+                       $content['end_time']    = generateDateTime($content['end_time']  , 1);
+                       $content['now_time']    = generateDateTime(time(), 1);
 
                        // Send mail to admin
                        sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), 'admin_rallye_purged', $content, 0);