X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Ftemplate-functions.php;h=77fb6bf78bc63c109768aa342147cb5d52b8df1c;hp=aea217a7fa08e9253dee6faa4c6086b48658f6af;hb=67f53c107d5b68f6e735407b98803fc83e12d7b4;hpb=c72268213d4d4829d845d39c101bb08fbe4ed79a diff --git a/inc/template-functions.php b/inc/template-functions.php index aea217a7fa..77fb6bf78b 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -155,7 +155,7 @@ function outputHtml ($htmlCode, $newLine = true) { default: // Huh, something goes wrong or maybe you have edited config.php ??? - debug_report_bug(__FUNCTION__, __LINE__, '{--FATAL_ERROR--}: {--LANG_NO_RENDER_DIRECT--}'); + debug_report_bug(__FUNCTION__, __LINE__, '{--FATAL_ERROR--}: {--NO_RENDER_DIRECT--}'); break; } // END - switch } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['header'])) || (count($GLOBALS['header']) == 0))) { @@ -226,7 +226,7 @@ function compileFinalOutput () { } // Main compilation loop -function doFinalCompilation ($code, $insertComments = true) { +function doFinalCompilation ($code, $insertComments = true, $enableCodes = true) { // Insert comments? (Only valid with HTML templates, of course) enableTemplateHtml($insertComments); @@ -240,8 +240,8 @@ function doFinalCompilation ($code, $insertComments = true) { $newContent = ''; // Compile it - //* DEBUG: */ debugOutput('
'.encodeEntities($code).'
'); - $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";'; + //* DEBUG: */ debugOutput('
'.linenumberCode($code).'
'); + $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code), false, true, $enableCodes)) . '";'; //* DEBUG: */ if (!$insertComments) print('
'.linenumberCode($eval).'
'); eval($eval); //* DEBUG: */ die('
'.encodeEntities($newContent).'
'); @@ -444,12 +444,12 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') { // Is content an array? if (is_array($content)) { // Add expiration to array - if ((isConfigEntrySet('auto_purge')) && (getConfig('auto_purge') == '0')) { + if ((isConfigEntrySet('auto_purge')) && (getAutoPurge() == '0')) { // Will never expire! $content['expiration'] = '{--MAIL_WILL_NEVER_EXPIRE--}'; } elseif (isConfigEntrySet('auto_purge')) { // Create nice date string - $content['expiration'] = createFancyTime(getConfig('auto_purge')); + $content['expiration'] = createFancyTime(getAutoPurge()); } else { // Missing entry $content['expiration'] = '{--MAIL_NO_CONFIG_AUTO_PURGE--}'; @@ -458,7 +458,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') { // Load user's data //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content)); - if (($userid > 0) && (is_array($content))) { + if ((isValidUserId($userid)) && (is_array($content))) { // If nickname extension is installed, fetch nickname as well if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!
"); @@ -1165,7 +1165,7 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) { // Is this already called? if (isset($GLOBALS[__FUNCTION__])) { // Other backtrace - print 'Message:'.$message.'
Backtrace:
';
+		print 'Message:' . $message . '
Backtrace:
';
 		debug_print_backtrace();
 		die('
'); } // END - if @@ -1191,8 +1191,8 @@ function debug_report_bug ($F, $L, $message = '', $sendEmail = true) { $debug .= 'Please report this bug at http://bugs.mxchange.org and include the logfile from ' . str_replace(getPath(), '', getCachePath()) . 'debug.log in your report (you can now attach files):
';
 	$debug .= debug_get_printable_backtrace();
 	$debug .= '
'; - $debug .= '
Request-URI: ' . getRequestUri() . '
'; - $debug .= '
Thank you for finding bugs.
'; + $debug .= '
Request-URI: ' . getRequestUri() . '
'; + $debug .= '
Thank you for finding bugs.
'; // Send an email? (e.g. not wanted for evaluation errors) if (($sendEmail === true) && (!isInstallationPhase())) { @@ -1360,7 +1360,7 @@ function determinePageTitle () { // Add title of module? (middle decoration will also be added!) if ((isModuleTitleEnabled()) || ((!isWhatSet()) && (!isActionSet())) || (getModule() == 'admin')) { - $TITLE .= ' ' . trim(getConfig('title_middle')) . ' ' . getModuleTitle(getModule()); + $TITLE .= ' ' . trim(getConfig('title_middle')) . ' {DQUOTE} . getModuleTitle(getModule()) . {DQUOTE}'; } // END - if // Add title from what file @@ -1379,10 +1379,10 @@ function determinePageTitle () { $pageTitle = '[-- ' . getMainTitle() . ' - ' . getModuleTitle(getModule()) . ' --]'; } elseif ((isInstalled()) && (!isAdminRegistered())) { // Installed but no admin registered - $pageTitle = '{--SETUP_OF_MAILER--}'; + $pageTitle = '{--INSTALLER_OF_MAILER_NO_ADMIN--}'; } elseif ((!isInstalled()) || (!isAdminRegistered())) { // Installation mode - $pageTitle = '{--INSTALLATION_OF_MAILER--}'; + $pageTitle = '{--INSTALLER_OF_MAILER--}'; } else { // Configuration not found! $pageTitle = '{--NO_CONFIG_FOUND_TITLE--}'; @@ -1536,7 +1536,7 @@ function sendModeMails ($mod, $modes) { $sub_mem = '{--MEMBER_CHANGED_DATA--}'; // Output success message - $content = '{--MYDATA_MAIL_SENT--}'; + $content = '{--MEMBER_MYDATA_MAIL_SENT--}'; break; default: // Unsupported module! @@ -1569,7 +1569,7 @@ function sendModeMails ($mod, $modes) { $content = '{--CANNOT_SEND_ADMIN_MAILS--}'; } else { // No mail to admin - $content = '{--MYDATA_MAIL_SENT--}'; + $content = '{--MEMBER_MYDATA_MAIL_SENT--}'; } } // END - if