X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=5b3b3855c384f2dbf1d16755a509c00ece02148c;hb=930830936f3d53fcfde60d14a408c5add6679a22;hp=3f5f434e2486fc8551b0b79fdde7d04d5945e099;hpb=a4def69502579db7d2d0ab4718b2373187dfbb8e;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index 3f5f434e24..5b3b3855c3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -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()) { @@ -921,15 +915,15 @@ function MAKE_TIME($H, $M, $S, $stamp) { function LOAD_URL($URL, $addUrlData=true) { global $CSS, $_CONFIG, $footer; + // Compile out URI codes + $URL = COMPILE_CODE($URL); + // Check if http(s):// is there if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) { // Make all URLs full-qualified $URL = URL."/".$URL; } - // Compile out URI codes - $URL = COMPILE_CODE($URL); - // Get output buffer $OUTPUT = ob_get_contents(); @@ -1284,6 +1278,9 @@ function bigintval($num, $castValue = true) { // Has the whole value changed? if ("".$ret."" != "".$num."") { // Log the values + print("
");
+		debug_print_backtrace();
+		die("
"); DEBUG_LOG(__FUNCTION__, __LINE__, " num={$num},ret={$ret}"); } // END - if @@ -2238,7 +2235,7 @@ function mxchange_die ($msg) { // Display parsing time and number of SQL queries in footer function DISPLAY_PARSING_TIME_FOOTER() { - global $startTime, $_CONFIG; + global $_CONFIG; $endTime = microtime(true); // Is the timer started? @@ -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 @@ -2605,7 +2602,7 @@ function REBUILD_CACHE ($cache, $inc="") { // Shall I remove the cache file? if ((EXT_IS_ACTIVE("cache")) && (is_object($cacheInstance))) { // Rebuild cache - if ($cacheInstance->cache_file($cache, true)) { + if ($cacheInstance->cache_file($cache)) { // Destroy it $cacheInstance->cache_destroy(); } // END - if @@ -2804,6 +2801,12 @@ function DESTROY_ADMIN_SESSION () { return @session_destroy(); } +// Checks if a given apache module is loaded +function IF_APACHE_MODULE_LOADED ($apacheModule) { + // Check it and return result + return (((function_exists('apache_get_modules')) && (in_array($apacheModule, apache_get_modules()))) || (!function_exists('apache_get_modules'))); +} + ////////////////////////////////////////////////// // // // AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //