Several fixes applied:
authorRoland Häder <roland@mxchange.org>
Sat, 19 Jun 2010 23:42:29 +0000 (23:42 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 19 Jun 2010 23:42:29 +0000 (23:42 +0000)
- Mail templates are now "compiled" with newly introduced doFinalCompilation() function
- Typo 'county' fixed ...
- Redirect does now work again (was broken by EL)
- New functions for HTML/mail/other templates added
- Some internal TODOs solved
- TODOs.txt updated

13 files changed:
DOCS/TODOs.txt
inc/expression-functions.php
inc/footer.php
inc/functions.php
inc/wrapper-functions.php
templates/de/emails/member/member_mydata_notify.tpl
templates/de/emails/register-admin.tpl
templates/de/emails/register-member.tpl
templates/de/emails/sponsor/sponsor_change_data.tpl
templates/de/emails/sponsor/sponsor_pending.tpl
templates/de/html/member/member_mydata_edit.tpl
templates/de/html/member/member_mydata_overview.tpl
templates/de/html/sponsor/sponsor_account_form.tpl

index b27b2a4..bf00659 100644 (file)
@@ -2,13 +2,13 @@
 ### DO NOT EDIT THIS FILE. ###
 ./autoreg.php:60:// @TODO Add processing of request here
 ./beg.php:173:                 // @TODO Opps, what is missing here???
-./birthday_confirm.php:94:             // @TODO Try to rewrite the following unset()
+./birthday_confirm.php:99:             // @TODO Try to rewrite the following unset()
 ./inc/autopurge/purge-inact.php:57:    // @TODO Rewrite these if() blocks to a filter
-./inc/cache/config-local.php:125:// @TODO Rewrite the following three constants, somehow...
-./inc/classes/cachesystem.class.php:471:       // @TODO Add support for more types which break in last else-block
-./inc/config-functions.php:144:        // @TODO Make this all better... :-/
-./inc/expression-functions.php:136:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
-./inc/expression-functions.php:199:    // @TODO is escapeQuotes enougth for strings with single/double quotes?
+./inc/cache/config-local.php:126:// @TODO Rewrite the following three constants, somehow...
+./inc/classes/cachesystem.class.php:474:       // @TODO Add support for more types which break in last else-block
+./inc/config-functions.php:140:        // @TODO Make this all better... :-/
+./inc/expression-functions.php:152:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
+./inc/expression-functions.php:48:     // @TODO is escapeQuotes() enougth for strings with single/double quotes?
 ./inc/extensions/ext-html_mail.php:138:                // @TODO Move these arrays into config
 ./inc/extensions/ext-menu.php:54:              // @TODO Convert menu-Id to one coding-standard. admin(edit|_add) => admin_menu_(edit|add), mem(edit|_add) => mem_menu_(edit|add)
 ./inc/extensions/ext-network.php:20: * @TODO AbisZED: Which charset?                                        *
 ./inc/extensions/ext-newsletter.php:220:               // @TODO Move these into configuration
 ./inc/extensions/ext-rallye.php:331:           // @TODO Move this code into rallye_functions.php
 ./inc/extensions/ext-rallye.php:94:            // @TODO Fix config_rallye_prices to list_rallye_prices
-./inc/extensions/ext-sql_patches.php:785:                      // @TODO Rewrite this to a filter
-./inc/extensions/ext-sql_patches.php:96:               /* @TODO SQL_ALTER_TABLE() should work now properly
+./inc/extensions/ext-sql_patches.php:755:                      // @TODO Rewrite this to a filter
 ./inc/extensions/ext-yoomedia.php:123:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:56:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
-./inc/extensions-functions.php:380:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
-./inc/extensions-functions.php:493:            // @TODO Extension is loaded, what next?
-./inc/functions.php:1026:// @TODO $simple is deprecated
-./inc/functions.php:1061:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2535:              // @TODO Add a little more infos here
-./inc/functions.php:256:       // @TODO Remove this sanity-check if all is fine
-./inc/functions.php:259:       // @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2618:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:2641:                      // @TODO Rewrite this old lost code to a template
-./inc/functions.php:2731:                      // @TODO Are these convertions still required?
-./inc/functions.php:2749:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3628:// @TODO Lame description for this function
-./inc/functions.php:3650:                      // @TODO Move this in a filter
-./inc/functions.php:3774:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:474:       // @TODO Do only use $content, not $DATA or raw variables
-./inc/functions.php:544:               // @TODO Extension 'msg' does not exist
-./inc/functions.php:613:// @TODO Rewrite this to an extension 'smtp'
+./inc/extensions-functions.php:143:    // @TODO Do we still need this? setExtensionUpdateNotes('');
+./inc/extensions-functions.php:423:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
+./inc/extensions-functions.php:539:            // @TODO Extension is loaded, what next?
+./inc/functions.php:1052:// @TODO $simple is deprecated
+./inc/functions.php:1087:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/functions.php:2420:      // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/functions.php:2569:              // @TODO Add a little more infos here
+./inc/functions.php:2652:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:266:       // @TODO Remove this sanity-check if all is fine
+./inc/functions.php:2675:                      // @TODO Rewrite this old lost code to a template
+./inc/functions.php:269:       // @TODO Try to rewrite all $DATA to $content
+./inc/functions.php:2765:                      // @TODO Are these convertions still required?
+./inc/functions.php:2783:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:3659:// @TODO Lame description for this function
+./inc/functions.php:3681:                      // @TODO Move this in a filter
+./inc/functions.php:3805:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:481:       // @TODO Do only use $content, not $DATA or raw variables
+./inc/functions.php:551:               // @TODO Extension 'msg' does not exist
+./inc/functions.php:614:// @TODO Rewrite this to an extension 'smtp'
 ./inc/install-functions.php:63:        // @TODO DEACTIVATED: changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1160:// @TODO Rewrite these two constants
-./inc/language/de.php:1176:// @TODO Rewrite these five constants
-./inc/language/de.php:852:// @TODO Are these constants longer used?
+./inc/language/de.php:1146:// @TODO Rewrite these two constants
+./inc/language/de.php:1161:// @TODO Rewrite these three constants
+./inc/language/de.php:309:     // @TODO Following two are unused?
+./inc/language/de.php:841:// @TODO Are these constants longer used?
 ./inc/language-functions.php:234:      // @TODO These are all valid languages, again hard-coded
 ./inc/language-functions.php:46:// @TODO Rewrite all language constants to this function.
-./inc/language/holiday_de.php:50:// @TODO Rewrite these two constants to one
-./inc/language/rallye_de.php:114:// @TODO Rewrite following two lines to one
 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings             *
 ./inc/language/refback_de.php:46:// @TODO Rewrite these constants to one
 ./inc/language/sponsor_de.php:119:// @TODO Rewrite these four constants to one and use sprintf()
 ./inc/libs/admins_functions.php:440:           // @TODO This can be, somehow, rewritten
 ./inc/libs/beg_functions.php:58:               // @TODO Try to rewrite the following unset()
-./inc/libs/bonus_functions.php:216:                    // @TODO Try to find a way for rewriting this constant
-./inc/libs/bonus_functions.php:304:            // @TODO This query isn't right, it will only update if the user was for a longer time away!
+./inc/libs/bonus_functions.php:213:                    // @TODO Try to find a way for rewriting this constant
+./inc/libs/bonus_functions.php:301:            // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/libs/doubler_functions.php:46:// @TODO Lame description
-./inc/libs/rallye_functions.php:722:   $EXPIRE = 3; // @TODO The hard-coded value...
-./inc/libs/rallye_functions.php:786:           // @TODO Rewrite this to our API function
+./inc/libs/rallye_functions.php:724:   $EXPIRE = 3; // @TODO The hard-coded value...
+./inc/libs/rallye_functions.php:806:// @TODO Please document this function
+./inc/libs/rallye_functions.php:864:           // Load count @TODO Can't we rewrite this to our API?
 ./inc/libs/refback_functions.php:61:           // @TODO Try to rewrite the following unset()
-./inc/libs/register_functions.php:297: // @TODO Rewrite these all to a single filter
-./inc/libs/register_functions.php:373: // @TODO Rewrite this to a filter
-./inc/libs/register_functions.php:380: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
-./inc/libs/register_functions.php:381: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
-./inc/libs/surfbar_functions.php:1556:         // @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:724:// @TODO Can't we use our new expression language instead of this ugly code?
-./inc/libs/surfbar_functions.php:972:  // @TODO Invalid salt should be refused
+./inc/libs/register_functions.php:299: // @TODO Rewrite these all to a single filter
+./inc/libs/register_functions.php:375: // @TODO Rewrite this to a filter
+./inc/libs/register_functions.php:382: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
+./inc/libs/register_functions.php:383: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+./inc/libs/surfbar_functions.php:1549:         // @TODO This can be somehow rewritten
+./inc/libs/surfbar_functions.php:721:// @TODO Can't we use our new expression language instead of this ugly code?
+./inc/libs/surfbar_functions.php:965:  // @TODO Invalid salt should be refused
 ./inc/libs/task_functions.php:245:             // @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters
 ./inc/libs/user_functions.php:138:     // @TODO These two constants are no longer used, maybe we reactivate this code?
 ./inc/libs/user_functions.php:225:// @TODO Double-check configuration entry here
 ./inc/libs/user_functions.php:317:                     // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:337:                     // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:337:                     // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
 ./inc/libs/user_functions.php:413:     // @TODO We should try to rewrite this to fetchUserData() somehow
 ./inc/libs/yoomedia_functions.php:116: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
 ./inc/load_config.php:77:      // @TODO Rewrite them to avoid this else block
 ./inc/modules/admin/admin-inc.php:325:                                 // @TODO Rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/admin/admin-inc.php:331:                                                 // @TODO ACL is 'allow'... hmmm
 ./inc/modules/admin/admin-inc.php:431:// @TODO Try to rewrite this to adminAddMenuSelectionBox()
-./inc/modules/admin/overview-inc.php:164:                              // @TODO Rewrite this to a filter
-./inc/modules/admin/overview-inc.php:278:                              // @TODO Rewrite this to something with include files and/or filter
-./inc/modules/admin/overview-inc.php:316:                                              // @TODO This may also be rewritten to include files
-./inc/modules/admin/overview-inc.php:318:                                                      default: // @TODO Unknown support mode
-./inc/modules/admin/overview-inc.php:439:                      // @TODO Try to move this in includes
+./inc/modules/admin/overview-inc.php:167:                              // @TODO Rewrite this to a filter
+./inc/modules/admin/overview-inc.php:281:                              // @TODO Rewrite this to something with include files and/or filter
+./inc/modules/admin/overview-inc.php:319:                                              // @TODO This may also be rewritten to include files
+./inc/modules/admin/overview-inc.php:321:                                                      default: // @TODO Unknown support mode
+./inc/modules/admin/overview-inc.php:442:                      // @TODO Try to move this in includes
 ./inc/modules/admin/overview-inc.php:45:// @TODO This function does also check for uncompleted tasks
 ./inc/modules/admin/what-add_guestnl_cat.php:49:       // @TODO Check if category does already exist
 ./inc/modules/admin/what-add_surfbar_url.php:57:       // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestParameter() calls to $postData
 ./inc/modules/admin/what-config_register.php:78:       // @TODO Move this HTML code into a template
 ./inc/modules/admin/what-edit_user.php:20: * @TODO Add support for ext-country                                    *
 ./inc/modules/admin/what-email_stats.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-extensions.php:350:                                           // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:362:                                           // @TODO Rewrite this to a filter
 ./inc/modules/admin/what-guest_add.php:137:                            // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-guest_add.php:69:             // @TODO Cant this be rewritten?
 ./inc/modules/admin/what-guest_add.php:85:             // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-holiday_list.php:48:// @TODO Unused at the moment
 ./inc/modules/admin/what-list_autopurge.php:55:// @TODO Rewrite those lines to filter
 ./inc/modules/admin/what-list_autopurge.php:85:                // @TODO Rewritings: surname->surname,family->family in templates
+./inc/modules/admin/what-list_bonus.php:131:           // @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_cats.php:56:             // @TODO No longer needed? define('__CATS_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
 ./inc/modules/admin/what-list_links.php:57:            // @TODO Try to rewrite this to a filter
 ./inc/modules/admin/what-list_links.php:89:                            // @TODO Find a way to rewrite this. See some lines above for different queries
 ./inc/modules/admin/what-list_links.php:98:                                    // @TODO Rewrite this to includes/filter
-./inc/modules/admin/what-list_payouts.php:118:                                         // @TODO Do we need this time-consuming eval() here?
 ./inc/modules/admin/what-list_rallyes.php:258:                 // @TODO Rewritings: opoints->curr_points,old->refs in template
-./inc/modules/admin/what-list_sponsor.php:149:                 // @TODO Rewritings: surname->surname,family->family,ip->remote_addr in template
 ./inc/modules/admin/what-list_task.php:146:            // @TODO Rewrite these templates to one and add $OUT
 ./inc/modules/admin/what-list_task.php:180:                    // @TODO Rewritings: admin->assigned_admin,userid->userid,type->task_type_msg in template
 ./inc/modules/admin/what-list_task.php:192:                            // @TODO Rewrite this to $OUT .= ..., true, ...
 ./inc/modules/admin/what-list_unconfirmed.php:100:             // @TODO Rewrite this to $content = SQL_FETCHARRAY(), look some lines above for two differrent queries
 ./inc/modules/admin/what-list_unconfirmed.php:77:      // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_BONUS_LINKS'));
 ./inc/modules/admin/what-list_unconfirmed.php:88:      // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
-./inc/modules/admin/what-list_user.php:160:            // @TODO Rewrite these to filters
-./inc/modules/admin/what-list_user.php:287:            // @TODO Rewrite this into a  filter
-./inc/modules/admin/what-list_user.php:341:                    // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:157:            // @TODO Rewrite these to filters
+./inc/modules/admin/what-list_user.php:280:            // @TODO Rewrite this into a  filter
+./inc/modules/admin/what-list_user.php:334:                    // @TODO Rewrite this into a filter
 ./inc/modules/admin/what-list_user.php:59:// @TODO Rewrite these if-blocks in a filter
 ./inc/modules/admin/what-logs.php:69:                  // @TODO Fix content-type here
 ./inc/modules/admin/what-logs.php:72:                  // @TODO Fix content-type here
 ./inc/modules/admin/what-mem_add.php:81:               // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-payments.php:152:                     // @TODO Rewritings: title->mail_title, pay->payment in template
 ./inc/modules/admin/what-refbanner.php:145:                    // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
-./inc/modules/admin/what-surfbar_stats.php:119:                        // @TODO Can't all these translation blocks moved into templates? This code looks ugly.
 ./inc/modules/admin/what-unlock_emails.php:89:                                 // @TODO Rewrite these if-blocks to a filter
-./inc/modules/admin/what-unlock_sponsor.php:192:               // @TODO Rewritings: remote->remote_addr, created->sponsor_created in template
+./inc/modules/admin/what-unlock_sponsor.php:204:               // @TODO Rewritings: remote->remote_addr, created->sponsor_created in template
 ./inc/modules/admin/what-usage.php:88: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
 ./inc/modules/admin/what-usr_online.php:51:    // @TODO Add a filter for sponsor
 ./inc/modules/guest/what-beg.php:60:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
 ./inc/modules/member/what-payout.php:221:                                      // @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:55:// @TODO Should we rewrite this to a filter?
 ./inc/modules/member/what-rallyes.php:91:      // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&amp;what=impressum&amp;admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
+./inc/modules/member/what-refback.php:131:                     // @TODO UNUSED: $refRow['status']      = translateUserStatus($refRow['status']);
 ./inc/modules/member/what-reflinks.php:54:// @TODO Move this into a filter
 ./inc/modules/member/what-stats.php:119:               // @TODO Rewrite in template: clix->clicks
-./inc/modules/member/what-transfer.php:136:                            // @TODO Rewrite this to a filter
-./inc/modules/member/what-transfer.php:226:                            // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
-./inc/modules/member/what-transfer.php:311:                    // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
-./inc/modules/member/what-transfer.php:317:                            // @TODO Rewrite: tid->trans_id,stamp->time_trans
+./inc/modules/member/what-transfer.php:132:                            // @TODO Rewrite this to a filter
+./inc/modules/member/what-transfer.php:222:                            // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
+./inc/modules/member/what-transfer.php:304:                    // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
+./inc/modules/member/what-transfer.php:310:                            // @TODO Rewrite: tid->trans_id,stamp->time_trans
 ./inc/modules/member/what-transfer.php:94:                     // @TODO Rewrite this to a filter
-./inc/modules/member/what-unconfirmed.php:151: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/order.php:76:            // @TODO Unused: 2,4
 ./inc/monthly/monthly_bonus.php:69:    // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1579:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1677:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2057:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2098:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1590:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1688:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2068:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2109:// @TODO Fix inconsistency between last_module and getWhat()
 ./inc/mysql-manager.php:229:                   // @TODO Nothing helped???
 ./inc/mysql-manager.php:264:                   // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:557:   // @TODO Try to rewrite this to one or more functions
+./inc/mysql-manager.php:563:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:94:// @TODO Can we cache this?
 ./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
 ./inc/reset/reset_birthday.php:92:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./templates/de/html/guest/guest_nickname_login.tpl:21: @TODO Deactivated feature, try to find a solution for this or remove it.
 ./templates/de/html/guest/guest_stats_member.tpl:21:   @TODO We have to fix these counters.
 ./templates/de/html/surfbar/surfbar_frame_textlinks.tpl:5:             <!-- @TODO These are static lines and should be replaced by a filter (see ext-sponsor) //-->
-./templates/de/html/surfbar/surfbar_frame_top.tpl:23:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy)
+./templates/de/html/surfbar/surfbar_frame_top.tpl:32:// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy)
 ### ### DEPRECATION FOLLOWS: ### ###
 ./inc/modules/admin/admin-inc.php:432:// @DEPRECATED
 ./inc/modules/member/what-newsletter.php:2:// @DEPRECATED
 ./inc/modules/member/what-sponsor.php:2:// @DEPRECATED
+./templates/de/html/admin/admin_list_rallye_noselect.tpl:1:<!-- @DEPRECATED //-->
 ### ### template-warnings.log follows: ### ###
 Warning: Not parsing JavaScript templates/de/html/js/js_order_send.tpl.
 Warning: Not parsing JavaScript templates/de/html/js/js_cookies_disabled.tpl.
index eebeb6c..dffef73 100644 (file)
@@ -115,7 +115,7 @@ function doExpressionUser ($data) {
        } // END - if
 
        // Generate replacer
-       $replacer = '{DQUOTE} . ' . $functionName . ' . "';
+       $replacer = '{DQUOTE} . ' . $functionName . ' . {DQUOTE}';
 
        // Now replace the code
        $code = replaceExpressionCode($data, $replacer);
index ec9d63b..a9bf76f 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 $GLOBALS['page_footer'] = '';
 
 // Footer disabled or already sent?
-// 1234      5                       54    45                              5    5                              543    3                              321
+// 1234      5                       54    45                            5    5                            543    3                    321
 if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != 1) && ($GLOBALS['footer_sent'] != 2))) && (getOutputMode() != 1))) {
        // Run the filter, sweet huh?
        runFilterChain('page_footer');
index 0a38bdf..bac7b16 100644 (file)
@@ -136,37 +136,11 @@ function sendHttpHeaders () {
 
 // Compiles the final output
 function compileFinalOutput () {
-       // Init counter
-       $cnt = 0;
-
        // Add page header and footer
        addPageHeaderFooter();
 
-       // Compile all out
-       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 '<pre>'.htmlentities($GLOBALS['output']).'</pre>';
-               $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($GLOBALS['output']))) . '";';
-               //* DEBUG: */ die('<pre>'.htmlentities($eval).'</pre>');
-               eval($eval);
-               //* DEBUG: */ die('<pre>'.htmlentities($newContent).'</pre>');
-
-               // Was that eval okay?
-               if (empty($newContent)) {
-                       // Something went wrong!
-                       debug_report_bug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', false);
-               } // END - if
-
-               // Use it again
-               $GLOBALS['output'] = $newContent;
-
-               // Count round
-               $cnt++;
-       } // END - while
+       // Do the final compilation
+       $GLOBALS['output'] = doFinalCompilation($GLOBALS['output']);
 
        // Extension 'rewrite' installed?
        if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
@@ -195,6 +169,44 @@ function compileFinalOutput () {
        flushHeaders();
 }
 
+// Main compilation loop
+function doFinalCompilation ($code, $insertComments = true) {
+       // Insert comments?
+       enableTemplateHtml($insertComments);
+
+       // Init counter
+       $cnt = 0;
+
+       // Compile all out
+       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{!') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
+               // Init common variables
+               $content = array();
+               $newContent = '';
+
+               // Compile it
+               //* DEBUG: */ print '<pre>'.htmlentities($code).'</pre>';
+               $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
+               //* DEBUG: */ die('<pre>'.htmlentities($eval).'</pre>');
+               eval($eval);
+               //* DEBUG: */ die('<pre>'.htmlentities($newContent).'</pre>');
+
+               // Was that eval okay?
+               if (empty($newContent)) {
+                       // Something went wrong!
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . linenumberCode($eval) . '</pre>', false);
+               } // END - if
+
+               // Use it again
+               $code = $newContent;
+
+               // Count round
+               $cnt++;
+       } // END - while
+
+       // Return the compiled code
+       return $code;
+}
+
 // Output the raw HTML code
 function outputRawCode ($htmlCode) {
        // Output stripped HTML code to avoid broken JavaScript code, etc.
@@ -557,7 +569,7 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "TO={$toEmail}<br />");
 
        // Check for PHPMailer or debug-mode
-       if (!checkPhpMailerUsage()) {
+       if ((!checkPhpMailerUsage()) || (isDebugModeEnabled())) {
                // Not in PHPMailer-Mode
                if (empty($mailHeader)) {
                        // Load email header template
@@ -566,24 +578,12 @@ function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '
                        // Append header
                        $mailHeader .= loadEmailTemplate('header');
                }
-       } elseif (isDebugModeEnabled()) {
-               if (empty($mailHeader)) {
-                       // Load email header template
-                       $mailHeader = loadEmailTemplate('header');
-               } else {
-                       // Append header
-                       $mailHeader .= loadEmailTemplate('header');
-               }
-       }
-
-       // Compile "TO"
-       eval('$toEmail = "' . compileRawCode(escapeQuotes($toEmail)) . '";');
-
-       // Compile "MSG"
-       eval('$message = "' . str_replace('$', '&#36;', compileRawCode(escapeQuotes($message))) . '";');
+       } // END - if
 
        // Fix HTML parameter (default is no!)
        if (empty($isHtml)) $isHtml = 'N';
+
+       // Debug mode enabled?
        if (isDebugModeEnabled()) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
                outputHtml('<pre>
@@ -592,6 +592,9 @@ To      : ' . htmlentities(utf8_decode($toEmail)) . '
 Subject : ' . htmlentities(utf8_decode($subject)) . '
 Message : ' . htmlentities(utf8_decode($message)) . '
 </pre>');
+
+               // This is always fine
+               return true;
        } elseif (($isHtml == 'Y') && (isExtensionActive('html_mail'))) {
                // Send mail as HTML away
                return sendHtmlEmail($toEmail, $subject, $message, $mailHeader);
@@ -602,6 +605,9 @@ Message : ' . htmlentities(utf8_decode($message)) . '
                // Problem found!
                return sendRawEmail(getConfig('WEBMASTER'), '[PROBLEM:]' . $subject, $message, $mailHeader);
        }
+
+       // Why did we end up here? This should not happen
+       debug_report_bug('Ending up: template=' . $template);
 }
 
 // Check to use wether legacy mail() command or PHPMailer class
@@ -614,10 +620,10 @@ function checkPhpMailerUsage() {
 // Send out a raw email with PHPMailer class or legacy mail() command
 function sendRawEmail ($toEmail, $subject, $message, $from) {
        // Just compile all again, to put out all configs, etc.
-       eval('$toEmail = decodeEntities("' . compileRawCode(escapeQuotes($toEmail)) . '");');
-       eval('$subject = decodeEntities("' . compileRawCode(escapeQuotes($subject)) . '");');
-       eval('$message = decodeEntities("' . compileRawCode(escapeQuotes($message)) . '");');
-       eval('$from    = decodeEntities("' . compileRawCode(escapeQuotes($from))    . '");');
+       eval('$toEmail = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($toEmail)), false) . '");');
+       eval('$subject = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($subject)), false) . '");');
+       eval('$message = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($message)), false) . '");');
+       eval('$from    = decodeEntities("' . doFinalCompilation(compileRawCode(escapeQuotes($from))   , false) . '");');
 
        // Shall we use PHPMailer class or legacy mode?
        if (checkPhpMailerUsage()) {
@@ -754,7 +760,7 @@ function translateYesNo ($yn) {
                        // Log unknown value
                        logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown value %s. Expected Y/N!", $yn));
                        break;
-       }
+       } // END - switch
 
        // Return it
        return $translated;
@@ -814,7 +820,7 @@ function translateComma ($dotted, $cut = true, $max = '0') {
                default: // All others
                        $dotted = number_format($dotted, $maxComma, '.', ',');
                        break;
-       }
+       } // END - switch
 
        // Return translated value
        return $dotted;
@@ -981,15 +987,15 @@ function redirectToUrl ($URL, $allowSpider = true) {
 
        // Simple probe for bots/spiders from search engines
        if ((isSpider()) && ($allowSpider === true)) {
-               // Secure the URL against bad things such als HTML insertions and so on...
-               $URL = secureString($URL);
-
                // Set content-type here to fix a missing array element
                setContentType('text/html');
 
                // Output new location link as anchor
-               outputHtml('<a href="' . $URL . '"' . $rel . '>' . $URL . '</a>');
+               outputHtml('<a href="' . $URL . '"' . $rel . '>' . secureString($URL) . '</a>');
        } elseif (!headers_sent()) {
+               // Clear output buffer
+               clearOutputBuffer();
+
                // Clear own output buffer
                $GLOBALS['output'] = '';
 
@@ -997,7 +1003,7 @@ function redirectToUrl ($URL, $allowSpider = true) {
                setHttpStatus('302 Found');
 
                // Load URL when headers are not sent
-               sendHeader('Location: '.str_replace('&amp;', '&', $URL));
+               sendRawRedirect(doFinalCompilation(str_replace('&amp;', '&', $URL), false));
        } else {
                // Output error message
                loadInclude('inc/header.php');
@@ -1011,17 +1017,8 @@ function redirectToUrl ($URL, $allowSpider = true) {
 
 // Wrapper for redirectToUrl but URL comes from a configuration entry
 function redirectToConfiguredUrl ($configEntry) {
-       // Get the URL
-       $URL = getConfig($configEntry);
-
-       // Is this URL set?
-       if (is_null($URL)) {
-               // Then abort here
-               debug_report_bug(__FUNCTION__, __LINE__, sprintf("Configuration entry %s is not set!", $configEntry));
-       } // END - if
-
        // Load the URL
-       redirectToUrl($URL);
+       redirectToUrl(getConfig($configEntry));
 }
 
 // Compiles the given HTML/mail code
@@ -1041,8 +1038,11 @@ function compileCode ($code, $simple = false, $constants = true, $full = true) {
        // Get timing
        $compiled = microtime(true);
 
-       // Add timing
-       $code .= '<!-- Compilation time: ' . (($compiled - $startCompile) * 1000). 'ms //-->';
+       // Add timing if enabled
+       if (isTemplateHtml()) {
+               // Add timing, this should be disabled in
+               $code .= '<!-- Compilation time: ' . (($compiled - $startCompile) * 1000). 'ms //-->';
+       } // END - if
 
        // Return compiled code
        return $code;
@@ -3871,6 +3871,9 @@ function isSpider () {
 
 // Prepares the header for HTML output
 function loadHtmlHeader () {
+       // Enable HTML templates
+       enableTemplateHtml();
+
        // Run two filters:
        // 1.) pre_page_header (mainly loads the page_header template and includes
        //     meta description)
index a184c20..c91f93e 100644 (file)
@@ -968,5 +968,81 @@ function compileSqlConfig ($sqlString) {
        return $sqlString;
 }
 
+// Setter for 'is_template_html'
+function enableTemplateHtml ($enable = true) {
+       $GLOBALS['is_template_html'] = (bool) $enable;
+}
+
+// Checks wether the template is HTML or not by previously set flag
+// Default: true
+function isTemplateHtml () {
+       // Is the output_mode other than 0 (HTML), then no comments are enabled
+       if (getOutputMode() != 0) {
+               // No HTML
+               return false;
+       } else {
+               // Maybe HTML?
+               return $GLOBALS['is_template_html'];
+       }
+}
+
+/**
+ * Send a HTTP redirect to the browser. This function was taken from DokuWiki
+ * (GNU GPL 2; http://www.dokuwiki.org) and modified to fit into mailer project.
+ *
+ * ----------------------------------------------------------------------------
+ * If you want to redirect, please use redirectToUrl(); instead
+ * ----------------------------------------------------------------------------
+ *
+ * Works arround Microsoft IIS cookie sending bug. Does exit the script.
+ *
+ * @link    http://support.microsoft.com/kb/q176113/
+ * @author  Andreas Gohr <andi@splitbrain.org>
+ * @access  private
+ */
+function sendRawRedirect ($url) {
+       // always close the session
+       session_write_close();
+
+       // Revert entity &amp;
+       $url = str_replace('&amp;', '&', $url);
+
+       // check if running on IIS < 6 with CGI-PHP
+       if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
+               (strpos($_SERVER['GATEWAY_INTERFACE'],'CGI') !== false) &&
+               (preg_match('|^Microsoft-IIS/(\d)\.\d$|', trim($_SERVER['SERVER_SOFTWARE']), $matches)) &&
+               ($matches[1] < 6)) {
+               // Send the IIS header
+               sendHeader('Refresh: 0;url=' . $url);
+       } else {
+               // Send generic header
+               sendHeader('Location: ' . $url);
+       }
+
+       // Shutdown here
+       shutdown();
+}
+
+// Determines the country of the given user id
+function determineCountry ($userid) {
+       // Default is 'invalid'
+       $country = 'invalid';
+
+       // Is extension country active?
+       if (isExtensionActive('country')) {
+               // Determine the right country code through the country id
+               $id = getUserData('country_code');
+
+               // Then handle it over
+               $country = generateCountryInfo($id);
+       } else {
+               // Get raw code from user data
+               $country = getUserData('country');
+       }
+
+       // Return it
+       return $country;
+}
+
 // [EOF]
 ?>
index 70706d9..3834d51 100644 (file)
@@ -8,7 +8,7 @@ Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,fa
 {--SURNAME--}: {%user,surname=$userid%}
 {--FAMILY--}: {%user,family=$userid%}
 {--STREET_NR--}: {%user,street_nr=$userid%}
-{--COUNTRY--}: {%user,county,determineCountry=$userid%}
+{--COUNTRY--}: {%user,country,determineCountry=$userid%}
 {--ZIP--}: {%user,zip,bigintval=$userid%}
 {--CITY--}: {%user,city=$userid%}
 {--EMAIL--}: {%user,email=$userid%}
index fad2699..8bab9f4 100644 (file)
@@ -8,7 +8,7 @@ Anrede: {%user,gender,translateGender=$userid%}
 Vorname: {%user,surname=$userid%}
 Nachname: {%user,family=$userid%}
 Stra&szlig;e und Hausnummer: $content[street]
-L&auml;ndercode: {%user,county,determineCountry=$userid%}
+L&auml;ndercode: {%user,country,determineCountry=$userid%}
 Postleitzahl: {%user,zip,bigintval=$userid%}
 Wohnort: {%user,city=$userid%}
 Email-Adresse: {%user,email=$userid%}
index 6371f9a..b329e2d 100644 (file)
@@ -8,7 +8,7 @@ Anrede: {%user,gender,translateGender=$userid%}
 Vorname: {%user,surname=$userid%}
 Nachname: {%user,family=$userid%}
 Stra&szlig;e und Hausnummer: $content[street]
-L&auml;ndercode: {%user,county,determineCountry=$userid%}
+L&auml;ndercode: {%user,country,determineCountry=$userid%}
 Postleitzahl: {%user,zip,bigintval=$userid%}
 Wohnort: {%user,city=$userid%}
 Email-Adresse: {%user,email=$userid%}
index e0222fb..10711c5 100644 (file)
@@ -12,7 +12,7 @@ Hier sind alle neuen (und in Klammern alten) Daten:
 {--SURNAME_FAMILY--}: $DATA[surname] $DATA[family] ({%sponsor,surname=$userid%} {%sponsor,family=$userid%})
 {--SPONSOR_EMAIL_STREET_NR1--}: $DATA[street_nr1] ({%sponsor,street_nr1=$userid%})
 {--SPONSOR_EMAIL_STREET_NR2--}: $DATA[street_nr2] ({%sponsor,street_nr2=$userid%})
-{--SPONSOR_EMAIL_CNTRY_ZIP_CITY--}: $DATA[country]-$DATA[zip] $DATA[city] ({%sponsor,county,determineCountry=$userid%}-{%sponsor,zip,bigintval=$userid%} {%sponsor,city=$userid%})
+{--SPONSOR_EMAIL_CNTRY_ZIP_CITY--}: $DATA[country]-$DATA[zip] $DATA[city] ({%sponsor,country,determineCountry=$userid%}-{%sponsor,zip,bigintval=$userid%} {%sponsor,city=$userid%})
 ------------------------------
 {--SPONSOR_ENTER_PHONE--}: $DATA[phone] ($content[phone])
 {--SPONSOR_ENTER_FAX--}: $DATA[fax] ($content[fax])
index b8a8f8e..fd034d7 100644 (file)
@@ -37,7 +37,7 @@ Strasse, Zeile 1: {%sponsor,street_nr1=$userid%}
 ------------------------------
 Strasse, Zeile 2: {%sponsor,street_nr2=$userid%}
 ------------------------------
-L&auml;ndercode: {%sponsor,county,determineCountry=$userid%}
+L&auml;ndercode: {%sponsor,country,determineCountry=$userid%}
 ------------------------------
 Postleitzahl: {%sponsor,zip,bigintval=$userid%}
 ------------------------------
index 104a25e..c0d5213 100644 (file)
@@ -32,7 +32,7 @@
        <tr>
                <td align="right">{--COUNTRY--}, {--ZIP--}, {--CITY--}:</td>
                <td>
-                       {%user,county,determineCountry=$userid%}
+                       {%user,country,determineCountry=$userid%}
                        <input type="text" name="zip" class="member_normal" size="5" maxlength="10" value="{%user,zip,bigintval=$userid%}" />
                        <input type="text" name="city" class="member_normal" size="20" maxlength="255" value="{%city,city=$userid%}" />
                </td>
index a24f2c3..746ab69 100644 (file)
@@ -27,7 +27,7 @@
        </tr>
        <tr>
                <td align="right">{--COUNTRY--}:</td>
-               <td><strong>{%user,county,determineCountry=$userid%}</strong></td>
+               <td><strong>{%user,country,determineCountry=$userid%}</strong></td>
        </tr>
        <tr>
                <td align="right">{--ZIP--}:</td>
index 58f8496..e266275 100644 (file)
@@ -89,7 +89,7 @@
     {--SPONSOR_ENTER_CNTRY_ZIP_CITY--}:
   </td>
   <td class="bottom">
-    <input type="text" name="country" class="guest_normal" size="2" maxlength="2" value="{%sponsor,county,determineCountry=$userid%}" />-<input type="text" name="zip" class="guest_normal" size="5" maxlength="6" value="{%sponsor,zip,bigintval=$userid%}" />
+    <input type="text" name="country" class="guest_normal" size="2" maxlength="2" value="{%sponsor,country,determineCountry=$userid%}" />-<input type="text" name="zip" class="guest_normal" size="5" maxlength="6" value="{%sponsor,zip,bigintval=$userid%}" />
     <input type="text" name="city" class="guest_normal" size="10" maxlength="255" value="{%sponsor,city=$userid%}" />
   </td>
 </tr>