inc/autopurge/purge-unconfirmed.php svneol=native#text/plain
inc/cache/.htaccess svneol=native#text/plain
inc/cache/_compiled/.htaccess svneol=native#text/plain
-inc/cache/_compiled/emails/.htaccess svneol=native#text/plain
+inc/cache/_compiled/email/.htaccess svneol=native#text/plain
inc/cache/_compiled/html/.htaccess svneol=native#text/plain
+inc/cache/_compiled/xml/.htaccess svneol=native#text/plain
inc/callback-functions.php svneol=native#text/plain
inc/classes/.htaccess svneol=native#text/plain
inc/classes/cachesystem.class.php svneol=native#text/plain
inc/modules/admin/what-list_transfer.php svneol=native#text/plain
inc/modules/admin/what-list_unconfirmed.php svneol=native#text/plain
inc/modules/admin/what-list_user.php svneol=native#text/plain
+inc/modules/admin/what-list_user_subid.php svneol=native#text/plain
inc/modules/admin/what-list_wernis.php svneol=native#text/plain
inc/modules/admin/what-list_yoomedia_tm.php svneol=native#text/plain
inc/modules/admin/what-lock_sponsor.php svneol=native#text/plain
./inc/modules/admin/what-list_refs.php:101: // @TODO Try to rewrite some to EL
./inc/modules/admin/what-list_unconfirmed.php:107: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
./inc/modules/admin/what-list_unconfirmed.php:84: // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}');
-./inc/modules/admin/what-list_user.php:290: // @TODO Rewrite this into a filter
-./inc/modules/admin/what-list_user.php:355: // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:289: // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:354: // @TODO Rewrite this into a filter
./inc/modules/admin/what-logs.php:64: // @TODO Fix content-type here
./inc/modules/admin/what-logs.php:70: // @TODO Fix content-type here
./inc/modules/admin/what-mem_add.php:124: // @TODO This can be somehow rewritten to a function
./inc/mysql-manager.php:44:// @TODO Can we cache this?
./inc/purge/purge-inact.php:55: // @TODO Rewrite these if() blocks to a filter
./inc/revision-functions.php:168:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1108: // @TODO Deprecate this thing
-./inc/template-functions.php:1119: // @TODO Deprecate this thing
-./inc/template-functions.php:1226: // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1275: // @TODO Add a little more infos here
-./inc/template-functions.php:1643:// @TODO Lame description for this function
-./inc/template-functions.php:1665: // @TODO Move this in a filter
+./inc/template-functions.php:1126: // @TODO Deprecate this thing
+./inc/template-functions.php:1137: // @TODO Deprecate this thing
+./inc/template-functions.php:1244: // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1293: // @TODO Add a little more infos here
+./inc/template-functions.php:1667:// @TODO Lame description for this function
+./inc/template-functions.php:1689: // @TODO Move this in a filter
./inc/template-functions.php:197: * @TODO On some pages this is buggy
+./inc/template-functions.php:2292: // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
./inc/template-functions.php:285: // @TODO Remove these sanity checks if all is fine
-./inc/template-functions.php:599:// @TODO $simple/$constants are deprecated
-./inc/template-functions.php:697: // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
+./inc/template-functions.php:617:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:715: // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
./inc/wrapper-functions.php:3010: // @TODO Find a way to not use direct module comparison
./inc/wrapper-functions.php:494:// @TODO Do some more sanity check here
-./inc/xml-functions.php:209: // @TODO Handle characters
+./inc/xml-functions.php:221: // @TODO Handle characters
./mailid.php:102: // @TODO Rewrite this to a filter
./mailid.php:145: // @TODO Rewrite this to a filter
./mailid_top.php:112: // @TODO Rewrite this to a filter/function
setAjaxReplyContent(loadTemplate('admin_area_' . trim(postRequestElement('tab')), true));
// Has the template been loaded?
- if (isset($GLOBALS['tpl_content']['admin_page_' . trim(postRequestElement('tab'))])) {
+ if (isset($GLOBALS['template_content']['html']['admin_page_' . trim(postRequestElement('tab'))])) {
// All okay if we reach this point
setHttpStatus('200 OK');
} else {
setAjaxReplyContent(loadTemplate('install_page_' . trim(postRequestElement('tab')), true));
// Has the template been loaded?
- if (isset($GLOBALS['tpl_content']['install_page_' . trim(postRequestElement('tab'))])) {
+ if (isset($GLOBALS['template_content']['html']['install_page_' . trim(postRequestElement('tab'))])) {
// All okay if we reach this point
setHttpStatus('200 OK');
} else {
--- /dev/null
+Deny from all
+++ /dev/null
-Deny from all
--- /dev/null
+Deny from all
} // END - if
// Version number
-setThisExtensionVersion('0.5.4');
+setThisExtensionVersion('0.5.5');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', true, isExtensionDryRun());
unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Weitere Filter für Referral-Counter und Sub-Id hinzugefügt.");
break;
+
+ case '0.5.5': // SQL queries for v0.5.5
+ // Register filter
+ registerFilter(__FILE__, __LINE__, 'member_admin_actions', 'ADD_USER_SUBID_MEMBER_ACTION', false, true, isExtensionDryRun());
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Weiteren Filter für Mitglieder-Aktionen im Adminbereich hinzugefügt.");
+ break;
} // END - switch
break;
return $filterData;
}
+// Filter for adding member action
+function FILTER_ADD_USER_SUBID_MEMBER_ACTION ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Add entry
+ array_push($filterData, 'list_user_subid');
+
+ // Return data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+
// [EOF]
?>
// Is there cached eval() data?
if ((isset($GLOBALS['template_eval'])) && (count($GLOBALS['template_eval']) > 0)) {
// Now flush all
- foreach ($GLOBALS['template_eval'] as $template => $eval) {
- // Flush the cache (if not yet found)
- flushTemplateCache($template, $eval);
- } // END - if
+ foreach ($GLOBALS['template_eval'] as $prefix => $templateArray) {
+ foreach ($templateArray as $template => $eval) {
+ // Flush the cache (if not yet found)
+ flushTemplateCache($prefix, $template, $eval);
+ } // END - foreach
+ } // END - foreach
} // END - if
}
array_push($GLOBALS['fatal_messages'], $message);
// Log fatal messages away
- logDebugMessage($F, $L, 'Fatal error message: ' . $message);
+ logDebugMessage($F, $L, 'Fatal error message: ' . compileCode($message));
}
// Getter for total fatal message count
'MEMBER_EDIT_USER_SUBIDS_SUBJECT' => "Änderung Ihrer Sub-Id",
'MEMBER_DELETE_USER_SUBIDS_SUBJECT' => "Ihre Sub-Id ist gelöscht",
+ // Admin - sub ids - action link
+ 'ADMIN_USER_ACTION_LINK_LIST_USER_SUBID_TITLE' => "Sub-Ids des Mitgliedes auflisten und Statistik einsehen",
+ 'ADMIN_USER_ACTION_LINK_LIST_USER_SUBID' => "Sub-Ids auflisten",
+
// Generic - subids
'SUBID_VALUE' => "Sub-Id:",
'SUBID_ADDED' => "Hinzugefügt:",
* -------------------------------------------------------------------- *
* File : what-list_!!!s.php *
* -------------------------------------------------------------------- *
- * Short description : List all URLs in !!! and sync from mail pool *
+ * Short description : List all URLs in !!! *
* -------------------------------------------------------------------- *
- * Kurzbeschreibung : Alle URLs in !!! auflisten und syncen *
+ * Kurzbeschreibung : Alle URLs in !!! auflisten *
* -------------------------------------------------------------------- *
* $Revision:: $ *
* $Date:: $ *
return false;
} // END - if
-// List all URLs
+// List all !!!
showEntriesByXmlCallback('admin_list_!!!s');
// [EOF]
// Check if 'userid' is set
if (isGetRequestElementSet('userid')) {
// List all entries per user
- showEntriesByXmlCallback('admin_list_nickname_history');
+ showEntriesByXmlCallback('admin_list_nickname_history', array(
+ 'userid' => bigintval(getRequestElement('userid'))
+ ));
} else {
// Output selection form with all confirmed user accounts listed
addMemberSelectionBox();
$content['joined'] = generateDateTime($content['joined'], '2');
$content['last_update'] = generateDateTime($content['last_update'], '2');
$content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], '2');
- $content['total_points'] = getTotalPoints($content['userid']);
$content['locked_points'] = countSumTotalData($content['userid'], 'user_points', 'locked_points') + countSumTotalData($content['userid'], 'user_points', 'locked_order_points');
// Prepare array for filter
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/09/2012 *
+ * =================== Last change: 10/09/2012 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-list_user_subid.php *
+ * -------------------------------------------------------------------- *
+ * Short description : List all URLs in user_subid *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Alle URLs in user_subid auflisten *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// By default show the list...
+$show = true;
+
+// Check for 'id' element
+if ((countRequestPost() > 0) && (!ifPostContainsSelections('id'))) {
+ // Not found so output message
+ displayMessage('{--ADMIN_USER_SUBID_NO_SELECTIONS--}');
+
+ // Abort here
+ return;
+} // END - if
+
+// Edit or delete button hit?
+if (isFormSent('delete')) {
+ // Show entries for deletion
+ showEntriesByXmlCallback('admin_delete_show_user_subid');
+
+ // Do not show the list of URLs after this template
+ $show = false;
+} elseif (isFormSent('do_delete')) {
+ // Remove entries from database
+ showEntriesByXmlCallback('admin_delete_do_user_subid');
+}
+
+// Show entries?
+if ($show === false) {
+ // No, a form has already been show
+ return false;
+} // END - if
+
+// Is a user id sent?
+if (isGetRequestElementSet('userid')) {
+ // List all sub ids
+ showEntriesByXmlCallback('admin_list_user_subid', array(
+ 'userid' => bigintval(getRequestElement('userid'))
+ ));
+} else {
+ // Output selection form with all confirmed user accounts listed
+ addMemberSelectionBox();
+}
+
+// [EOF]
+?>
$GLOBALS['current_template'] = $template;
// Is there cache?
- if ((!isDebuggingTemplateCache()) && (isTemplateCached($template))) {
+ if ((!isDebuggingTemplateCache()) && (isTemplateCached('html', $template))) {
// Evaluate the cache
- eval(readTemplateCache($template));
- } elseif (!isset($GLOBALS['template_eval'][$template])) {
+ eval(readTemplateCache('html', $template));
+ } elseif (!isset($GLOBALS['template_eval']['html'][$template])) {
// Make all template names lowercase
$template = strtolower($template);
// Base directory
$basePath = sprintf("%stemplates/%s/html/", getPath(), getLanguage());
- $extraPath = detectExtraTemplatePath($template);
+ $extraPath = detectExtraTemplatePath('html', $template);
// Generate FQFN
$FQFN = $basePath . $extraPath . $template . '.tpl';
incrementConfigEntry('num_templates');
// The local file does exists so we load it. :)
- $GLOBALS['tpl_content'][$template] = readFromFile($FQFN);
+ $GLOBALS['template_content']['html'][$template] = readFromFile($FQFN);
// Is there to compile the code?
- if ((isInString('$', $GLOBALS['tpl_content'][$template])) || (isInString('{--', $GLOBALS['tpl_content'][$template])) || (isInString('{?', $GLOBALS['tpl_content'][$template])) || (isInString('{%', $GLOBALS['tpl_content'][$template]))) {
+ if ((isInString('$', $GLOBALS['template_content']['html'][$template])) || (isInString('{--', $GLOBALS['template_content']['html'][$template])) || (isInString('{?', $GLOBALS['template_content']['html'][$template])) || (isInString('{%', $GLOBALS['template_content']['html'][$template]))) {
// Normal HTML output?
if ((isHtmlOutputMode()) && (substr($template, 0, 3) != 'js_')) {
// Add surrounding HTML comments to help finding bugs faster
- $code = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'][$template] . '<!-- Template ' . $template . ' - End //-->';
+ $code = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
// Prepare eval() command
- $GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($code), false, true, true, $compileCode) . '";';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileCode(escapeQuotes($code), false, true, true, $compileCode) . '";';
} elseif (substr($template, 0, 3) == 'js_') {
// JavaScripts don't like entities, dollar signs and timings
- $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
} else {
// Prepare eval() command, other output doesn't like entities, maybe
- $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
}
} elseif (isHtmlOutputMode()) {
// Add surrounding HTML comments to help finding bugs faster
- $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'][$template] . '<!-- Template ' . $template . ' - End //-->';
- $GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), false, true, true, $compileCode) . '";';
+ $ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['template_content']['html'][$template] . '<!-- Template ' . $template . ' - End //-->';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), false, true, true, $compileCode) . '";';
} else {
// JavaScript again
- $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
+ $GLOBALS['template_eval']['html'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['template_content']['html'][$template]), false, true, true, $compileCode) . '");';
} // END - if
} elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
</div>';
} else {
// No file!
- $GLOBALS['template_eval'][$template] = '404';
+ $GLOBALS['template_eval']['html'][$template] = '404';
}
}
// Code set?
- if ((isset($GLOBALS['template_eval'][$template])) && ($GLOBALS['template_eval'][$template] != '404')) {
+ if ((isset($GLOBALS['template_eval']['html'][$template])) && ($GLOBALS['template_eval']['html'][$template] != '404')) {
// Eval the code
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - BEFORE EVAL');
- ///* DEBUG: */ print('<pre>'.htmlentities($GLOBALS['template_eval'][$template]).'</pre>');
- eval($GLOBALS['template_eval'][$template]);
+ ///* DEBUG: */ print('<pre>'.htmlentities($GLOBALS['template_eval']['html'][$template]).'</pre>');
+ eval($GLOBALS['template_eval']['html'][$template]);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - AFTER EVAL');
} // END - if
}
// Detects the extra template path from given template name
-function detectExtraTemplatePath ($template) {
+function detectExtraTemplatePath ($prefix, $template) {
// Default is empty
$extraPath = '';
// Is there cache?
- if (!isset($GLOBALS['extra_path'][$template])) {
+ if (!isset($GLOBALS['extra_path'][$prefix][$template])) {
// Check for admin/guest/member/etc. templates
if (substr($template, 0, 6) == 'admin_') {
// Admin template found
}
// Store it in cache
- $GLOBALS['extra_path'][$template] = $extraPath;
+ $GLOBALS['extra_path'][$prefix][$template] = $extraPath;
} // END - if
// Return result
- return $GLOBALS['extra_path'][$template];
+ return $GLOBALS['extra_path'][$prefix][$template];
}
// Loads an email template and compiles it
}
} // END - if
- // Base directory
- $basePath = sprintf("%stemplates/%s/emails/", getPath(), getLanguage());
+ // Is there cache?
+ if ((!isDebuggingTemplateCache()) && (isTemplateCached('email', $template))) {
+ // Evaluate the cache
+ eval(readTemplateCache('email', $template));
+ } elseif (!isset($GLOBALS['template_eval']['email'][$template])) {
+ // Base directory
+ $basePath = sprintf("%stemplates/%s/emails/", getPath(), getLanguage());
- // Detect extra path
- $extraPath = detectExtraTemplatePath($template);
+ // Detect extra path
+ $extraPath = detectExtraTemplatePath('email', $template);
- // Generate full FQFN
- $FQFN = $basePath . $extraPath . $template . '.tpl';
+ // Generate full FQFN
+ $FQFN = $basePath . $extraPath . $template . '.tpl';
- // Does the special template exists?
- if (!isFileReadable($FQFN)) {
- // Reset to default template
- $FQFN = $basePath . $template . '.tpl';
- } // END - if
+ // Does the special template exists?
+ if (!isFileReadable($FQFN)) {
+ // Reset to default template
+ $FQFN = $basePath . $template . '.tpl';
+ } // END - if
- // Now does the final template exists?
- $newContent = '';
- if (isFileReadable($FQFN)) {
- // The local file does exists so we load it. :)
- $GLOBALS['tpl_content'][$template] = readFromFile($FQFN);
-
- // Run code
- $GLOBALS['tpl_content'][$template] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'][$template])) . '");';
- eval($GLOBALS['tpl_content'][$template]);
- } elseif (!empty($template)) {
- // Template file not found
- $newContent = '<div class="para">
+ // Now does the final template exists?
+ $newContent = '';
+ if (isFileReadable($FQFN)) {
+ // The local file does exists so we load it. :)
+ $GLOBALS['template_content']['email'][$template] = readFromFile($FQFN);
+
+ // Run code
+ $GLOBALS['template_eval']['email'][$template] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['template_content']['email'][$template])) . '");';
+ } elseif (!empty($template)) {
+ // Template file not found
+ $newContent = '<div class="para">
{--TEMPLATE_404--}: ' . $template . '
</div>
<div class="para">
<pre>' . print_r($content, true) . '</pre>
</div>';
- // Debug mode not active? Then remove the HTML tags
- if (!isDebugModeEnabled()) {
- // Remove HTML tags
- $newContent = secureString($newContent);
- } // END - if
- } else {
- // No template name supplied!
- $newContent = '{--NO_TEMPLATE_SUPPLIED--}';
+ // Don't cache this, as there is no template to cache
+ $GLOBALS['template_eval']['email'][$template] = '404';
+
+ // Debug mode not active? Then remove the HTML tags
+ if (!isDebugModeEnabled()) {
+ // Remove HTML tags
+ $newContent = secureString($newContent);
+ } // END - if
+ } else {
+ // No template name supplied!
+ $newContent = '{--NO_TEMPLATE_SUPPLIED--}';
+ $GLOBALS['template_eval']['email'][$template] = '404';
+ }
}
+ // Is there something to eval?
+ if ((isset($GLOBALS['template_eval']['email'][$template])) && ($GLOBALS['template_eval']['email'][$template] != '404')) {
+ // Eval the code
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - BEFORE EVAL');
+ ///* DEBUG: */ print('<pre>'.htmlentities($GLOBALS['template_eval']['email'][$template]).'</pre>');
+ eval($GLOBALS['template_eval']['email'][$template]);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template=' . $template . ' - AFTER EVAL');
+ } // END - if
+
// Are there some content?
if (empty($newContent)) {
// Compiling failed
- $newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['tpl_content'][$template];
+ $newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['template_content']['email'][$template];
// Add last error if the required function exists
if (function_exists('error_get_last')) {
// Add last error and some lines for better overview
- $newContent .= "\n--------------------------------------\nDebug:\n".print_r(error_get_last(), true)."--------------------------------------\nPlease don't alter these informations!\nThanx.";
+ $newContent .= "\n--------------------------------------\nDebug:\n" . print_r(error_get_last(), true) . "--------------------------------------\nPlease don't alter these informations!\nThanx.";
} // END - if
} // END - if
}
// Checks whethere there is a cache file there. This function is cached.
-function isTemplateCached ($template) {
+function isTemplateCached ($prefix, $template) {
// Is there cached this result?
- if (!isset($GLOBALS['template_cache'][$template])) {
+ if (!isset($GLOBALS['template_cache'][$prefix][$template])) {
// Generate FQFN
- $FQFN = generateCacheFqfn($template);
+ $FQFN = generateCacheFqfn($prefix, $template);
// Is it there?
- $GLOBALS['template_cache'][$template] = isFileReadable($FQFN);
+ $GLOBALS['template_cache'][$prefix][$template] = isFileReadable($FQFN);
} // END - if
// Return it
- return $GLOBALS['template_cache'][$template];
+ return $GLOBALS['template_cache'][$prefix][$template];
}
// Flushes non-flushed template cache to disk
-function flushTemplateCache ($template, $eval) {
+function flushTemplateCache ($prefix, $template, $eval) {
// Is this cache flushed?
- if ((isDebuggingTemplateCache() === false) && (isTemplateCached($template) === false) && ($eval != '404')) {
+ if ((isDebuggingTemplateCache() === false) && (isTemplateCached($prefix, $template) === false) && ($eval != '404')) {
// Generate FQFN
- $FQFN = generateCacheFqfn($template);
+ $FQFN = generateCacheFqfn($prefix, $template);
+
+ // Is this a XML template?
+ if ($prefix == 'xml') {
+ // Compact only XML templates as emails needs new-line characters and HTML may contain required "comments"
+ $eval = compactContent($eval);
+ } // END - if
// And flush it
writeToFile($FQFN, $eval, true);
}
// Reads a template cache
-function readTemplateCache ($template) {
+function readTemplateCache ($prefix, $template) {
// Check it again
- if ((isDebuggingTemplateCache()) || (!isTemplateCached($template))) {
+ if ((isDebuggingTemplateCache()) || (!isTemplateCached($prefix, $template))) {
// This should not happen
reportBug('Wether debugging of template cache is enabled or template ' . $template . ' is not cached while expected.');
} // END - if
// Is it cached?
- if (!isset($GLOBALS['template_eval'][$template])) {
+ if (!isset($GLOBALS['template_eval'][$prefix][$template])) {
// Generate FQFN
- $FQFN = generateCacheFqfn($template);
+ $FQFN = generateCacheFqfn($prefix, $template);
// And read from it
- $GLOBALS['template_eval'][$template] = readFromFile($FQFN);
+ $GLOBALS['template_eval'][$prefix][$template] = readFromFile($FQFN);
} // END - if
// And return it
- return $GLOBALS['template_eval'][$template];
+ return $GLOBALS['template_eval'][$prefix][$template];
}
// Escapes quotes (default is only double-quotes)
}
// Generates an FQFN for template cache from the given template name
-function generateCacheFqfn ($template, $mode = 'html') {
+function generateCacheFqfn ($prefix, $template) {
// Is this cached?
- if (!isset($GLOBALS['template_cache_fqfn'][$template])) {
+ if (!isset($GLOBALS['template_cache_fqfn'][$prefix][$template])) {
// Generate the FQFN
- $GLOBALS['template_cache_fqfn'][$template] = sprintf(
+ $GLOBALS['template_cache_fqfn'][$prefix][$template] = sprintf(
"%s_compiled/%s/%s.tpl.cache",
getCachePath(),
- $mode,
+ $prefix,
$template
);
} // END - if
// Return it
- return $GLOBALS['template_cache_fqfn'][$template];
+ return $GLOBALS['template_cache_fqfn'][$prefix][$template];
}
// "Fixes" null or empty string to count of dashes
return $data;
}
+/**
+ * Removes all commentd, tabs and new-line characters to compact the content
+ *
+ * @param $uncompactedContent The uncompacted content
+ * @return $compactedContent The compacted content
+ */
+function compactContent ($uncompactedContent) {
+ // First, remove all tab/new-line/revert characters
+ $compactedContent = str_replace(chr(9), '', str_replace(chr(10), '', str_replace(chr(13), '', $uncompactedContent)));
+
+ // Then regex all comments like <!-- //--> away
+ preg_match_all('/<!--[\w\W]*?(\/\/){0,1}-->/', $compactedContent, $matches);
+
+ // Do we have entries?
+ if (isset($matches[0][0])) {
+ // Remove all
+ foreach ($matches[0] as $match) {
+ // Remove the match
+ $compactedContent = str_replace($match, '', $compactedContent);
+ } // END - foreach
+ } // END - if
+
+ // Set the content again
+ // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
+
+ // Return compacted content
+ return $compactedContent;
+}
+
// [EOF]
?>
} // END - if
// Calls back a function based on given XML template data
-function showEntriesByXmlCallback ($template) {
+function showEntriesByXmlCallback ($template, $content = array(), $compileCode = true) {
// Generate FQFN for with special path
$FQFN = sprintf("%stemplates/xml/%s%s.xml",
getPath(),
- detectExtraTemplatePath($template),
+ detectExtraTemplatePath('xml', $template),
$template
);
// Is it again readable?
if (isFileReadable($FQFN)) {
- // Read it
- $templateContent = readFromFile($FQFN);
+ // Is there cache?
+ if ((!isDebuggingTemplateCache()) && (isTemplateCached('xml', $template))) {
+ // Evaluate the cache
+ eval(readTemplateCache('xml', $template));
+ } else {
+ // Read it
+ $templateContent = readFromFile($FQFN);
+
+ // Prepare it for finaly eval() command
+ $GLOBALS['template_eval']['xml'][$template] = '$templateContent = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($templateContent), false, true, true, $compileCode) . '");';
+
+ // Eval the code, this does insert any array elements from $content
+ eval($GLOBALS['template_eval']['xml'][$template]);
+ }
// Init main arrays
$GLOBALS['__XML_CALLBACKS'] = array(
// Adds special elements by calling back another template-depending function
function addXmlSpecialElements ($template) {
- // Generate the FQCN (Full-Qualified CallbackName)
+ // Generate the FQCN (Full-Qualified Callback Name)
$FQCN = 'addXmlSpecial' . capitalizeUnderscoreString($template);
// Is it there?
- condition = look-up condition
- look-for = What to look for
//-->
- <where-select-from-list-entry type="string" table="" value="history_userid" condition="EQUALS" look-for="$userid" />
+ <where-select-from-list-entry type="string" table="" value="history_userid" condition="EQUALS" look-for="$content[userid]" />
</where-select-from-list>
<!--
Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for listing user sub ids
+
+@author Roland Haeder <webmaster@mxchange.org>
+@version 0.2.1-FINAL
+@copyright (c) 2003 - 2009 by Roland Haeder
+@copyright (c) 2009 - 2012 by Mailer Developer Team
+@license GNU GPL 2.0 or any newer version
+@link http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA 02110-1301 USA
+//-->
+<admin-list-data>
+ <!--
+ Call-back function, the extracted data from this XML will then be re-read
+ from that function. The most common function this XML uses is
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
+ //-->
+ <callback-function type="string" value="doGenericListEntries" />
+ <!--
+ Now we need information which template should be loaded and which functions
+ shall be called back. So lets start with the main list template. This mostly
+ requires no call-back function.
+ //-->
+ <list-template type="string" value="admin_list_user_subid" />
+ <!--
+ The template for all rows, mostly this name has a '_row' suffix and again,
+ no call-back function is usually required.
+ //-->
+ <list-row-template type="string" value="admin_list_user_subid_row" />
+ <!--
+ Message id to display if no entry could be found
+ //-->
+ <no-entry-found-message type="string" value="ADMIN_FORCED_ADS_404" />
+ <!--
+ The table(s) we shall grab the data from, all as list.
+ //-->
+ <data-tables>
+ <!--
+ A single table entry, with alias and without the configurable
+ _MYSQL_PREFIX. You can specify the table's name or alias later on.
+ //-->
+ <data-table type="string" alias="" value="user_subids" />
+ <!--
+ Columns to perform the SELECT statement on, with alias and name plus which table.
+ //-->
+ <select-data-from-list>
+ <!--
+ A single entry with table name (can be left empty), value (must
+ always be set), alias (again can be left empty) and SQL function
+ (can also be left empty) which shall be applied on the column.
+ //-->
+ <select-data-from-list-entry type="string" table="" value="id" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="userid" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="subid" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
+ </select-data-from-list>
+ <!--
+ And the column list to perform the WHERE statement on.
+ //-->
+ <where-select-from-list>
+ <!--
+ Query on for selected user's sub ids
+ //-->
+ <where-select-from-list-entry type="string" table="" value="userid" condition="EQUALS" look-for="$content[userid]" />
+ </where-select-from-list>
+ <!--
+ Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
+ //-->
+ <order-by-list>
+ <!--
+ A single entry to perform the ORDER BY statement on, see above WHERE entry for details.
+ //-->
+ <order-by-list-entry type="string" table="" order="subid" value="ASC" />
+ </order-by-list>
+ </data-tables>
+ <!--
+ List all column names from the 'select-data-from-list' node here, but now
+ with call-back informations. The list must only contain those entries where
+ a call-back function shall be called for.
+ //-->
+ <column-callback-list>
+ <!--
+ Another column, now we need a second parameter here because
+ generateDateTime() expects two parameters (first is always the data
+ from column).
+ //-->
+ <column-callback-list-entry>
+ <!--
+ The actual data, again.
+ //-->
+ <column-callback-data type="string" value="subid_added" callback="generateDateTime" />
+ <!--
+ More parameters, remember that the first parameter is always given
+ and that it is the data from column.
+ //-->
+ <callback-extra-parameter-list>
+ <!--
+ A single parameter, 'type' can be one of 'float', 'int',
+ 'bool', 'string'. 'array' is not yet supported.
+ //-->
+ <callback-extra-parameter-list-entry type="int" column="subid_added" value="2" />
+ </callback-extra-parameter-list>
+ </column-callback-list-entry>
+ </column-callback-list>
+</admin-list-data>
- condition = look-up condition
- look-for = What to look for
//-->
- <where-select-from-list-entry type="string" table="dt" value="userid" condition="EQUALS" look-for="$userid" />
+ <where-select-from-list-entry type="string" table="dt" value="userid" condition="EQUALS" look-for="$content[userid]" />
<!--
The second column to perform the WHERE statement on. NOT-EQUALS is an alias for '!='.
//-->