]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool/pool-user.php
A lot has been rewritten, ext-teams added, ext-forced continued:
[mailer.git] / inc / pool / pool-user.php
index bc832f06251617b24ae5a2433ec57ec22b9bea4b..d57caf685c2934d4ab78c0ecd726e0dd4e9b215b 100644 (file)
@@ -60,8 +60,8 @@ if (isExtensionActive('html_mail')) {
 
 // Main query
 $result_main = SQL_QUERY("SELECT
-       `id`, `sender` AS `sender_userid`, `subject`, `text`, `receivers`,
-       `payment_id`, `timestamp`, `url`, `target_send`, `cat_id`
+       `id`,`sender` AS `sender_userid`,`subject`,`text`,`receivers`,
+       `payment_id`,`timestamp`,`url`,`target_send`,`cat_id`
        ".$HTML."
 FROM
        `{?_MYSQL_PREFIX?}_pool`
@@ -100,7 +100,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                // No users left
                                $receivers = array(0);
                        }
-                       $dummy = $receivers;
+                       $temporaryReceivers = $receivers;
 
                        // Now, if we are good little boys and girls Santa Claus left us some user-ids.
                        // We can now send mails to them...
@@ -116,7 +116,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                        //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
                                        if (SQL_HASZERONUMS($result_stats)) {
                                                // No entry was found, so we add him!
-                                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`, `cat_id`, `payment_id`, `subject`, `url` , `max_rec` , `timestamp_ordered`, `timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
+                                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats` (`pool_id` , `userid`,`cat_id`,`payment_id`,`subject`,`url` , `max_rec` , `timestamp_ordered`,`timestamp_sstart`) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
                                                        array(bigintval($mailData['id']), bigintval($mailData['sender_userid']), bigintval($mailData['cat_id']), bigintval($mailData['payment_id']), $mailData['subject'], $mailData['url'], $mailData['target_send'], bigintval($mailData['timestamp'])), __FILE__, __LINE__);
 
                                                // Receive it's id for the links table
@@ -130,9 +130,9 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                list($stats_id) = SQL_FETCHROW($result_stats);
 
                                                // Remove receiver from list
-                                               $status = removeReceiver($dummy, $key, bigintval($userid), bigintval($mailData['id']), bigintval($stats_id));
+                                               $status = removeReceiver($temporaryReceivers, $key, bigintval($userid), bigintval($mailData['id']), bigintval($stats_id));
 
-                                               //* DEBUG: */ debugOutput('?L:'.__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender_userid'].')/'.$mailData['id'].'/'.$stats_id.'?');
+                                               //* DEBUG: */ debugOutput('?L:'.__LINE__.'/'.$temporaryReceivers.'/'.$key.'/'.$userid.'('.['sender_userid'].')/'.$mailData['id'].'/'.$stats_id.'?');
                                                switch ($status) {
                                                        case 'done':
                                                                // Prepare the mail
@@ -234,7 +234,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                if ($GLOBALS['pool_cnt'] <= $mailData['target_send']) $add = ", target_send=target_send-".$GLOBALS['pool_cnt'];
                                                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW', receivers='%s'" . $add . " WHERE `id`=%s LIMIT 1",
                                                        array(
-                                                               implode(';', $dummy),
+                                                               implode(';', $temporaryReceivers),
                                                                bigintval($mailData['id'])
                                                        ), __FILE__, __LINE__);
 
@@ -267,11 +267,11 @@ if (!SQL_HASZERONUMS($result_main)) {
                                        }
 
                                        // Remove entry from list
-                                       unset($dummy[$key]);
+                                       unset($temporaryReceivers[$key]);
 
                                        // Update receivers
                                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `receivers`='%s' WHERE `id`=%s LIMIT 1",
-                                               array(implode(';', $dummy), bigintval($mailData['id'])), __FILE__, __LINE__);
+                                               array(implode(';', $temporaryReceivers), bigintval($mailData['id'])), __FILE__, __LINE__);
                                }
                        } // END - foreach
                } // END - if