X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ftemplate-functions.php;h=829c80fea130af34e936297b514061d4897d51ed;hb=0851db137e420b90617f47b77de2302e770f5f02;hp=bdb505d8fbd63be40be7494ebefdcf60eca102ca;hpb=46c1acbca83153bb96f76cc084d532069b88d96e;p=mailer.git
diff --git a/inc/template-functions.php b/inc/template-functions.php
index bdb505d8fb..829c80fea1 100644
--- a/inc/template-functions.php
+++ b/inc/template-functions.php
@@ -331,7 +331,7 @@ function loadTemplate ($template, $return = false, $content = array(), $compileC
(' . $template . ')
- {--TEMPLATE_CONTENT--}
+ {--TEMPLATE_CONTENT--}:
' . print_r($content, true) . '
';
} else {
@@ -448,15 +448,20 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
fetchUserData($userid, 'nickname');
} else {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NO-NICK!
");
- /// Load by userid
+ // Load by userid
fetchUserData($userid);
}
// Merge data if valid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE
");
if ((isUserDataValid()) && ($loadUserData === true)) {
+ // It is valid
$content = merge_array($content, getUserDataArray());
+
+ // But we don't like hashed passwords be mailed
+ unset($content['password']);
} // END - if
+
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER
");
} // END - if
@@ -490,9 +495,9 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadU
{--TEMPLATE_404--}: ' . $template . '
- {--TEMPLATE_CONTENT--}
+ {--TEMPLATE_CONTENT--}:
' . print_r($content, true) . '
- {--TEMPLATE_DATA--}
+ {--TEMPLATE_DATA--}:
' . print_r($DATA, true) . '
';
@@ -543,8 +548,8 @@ function getMenuCssClasses ($data) {
}
// Generate XHTML code for the CAPTCHA
-function generateCaptchaCode ($code, $type, $DATA, $userid) {
- return '';
+function generateCaptchaCode ($code, $type, $type, $userid) {
+ return '';
}
// Compiles the given HTML/mail code
@@ -689,7 +694,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 'fo
$year = getYear();
// Use configured min age or fixed?
- if (isExtensionInstalledAndNewer('order', '0.2.1')) {
+ if (isExtensionInstalledAndNewer('other', '0.2.1')) {
// Configured
$startYear = $year - getConfig('min_age');
} else {
@@ -716,7 +721,7 @@ function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 'fo
// Get current year and subtract the configured minimum age
$OUT .= '';
// Calculate earliest year depending on extension version
- if (isExtensionInstalledAndNewer('order', '0.2.1')) {
+ if (isExtensionInstalledAndNewer('other', '0.2.1')) {
// Use configured minimum age
$year = getYear() - getConfig('min_age');
} else {
@@ -818,6 +823,7 @@ function generateImageOrCode ($img_code, $headerSent = true) {
// Remove image from memory
imagedestroy($image);
}
+
// Create selection box or array of splitted timestamp
function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $return_array=false) {
// Do not continue if ONE_DAY is absend
@@ -841,7 +847,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
$M2 = getMonth(time() + $timestamp);
// If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
- if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) $SWITCH = getOneDay();
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) {
+ $SWITCH = getOneDay();
+ } // END - switch
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
@@ -1024,7 +1032,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
// Generate a list of administrative links to a given userid
function generateMemberAdminActionLinks ($userid) {
// Make sure userid is a number
- if ($userid != bigintval($userid)) debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ if ($userid != bigintval($userid)) {
+ debug_report_bug(__FUNCTION__, __LINE__, 'userid is not a number!');
+ } // END - if
// Define all main targets
$targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
@@ -1229,7 +1239,9 @@ function handleCodeMessage () {
$ext = 'unknown';
// Is extension given?
- if (isGetRequestParameterSet('ext')) $ext = getRequestParameter('ext');
+ if (isGetRequestParameterSet('ext')) {
+ $ext = getRequestParameter('ext');
+ } // END - if
// Convert the 'code' parameter from URL to a human-readable message
$message = getMessageFromErrorCode(getRequestParameter('code'));
@@ -1339,7 +1351,7 @@ function linenumberCode ($code) {
if ($count_lines == 1) {
$r .= 1;
} else {
- $r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
+ $r .= ($line == ($count_lines - 1)) ? '' : ($line+1);
}
$r .= '|';
@@ -1462,7 +1474,7 @@ function escapeQuotes ($str, $single = false) {
$str = addslashes($str);
} else {
// Remove escaping of single quotes
- $str = str_replace("\'", "'", $str);
+ $str = str_replace("\\'", "'", $str);
// Escape only double-quotes but prevent double-quoting
$str = str_replace("\\\\", "\\", str_replace('"', "\\\"", $str));
@@ -1586,11 +1598,11 @@ function sendModeMails ($mod, $modes) {
}
// Load template
- loadTemplate('admin_settings_saved', false, $content['message']);
+ displayMessage($content['message']);
}
// Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
+function generateSelectionBoxFromArray (array $options, $name, $optionValue, $optionContent = '', $extraName = '') {
// Start the output
$OUT = '