Debug comments rewritten
[mailer.git] / inc / functions.php
index 70694e75c449baf8e4f3ef561bacd470588d5019..65d558956bf1951c789ea2d7e4ac48c36dd85c1d 100644 (file)
@@ -603,23 +603,17 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
        if ($max > 0) $maxComma = $max;
 
        // Cut zeros off?
-       if ($cut) {
+       if (($cut) && ($max == 0)) {
                // Test for commata if in cut-mode
                $com = explode(".", $dotted);
-               if (count($com) > 1) {
-                       // Commata found, so only zeros?
-                       if ($com[1] == str_repeat("0", strlen($com[1]))) {
-                               // Only zeros, so display only one
-                               $maxComma = 1;
-                       } // END - if
-               } else {
+               if (count($com) < 2) {
                        // Don't display commatas even if there are none... ;-)
                        $maxComma = 0;
                }
        } // END - if
 
        // Debug log
-       //DEBUG_LOG(__FUNCTION__, __LINE__, "dotted={$dotted},maxComma={$maxComma}");
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "dotted={$dotted},maxComma={$maxComma}");
 
        // Translate it now
        switch (GET_LANGUAGE()) {
@@ -1284,6 +1278,9 @@ function bigintval($num, $castValue = true) {
        // Has the whole value changed?
        if ("".$ret."" != "".$num."") {
                // Log the values
+               print("<pre>");
+               debug_print_backtrace();
+               die("</pre>");
                DEBUG_LOG(__FUNCTION__, __LINE__, " num={$num},ret={$ret}");
        } // END - if
 
@@ -2519,31 +2516,31 @@ function FILE_READABLE($fqfn) {
 // Converts timestamp selections into a timestamp
 function CONVERT_SELECTIONS_TO_TIMESTAMP(&$POST, &$DATA, &$id, &$skip) {
        // Init test variable
-       $TEST2 = "";
+       $test2 = "";
 
        // Get last three chars
-       $TEST = substr($id, -3);
+       $test = substr($id, -3);
 
        // Improved way of checking! :-)
-       if (in_array($TEST, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) {
+       if (in_array($test, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) {
                // Found a multi-selection for timings?
-               $TEST = substr($id, 0, -3);
-               if ((isset($POST[$TEST."_ye"])) && (isset($POST[$TEST."_mo"])) && (isset($POST[$TEST."_we"])) && (isset($POST[$TEST."_da"])) && (isset($POST[$TEST."_ho"])) && (isset($POST[$TEST."_mi"])) && (isset($POST[$TEST."_se"])) && ($TEST != $TEST2)) {
+               $test = substr($id, 0, -3);
+               if ((isset($POST[$test."_ye"])) && (isset($POST[$test."_mo"])) && (isset($POST[$test."_we"])) && (isset($POST[$test."_da"])) && (isset($POST[$test."_ho"])) && (isset($POST[$test."_mi"])) && (isset($POST[$test."_se"])) && ($test != $test2)) {
                        // Generate timestamp
-                       $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST);
-                       $DATA[] = "$TEST='".$POST[$TEST]."'";
+                       $POST[$test] = CREATE_TIMESTAMP_FROM_SELECTIONS($test, $POST);
+                       $DATA[] = sprintf("%s='%s'", $test, $POST[$test]);
 
                        // Remove data from array
                        foreach (array("ye", "mo", "we", "da", "ho", "mi", "se") as $rem) {
-                               unset($POST[$TEST."_".$rem]);
+                               unset($POST[$test."_".$rem]);
                        } // END - foreach
 
                        // Skip adding
-                       unset($id); $skip = true; $TEST2 = $TEST;
+                       unset($id); $skip = true; $test2 = $test;
                } // END - if
        } else {
                // Process this entry
-               $skip = false; $TEST2 = "";
+               $skip = false; $test2 = "";
        }
 }
 // Reverts the german decimal comma into Computer decimal dot