X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ffunctions.php;h=f55f5135603ad783649c0e0dfd92fd15e04f7ee1;hp=545a2f2eb41823b76000be5e197cb823262656a8;hb=07612d2debcc78a93678db0deed050d82df432f1;hpb=06a24901c58897845bafc1e5b428fee99024bc64
diff --git a/inc/functions.php b/inc/functions.php
index 545a2f2eb4..f55f513560 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -120,6 +120,9 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
// Compile and run finished rendered HTML code
while (strpos($OUTPUT, '{!') > 0) {
+ // Replace _MYSQL_PREFIX
+ $OUTPUT = str_replace("{!_MYSQL_PREFIX!}", getConfig('_MYSQL_PREFIX'), $OUTPUT);
+
// Prepare the content and eval() it...
$newContent = '';
$eval = "\$newContent = \"".COMPILE_CODE(smartAddSlashes($OUTPUT))."\";";
@@ -128,7 +131,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
// Was that eval okay?
if (empty($newContent)) {
// Something went wrong!
- app_die(__FUNCTION__, __LINE__, "Evaluation error:
".htmlentities($eval)."
");
+ app_die(__FUNCTION__, __LINE__, 'Evaluation error:' . htmlentities($eval) . '
');
} // END - if
$OUTPUT = $newContent;
} // END - while
@@ -286,13 +289,16 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
} elseif (strpos($template, 'la_') > -1) {
// 'Logical-area' template found
$mode = 'la/';
+ } elseif (strpos($template, 'js_') > -1) {
+ // JavaScript template found
+ $mode = 'js/';
} else {
// Test for extension
$test = substr($template, 0, strpos($template, '_'));
if (EXT_IS_ACTIVE($test)) {
// Set extra path to extension's name
- $mode = $test.'/';
- }
+ $mode = $test . '/';
+ } // END - if
}
////////////////////////
@@ -341,8 +347,11 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
$ret = $tmpl_file;
}
- // Add surrounding HTML comments to help finding bugs faster
- $ret = "\n" . $ret . "\n";
+ // Normal HTML output?
+ if ($GLOBALS['output_mode'] == 0) {
+ // Add surrounding HTML comments to help finding bugs faster
+ $ret = "\n" . $ret . "\n";
+ } // END - if
} elseif ((IS_ADMIN()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
$ret = "
{--TEMPLATE_404--}
@@ -514,16 +523,16 @@ function sendRawEmail ($toEmail, $subject, $message, $from) {
}
// Generate a password in a specified length or use default password length
-function generatePassword ($LEN = 0) {
+function generatePassword ($length = 0) {
// Auto-fix invalid length of zero
- if ($LEN == 0) $LEN = getConfig('pass_len');
+ if ($length == 0) $length = getConfig('pass_len');
// Initialize array with all allowed chars
- $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/');
+ $ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
// Start creating password
$PASS = '';
- for ($i = 0; $i < $LEN; $i++) {
+ for ($i = 0; $i < $length; $i++) {
$PASS .= $ABC[mt_rand(0, count($ABC) -1)];
} // END - for
@@ -1286,9 +1295,9 @@ function bigintval ($num, $castValue = true) {
// Has the whole value changed?
// @TODO Remove this if() block if all is working fine
- if ("" . $ret."" != '' . $num."") {
+ if ('' . $ret . '' != '' . $num . '') {
// Log the values
- debug_report_bug("{$ret}<>{$num}");
+ //debug_report_bug("{$ret}<>{$num}");
} // END - if
// Return result
@@ -1412,7 +1421,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
$OUT .= " {--_YEARS--} | \n";
}
- if (ereg("M", $display) || (empty($display))) {
+ if (ereg('M', $display) || (empty($display))) {
$OUT .= " {--_MONTHS--} | \n";
}
@@ -1452,7 +1461,7 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
$OUT .= "\n";
}
- if (ereg("M", $display) || (empty($display))) {
+ if (ereg('M', $display) || (empty($display))) {
// Generate month selection
$OUT .= " |