X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=6e3cda3de9dad272524e41e5964431122e6f1cbe;hb=9642d17a028f3e7fdc57fa12e5dbd7129f166816;hp=e0bee7f20cc894cd130df6c8081deb157cd1a9a1;hpb=8cd3d68a23aa285f2fe149698a46cf8b4e3ac0ca;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index e0bee7f20c..6e3cda3de9 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -45,7 +45,9 @@ if (!defined('__SECURITY')) { // Output HTML code directly or 'render' it. You addionally switch the new-line character off function outputHtml ($htmlCode, $newLine = true) { // Init output - if (!isset($GLOBALS['output'])) $GLOBALS['output'] = ''; + if (!isset($GLOBALS['output'])) { + $GLOBALS['output'] = ''; + } // END - if // Transfer username $username = getMessage('USERNAME_UNKNOWN'); @@ -95,11 +97,6 @@ function outputHtml ($htmlCode, $newLine = true) { clearOutputBuffer(); } // END - if - // Extension 'rewrite' installed? - if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) { - $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']); - } // END - if - // Send all HTTP headers sendHttpHeaders(); @@ -109,11 +106,6 @@ function outputHtml ($htmlCode, $newLine = true) { // Output code here, DO NOT REMOVE! ;-) outputRawCode($GLOBALS['output']); } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($GLOBALS['output']))) { - // Rewrite links when rewrite extension is active - if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) { - $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']); - } // END - if - // Send all HTTP headers sendHttpHeaders(); @@ -155,16 +147,17 @@ function compileFinalOutput () { addPageHeaderFooter(); // Compile all out - while (((strpos($GLOBALS['output'], '{--') !== false) || (strpos($GLOBALS['output'], '{!') !== false) || (strpos($GLOBALS['output'], '{?') !== false) || (strpos($GLOBALS['output'], '{%') !== false)) && ($cnt < 3)) { + while (((strpos($GLOBALS['output'], '{--') !== false) || (strpos($GLOBALS['output'], '{DQUOTE}') !== false) || (strpos($GLOBALS['output'], '{!') !== false) || (strpos($GLOBALS['output'], '{?') !== false) || (strpos($GLOBALS['output'], '{%') !== false)) && ($cnt < 3)) { // Init common variables $content = array(); $newContent = ''; // Compile it //* DEBUG: */ print '
'.htmlentities($GLOBALS['output']).'
'; - $eval = '$newContent = "' . compileCode(escapeQuotes($GLOBALS['output'])) . '";'; + $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($GLOBALS['output']))) . '";'; //* DEBUG: */ die('
'.htmlentities($eval).'
'); eval($eval); + //* DEBUG: */ die('
'.htmlentities($newContent).'
'); // Was that eval okay? if (empty($newContent)) { @@ -179,6 +172,11 @@ function compileFinalOutput () { $cnt++; } // END - while + // Extension 'rewrite' installed? + if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) { + $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']); + } // END - if + // Compress it? if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) { // Compress it for HTTP gzip @@ -1169,30 +1167,30 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're if ($type == 'yn') { // This is a yes/no selection only! - if ($id > 0) $prefix .= "[" . $id."]"; - $OUT .= " '; } else { // Begin with regular selection box here if (!empty($prefix)) $prefix .= "_"; $type2 = $type; - if ($id > 0) $type2 .= "[" . $id."]"; - $OUT .= " '; } switch ($type) { case 'day': // Day for ($idx = 1; $idx < 32; $idx++) { - $OUT .= "'; } // END - for break; case 'month': // Month - foreach ($GLOBALS['month_descr'] as $month => $descr) { - $OUT .= "'; } // END - for } elseif ($default == -1) { // Current year minus 1 - for ($idx = $startYear; $idx <= ($year + 1); $idx++) - { - $OUT .= "\n"; - } + for ($idx = $startYear; $idx <= ($year + 1); $idx++) { + $OUT .= ''; + } // END - for } else { // Get current year and subtract the configured minimum age - $OUT .= "\n"; + $OUT .= ''; // Calculate earliest year depending on extension version if (isExtensionInstalledAndNewer('order', '0.2.1')) { // Use configured minimum age @@ -1239,41 +1236,41 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 're // Construct year selection list for ($idx = $minYear; $idx <= $year; $idx++) { - $OUT .= "'; } // END - for } break; case 'sec': case 'min': - for ($idx = '0'; $idx < 60; $idx+=5) { + for ($idx = 0; $idx < 60; $idx+=5) { if (strlen($idx) == 1) $idx = '0' . $idx; - $OUT .= "'; } // END - for break; case 'hour': - for ($idx = '0'; $idx < 24; $idx++) { + for ($idx = 0; $idx < 24; $idx++) { if (strlen($idx) == 1) $idx = '0' . $idx; - $OUT .= "'; } // END - for break; case 'yn': - $OUT .= "