New debugging function debugOutput() introduced, some rewrites to EL:
[mailer.git] / inc / libs / rallye_functions.php
index acb09444c5c049133c79d66149084909a22c21c2..ae14ace7c0897695dc9832e1fa8b79271c8e31c0 100644 (file)
@@ -292,7 +292,7 @@ LIMIT 1",
                $userid = '---';
 
                // List only users with at least one ref!
-               //* DEBUG: */ print("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
+               //* DEBUG: */ debugOutput('*'.$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints.'*');
                if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $userid = $content['userid']; } else { $cnt = ''; }
 
                // Save values to array
@@ -870,14 +870,14 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                $cnt = '0';
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
                        // Do we have a ref for this user?
-                       //* DEBUG: */ print("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
+                       //* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',old='.$old.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
                        if (($currUserid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
-                               //* DEBUG: */ print("userid matches!<br />");
+                               //* DEBUG: */ debugOutput('userid matches!');
                                foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
                                        if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
                                                // Level does exist so abort here
                                                $cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
-                                               //* DEBUG: */ print("*".$userid.'/'.$cnt."*<br />");
+                                               //* DEBUG: */ debugOutput('*'.$userid.'/'.$cnt.'*');
                                                break;
                                        } elseif ($level > 1) {
                                                // Not interesting here...
@@ -890,9 +890,7 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                        } // END - if
                } // END - foreach
 
-               //* DEBUG: */ print("<pre>");
-               //* DEBUG: */ print(print_r($GLOBALS['cache_array']['refsystem'], true));
-               //* DEBUG: */ print("</pre>");
+               //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], true).'</pre>');
                //* DEBUG: */ shutdown();
 
                if ($cnt > 0) {
@@ -900,7 +898,7 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                        incrementStatsEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ print('+'.$cnt.'/'.$old."+<br />");
+                       //* DEBUG: */ debugOutput('+'.$cnt.'/'.$old.'+');
                        $cnt -= $old;
                } // END - if
        } else {
@@ -933,7 +931,7 @@ WHERE
        }
 
        // Return count
-       //* DEBUG: */ print("*".$userid.'/'.$old.'/'.$cnt."*<br />");
+       //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$cnt.'*');
        return $cnt;
 }