]> git.mxchange.org Git - mailer.git/blobdiff - inc/pool/pool-user.php
New debugging function debugOutput() introduced, some rewrites to EL:
[mailer.git] / inc / pool / pool-user.php
index 744fb6b3ee47a8ed0c60597cec671d6bbf299202..d51453f469f79379b1023cfeb44dfe94ed1a23d2 100644 (file)
@@ -93,14 +93,14 @@ if (SQL_NUMROWS($result_main) > 0) {
                        // We can now send mails to them...
                        foreach ($receiverS as $key => $userid) {
                                // Lookup user id
-                               //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />");
+                               //* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.SQL_NUMROWS($result_user).'*');
                                if (fetchUserData($userid)) {
                                        // Do we have a stats entry?
                                        $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1",
                                                array($DATA['id'], $DATA['sender'], $DATA['timestamp']), __FILE__, __LINE__);
 
                                        // If there's no stats entry add it!
-                                       //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
+                                       //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
                                        if (SQL_NUMROWS($result_stats) == 0) {
                                                // 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())",
@@ -111,13 +111,13 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        array(bigintval($DATA['id']), bigintval($DATA['sender']), bigintval($DATA['timestamp'])), __FILE__, __LINE__);
                                        } // END - if
 
-                                       //* DEBUG: */ outputHtml("!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />");
+                                       //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.SQL_NUMROWS($result_stats).'!');
                                        if (SQL_NUMROWS($result_stats) == 1) {
                                                // We got one!
                                                list($stats_id) = SQL_FETCHROW($result_stats);
 
                                                // Mark this user as "spammed" ;-) And place a line for him...
-                                               //* DEBUG: */ outputHtml("?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender'].")/".$DATA['id'].'/'.$stats_id."?<br />");
+                                               //* DEBUG: */ debugOutput('?L:'.__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender'].')/'.$DATA['id'].'/'.$stats_id.'?');
                                                switch (removeReceiver($dummy, $key, bigintval($userid), bigintval($DATA['id']), bigintval($stats_id))) {
                                                        case 'done':
                                                                // Prepare the mail
@@ -151,25 +151,25 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                // Update mediadata if version is 0.0.4 or higher
                                                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                                        // Update entry (or add missing)
-                                                                       //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+                                                                       //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
                                                                        updateMediadataEntry(array('total_send', 'normal_send'), 'add', 1);
                                                                } // END - if
 
                                                                // And count up the mail
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />");
+                                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'*');
                                                                break;
 
                                                        case 'already':
                                                                // Entry already found, but we still count one up!
                                                                $GLOBALS['pool_cnt']++;
-                                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />");
+                                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt']);
                                                                break;
                                                }
                                        }
 
                                        // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
-                                       //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA['target_send'].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA['id']."*<br />");
+                                       //* DEBUG: */ debugOutput('*L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'>='.$DATA['target_send'].'/'.getConfig('max_send').'>='.$GLOBALS['pool_cnt'].'/'.$lastSentId.'!='.$DATA['id'].'*');
                                        if ((($GLOBALS['pool_cnt'] >= $DATA['target_send'])) && ($lastSentId != $DATA['id'])) {
                                                // Prepare content
                                                $content = array(
@@ -206,11 +206,11 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                // Update mediadata if version is 0.0.4 or higher
                                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                                        // Update entry (or add missing)
-                                                       //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+                                                       //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
                                                        updateMediadataEntry(array('total_orders', 'normal_orders'), 'add', 1);
                                                } // END - if
 
-                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__.'/'.$P."<br />");
+                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$P);
                                                break;
                                        }
                                        // Do we have send maximum mails?
@@ -224,7 +224,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                bigintval($DATA['id'])
                                                        ), __FILE__, __LINE__);
 
-                                               //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__."*<br />");
+                                               //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'*');
                                                break;
                                        }