A lot code rewritten:
authorRoland Häder <roland@mxchange.org>
Tue, 29 Jun 2010 01:19:13 +0000 (01:19 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Jun 2010 01:19:13 +0000 (01:19 +0000)
- New template-functions.php added and a lot functions moved from functions.php
  and some from wrapper-functions.php to it.
- New EL function doExpressionTemplate() added
- New template function doTemplateColorSwitch() added
- Heavy rewrite of PHP code and templates to make usage of that new function
  which should result in an easier PHP code
- Some fixes
- TODOs.txt updated

251 files changed:
.gitattributes
DOCS/TODOs.txt
inc/config-global.php
inc/expression-functions.php
inc/extensions-functions.php
inc/functions.php
inc/language/de.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/doubler_functions.php
inc/libs/network_functions.php
inc/libs/other_functions.php
inc/libs/rallye_functions.php
inc/libs/register_functions.php
inc/libs/task_functions.php
inc/libs/user_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-chk_regs.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_cats.php
inc/modules/admin/what-config_email.php
inc/modules/admin/what-config_home.php
inc/modules/admin/what-config_imprint.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-config_rallye_prices.php
inc/modules/admin/what-config_register.php
inc/modules/admin/what-config_rewrite.php
inc/modules/admin/what-del_transfer.php
inc/modules/admin/what-edit_emails.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_bank_package.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_cats.php
inc/modules/admin/what-list_country.php
inc/modules/admin/what-list_holiday.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_network_array_translation.php
inc/modules/admin/what-list_network_params.php
inc/modules/admin/what-list_network_translations.php
inc/modules/admin/what-list_network_types.php
inc/modules/admin/what-list_networks.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_primera.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_refs.php
inc/modules/admin/what-list_sponsor.php
inc/modules/admin/what-list_sponsor_pay.php
inc/modules/admin/what-list_surfbar_actions.php
inc/modules/admin/what-list_surfbar_urls.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-list_transfer.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-list_wernis.php
inc/modules/admin/what-list_yoomedia_tm.php
inc/modules/admin/what-memedit.php
inc/modules/admin/what-optimize.php
inc/modules/admin/what-payments.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-repair_lang.php
inc/modules/admin/what-stats_mods.php
inc/modules/admin/what-surfbar_stats.php
inc/modules/admin/what-theme_edit.php
inc/modules/admin/what-theme_import.php
inc/modules/admin/what-unlock_emails.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/admin/what-unlock_surfbar_urls.php
inc/modules/admin/what-usr_online.php
inc/modules/guest/what-active.php
inc/modules/guest/what-extensions.php
inc/modules/guest/what-sponsor_infos.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/guest/what-stats.php
inc/modules/guest/what-top10.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-payout.php
inc/modules/member/what-primera.php
inc/modules/member/what-refback.php
inc/modules/member/what-reflinks.php
inc/modules/member/what-reflist.php
inc/modules/member/what-stats.php
inc/modules/member/what-surfbar_list.php
inc/modules/member/what-themes.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/modules/member/what-wernis.php
inc/template-functions.php [new file with mode: 0644]
inc/wrapper-functions.php
templates/de/html/admin/admin_admins_mails_edit_row.tpl
templates/de/html/admin/admin_admins_mails_list_row.tpl
templates/de/html/admin/admin_amenu_delete_row.tpl
templates/de/html/admin/admin_amenu_edit_row.tpl
templates/de/html/admin/admin_config_admins_del_row.tpl
templates/de/html/admin/admin_config_admins_edit_row.tpl
templates/de/html/admin/admin_config_admins_row.tpl
templates/de/html/admin/admin_config_cats_row.tpl
templates/de/html/admin/admin_config_email_del_row.tpl
templates/de/html/admin/admin_config_email_edit_row.tpl
templates/de/html/admin/admin_config_email_row.tpl
templates/de/html/admin/admin_config_home_row.tpl
templates/de/html/admin/admin_config_payouts_del_row.tpl
templates/de/html/admin/admin_config_payouts_edit_row.tpl
templates/de/html/admin/admin_config_payouts_row.tpl
templates/de/html/admin/admin_config_rallye_del_row.tpl
templates/de/html/admin/admin_config_rallye_edit_row.tpl
templates/de/html/admin/admin_config_rallye_prices_row.tpl
templates/de/html/admin/admin_config_register_row.tpl
templates/de/html/admin/admin_config_rewrite_rows.tpl
templates/de/html/admin/admin_del_admins_row.tpl
templates/de/html/admin/admin_del_bank_packages_row.tpl
templates/de/html/admin/admin_del_cats_row.tpl
templates/de/html/admin/admin_del_network_params_row.tpl
templates/de/html/admin/admin_del_network_types_row.tpl
templates/de/html/admin/admin_del_networks_row.tpl
templates/de/html/admin/admin_del_payments_row.tpl
templates/de/html/admin/admin_del_surfbar_urls_row.tpl
templates/de/html/admin/admin_del_transfer_row.tpl
templates/de/html/admin/admin_edit_admins_row.tpl
templates/de/html/admin/admin_edit_bank_packages_row.tpl
templates/de/html/admin/admin_edit_cats_row.tpl
templates/de/html/admin/admin_edit_email_row.tpl
templates/de/html/admin/admin_edit_network_params_row.tpl
templates/de/html/admin/admin_edit_network_types_row.tpl
templates/de/html/admin/admin_edit_networks_row.tpl
templates/de/html/admin/admin_edit_payments_row.tpl
templates/de/html/admin/admin_edit_rallyes_row.tpl
templates/de/html/admin/admin_edit_surfbar_urls_row.tpl
templates/de/html/admin/admin_email_archiv_row.tpl
templates/de/html/admin/admin_ext_sql_row.tpl
templates/de/html/admin/admin_extensions_delete_row.tpl
templates/de/html/admin/admin_extensions_delete_row_404.tpl
templates/de/html/admin/admin_extensions_edit_row.tpl
templates/de/html/admin/admin_extensions_row.tpl
templates/de/html/admin/admin_gmenu_delete_row.tpl
templates/de/html/admin/admin_gmenu_edit_row.tpl
templates/de/html/admin/admin_list_admins_row.tpl
templates/de/html/admin/admin_list_autopurge_row.tpl
templates/de/html/admin/admin_list_bank_package_row.tpl
templates/de/html/admin/admin_list_beg_rows.tpl
templates/de/html/admin/admin_list_bonus_rows.tpl
templates/de/html/admin/admin_list_cats_row.tpl
templates/de/html/admin/admin_list_chk_reg_row.tpl
templates/de/html/admin/admin_list_country_del_row.tpl
templates/de/html/admin/admin_list_country_edit_row.tpl
templates/de/html/admin/admin_list_country_row.tpl
templates/de/html/admin/admin_list_doubler_overview.tpl
templates/de/html/admin/admin_list_holiday_row.tpl
templates/de/html/admin/admin_list_imprint_row.tpl
templates/de/html/admin/admin_list_links_problem.tpl
templates/de/html/admin/admin_list_links_row.tpl
templates/de/html/admin/admin_list_mods_row.tpl
templates/de/html/admin/admin_list_network_params_row.tpl
templates/de/html/admin/admin_list_network_types_row.tpl
templates/de/html/admin/admin_list_networks_row.tpl
templates/de/html/admin/admin_list_online_row.tpl
templates/de/html/admin/admin_list_payouts_row.tpl
templates/de/html/admin/admin_list_primera_row.tpl
templates/de/html/admin/admin_list_rallye_prices_row.tpl
templates/de/html/admin/admin_list_rallye_usr_row.tpl
templates/de/html/admin/admin_list_rallyes_row.tpl
templates/de/html/admin/admin_list_rallyes_row2.tpl
templates/de/html/admin/admin_list_refs_row.tpl
templates/de/html/admin/admin_list_sponsor_pay_404.tpl
templates/de/html/admin/admin_list_sponsor_pay_del_row.tpl
templates/de/html/admin/admin_list_sponsor_pay_edit_row.tpl
templates/de/html/admin/admin_list_sponsor_pay_row.tpl
templates/de/html/admin/admin_list_sponsor_row.tpl
templates/de/html/admin/admin_list_surfbar_actions.tpl
templates/de/html/admin/admin_list_surfbar_actions_row.tpl
templates/de/html/admin/admin_list_surfbar_urls_row.tpl
templates/de/html/admin/admin_list_task_ext_rows.tpl
templates/de/html/admin/admin_list_task_rows.tpl
templates/de/html/admin/admin_list_transfer_row.tpl
templates/de/html/admin/admin_list_unconfirmed_row.tpl
templates/de/html/admin/admin_list_unconfirmed_row_404.tpl
templates/de/html/admin/admin_list_user_row.tpl
templates/de/html/admin/admin_list_wernis_row.tpl
templates/de/html/admin/admin_list_yoomedia_tm_already.tpl
templates/de/html/admin/admin_list_yoomedia_tm_row.tpl
templates/de/html/admin/admin_lock_surfbar_urls_row.tpl
templates/de/html/admin/admin_menu_404_row.tpl
templates/de/html/admin/admin_menu_overview_row.tpl
templates/de/html/admin/admin_menu_status_row.tpl
templates/de/html/admin/admin_mmenu_edit_row.tpl
templates/de/html/admin/admin_mods_edit_row.tpl
templates/de/html/admin/admin_mods_stats2_row.tpl
templates/de/html/admin/admin_mods_stats_row.tpl
templates/de/html/admin/admin_optimize_row.tpl
templates/de/html/admin/admin_other_sqls_row.tpl
templates/de/html/admin/admin_overview_list_ext_rows.tpl
templates/de/html/admin/admin_overview_list_rows.tpl
templates/de/html/admin/admin_overview_row.tpl
templates/de/html/admin/admin_overview_task_rows.tpl
templates/de/html/admin/admin_payments_list_row.tpl
templates/de/html/admin/admin_points_del_row.tpl
templates/de/html/admin/admin_points_edit_row.tpl
templates/de/html/admin/admin_points_row.tpl
templates/de/html/admin/admin_refbanner_edit_row.tpl
templates/de/html/admin/admin_refbanner_row.tpl
templates/de/html/admin/admin_repair_lang_row_404.tpl
templates/de/html/admin/admin_repair_lang_row_compares.tpl
templates/de/html/admin/admin_repair_lang_row_diff.tpl
templates/de/html/admin/admin_theme_edit_row.tpl
templates/de/html/admin/admin_theme_import_row.tpl
templates/de/html/admin/admin_undelete_surfbar_urls_row.tpl
templates/de/html/admin/admin_unlock_emails_redir_row.tpl
templates/de/html/admin/admin_unlock_emails_row.tpl
templates/de/html/admin/admin_unlock_sponsor_row.tpl
templates/de/html/admin/admin_unlock_surfbar_urls_row.tpl
templates/de/html/guest/guest_active_row.tpl
templates/de/html/guest/guest_cat_row.tpl
templates/de/html/guest/guest_doubler_list_rows.tpl
templates/de/html/guest/guest_rallye_row.tpl
templates/de/html/guest/guest_sponsor_act_row.tpl
templates/de/html/guest/guest_sponsor_pay_row.tpl
templates/de/html/guest/guest_sponsor_payment_row.tpl
templates/de/html/guest/guest_stats_cats_row.tpl
templates/de/html/guest/guest_stats_row.tpl
templates/de/html/guest/guest_top10_empty4.tpl
templates/de/html/guest/guest_top10_empty5.tpl
templates/de/html/guest/guest_top10_row_earner.tpl
templates/de/html/guest/guest_top10_row_login.tpl
templates/de/html/guest/guest_top10_row_refs.tpl
templates/de/html/member/member_bonus_row.tpl
templates/de/html/member/member_cat_row.tpl
templates/de/html/member/member_doubler_list_rows.tpl
templates/de/html/member/member_list_beg_row.tpl
templates/de/html/member/member_payout_row.tpl
templates/de/html/member/member_primera_mode_list_row.tpl
templates/de/html/member/member_ref_list_row.tpl
templates/de/html/member/member_refback_list_row.tpl
templates/de/html/member/member_refback_list_row_deleted.tpl
templates/de/html/member/member_reflinks_row.tpl
templates/de/html/member/member_surfbar_list_row.tpl
templates/de/html/member/member_transfer_row.tpl
templates/de/html/member/member_unconfirmed_404.tpl
templates/de/html/member/member_unconfirmed_404_nopoints.tpl
templates/de/html/member/member_unconfirmed_row.tpl
templates/de/html/member/member_unconfirmed_row_nopoints.tpl
templates/de/html/member/member_wernis_mode_list_row.tpl

index 0efc620..6211e9b 100644 (file)
@@ -686,6 +686,7 @@ inc/session.php -text
 inc/sql-functions.php -text
 inc/stats-functions.php -text
 inc/stylesheet.php -text
+inc/template-functions.php -text
 inc/weekly/.htaccess -text
 inc/weekly/weekly_ -text
 inc/weekly/weekly_surfbar.php -text
index abceefe..9e5ceb7 100644 (file)
 ./inc/extensions-functions.php:143:    // @TODO Do we still need this? setExtensionUpdateNotes('');
 ./inc/extensions-functions.php:428:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:544:            // @TODO Extension is loaded, what next?
-./inc/functions.php:1065:// @TODO $simple/$constants are deprecated
-./inc/functions.php:1092:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-./inc/functions.php:2372:      // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/functions.php:2521:              // @TODO Add a little more infos here
-./inc/functions.php:2605:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:2628:                      // @TODO Rewrite this old lost code to a template
-./inc/functions.php:266:       // @TODO Remove this sanity-check if all is fine
-./inc/functions.php:269:       // @TODO Try to rewrite all $DATA to $content
-./inc/functions.php:2718:                      // @TODO Are these convertions still required?
-./inc/functions.php:2736:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:3620:// @TODO Lame description for this function
-./inc/functions.php:3639:                      // @TODO Move this in a filter
-./inc/functions.php:3763:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:542:               // @TODO Extension 'msg' does not exist
-./inc/functions.php:605:// @TODO Rewrite this to an extension 'smtp'
+./inc/functions.php:115:               // @TODO Extension 'msg' does not exist
+./inc/functions.php:1472:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1495:                      // @TODO Rewrite this old lost code to a template
+./inc/functions.php:1563:                      // @TODO Are these convertions still required?
+./inc/functions.php:1581:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:178:// @TODO Rewrite this to an extension 'smtp'
+./inc/functions.php:2234:      // @TODO This is still very static, rewrite it somehow
 ./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:1143:// @TODO Rewrite these two constants
-./inc/language/de.php:1158:// @TODO Rewrite these three constants
+./inc/language/de.php:1141:// @TODO Rewrite these two constants
+./inc/language/de.php:1156:// @TODO Rewrite these three constants
 ./inc/language/de.php:309:     // @TODO Following two are unused?
-./inc/language/de.php:838:// @TODO Are these constants longer used?
+./inc/language/de.php:836:// @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/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/admins_functions.php:434:           // @TODO This can be, somehow, rewritten
 ./inc/libs/beg_functions.php:58:               // @TODO Try to rewrite the following unset()
-./inc/libs/bonus_functions.php:213:            // @TODO Move this HTML to a template
-./inc/libs/bonus_functions.php:297:            // @TODO This query isn't right, it will only update if the user was for a longer time away!
+./inc/libs/bonus_functions.php:206:            // @TODO Move this HTML to a template
+./inc/libs/bonus_functions.php:290:            // @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/doubler_functions.php:94:                   // @TODO Can't this be moved into EL?
 ./inc/libs/mailid_functions.php:49:            // @TODO Rewrite this to a dynamic include or so
-./inc/libs/rallye_functions.php:703:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
-./inc/libs/rallye_functions.php:773:   $EXPIRE = 3; // @TODO The hard-coded value...
-./inc/libs/rallye_functions.php:859:// @TODO Please document this function
-./inc/libs/rallye_functions.php:915:           // Load count @TODO Can't we rewrite this to our API?
+./inc/libs/rallye_functions.php:700:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
+./inc/libs/rallye_functions.php:768:   $EXPIRE = 3; // @TODO The hard-coded value...
+./inc/libs/rallye_functions.php:854:// @TODO Please document this function
+./inc/libs/rallye_functions.php:910:           // 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: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/register_functions.php:296: // @TODO Rewrite these all to a single filter
+./inc/libs/register_functions.php:372: // @TODO Rewrite this to a filter
+./inc/libs/register_functions.php:379: // @TODO Rewrite this whole if() block to addPointsThroughReferalSystem(). This will also make following if() block obsolete
+./inc/libs/register_functions.php:380: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
 ./inc/libs/surfbar_functions.php:1541:         // @TODO This can be somehow rewritten
 ./inc/libs/surfbar_functions.php:713:// @TODO Can't we use our new expression language instead of this ugly code?
 ./inc/libs/surfbar_functions.php:957:  // @TODO Invalid salt should be refused
 ./inc/modules/admin/admin-inc.php:338:                                                 // @TODO ACL is 'allow'... hmmm
 ./inc/modules/admin/admin-inc.php:438:// @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:436:                      // @TODO Try to move this in includes
+./inc/modules/admin/overview-inc.php:277:                              // @TODO Rewrite this to something with include files and/or filter
+./inc/modules/admin/overview-inc.php:315:                                              // @TODO This may also be rewritten to include files
+./inc/modules/admin/overview-inc.php:317:                                                      default: // @TODO Unknown support mode
+./inc/modules/admin/overview-inc.php:432:                      // @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-adminedit.php:58:     // @TODO Kill all constants in this file
 ./inc/modules/admin/what-admins_mails.php:61:                          // @TODO Can this be rewritten to an API function?
 ./inc/modules/admin/what-bonus.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-config_admins.php:132:        // @TODO Rewrite this to filter 'run_sqls'
+./inc/modules/admin/what-config_admins.php:126:        // @TODO Rewrite this to filter 'run_sqls'
 ./inc/modules/admin/what-config_mods.php:57:                   // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
 ./inc/modules/admin/what-config_points.php:113:                        // @TODO Rewrite this to a filter
-./inc/modules/admin/what-config_rallye_prices.php:207:                 // @TODO Rewrite these two constants
-./inc/modules/admin/what-config_register.php:78:       // @TODO Move this HTML code into a template
+./inc/modules/admin/what-config_rallye_prices.php:197:                 // @TODO Rewrite these two constants
+./inc/modules/admin/what-config_register.php:77:       // @TODO Move this HTML code into a template
 ./inc/modules/admin/what-del_email.php:60:             // @TODO Unused: $price = getPaymentPoints($content['payment_id'], 'price');
 ./inc/modules/admin/what-del_email.php:61:             // @TODO Unused: cat_id, payment_id
 ./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:282:                           // @TODO Rewrite in template: id->ext_id,name->ext_name,active->ext_active,ver->ext_ver
-./inc/modules/admin/what-extensions.php:363:                                           // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:277:                           // @TODO Rewrite in template: id->ext_id,name->ext_name,active->ext_active,ver->ext_ver
+./inc/modules/admin/what-extensions.php:356:                                           // @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:49:// @TODO Rewrite those lines to filter
-./inc/modules/admin/what-list_bonus.php:135:           // @TODO Can't this be moved into our expression language?
+./inc/modules/admin/what-list_bonus.php:134:           // @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_cats.php:56:             // @TODO No longer needed? define('__CATEGORIES_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
 ./inc/modules/admin/what-list_cats.php:71:                             // @TODO Rewrite this to countSum.....() function
 ./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_refs.php:110:                                                            // @TODO Try to rewrite some to EL
+./inc/modules/admin/what-list_refs.php:107:                                                            // @TODO Try to rewrite some to EL
 ./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', '{--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:151:            // @TODO Rewrite these to filters
 ./inc/modules/admin/what-list_user.php:257:            // @TODO Rewrite this into a filter
-./inc/modules/admin/what-list_user.php:301:                    // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:300:                    // @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:126:                              // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-mem_add.php:65:               // @TODO Cant this be rewritten?
 ./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 in template
-./inc/modules/admin/what-refbanner.php:145:                    // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
+./inc/modules/admin/what-payments.php:148:                     // @TODO Rewritings: title->mail_title in template
+./inc/modules/admin/what-refbanner.php:143:                    // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
 ./inc/modules/admin/what-unlock_emails.php:89:                                 // @TODO Rewrite these if-blocks to a filter
 ./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/member/what-categories.php:129:          // @TODO Rewrite this to use $OUT .= ...
 ./inc/modules/member/what-order.php:457:                       // @TODO Rewrite this to a filter
 ./inc/modules/member/what-order.php:65:// @TODO Rewrite this to a filter
-./inc/modules/member/what-payout.php:218:                                      // @TODO Rewrite this to a filter
+./inc/modules/member/what-payout.php:216:                                      // @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:128:                     // @TODO UNUSED: $refRow['status']      = translateUserStatus($refRow['status']);
+./inc/modules/member/what-refback.php:126:                     // @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:74:                // @TODO More usage of EL at this array
+./inc/modules/member/what-themes.php:116:      // @TODO Move this code into a template
 ./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/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
 ./inc/reset/reset_birthday.php:91:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/revision-functions.php:153:// @TODO Please describe this function
+./inc/template-functions.php:1155:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1188:             // @TODO Add a little more infos here
+./inc/template-functions.php:1473:// @TODO Lame description for this function
+./inc/template-functions.php:1492:                     // @TODO Move this in a filter
+./inc/template-functions.php:280:      // @TODO Remove this sanity-check if all is fine
+./inc/template-functions.php:595:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:622:      // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
 ./inc/wrapper-functions.php:127:// @TODO Implement $compress
 ./inc/wrapper-functions.php:134:// @TODO Implement $decompress
 ./inc/wrapper-functions.php:455:// @TODO Do some more sanity check here
index 2861f71..dc5edaa 100644 (file)
@@ -56,7 +56,7 @@ error_reporting(E_ALL | E_STRICT);
 $PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
 
 // Some very important function includes
-foreach (array('config','wrapper','inc','stats') as $inc) {
+foreach (array('config','wrapper','template','inc','stats') as $inc) {
        include($PATH . 'inc/' . $inc . '-functions.php');
 } // END - foreach
 
index 6a7ca12..d44b587 100644 (file)
@@ -236,5 +236,18 @@ function doExpressionMessage ($data) {
        return $code;
 }
 
+// Expression call-back for template functions
+function doExpressionTemplate ($data) {
+       // Do the replacement
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
+       $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true) . {DQUOTE}";
+
+       // Replace the code
+       $code = replaceExpressionCode($data, $replacer);
+
+       // Return the (maybe) replaced code
+       return $code;
+}
+
 // [EOF]
 ?>
index 9c5771d..af6f615 100644 (file)
@@ -738,9 +738,6 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
 
        // Do we have queries?
        if ((isExtensionInstalledAndNewer('sql_patches', '0.0.7')) && (getConfig('verbose_sql') == 'Y')) {
-               // Init switch color
-               $SW = 2;
-
                // Get all SQLs
                foreach (getExtensionSqls() as $sqls) {
                        // New array format is recursive
@@ -752,16 +749,12 @@ function addExtensionVerboseSqlTable ($title = '', $dashed = '', $switch = false
                                if (!empty($sql)) {
                                        // Prepare output for template
                                        $content = array(
-                                               'sw'  => $SW,
                                                'i'   => ($idx+1),
                                                'sql' => $sql
                                        );
 
                                        // Load row template
                                        $OUT .= loadTemplate('admin_ext_sql_row', true, $content);
-
-                                       // Switch color
-                                       $SW = 3 - $SW;
                                } // END - if
                        } // END - foreach
                } // END - foreach
index 673c8e8..6f82e17 100644 (file)
@@ -42,80 +42,6 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
-// Output HTML code directly or 'render' it. You addionally switch the new-line character off
-function outputHtml ($htmlCode, $newLine = true) {
-       // Init output
-       if (!isset($GLOBALS['output'])) {
-               $GLOBALS['output'] = '';
-       } // END - if
-
-       // Do we have HTML-Code here?
-       if (!empty($htmlCode)) {
-               // Yes, so we handle it as you have configured
-               switch (getConfig('OUTPUT_MODE')) {
-                       case 'render':
-                               // That's why you don't need any \n at the end of your HTML code... :-)
-                               if (getPhpCaching() == 'on') {
-                                       // Output into PHP's internal buffer
-                                       outputRawCode($htmlCode);
-
-                                       // That's why you don't need any \n at the end of your HTML code... :-)
-                                       if ($newLine === true) print("\n");
-                               } else {
-                                       // Render mode for old or lame servers...
-                                       $GLOBALS['output'] .= $htmlCode;
-
-                                       // That's why you don't need any \n at the end of your HTML code... :-)
-                                       if ($newLine === true) $GLOBALS['output'] .= "\n";
-                               }
-                               break;
-
-                       case 'direct':
-                               // If we are switching from render to direct output rendered code
-                               if ((!empty($GLOBALS['output'])) && (getPhpCaching() != 'on')) { outputRawCode($GLOBALS['output']); $GLOBALS['output'] = ''; }
-
-                               // The same as above... ^
-                               outputRawCode($htmlCode);
-                               if ($newLine === true) print("\n");
-                               break;
-
-                       default:
-                               // Huh, something goes wrong or maybe you have edited config.php ???
-                               debug_report_bug(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
-                               break;
-               } // END - switch
-       } elseif ((getPhpCaching() == 'on') && ((!isset($GLOBALS['header'])) || (count($GLOBALS['header']) == 0))) {
-               // Output cached HTML code
-               $GLOBALS['output'] = ob_get_contents();
-
-               // Clear output buffer for later output if output is found
-               if (!empty($GLOBALS['output'])) {
-                       clearOutputBuffer();
-               } // END - if
-
-               // Send all HTTP headers
-               sendHttpHeaders();
-
-               // Compile and run finished rendered HTML code
-               compileFinalOutput();
-
-               // Output code here, DO NOT REMOVE! ;-)
-               outputRawCode($GLOBALS['output']);
-       } elseif ((getConfig('OUTPUT_MODE') == 'render') && (!empty($GLOBALS['output']))) {
-               // Send all HTTP headers
-               sendHttpHeaders();
-
-               // Compile and run finished rendered HTML code
-               compileFinalOutput();
-
-               // Output code here, DO NOT REMOVE! ;-)
-               outputRawCode($GLOBALS['output']);
-       } else {
-               // And flush all headers
-               flushHeaders();
-       }
-}
-
 // Sends out all headers required for HTTP/1.1 reply
 function sendHttpHeaders () {
        // Used later
@@ -134,91 +60,6 @@ function sendHttpHeaders () {
        sendHeader('Content-Language: ' . getLanguage());
 }
 
-// Compiles the final output
-function compileFinalOutput () {
-       // Add page header and footer
-       addPageHeaderFooter();
-
-       // Do the final compilation
-       $GLOBALS['output'] = doFinalCompilation($GLOBALS['output']);
-
-       // Extension 'rewrite' installed?
-       if ((isExtensionActive('rewrite')) && (getOutputMode() != 1)) {
-               $GLOBALS['output'] = rewriteLinksInCode($GLOBALS['output']);
-       } // END - if
-
-       // Compress it?
-       if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
-               // Compress it for HTTP gzip
-               $GLOBALS['output'] = gzencode($GLOBALS['output'], 9, true);
-
-               // Add header
-               sendHeader('Content-Encoding: gzip');
-       } elseif (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('deflate', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
-               // Compress it for HTTP deflate
-               $GLOBALS['output'] = gzcompress($GLOBALS['output'], 9);
-
-               // Add header
-               sendHeader('Content-Encoding: deflate');
-       }
-
-       // Add final length
-       sendHeader('Content-Length: ' . strlen($GLOBALS['output']));
-
-       // Flush all headers
-       flushHeaders();
-}
-
-// Main compilation loop
-function doFinalCompilation ($code, $insertComments = true) {
-       // Insert comments? (Only valid with HTML templates, of course)
-       enableTemplateHtml($insertComments);
-
-       // Init counter
-       $cnt = 0;
-
-       // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 4)) {
-               // Init common variables
-               $content = array();
-               $newContent = '';
-
-               // Compile it
-               //* DEBUG: */ debugOutput('<pre>'.encodeEntities($code).'</pre>');
-               $eval = '$newContent = "' . str_replace('{DQUOTE}', '"', compileCode(escapeQuotes($code))) . '";';
-               //* DEBUG: */ if ($insertComments) die('<pre>'.linenumberCode($eval).'</pre>');
-               eval($eval);
-               //* DEBUG: */ die('<pre>'.encodeEntities($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.
-       print(str_replace('{BACK}', "\\", $htmlCode));
-
-       // Flush the output if only getPhpCaching() is not 'on'
-       if (getPhpCaching() != 'on') {
-               // Flush it
-               flush();
-       } // END - if
-}
-
 // Init fatal message array
 function initFatalMessages () {
        $GLOBALS['fatal_messages'] = array();
@@ -261,274 +102,6 @@ function getTotalFatalErrors () {
        return $count;
 }
 
-// Load a template file and return it's content (only it's name; do not use ' or ")
-function loadTemplate ($template, $return = false, $content = array()) {
-       // @TODO Remove this sanity-check if all is fine
-       if (!is_bool($return)) debug_report_bug(__FUNCTION__, __LINE__, 'return is not bool (' . gettype($return) . ')');
-
-       // @TODO Try to rewrite all $DATA to $content
-       global $DATA;
-
-       // Do we have cache?
-       if ((isDebuggingTemplateCache() === false) && (isTemplateCached($template))) {
-               // Evaluate the cache
-               eval(readTemplateCache($template));
-       } elseif (!isset($GLOBALS['template_eval'][$template])) {
-               // Make all template names lowercase
-               $template = strtolower($template);
-
-               // Init some data
-               $ret = '';
-               if (empty($GLOBALS['refid'])) $GLOBALS['refid'] = '0';
-
-               // Base directory
-               $basePath = sprintf("%stemplates/%s/html/", getConfig('PATH'), getLanguage());
-               $extraPath = detectExtraTemplatePath($template);;
-
-               ////////////////////////
-               // Generate file name //
-               ////////////////////////
-               $FQFN = $basePath . $extraPath . $template . '.tpl';
-
-               // Does the special template exists?
-               if (!isFileReadable($FQFN)) {
-                       // Reset to default template
-                       $FQFN = $basePath . $template . '.tpl';
-               } // END - if
-
-               // Now does the final template exists?
-               if (isFileReadable($FQFN)) {
-                       // Count the template load
-                       incrementConfigEntry('num_templates');
-
-                       // The local file does exists so we load it. :)
-                       $GLOBALS['tpl_content'] = readFromFile($FQFN);
-
-                       // Do we have to compile the code?
-                       $ret = '';
-                       if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
-                               // Normal HTML output?
-                               if (getOutputMode() == '0') {
-                                       // Add surrounding HTML comments to help finding bugs faster
-                                       $ret = '<!-- Template ' . $template . " - Start -->\n" . $GLOBALS['tpl_content'] . '<!-- Template ' . $template . " - End -->\n";
-
-                                       // Prepare eval() command
-                                       $eval = '$ret = "' . compileCode(escapeQuotes($ret)) . '";';
-                               } elseif (substr($template, 0, 3) == 'js_') {
-                                       // JavaScripts don't like entities and timings
-                                       $eval = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'])) . '");';
-                               } else {
-                                       // Prepare eval() command, other output doesn't like entities, maybe
-                                       $eval = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
-                               }
-                       } else {
-                               // Add surrounding HTML comments to help finding bugs faster
-                               $ret = '<!-- Template ' . $template . " - Start -->\n" . $GLOBALS['tpl_content'] . '<!-- Template ' . $template . " - End -->\n";
-                               $eval = '$ret = "' . compileRawCode(escapeQuotes($ret)) . '";';
-                       } // END - if
-
-                       // Cache the eval() command here
-                       $GLOBALS['template_eval'][$template] = $eval;
-               } elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
-                       // Only admins shall see this warning or when installation mode is active
-                       $ret = '<div class="para">
-       <span class="guest_failed">{--TEMPLATE_404--}</span>
-</div>
-<div class="para">
-       (' . $template . ')
-</div>
-<div class="para">
-       {--TEMPLATE_CONTENT--}
-       <pre>' . print_r($content, true) . '</pre>
-       {--TEMPLATE_DATA--}
-       <pre>' . print_r($DATA, true) . '</pre>
-</div>';
-               } else {
-                       // No file!
-                       $GLOBALS['template_eval'][$template] = '404';
-               }
-       }
-
-       // Code set?
-       if ((isset($GLOBALS['template_eval'][$template])) && ($GLOBALS['template_eval'][$template] != '404')) {
-               // Eval the code
-               eval($GLOBALS['template_eval'][$template]);
-       } // END - if
-
-       // Do we have some content to output or return?
-       if (!empty($ret)) {
-               // Not empty so let's put it out! ;)
-               if ($return === true) {
-                       // Return the HTML code
-                       return $ret;
-               } else {
-                       // Output directly
-                       outputHtml($ret);
-               }
-       } elseif (isDebugModeEnabled()) {
-               // Warning, empty output!
-               return 'E:' . $template . ',content=<pre>' . print_r($content, true) . '</pre>';
-       }
-}
-
-// Detects the extra template path from given template name
-function detectExtraTemplatePath ($template) {
-       // Default is empty
-       $extraPath = '';
-
-       // Do we have cache?
-       if (!isset($GLOBALS['extra_path'][$template])) {
-               // Check for admin/guest/member/etc. templates
-               if (substr($template, 0, 6) == 'admin_') {
-                       // Admin template found
-                       $extraPath = 'admin/';
-               } elseif (substr($template, 0, 6) == 'guest_') {
-                       // Guest template found
-                       $extraPath = 'guest/';
-               } elseif (substr($template, 0, 7) == 'member_') {
-                       // Member template found
-                       $extraPath = 'member/';
-               } elseif (substr($template, 0, 7) == 'select_') {
-                       // Selection template found
-                       $extraPath = 'select/';
-               } elseif (substr($template, 0, 8) == 'install_') {
-                       // Installation template found
-                       $extraPath = 'install/';
-               } elseif (substr($template, 0, 4) == 'ext_') {
-                       // Extension template found
-                       $extraPath = 'ext/';
-               } elseif (substr($template, 0, 3) == 'la_') {
-                       // 'Logical-area' template found
-                       $extraPath = 'la/';
-               } elseif (substr($template, 0, 3) == 'js_') {
-                       // JavaScript template found
-                       $extraPath = 'js/';
-               } elseif (substr($template, 0, 5) == 'menu_') {
-                       // Menu template found
-                       $extraPath = 'menu/';
-               } else {
-                       // Test for extension
-                       $test = substr($template, 0, strpos($template, '_'));
-
-                       // Probe for valid extension name
-                       if (isExtensionNameValid($test)) {
-                               // Set extra path to extension's name
-                               $extraPath = $test . '/';
-                       } // END - if
-               }
-
-               // Store it in cache
-               $GLOBALS['extra_path'][$template] = $extraPath;
-       } // END - if
-
-       // Return result
-       return $GLOBALS['extra_path'][$template];
-}
-
-// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = '0') {
-       global $DATA;
-
-       // Make sure all template names are lowercase!
-       $template = strtolower($template);
-
-       // Is content an array?
-       if (is_array($content)) {
-               // Add expiration to array
-               if ((isConfigEntrySet('auto_purge')) && (getConfig('auto_purge') == '0')) {
-                       // Will never expire!
-                       $content['expiration'] = '{--MAIL_WILL_NEVER_EXPIRE--}';
-               } elseif (isConfigEntrySet('auto_purge')) {
-                       // Create nice date string
-                       $content['expiration'] = createFancyTime(getConfig('auto_purge'));
-               } else {
-                       // Missing entry
-                       $content['expiration'] = '{--MAIL_NO_CONFIG_AUTO_PURGE--}';
-               }
-       } // END - if
-
-       // Load user's data
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
-       if (($userid > 0) && (is_array($content))) {
-               // If nickname extension is installed, fetch nickname as well
-               if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
-                       // Load by nickname
-                       fetchUserData($userid, 'nickname');
-               } else {
-                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NO-NICK!<br />");
-                       /// Load by userid
-                       fetchUserData($userid);
-               }
-
-               // Merge data if valid
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
-               if (isUserDataValid()) {
-                       $content = merge_array($content, getUserDataArray());
-               } // END - if
-               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
-       } // END - if
-
-       // Base directory
-       $basePath = sprintf("%stemplates/%s/emails/", getConfig('PATH'), getLanguage());
-
-       // Detect extra path
-       $extraPath = detectExtraTemplatePath($template);
-
-       // 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
-
-       // Now does the final template exists?
-       $newContent = '';
-       if (isFileReadable($FQFN)) {
-               // The local file does exists so we load it. :)
-               $GLOBALS['tpl_content'] = readFromFile($FQFN);
-
-               // Run code
-               $GLOBALS['tpl_content'] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
-               eval($GLOBALS['tpl_content']);
-       } elseif (!empty($template)) {
-               // Template file not found!
-               $newContent = '<div class="para">
-       {--TEMPLATE_404--}: ' . $template . '
-</div>
-<div class="para">
-       {--TEMPLATE_CONTENT--}
-       <pre>' . print_r($content, true) . '</pre>
-       {--TEMPLATE_DATA--}
-       <pre>' . print_r($DATA, true) . '</pre>
-</div>';
-
-               // Debug mode not active? Then remove the HTML tags
-               if (!isDebugModeEnabled()) $newContent = secureString($newContent);
-       } else {
-               // No template name supplied!
-               $newContent = '{--NO_TEMPLATE_SUPPLIED--}';
-       }
-
-       // Is there some content?
-       if (empty($newContent)) {
-               // Compiling failed
-               $newContent = "Compiler error for template " . $template . " !\nUncompiled content:\n" . $GLOBALS['tpl_content'];
-
-               // Add last error if the required function exists
-               if (function_exists('error_get_last')) $newContent .= "\n--------------------------------------\nDebug:\n".print_r(error_get_last(), true)."--------------------------------------\nPlease don't alter these informations!\nThanx.";
-       } // END - if
-
-       // Remove content and data
-       unset($content);
-       unset($DATA);
-
-       // Return content
-       return $newContent;
-}
-
 // Send mail out to an email address
 function sendEmail ($toEmail, $subject, $message, $isHtml = 'N', $mailHeader = '') {
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "TO={$toEmail},SUBJECT={$subject}<br />");
@@ -890,25 +463,6 @@ function translateMenuVisibleLocked ($content, $prefix = '') {
        return $content;
 }
 
-// "Getter" for menu CSS classes, mainly used in templates
-function getMenuCssClasses ($data) {
-       // $data needs to be converted into an array
-       $content = explode('|', $data);
-
-       // Non-existent index 2 will happen in menu blocks
-       if (!isset($content[2])) $content[2] = '';
-
-       // Re-construct the array: 0=visible,1=locked,2=prefix
-       $content['visible'] = $content[0];
-       $content['locked']  = $content[1];
-
-       // Call our "translator" function
-       $content = translateMenuVisibleLocked($content, $content[2]);
-
-       // Return CSS classes
-       return ($content['visible_css'] . ' ' . $content['locked_css']);
-}
-
 // Generates an URL for the dereferer
 function generateDerefererUrl ($URL) {
        // Don't de-refer our own links!
@@ -953,11 +507,6 @@ function countSelection ($array) {
        return $ret;
 }
 
-// Generate XHTML code for the CAPTCHA
-function generateCaptchaCode ($code, $type, $DATA, $userid) {
-       return '<img border="0" alt="Code ' . $code . '" src="{%url=mailid_top.php?userid=' . $userid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '%}" />';
-}
-
 // Generates a timestamp (some wrapper for mktime())
 function makeTime ($hours, $minutes, $seconds, $stamp) {
        // Extract day, month and year from given timestamp
@@ -1028,117 +577,6 @@ function redirectToUrl ($URL, $allowSpider = true) {
        shutdown();
 }
 
-// Wrapper for redirectToUrl but URL comes from a configuration entry
-function redirectToConfiguredUrl ($configEntry) {
-       // Load the URL
-       redirectToUrl(getConfig($configEntry));
-}
-
-// Compiles the given HTML/mail code
-function compileCode ($code, $simple = false, $constants = true, $full = true) {
-       // Is the code a string?
-       if (!is_string($code)) {
-               // Silently return it
-               return $code;
-       } // END - if
-
-       // Start couting
-       $startCompile = microtime(true);
-
-       // Comile the code
-       $code = compileRawCode($code, $simple, $constants, $full);
-
-       // Get timing
-       $compiled = microtime(true);
-
-       // 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;
-}
-
-// Compiles the code (use compileCode() only for HTML because of the comments)
-// @TODO $simple/$constants are deprecated
-function compileRawCode ($code, $simple = false, $constants = true, $full = true) {
-       // Is the code a string?
-       if (!is_string($code)) {
-               // Silently return it
-               return $code;
-       } // END - if
-
-       // Init replacement-array with smaller set of security characters
-       $secChars = $GLOBALS['url_chars'];
-
-       // Select full set of chars to replace when we e.g. want to compile URLs
-       if ($full === true) $secChars = $GLOBALS['security_chars'];
-
-       // Compile more through a filter
-       $code = runFilterChain('compile_code', $code);
-
-       // Compile message strings
-       $code = str_replace('{--', '{%message,', str_replace('--}', '%}', $code));
-
-       // Compile QUOT and other non-HTML codes
-       foreach ($secChars['to'] as $k => $to) {
-               // Do the reversed thing as in inc/libs/security_functions.php
-               $code = str_replace($to, $secChars['from'][$k], $code);
-       } // END - foreach
-
-       // Find $content[bla][blub] entries
-       // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
-       preg_match_all('/\$(content|GLOBALS|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
-
-       // Are some matches found?
-       if ((count($matches) > 0) && (count($matches[0]) > 0)) {
-               // Replace all matches
-               $matchesFound = array();
-               foreach ($matches[0] as $key => $match) {
-                       // Fuzzy look has failed by default
-                       $fuzzyFound = false;
-
-                       // Fuzzy look on match if already found
-                       foreach ($matchesFound as $found => $set) {
-                               // Get test part
-                               $test = substr($found, 0, strlen($match));
-
-                               // Does this entry exist?
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "found={$found},match={$match},set={$set}<br />");
-                               if ($test == $match) {
-                                       // Match found!
-                                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "fuzzyFound!<br />");
-                                       $fuzzyFound = true;
-                                       break;
-                               } // END - if
-                       } // END - foreach
-
-                       // Skip this entry?
-                       if ($fuzzyFound === true) continue;
-
-                       // Take all string elements
-                       if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key.'_' . $matches[4][$key]]))) {
-                               // Replace it in the code
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "key={$key},match={$match}<br />");
-                               $newMatch = str_replace('[', "['", str_replace(']', "']", $match));
-                               $code = str_replace($match, '".' . $newMatch . '."', $code);
-                               $matchesFound[$key . '_' . $matches[4][$key]] = 1;
-                               $matchesFound[$match] = 1;
-                       } elseif (!isset($matchesFound[$match])) {
-                               // Not yet replaced!
-                               //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "match={$match}<br />");
-                               $code = str_replace($match, '".' . $match . '."', $code);
-                               $matchesFound[$match] = 1;
-                       }
-               } // END - foreach
-       } // END - if
-
-       // Return it
-       return $code;
-}
-
 /************************************************************************
  *                                                                      *
  * Gaenderter Sortier-Algorythmus, $array wird nach dem Array (!)       *
@@ -1190,118 +628,6 @@ function array_pk_sort (&$array, $a_sort, $primary_key = '0', $order = -1, $nums
        $array = $dummy;
 }
 
-//
-function addSelectionBox ($type, $default, $prefix = '', $id = '0', $class = 'register_select') {
-       $OUT = '';
-
-       if ($type == 'yn') {
-               // This is a yes/no selection only!
-               if ($id > 0) $prefix .= '[' . $id . ']';
-               $OUT .= '<select name="' . $prefix . '" class="' . $class . '" size="1">';
-       } else {
-               // Begin with regular selection box here
-               if (!empty($prefix)) $prefix .= '_';
-               $type2 = $type;
-               if ($id > 0) $type2 .= '[' . $id . ']';
-               $OUT .= '<select name="' . strtolower($prefix . $type2) . '" class="' . $class . '" size="1">';
-       }
-
-       switch ($type) {
-               case 'day': // Day
-                       for ($idx = 1; $idx < 32; $idx++) {
-                               $OUT .= '<option value="' . $idx . '"';
-                               if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       break;
-
-               case 'month': // Month
-                       foreach ($GLOBALS['month_descr'] as $idx => $descr) {
-                               $OUT .= '<option value="' . $idx . '"';
-                               if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $descr . '</option>';
-                       } // END - for
-                       break;
-
-               case 'year': // Year
-                       // Get current year
-                       $year = date('Y', time());
-
-                       // Use configured min age or fixed?
-                       if (isExtensionInstalledAndNewer('order', '0.2.1')) {
-                               // Configured
-                               $startYear = $year - getConfig('min_age');
-                       } else {
-                               // Fixed 16 years
-                               $startYear = $year - 16;
-                       }
-
-                       // Calculate earliest year (100 years old people can still enter Internet???)
-                       $minYear = $year - 100;
-
-                       // Check if the default value is larger than minimum and bigger than actual year
-                       if (($default > $minYear) && ($default >= $year)) {
-                               for ($idx = $year; $idx < ($year + 11); $idx++) {
-                                       $OUT .= '<option value="' . $idx . '"';
-                                       if ($default == $idx) $OUT .= ' selected="selected"';
-                                       $OUT .= '>' . $idx . '</option>';
-                               } // END - for
-                       } elseif ($default == -1) {
-                               // Current year minus 1
-                               for ($idx = $startYear; $idx <= ($year + 1); $idx++) {
-                                       $OUT .= '<option value="' . $idx . '">' . $idx . '</option>';
-                               } // END - for
-                       } else {
-                               // Get current year and subtract the configured minimum age
-                               $OUT .= '<option value="' . ($minYear - 1) . '">&lt;' . $minYear . '</option>';
-                               // Calculate earliest year depending on extension version
-                               if (isExtensionInstalledAndNewer('order', '0.2.1')) {
-                                       // Use configured minimum age
-                                       $year = date('Y', time()) - getConfig('min_age');
-                               } else {
-                                       // Use fixed 16 years age
-                                       $year = date('Y', time()) - 16;
-                               }
-
-                               // Construct year selection list
-                               for ($idx = $minYear; $idx <= $year; $idx++) {
-                                       $OUT .= '<option value="' . $idx . '"';
-                                       if ($default == $idx) $OUT .= ' selected="selected"';
-                                       $OUT .= '>' . $idx . '</option>';
-                               } // END - for
-                       }
-                       break;
-
-               case 'sec':
-               case 'min':
-                       for ($idx = 0; $idx < 60; $idx+=5) {
-                               if (strlen($idx) == 1) $idx = '0' . $idx;
-                               $OUT .= '<option value="' . $idx . '"';
-                               if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       break;
-
-               case 'hour':
-                       for ($idx = 0; $idx < 24; $idx++) {
-                               if (strlen($idx) == 1) $idx = '0' . $idx;
-                               $OUT .= '<option value="' . $idx . '"';
-                               if ($default == $idx) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       break;
-
-               case 'yn':
-                       $OUT .= '<option value="Y"';
-                       if ($default == 'Y') $OUT .= ' selected="selected"';
-                       $OUT .= '>{--YES--}</option><option value="N"';
-                       if ($default != 'Y') $OUT .= ' selected="selected"';
-                       $OUT .= '>{--NO--}</option>';
-                       break;
-       }
-       $OUT .= '</select>';
-       return $OUT;
-}
 
 //
 // Deprecated : $length
@@ -1377,266 +703,7 @@ function bigintval ($num, $castValue = true, $abortOnMismatch = true) {
        return $ret;
 }
 
-// Insert the code in $img_code into jpeg or PNG image
-function generateImageOrCode ($img_code, $headerSent = true) {
-       // Is the code size oversized or shouldn't we display it?
-       if ((strlen($img_code) > 6) || (empty($img_code)) || (getConfig('code_length') == '0')) {
-               // Stop execution of function here because of over-sized code length
-               debug_report_bug(__FUNCTION__, __LINE__, 'img_code ' . $img_code .' has invalid length. img_code()=' . strlen($img_code) . ' code_length=' . getConfig('code_length'));
-       } elseif ($headerSent === false) {
-               // Return an HTML code here
-               return '<img src="{%url=img.php?code=' . $img_code . '%}" alt="Image" />';
-       }
-
-       // Load image
-       $img = sprintf("%s/theme/%s/images/code_bg.%s",
-               getConfig('PATH'),
-               getCurrentTheme(),
-               getConfig('img_type')
-       );
-
-       // Is it readable?
-       if (isFileReadable($img)) {
-               // Switch image type
-               switch (getConfig('img_type')) {
-                       case 'jpg':
-                               // Okay, load image and hide all errors
-                               $image = imagecreatefromjpeg($img);
-                               break;
-
-                       case 'png':
-                               // Okay, load image and hide all errors
-                               $image = imagecreatefrompng($img);
-                               break;
-               } // END - switch
-       } else {
-               // Exit function here
-               logDebugMessage(__FUNCTION__, __LINE__, sprintf("File for image type %s not found.", getConfig('img_type')));
-               return;
-       }
-
-       // Generate text color (red/green/blue; 0 = dark, 255 = bright)
-       $text_color = imagecolorallocate($image, 0, 0, 0);
-
-       // Insert code into image
-       imagestring($image, 5, 14, 2, $img_code, $text_color);
-
-       // Return to browser
-       sendHeader('Content-Type: image/' . getConfig('img_type'));
-
-       // Output image with matching image factory
-       switch (getConfig('img_type')) {
-               case 'jpg': imagejpeg($image); break;
-               case 'png': imagepng($image);  break;
-       } // END - switch
-
-       // 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
-       if (!isConfigEntrySet('ONE_DAY')) {
-               // And return the timestamp itself or empty array
-               if ($return_array === true) {
-                       return array();
-               } else {
-                       return $timestamp;
-               }
-       } // END - if
-
-       // Calculate 2-seconds timestamp
-       $stamp = round($timestamp);
-       //* DEBUG: */ debugOutput('*' . $stamp .'/' . $timestamp . '*');
-
-       // Do we have a leap year?
-       $SWITCH = '0';
-       $TEST = date('Y', time()) / 4;
-       $M1 = date('m', time());
-       $M2 = date('m', (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 = getConfig('ONE_DAY');
-
-       // First of all years...
-       $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
-       //* DEBUG: */ debugOutput('Y=' . $Y);
-       // Next months...
-       $M = abs(floor($timestamp / 2628000 - $Y * 12));
-       //* DEBUG: */ debugOutput('M=' . $M);
-       // Next weeks
-       $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('ONE_DAY')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) / 7)));
-       //* DEBUG: */ debugOutput('W=' . $W);
-       // Next days...
-       $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY'))) - $W * 7));
-       //* DEBUG: */ debugOutput('D=' . $D);
-       // Next hours...
-       $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24) - $W * 7 * 24 - $D * 24));
-       //* DEBUG: */ debugOutput('h=' . $h);
-       // Next minutes..
-       $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
-       //* DEBUG: */ debugOutput('m=' . $m);
-       // And at last seconds...
-       $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
-       //* DEBUG: */ debugOutput('s=' . $s);
-
-       // Is seconds zero and time is < 60 seconds?
-       if (($s == '0') && ($timestamp < 60)) {
-               // Fix seconds
-               $s = round($timestamp);
-       } // END - if
-
-       //
-       // Now we convert them in seconds...
-       //
-       if ($return_array) {
-               // Just put all data in an array for later use
-               $OUT = array(
-                       'YEARS'   => $Y,
-                       'MONTHS'  => $M,
-                       'WEEKS'   => $W,
-                       'DAYS'    => $D,
-                       'HOURS'   => $h,
-                       'MINUTES' => $m,
-                       'SECONDS' => $s
-               );
-       } else {
-               // Generate table
-               $OUT  = '<div align="' . $align . '">';
-               $OUT .= '<table border="0" cellspacing="0" cellpadding="0" class="timebox_table dashed">';
-               $OUT .= '<tr>';
-
-               if (isInString('Y', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_YEARS--}</strong></td>';
-               } // END - if
-
-               if (isInString('M', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_MONTHS--}</strong></td>';
-               } // END - if
-
-               if (isInString('W', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_WEEKS--}</strong></td>';
-               } // END - if
-
-               if (isInString('D', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_DAYS--}</strong></td>';
-               } // END - if
-
-               if (isInString('h', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_HOURS--}</strong></td>';
-               } // END - if
-
-               if (isInString('m', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_MINUTES--}</strong></td>';
-               } // END - if
-
-               if (isInString('s', $display) || (empty($display))) {
-                       $OUT .= '<td align="center" class="timebox_column bottom"><div class="tiny">{--_SECONDS--}</strong></td>';
-               } // END - if
-
-               $OUT .= '</tr>';
-               $OUT .= '<tr>';
-
-               if (isInString('Y', $display) || (empty($display))) {
-                       // Generate year selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_ye" size="1">';
-                       for ($idx = 0; $idx <= 10; $idx++) {
-                               $OUT .= '<option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $Y) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_ye" value="0" />';
-               }
-
-               if (isInString('M', $display) || (empty($display))) {
-                       // Generate month selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_mo" size="1">';
-                       for ($idx = 0; $idx <= 11; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $M) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_mo" value="0" />';
-               }
-
-               if (isInString('W', $display) || (empty($display))) {
-                       // Generate week selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_we" size="1">';
-                       for ($idx = 0; $idx <= 4; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $W) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_we" value="0" />';
-               }
-
-               if (isInString('D', $display) || (empty($display))) {
-                       // Generate day selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_da" size="1">';
-                       for ($idx = 0; $idx <= 31; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $D) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_da" value="0" />';
-               }
-
-               if (isInString('h', $display) || (empty($display))) {
-                       // Generate hour selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_ho" size="1">';
-                       for ($idx = 0; $idx <= 23; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $h) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_ho" value="0" />';
-               }
-
-               if (isInString('m', $display) || (empty($display))) {
-                       // Generate minute selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_mi" size="1">';
-                       for ($idx = 0; $idx <= 59; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $m) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_mi" value="0" />';
-               }
-
-               if (isInString('s', $display) || (empty($display))) {
-                       // Generate second selection
-                       $OUT .= '<td align="center"><select class="mini_select" name="' . $prefix . '_se" size="1">';
-                       for ($idx = 0; $idx <= 59; $idx++) {
-                               $OUT .= '  <option class="mini_select" value="' . $idx . '"';
-                               if ($idx == $s) $OUT .= ' selected="selected"';
-                               $OUT .= '>' . $idx . '</option>';
-                       } // END - for
-                       $OUT .= '</select></td>';
-               } else {
-                       $OUT .= '<input type="hidden" name="' . $prefix . '_se" value="0" />';
-               }
-               $OUT .= '</tr>';
-               $OUT .= '</table>';
-               $OUT .= '</div>';
-       }
-
-       // Return generated HTML code
-       return $OUT;
-}
-
-//
+// Creates a Uni* timestamp from given selection data and prefix
 function createTimestampFromSelections ($prefix, $postData) {
        // Initial return value
        $ret = '0';
@@ -2044,72 +1111,6 @@ function isUrlValid ($URL, $compile=true) {
        return isUrlValidSimple($URL);
 }
 
-// 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!');
-
-       // Define all main targets
-       $targetArray = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
-
-       // Get user status
-       $status = getFetchedUserData('userid', $userid, 'status');
-
-       // Begin of navigation links
-       $OUT = '[';
-
-       foreach ($targetArray as $tar) {
-               $OUT .= '<span class="admin_user_link"><a href="{%url=modules.php?module=admin&amp;what=' . $tar . '&amp;userid=' . $userid . '%}" title="{--ADMIN_LINK_';
-               //* DEBUG: */ debugOutput('*' . $tar.'/' . $status.'*');
-               if (($tar == 'lock_user') && ($status == 'LOCKED')) {
-                       // Locked accounts shall be unlocked
-                       $OUT .= 'UNLOCK_USER';
-               } else {
-                       // All other status is fine
-                       $OUT .= strtoupper($tar);
-               }
-               $OUT .= '_TITLE--}">{--ADMIN_';
-               if (($tar == 'lock_user') && ($status == 'LOCKED')) {
-                       // Locked accounts shall be unlocked
-                       $OUT .= 'UNLOCK_USER';
-               } else {
-                       // All other status is fine
-                       $OUT .= strtoupper($tar);
-               }
-               $OUT .= '--}</a></span>|';
-       } // END - foreach
-
-       // Finish navigation link
-       $OUT = substr($OUT, 0, -1) . ']';
-
-       // Return string
-       return $OUT;
-}
-
-// Generate an email link
-function generateEmailLink ($email, $table = 'admins') {
-       // Default email link (INSECURE! Spammer can read this by harvester programs)
-       $EMAIL = 'mailto:' . $email;
-
-       // Check for several extensions
-       if ((isExtensionActive('admins')) && ($table == 'admins')) {
-               // Create email link for contacting admin in guest area
-               $EMAIL = generateAdminEmailLink($email);
-       } elseif ((isExtensionInstalledAndNewer('user', '0.3.3')) && ($table == 'user_data')) {
-               // Create email link for contacting a member within admin area (or later in other areas, too?)
-               $EMAIL = generateUserEmailLink($email, 'admin');
-       } elseif ((isExtensionActive('sponsor')) && ($table == 'sponsor_data')) {
-               // Create email link to contact sponsor within admin area (or like the link above?)
-               $EMAIL = generateSponsorEmailLink($email, 'sponsor_data');
-       }
-
-       // Shall I close the link when there is no admin?
-       if ((!isAdmin()) && ($EMAIL == $email)) $EMAIL = '#'; // Closed!
-
-       // Return email link
-       return $EMAIL;
-}
-
 // Generate a hash for extra-security for all passwords
 function generateHash ($plainText, $salt = '', $hash = true) {
        // Debug output
@@ -2324,90 +1325,6 @@ function fixDeletedCookies ($cookies) {
        } // END - if
 }
 
-// Output error messages in a fasioned way and die...
-function app_die ($F, $L, $message) {
-       // Check if Script is already dieing and not let it kill itself another 1000 times
-       if (!isset($GLOBALS['app_died'])) {
-               // Make sure, that the script realy realy diese here and now
-               $GLOBALS['app_died'] = true;
-
-               // Set content type as text/html
-               setContentType('text/html');
-
-               // Load header
-               loadIncludeOnce('inc/header.php');
-
-               // Rewrite message for output
-               $message = sprintf(getMessage('MAILER_HAS_DIED'), basename($F), $L, $message);
-
-               // Load the message template
-               loadTemplate('app_die_message', false, $message);
-
-               // Load footer
-               loadIncludeOnce('inc/footer.php');
-       } else {
-               // Script tried to kill itself twice
-               die('['.__FUNCTION__.':'.__LINE__.']: Script wanted to kill itself more than once! Raw message=' . $message . ', file/function=' . $F . ', line=' . $L);
-       }
-}
-
-// Display parsing time and number of SQL queries in footer
-function displayParsingTime () {
-       // Is the timer started?
-       if (!isset($GLOBALS['startTime'])) {
-               // Abort here
-               return false;
-       } // END - if
-
-       // Get end time
-       $endTime = microtime(true);
-
-       // "Explode" both times
-       $start = explode(' ', $GLOBALS['startTime']);
-       $end = explode(' ', $endTime);
-       $runTime = $end[0] - $start[0];
-       if ($runTime < 0) $runTime = '0';
-
-       // Prepare output
-       // @TODO This can be easily moved out after the merge from EL branch to this is complete
-       $content = array(
-               'run_time' => $runTime,
-               'sql_time' => translateComma(getConfig('sql_time') * 1000),
-       );
-
-       // Load the template
-       $GLOBALS['page_footer'] .= loadTemplate('show_timings', true, $content);
-}
-
-// Check wether a boolean constant is set
-// Taken from user comments in PHP documentation for function constant()
-function isBooleanConstantAndTrue ($constName) { // : Boolean
-       // Failed by default
-       $res = false;
-
-       // In cache?
-       if (isset($GLOBALS['cache_array']['const'][$constName])) {
-               // Use cache
-               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-CACHE!<br />");
-               $res = ($GLOBALS['cache_array']['const'][$constName] === true);
-       } else {
-               // Check constant
-               //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-RESOLVE!<br />");
-               if (defined($constName)) {
-                       // Found!
-                       //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>): ' . $constName."-FOUND!<br />");
-                       $res = (constant($constName) === true);
-               } // END - if
-
-               // Set cache
-               $GLOBALS['cache_array']['const'][$constName] = $res;
-       }
-       //* DEBUG: */ var_dump($res);
-
-       // Return value
-       return $res;
-}
-
 // Checks if a given apache module is loaded
 function isApacheModuleLoaded ($apacheModule) {
        // Check it and return result
@@ -2495,56 +1412,6 @@ function debug_get_mailable_backtrace () {
        return $backtrace;
 }
 
-// Output a debug backtrace to the user
-function debug_report_bug ($F, $L, $message = '', $sendEmail = true) {
-       // Is this already called?
-       if (isset($GLOBALS[__FUNCTION__])) {
-               // Other backtrace
-               print 'Message:'.$message.'<br />Backtrace:<pre>';
-               debug_print_backtrace();
-               die('</pre>');
-       } // END - if
-
-       // Set this function as called
-       $GLOBALS[__FUNCTION__] = true;
-
-       // Init message
-       $debug = '';
-
-       // Is the optional message set?
-       if (!empty($message)) {
-               // Use and log it
-               $debug = sprintf("Note: %s<br />\n",
-                       $message
-               );
-
-               // @TODO Add a little more infos here
-               logDebugMessage($F, $L, strip_tags($message));
-       } // END - if
-
-       // Add output
-       $debug .= 'Please report this bug at <a title="Direct link to the bug-tracker" href="http://bugs.mxchange.org" rel="external" target="_blank">http://bugs.mxchange.org</a> and include the logfile from <strong>' . str_replace(getConfig('PATH'), '', getConfig('CACHE_PATH')) . 'debug.log</strong> in your report (you can now attach files):<pre>';
-       $debug .= debug_get_printable_backtrace();
-       $debug .= '</pre>';
-       $debug .= '<div>Request-URI: ' . getRequestUri() . '</div>';
-       $debug .= '<div>Thank you for finding bugs.</div>';
-
-       // Send an email? (e.g. not wanted for evaluation errors)
-       if (($sendEmail === true) && (!isInstallationPhase())) {
-               // Prepare content
-               $content = array(
-                       'message'   => trim($message),
-                       'backtrace' => trim(debug_get_mailable_backtrace())
-               );
-
-               // Send email to webmaster
-               sendAdminNotification('{--DEBUG_REPORT_BUG_SUBJECT--}', 'admin_report_bug', $content);
-       } // END - if
-
-       // And abort here
-       app_die($F, $L, $debug);
-}
-
 // Generates a ***weak*** seed
 function generateSeed () {
        return microtime(true) * 100000;
@@ -2644,28 +1511,6 @@ function getMessageFromErrorCode ($code) {
        return $message;
 }
 
-// Compile characters which are allowed in URLs
-function compileUriCode ($code, $simple = true) {
-       // Compile constants
-       if ($simple === false) $code = str_replace('{--', '".', str_replace('--}', '."', $code));
-
-       // Compile QUOT and other non-HTML codes
-       $code = str_replace('{DOT}', '.',
-               str_replace('{SLASH}', '/',
-               str_replace('{QUOT}', "'",
-               str_replace('{DOLLAR}', '$',
-               str_replace('{OPEN_ANCHOR}', '(',
-               str_replace('{CLOSE_ANCHOR}', ')',
-               str_replace('{OPEN_SQR}', '[',
-               str_replace('{CLOSE_SQR}', ']',
-               str_replace('{PER}', '%',
-               $code
-       )))))))));
-
-       // Return compiled code
-       return $code;
-}
-
 // Function taken from user comments on www.php.net / function isInStringIgnoreCase()
 function isUrlValidSimple ($url) {
        // Prepare URL
@@ -3167,23 +2012,6 @@ function isMemberIdSet () {
        return (isset($GLOBALS['member_id']));
 }
 
-// Handle message codes from URL
-function handleCodeMessage () {
-       if (isGetRequestParameterSet('code')) {
-               // Default extension is 'unknown'
-               $ext = 'unknown';
-
-               // Is extension given?
-               if (isGetRequestParameterSet('ext')) $ext = getRequestParameter('ext');
-
-               // Convert the 'code' parameter from URL to a human-readable message
-               $message = getMessageFromErrorCode(getRequestParameter('code'));
-
-               // Load message template
-               loadTemplate('message', false, $message);
-       } // END - if
-}
-
 // Setter for extra title
 function setExtraTitle ($extraTitle) {
        $GLOBALS['extra_title'] = $extraTitle;
@@ -3206,74 +2034,6 @@ function isExtraTitleSet () {
        return ((isset($GLOBALS['extra_title'])) && (!empty($GLOBALS['extra_title'])));
 }
 
-// Generates a 'extension foo inactive' message
-function generateExtensionInactiveMessage ($ext_name) {
-       // Is the extension empty?
-       if (empty($ext_name)) {
-               // This should not happen
-               debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
-       } // END - if
-
-       // Default message
-       $message = getMaskedMessage('EXTENSION_PROBLEM_EXT_INACTIVE', $ext_name);
-
-       // Is an admin logged in?
-       if (isAdmin()) {
-               // Then output admin message
-               $message = getMaskedMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE', $ext_name);
-       } // END - if
-
-       // Return prepared message
-       return $message;
-}
-
-// Generates a 'extension foo not installed' message
-function generateExtensionNotInstalledMessage ($ext_name) {
-       // Is the extension empty?
-       if (empty($ext_name)) {
-               // This should not happen
-               debug_report_bug(__FUNCTION__, __LINE__, 'Parameter ext is empty. This should not happen.');
-       } // END - if
-
-       // Default message
-       $message = getMaskedMessage('EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED', $ext_name);
-
-       // Is an admin logged in?
-       if (isAdmin()) {
-               // Then output admin message
-               $message = getMaskedMessage('ADMIN_EXTENSION_PROBLEM_EXTENSION_NOT_INSTALLED', $ext_name);
-       } // END - if
-
-       // Return prepared message
-       return $message;
-}
-
-// Generates a message depending on if the extension is not installed or not
-// just activated
-function generateExtensionInactiveNotInstalledMessage ($ext_name) {
-       // Init message
-       $message = '';
-
-       // Is the extension not installed or just deactivated?
-       switch (isExtensionInstalled($ext_name)) {
-               case true; // Deactivated!
-                       $message = generateExtensionInactiveMessage($ext_name);
-                       break;
-
-               case false; // Not installed!
-                       $message = generateExtensionNotInstalledMessage($ext_name);
-                       break;
-
-               default: // Should not happen!
-                       logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid state of extension %s detected.", $ext_name));
-                       $message = sprintf("Invalid state of extension %s detected.", $ext_name);
-                       break;
-       } // END - switch
-
-       // Return the message
-       return $message;
-}
-
 // Reads a directory recursively by default and searches for files not matching
 // an exclusion pattern. You can now keep the exclusion pattern empty for reading
 // a whole directory.
@@ -3461,300 +2221,11 @@ function getMessageFromIndexedArray ($message, $pos, $array) {
        return $ret;
 }
 
-// Print code with line numbers
-function linenumberCode ($code)    {
-       if (!is_array($code)) $codeE = explode("\n", $code); else $codeE = $code;
-       $count_lines = count($codeE);
-
-       $r = 'Line | Code:<br />';
-       foreach($codeE as $line => $c) {
-               $r .= '<div class="line"><span class="linenum">';
-               if ($count_lines == 1) {
-                       $r .= 1;
-               } else {
-                       $r .= ($line == ($count_lines - 1)) ? '' :  ($line+1);
-               }
-               $r .= '</span>|';
-
-               // Add code
-               $r .= '<span class="linetext">' . encodeEntities($c) . '</span></div>';
-       }
-
-       return '<div class="code">' . $r . '</div>';
-}
-
 // Convert ';' to ', ' for e.g. receiver list
 function convertReceivers ($old) {
        return str_replace(';', ', ', $old);
 }
 
-// Determines the right page title
-function determinePageTitle () {
-       // Config and database connection valid?
-       if ((isConfigLocalLoaded()) && (isConfigurationLoaded()) && (SQL_IS_LINK_UP()) && (isExtensionInstalledAndNewer('sql_patches', '0.1.6'))) {
-               // Init title
-               $TITLE = '';
-
-               // Title decoration enabled?
-               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left')) . ' ';
-
-               // Do we have some extra title?
-               if (isExtraTitleSet()) {
-                       // Then prepent it
-                       $TITLE .= getExtraTitle() . ' by ';
-               } // END - if
-
-               // Add main title
-               $TITLE .= getConfig('MAIN_TITLE');
-
-               // Add title of module? (middle decoration will also be added!)
-               if ((getConfig('enable_mod_title') == 'Y') || ((!isWhatSet()) && (!isActionSet())) || (getModule() == 'admin')) {
-                       $TITLE .= ' ' . trim(getConfig('title_middle')) . ' ' . getModuleTitle(getModule());
-               } // END - if
-
-               // Add title from what file
-               $mode = '';
-               if (getModule() == 'login') $mode = 'member';
-               elseif (getModule() == 'index') $mode = 'guest';
-               if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= ' ' . trim(getConfig('title_middle')) . ' ' . getTitleFromMenu($mode, getWhat());
-
-               // Add title decorations? (right)
-               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != '')) $TITLE .= ' ' . trim(getConfig('title_right'));
-
-               // Remember title in constant for the template
-               $pageTitle = $TITLE;
-       } elseif ((isInstalled()) && (isAdminRegistered())) {
-               // Installed, admin registered but no ext-sql_patches
-               $pageTitle = '[-- ' . getConfig('MAIN_TITLE') . ' - ' . getModuleTitle(getModule()) . ' --]';
-       } elseif ((isInstalled()) && (!isAdminRegistered())) {
-               // Installed but no admin registered
-               $pageTitle = '{--SETUP_OF_MAILER--}';
-       } elseif ((!isInstalled()) || (!isAdminRegistered())) {
-               // Installation mode
-               $pageTitle = '{--INSTALLATION_OF_MAILER--}';
-       } else {
-               // Configuration not found!
-               $pageTitle = '{--NO_CONFIG_FOUND_TITLE--}';
-
-               // Do not add the fatal message in installation mode
-               if ((!isInstalling()) && (!isConfigurationLoaded())) addFatalMessage(__FUNCTION__, __LINE__, '{--NO_CONFIG_FOUND--}');
-       }
-
-       // Return title
-       return decodeEntities($pageTitle);
-}
-
-// Checks wethere there is a cache file there. This function is cached.
-function isTemplateCached ($template) {
-       // Do we have cached this result?
-       if (!isset($GLOBALS['template_cache'][$template])) {
-               // Generate FQFN
-               $FQFN = generateCacheFqfn($template);
-
-               // Is it there?
-               $GLOBALS['template_cache'][$template] = isFileReadable($FQFN);
-       } // END - if
-
-       // Return it
-       return $GLOBALS['template_cache'][$template];
-}
-
-// Flushes non-flushed template cache to disk
-function flushTemplateCache ($template, $eval) {
-       // Is this cache flushed?
-       if ((isDebuggingTemplateCache() === false) && (isTemplateCached($template) === false) && ($eval != '404')) {
-               // Generate FQFN
-               $FQFN = generateCacheFqfn($template);
-
-               // And flush it
-               writeToFile($FQFN, $eval, true);
-       } // END - if
-}
-
-// Reads a template cache
-function readTemplateCache ($template) {
-       // Check it again
-       if ((isDebuggingTemplateCache()) || (!isTemplateCached($template))) {
-               // This should not happen
-               debug_report_bug('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])) {
-               // Generate FQFN
-               $FQFN = generateCacheFqfn($template);
-
-               // And read from it
-               $GLOBALS['template_eval'][$template] = readFromFile($FQFN);
-       } // END - if
-
-       // And return it
-       return $GLOBALS['template_eval'][$template];
-}
-
-// Escapes quotes (default is only double-quotes)
-function escapeQuotes ($str, $single = false) {
-       // Should we escape all?
-       if ($single === true) {
-               // Escape all (including null)
-               $str = addslashes($str);
-       } else {
-               // Escape only double-quotes but prevent double-quoting
-               $str = str_replace("\\\\", "\\", str_replace('"', "\\\"", $str));
-       }
-
-       // Return the escaped string
-       return $str;
-}
-
-// Escapes the JavaScript code, prevents \r and \n becoming char 10/13
-function escapeJavaScriptQuotes ($str) {
-       // Replace all double-quotes and secure back-ticks
-       $str = str_replace('"', '\"', str_replace("\\", '{BACK}', $str));
-
-       // Return it
-       return $str;
-}
-
-// Send out mails depending on the 'mod/modes' combination
-// @TODO Lame description for this function
-function sendModeMails ($mod, $modes) {
-       // Load hash
-       if (fetchUserData(getMemberId())) {
-               // Extract salt from cookie
-               $salt = substr(getSession('u_hash'), 0, -40);
-
-               // Now let's compare passwords
-               $hash = encodeHashForCookie(getUserData('password'));
-
-               // Does the hash match or should we change it?
-               if (($hash == getSession('u_hash')) || (postRequestParameter('pass1') == postRequestParameter('pass2'))) {
-                       // Load the data
-                       $content = getUserDataArray();
-
-                       // Clear/init the content variable
-                       $content['message'] = '';
-
-                       // Which mail?
-                       // @TODO Move this in a filter
-                       switch ($mod) {
-                               case 'mydata':
-                                       foreach ($modes as $mode) {
-                                               switch ($mode) {
-                                                       case 'normal': break; // Do not add any special lines
-                                                       case 'email': // Email was changed!
-                                                               $content['message'] = '{--MEMBER_CHANGED_EMAIL--}' . ': ' . postRequestParameter('old_email') . "\n";
-                                                               break;
-
-                                                       case 'pass': // Password was changed
-                                                               $content['message'] = '{--MEMBER_CHANGED_PASS--}' . "\n";
-                                                               break;
-
-                                                       default:
-                                                               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown mode %s detected.", $mode));
-                                                               $content['message'] = '{--MEMBER_UNKNOWN_MODE--}' . ': ' . $mode . "\n\n";
-                                                               break;
-                                               } // END - switch
-                                       } // END - foreach
-
-                                       if (isExtensionActive('country')) {
-                                               // Replace code with description
-                                               $content['country'] = generateCountryInfo(postRequestParameter('country_code'));
-                                       } // END - if
-
-                                       // Merge content with data from POST
-                                       $content = merge_array($content, postRequestArray());
-
-                                       // Load template
-                                       $message = loadEmailTemplate('member_mydata_notify', $content, getMemberId());
-
-                                       if (getConfig('admin_notify') == 'Y') {
-                                               // The admin needs to be notified about a profile change
-                                               $message_admin = 'admin_mydata_notify';
-                                               $sub_adm   = '{--ADMIN_CHANGED_DATA--}';
-                                       } else {
-                                               // No mail to admin
-                                               $message_admin = '';
-                                               $sub_adm   = '';
-                                       }
-
-                                       // Set subject lines
-                                       $sub_mem = '{--MEMBER_CHANGED_DATA--}';
-
-                                       // Output success message
-                                       $content = '<span class="member_done">{--MYDATA_MAIL_SENT--}</span>';
-                                       break;
-
-                               default: // Unsupported module!
-                                       logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
-                                       $content = '<span class="member_failed">{--UNKNOWN_MODULE--}</span>';
-                                       break;
-                       } // END - switch
-               } else {
-                       // Passwords mismatch
-                       $content = '<span class="member_failed">{--MEMBER_PASSWORD_ERROR--}</span>';
-               }
-       } else {
-               // Could not load profile
-               $content = '<span class="member_failed">{--MEMBER_CANNOT_LOAD_PROFILE--}</span>';
-       }
-
-       // Send email to user if required
-       if ((!empty($sub_mem)) && (!empty($message))) {
-               // Send member mail
-               sendEmail($content['email'], $sub_mem, $message);
-       } // END - if
-
-       // Send only if no other error has occured
-       if (empty($content)) {
-               if ((!empty($sub_adm)) && (!empty($message_admin))) {
-                       // Send admin mail
-                       sendAdminNotification($sub_adm, $message_admin, $content, getMemberId());
-               } elseif (getConfig('admin_notify') == 'Y') {
-                       // Cannot send mails to admin!
-                       $content = '{--CANNOT_SEND_ADMIN_MAILS--}';
-               } else {
-                       // No mail to admin
-                       $content = '<span class="member_done">{--MYDATA_MAIL_SENT--}</span>';
-               }
-       } // END - if
-
-       // Load template
-       loadTemplate('admin_settings_saved', false, $content);
-}
-
-// Generates a 'selection box' from given array
-function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
-       // Start the output
-       $OUT = '<select name="' . $name . '" size="1" class="admin_select">
-<option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
-
-       // Walk through all options
-       foreach ($options as $option) {
-               // Add the <option> entry
-               if (empty($optionContent)) {
-                       // ... from template
-                       $OUT .= loadTemplate('select_' . $name . $extraName . '_option', true, $option);
-               } else {
-                       // Direct HTML code
-                       $OUT .= '<option value="' . $option[$optionValue] . '">' . $option[$optionContent] . '</option>';
-               }
-       } // END - foreach
-
-       // Finish selection box
-       $OUT .= '</select>';
-
-       // Prepare output
-       $content = array(
-               'selection_box' => $OUT,
-               'module'        => getModule(),
-               'what'          => getWhat()
-       );
-
-       // Load template and return it
-       return loadTemplate('select_' . $name . $extraName . '_box', true, $content);
-}
-
 // Get a module from filename and access level
 function getModuleFromFileName ($file, $accessLevel) {
        // Default is 'invalid';
@@ -3827,69 +2298,6 @@ function isSpider () {
        return ((strpos($userAgent, 'spider') !== false) || (strpos($userAgent, 'slurp') !== false) || (strpos($userAgent, 'bot') !== false) || (strpos($userAgent, 'archiver') !== false));
 }
 
-// Prepares the header for HTML output
-function loadHtmlHeader () {
-       // Run two filters:
-       // 1.) pre_page_header (mainly loads the page_header template and includes
-       //     meta description)
-       runFilterChain('pre_page_header');
-
-       // Here can be something be added, but normally one of the two filters
-       // around this line should do the job for you.
-
-       // 2.) post_page_header (mainly to load stylesheet, extra JavaScripts and
-       //     to close the head-tag)
-       // Include more header data here
-       runFilterChain('post_page_header');
-}
-
-// Adds page header and footer to output array element
-function addPageHeaderFooter () {
-       // Init output
-       $OUT = '';
-
-       // Add them all together. This is maybe to simple
-       foreach (array('page_header', 'output', 'page_footer') as $pagePart) {
-               // Add page part if set
-               if (isset($GLOBALS[$pagePart])) $OUT .= $GLOBALS[$pagePart];
-       } // END - foreach
-
-       // Transfer $OUT to 'output'
-       $GLOBALS['output'] = $OUT;
-}
-
-// Generates meta description for current module and 'what' value
-function generateMetaDescriptionCode () {
-       // Only include from guest area and if sql_patches has correct version
-       if ((getModule() == 'index') && (isExtensionInstalledAndNewer('sql_patches', '0.1.6'))) {
-               // Construct dynamic description
-               $DESCR = '{?MAIN_TITLE?} ' . trim(getConfig('title_middle')) . ' ' . getTitleFromMenu('guest', getWhat());
-
-               // Output it directly
-               $GLOBALS['page_header'] .= '<meta name="description" content="' . $DESCR . '" />';
-       } // END - if
-
-       // Remove depth
-       unset($GLOBALS['ref_level']);
-}
-
-// Generates an FQFN for template cache from the given template name
-function generateCacheFqfn ($template, $mode = 'html') {
-       // Is this cached?
-       if (!isset($GLOBALS['template_cache_fqfn'][$template])) {
-               // Generate the FQFN
-               $GLOBALS['template_cache_fqfn'][$template] = sprintf(
-                       "%s_compiled/%s/%s.tpl.cache",
-                       getConfig('CACHE_PATH'),
-                       $mode,
-                       $template
-               );
-       } // END - if
-
-       // Return it
-       return $GLOBALS['template_cache_fqfn'][$template];
-}
-
 // Function to search for the last modified file
 function searchDirsRecursive ($dir, &$last_changed, $lookFor = 'Date') {
        // Get dir as array
@@ -3927,21 +2335,6 @@ function searchDirsRecursive ($dir, &$last_changed, $lookFor = 'Date') {
        } // END - foreach
 }
 
-// "Fixes" null or empty string to count of dashes
-function fixNullEmptyToDashes ($str, $num) {
-       // Use str as default
-       $return = $str;
-
-       // Is it empty?
-       if ((is_null($str)) || (trim($str) == '')) {
-               // Set it
-               $return = str_repeat('-', $num);
-       } // END - if
-
-       // Return final string
-       return $return;
-}
-
 // Handles the braces [] of a field (e.g. value of 'name' attribute)
 function handleFieldWithBraces ($field) {
        // Are there braces [] at the end?
index eafdcb0..99e10a3 100644 (file)
@@ -663,8 +663,6 @@ addMessages(array(
        'PROFILE_NEVER_CHANGED' => "Sie haben noch nie eine Aenderung durchgefuehrt.",
        'PROFILE_UPDATED' => "Profildaten wurden ge&auml;ndert.",
        'SORT_BY' => "Sortieren:",
-       '_OTHERS' => "Andere",
-       '_ALL2' => "Alle",
        'WE_HAVE' => "Wir haben",
        'MEMBER_TEST_URL' => "Zur beworbenen Seite",
        'ADMIN_ENTER_REDIRECT_URL' => "URL eingeben, wenn abgelehnt werden soll",
index 6c75e6a..e9a5e8a 100644 (file)
@@ -291,7 +291,7 @@ function adminsEditAdminAccount ($postData) {
        $currMode = getAdminDefaultAcl(getCurrentAdminId());
 
        // Begin the edit loop
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach ($postData['sel'] as $id => $selected) {
                // Secure id number
                $id = bigintval($id);
@@ -305,7 +305,6 @@ function adminsEditAdminAccount ($postData) {
                        SQL_FREERESULT($result);
 
                        // Prepare some more data for the template
-                       $content['sw'] = $SW;
                        $content['id'] = $id;
 
                        // Shall we allow changing default ACL?
@@ -320,9 +319,8 @@ function adminsEditAdminAccount ($postData) {
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_edit_admins_row', true, $content);
-                       $SW = 3 - $SW;
-               }
-       }
+               } // END - if
+       } // END - foreach
 
        // Load template
        loadTemplate('admin_edit_admins', false, $OUT);
@@ -336,7 +334,7 @@ function adminsDeleteAdminAccount ($postData) {
        SQL_FREERESULT($result_main);
        if ($accounts > 1) {
                // Delete accounts
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach ($postData['sel'] as $id => $selected) {
                        // Secure id number
                        $id = bigintval($id);
@@ -352,14 +350,12 @@ function adminsDeleteAdminAccount ($postData) {
                                $content['la_mode'] = '{--ADMINS_' . strtoupper($content['la_mode']) . '_LA_SETTING--}';
 
                                // Prepare some more data
-                               $content['sw'] = $SW;
                                $content['id'] = $id;
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_del_admins_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
-               }
+                       } // END - if
+               } // END - foreach
 
                // Load template
                loadTemplate('admin_del_admins', false, $OUT);
@@ -397,20 +393,18 @@ function adminsRemoveAdminAccount ($postData) {
 function adminsListAdminAccounts() {
        // Select all admin accounts
        $result = SQL_QUERY("SELECT `id`, `login`, `email`, `default_acl` AS mode, `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `login` ASC", __FUNCTION__, __LINE__);
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Compile some variables
                $content['mode']    = '{--ADMINS_' . strtoupper($content['mode'])    . '_MODE--}';
                $content['la_mode'] = '{--ADMINS_' . strtoupper($content['la_mode']) . '_LA_SETTING--}';
 
                // Prepare some more data
-               $content['sw']         = $SW;
                $content['email_link'] = generateEmailLink($content['id'], 'admins');
 
                // Load row template and switch color
                $OUT .= loadTemplate('admin_list_admins_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
index a240988..dfe22f5 100644 (file)
@@ -155,9 +155,6 @@ function addBonusRanks ($data, $type, $userid) {
                // Start generating the ranking list
                $max = SQL_NUMROWS($result);
 
-               // Init variables
-               $SW = 2;
-
                // Output all ranks (levels)
                for ($rank = 1; $rank <= $max; $rank++) {
                        // Load data
@@ -195,13 +192,9 @@ LIMIT 1",
 
                        // Add more
                        $rows['rank'] = $rank;
-                       $rows['sw']   = $SW;
 
                        // Load row template
                        $OUT .= loadTemplate('member_bonus_turbo_row', true, $rows);
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END - for
 
                if ($self === false) {
index e24a3ea..ba8b290 100644 (file)
@@ -88,7 +88,7 @@ LIMIT %s",
 
        if (SQL_NUMROWS($result) > 0) {
                // List entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Rewrite userid/refid only if admin is in
                        // @TODO Can't this be moved into EL?
@@ -108,12 +108,10 @@ LIMIT %s",
                                'rid'      => $content['refid'],
                                'points'   => $content['points'],
                                'timemark' => generateDateTime($content['timemark'], $DT_MODE),
-                               'sw'       => $SW,
                        );
 
                        // Load template and switch color
                        $OUT .= loadTemplate($mode . '_doubler_list_rows', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index 1a1247e..ad261c9 100644 (file)
@@ -620,7 +620,7 @@ function doAdminNetworkProcessHandlenetworkForm () {
        // Do we have selections?
        if (countPostSelection() > 0) {
                // Something has been selected, so start displaying one by one
-               $SW = 2; $OUT = '';
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                        // Is this selected?
                        if ($sel == 1) {
@@ -629,9 +629,6 @@ function doAdminNetworkProcessHandlenetworkForm () {
 
                                // Do we have found the network?
                                if (count($networkData) > 0) {
-                                       // Add color
-                                       $networkData['sw'] = $SW;
-
                                        if (isFormSent('edit')) {
                                                // Make selection box for network_request_type
                                                $networkData['network_request_type'] = generateOptionList(
@@ -659,9 +656,6 @@ function doAdminNetworkProcessHandlenetworkForm () {
                                                // Problem!
                                                debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
-
-                                       // Switch colors
-                                       $SW = 3 - $SW;
                                } // END - if
                        } // END - if
                } // END - foreach
@@ -695,7 +689,7 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
                $networkData = getNetworkDataById(getRequestParameter('network'));
 
                // Something has been selected, so start displaying one by one
-               $SW = 2; $OUT = '';
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                        // Is this selected?
                        if ($sel == 1) {
@@ -704,9 +698,6 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
 
                                // Do we have found the network?
                                if (count($networkTypeData) > 0) {
-                                       // Add color
-                                       $networkTypeData['sw'] = $SW;
-
                                        if (isFormSent('edit')) {
                                                // Add row template for deleting
                                                $OUT .= loadTemplate('admin_edit_network_types_row', true, $networkTypeData);
@@ -717,9 +708,6 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
                                                // Problem!
                                                debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
-
-                                       // Switch colors
-                                       $SW = 3 - $SW;
                                } // END - if
                        } // END - if
                } // END - foreach
@@ -762,7 +750,7 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
                $networkData = getNetworkDataById(getRequestParameter('network'));
 
                // Something has been selected, so start displaying one by one
-               $SW = 2; $OUT = '';
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                        // Is this selected?
                        if ($sel == 1) {
@@ -771,9 +759,6 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
 
                                // Do we have found the network?
                                if (count($networkRequestData) > 0) {
-                                       // Add color
-                                       $networkRequestData['sw'] = $SW;
-
                                        if (isFormSent('edit')) {
                                                // Add options list for network type
                                                $networkRequestData['type_options'] = generateNetworkTypeOptions($networkRequestData['network_type_id']);
@@ -793,9 +778,6 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
                                                // Problem!
                                                debug_report_bug(__FUNCTION__, __LINE__, 'Cannot detect edit/del.');
                                        }
-
-                                       // Switch colors
-                                       $SW = 3 - $SW;
                                } // END - if
                        } // END - if
                } // END - foreach
index 811ff5f..ae30bab 100644 (file)
@@ -45,18 +45,17 @@ if (!defined('__SECURITY')) {
 // Displays all SQL queries with num rows, affected rows and timings
 function displayDebugSqls () {
        // Walk through all SQLs
-       $OUT = ''; $SW = 2; $i = 1;
+       $OUT = ''; $i = 1;
        foreach ($GLOBALS['debug_sqls'] as $content) {
                // Translate/add some data
-               $content['sw']       = $SW;
                $content['i']        = $i;
                $content['timing']   = translateComma($content['timing'] * 1000);
 
                // Load row template
                $OUT .= loadTemplate('admin_other_sqls_row', true, $content);
 
-               // Switch color
-               $SW = 3 - $SW; $i++;
+               // Count one up
+               $i++;
        } // END - foreach
 
        // Load main template
index 1e1139e..62bc2a0 100644 (file)
@@ -311,7 +311,6 @@ LIMIT 1",
 
        // Generate table
        $OUT = '';
-       $SW = 2;
        for ($idx = '0'; $idx < $prices; $idx++) {
                // Prepare marking of default (maybe current user's) id
                $start = ''; $end = '';
@@ -322,7 +321,6 @@ LIMIT 1",
 
                // Prepare content
                $content = array(
-                       'sw'     => $SW,
                        'idx'    => ($idx + 1),
                        'start'  => $start,
                        'end'    => $end,
@@ -333,7 +331,6 @@ LIMIT 1",
 
                // Load row template and switch color
                $OUT .= loadTemplate('guest_rallye_row', true, $content);
-               $SW = 3 - $SW;
        } // END - for
 
        // Add min_prices/users
@@ -712,7 +709,7 @@ function addReferalRallyeWinners ($rallye, $default=0) {
        $DATA = getArrayFromReferalRallyeUsers($rallye);
 
        // Generate table
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        for ($idx = '0'; $idx < $prices; $idx++) {
                // Check status
                //   active = 1: account is still confirmed
@@ -742,7 +739,6 @@ function addReferalRallyeWinners ($rallye, $default=0) {
 
                // Prepare content
                $content = array(
-                       'sw'     => $SW,
                        'idx'    => ($idx + 1),
                        'userid' => $DATA['userid'][$idx],
                        'ref'    => $DATA['ref'][$idx],
@@ -753,7 +749,6 @@ function addReferalRallyeWinners ($rallye, $default=0) {
 
                // Load row template
                $OUT .= loadTemplate('guest_rallye_row', true, $content);
-               $SW = 3 - $SW;
        } // END - for
 
        // Prepare content
index 46bca1b..89539ff 100644 (file)
@@ -89,12 +89,10 @@ function registerGenerateCategoryTable ($mode, $return=false) {
 
        if (SQL_NUMROWS($result) > 0) {
                // List alle visible modules (or all to the admin)
-               $SW = 2;
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare array for the template
                        $content = array(
-                               'sw'    => $SW,
                                'cat'   => $content['cat'],
                                'def_y' => '',
                                'def_n' => '',
@@ -110,8 +108,7 @@ function registerGenerateCategoryTable ($mode, $return=false) {
 
                        // Load template and switch color
                        $OUT .= loadTemplate('guest_cat_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - while
                $OUT .= '</table>';
 
                // Free memory
index 95e0082..dfdd7f2 100644 (file)
@@ -549,7 +549,7 @@ ORDER BY
 //
 function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
        // Init variables
-       $OUT = ''; $SW = 2;
+       $OUT = '';
 
        // Sadly this cannot be rewritten to a filter... :(
        foreach (getSqls() as $sqls) {
@@ -567,7 +567,6 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                        // Prepare array for output
                        $content = array(
                                'row_descr' => $DESCRs[$key],
-                               'row_sw'    => $SW,
                                'bottom'    => '',
                        );
 
@@ -583,9 +582,6 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
 
                        // And insert the final string into extras template
                        $OUT .= loadTemplate('admin_overview_task_rows', true, $content);
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END- foreach
        } // END - foreach
 
index d400066..4ef50c9 100644 (file)
@@ -49,7 +49,7 @@ function alpha ($sortby, $colspan, $return=false) {
        if (isGetRequestParameterSet('mode')) $add .= '&amp;mode='.getRequestParameter('mode');
 
        /* Creates the list of letters and makes them a link. */
-       $alphabet = explode(',', '{--_ALL2--}' . ',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,' . '{--_OTHERS--}');
+       $alphabet = 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,');
        $num = count($alphabet) - 1;
        $OUT = '';
        while (list($counter, $ltr) = each($alphabet)) {
@@ -101,7 +101,7 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) {
        elseif (isGetRequestParameterSet('mode')) $add .= '&amp;mode=' . getRequestParameter('mode');
 
        // Makes order by links..
-       if ($letter == 'front') $letter = '{--_ALL2--}';
+       if ($letter == 'front') $letter = '';
 
        // Prepare array with all possible sorters
        $list = array(
@@ -159,7 +159,7 @@ function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=fal
                if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
                        $OUT .= '<strong>-';
                } else {
-                       if (!isGetRequestParameterSet('letter')) setGetRequestParameter('letter', '{--_ALL2--}');
+                       if (!isGetRequestParameterSet('letter')) setGetRequestParameter('letter', '');
                        if (!isGetRequestParameterSet('sortby')) setGetRequestParameter('sortby', 'userid');
 
                        // Base link
index 6856083..d455f6c 100644 (file)
@@ -766,7 +766,7 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
 
 // Build a special template list
 function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $userid = 'userid') {
-       $OUT = ''; $SW = 2;
+       $OUT = '';
 
        // "Walk" through all entries
        foreach ($IDs as $id => $selected) {
@@ -805,18 +805,12 @@ function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions,
                                $content[$key] = handleExtraValues($filterFunctions[$idx], $value, $extraValues[$idx]);
                        } // END - foreach
 
-                       // Add color switching
-                       $content['sw'] = $SW;
-
                        // Then list it
                        $OUT .= loadTemplate(sprintf("admin_%s_%s_row",
                                $listType,
                                $table
                                ), true, $content
                        );
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END - if
 
                // Free the result
index 79df8a2..2a02b28 100644 (file)
@@ -132,7 +132,7 @@ ORDER BY
 function outputSeletectedTasks ($postData, $result_tasks) {
        if ((isset($postData['assign'])) && (count($postData['sel']) > 0)) {
                // Assign / do tasks
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach ($postData['sel'] as $id => $sel) {
                        $result_task = SQL_QUERY_ESC("SELECT
        `id`, `userid`, `task_type`, `subject`, `text`, `task_created`, `status`, `assigned_admin`
@@ -263,7 +263,6 @@ LIMIT 1",
 
                                // Prepare array for the template
                                $content = array(
-                                       'sw'           => $SW,
                                        'subject'      => $taskData['subject'],
                                        'add'          => $add,
                                        'text'         => $taskData['text'],
@@ -394,9 +393,6 @@ LIMIT 1",
 
                        // Free result
                        SQL_FREERESULT($result_task);
-
-                       // Switch colors
-                       $SW = 3 - $SW;
                } // END - foreach
 
                // Load final template
@@ -427,7 +423,7 @@ LIMIT 1",
                } // END - if
 
                // There are uncompleted jobs!
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result_tasks)) {
                        // Init infos
                        $content['infos'] = '';
@@ -452,7 +448,6 @@ LIMIT 1",
                        }
 
                        // Add/translate some content
-                       $content['sw']           = $SW;
                        $content['task_created'] = generateDateTime($content['task_created'], 2);
 
                        // Do we have extension task?
@@ -463,9 +458,6 @@ LIMIT 1",
                                // Load default row template
                                $OUT .= loadTemplate('admin_overview_list_rows', true, $content);
                        }
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index a26f5db..b4eb539 100644 (file)
@@ -58,7 +58,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
        // @TODO Kill all constants in this file
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
-       $cnt = '0'; $SW = 2;
+       $cnt = '0';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -72,7 +72,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                $data = array(
                                        'action' => adminAddMenuSelectionBox('admin', 'action', 'sel_action[' . $sel . ']', $data['action']),
                                        'what'   => adminAddMenuSelectionBox('admin', 'what'  , 'sel_what['   . $sel . ']', $data['what']),
-                                       'sw'     => $SW,
                                        'sel'    => $sel,
                                        'menu'   => $data['title'],
                                        'descr'  => $data['descr'],
@@ -84,7 +83,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        } else {
                                // Entry not found?
                                $data = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
 
@@ -94,7 +92,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Free result and switch color
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
                } // END - if
        } // END - foreach
 
@@ -109,7 +106,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
        $content['chk'] = countPostSelection();
 
        // Del menu entries with or without confirmation
-       $SW = 2; $cnt = '0'; $OUT = '';
+       $cnt = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -124,21 +121,18 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'menu' => $data['title'],
                                        'cnt'  => $cnt,
                                        'sel'  => $sel,
-                                       'sw'   => $SW
                                );
                                $OUT .= loadTemplate('admin_amenu_delete_row', true, $data);
                        } else {
                                // Entry not found?
                                $data = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $data);
                        }
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
-               }
-       }
+               } // END - if
+       } // END - switch
        $content['rows'] = $OUT;
        $content['cnt'] = $cnt;
 
index 753cf83..6873a58 100644 (file)
@@ -50,7 +50,7 @@ if (isFormSent('edit')) {
        if (countPostSelection() > 0) {
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
-               $SW = 2; $rows = '';
+               $rows = '';
                foreach (postRequestParameter('sel') as $template => $sel) {
                        // First of all load data from DB
                        $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
@@ -81,7 +81,6 @@ if (isFormSent('edit')) {
 
                        // Prepare content
                        $content['id']            = $id;
-                       $content['sw']            = $SW;
                        $content['mail_template'] = $template;
                        $content['admins']        = $adminsList;
 
@@ -95,8 +94,7 @@ if (isFormSent('edit')) {
 
                        // Start outputing line
                        $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Edit checked entries
                loadTemplate('admin_admins_mails_edit', false, $rows);
@@ -169,14 +167,10 @@ ORDER BY
                } // END - if
 
                // List found entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Prepare content
-                       $content['sw']   = $SW;
-
                        // Load row template
                        $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free result
index 55ccb05..4760a60 100644 (file)
@@ -57,11 +57,10 @@ ORDER BY
 
 if (SQL_NUMROWS($result) > 0) {
        // We have some (new?) registrations!
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare array for the row template
                $content = array(
-                       'sw'          => $SW,
                        'gender'      => $content['gender'],
                        'surname'     => $content['surname'],
                        'family'      => $content['family'],
@@ -74,8 +73,7 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load row template and switch color
                $OUT .= loadTemplate('admin_list_chk_reg_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - while
 
        // Load main template
        loadTemplate('admin_list_chk_reg', false, $OUT);
index 552a7b8..aee1399 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit ACLs
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Load data for the id
                $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
@@ -57,7 +57,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
 
                // Prepare data for the row template
                $content = array(
-                       'sw'               => $SW,
                        'id'               => $id,
                        'admins_selection' => generateOptionList('admins', 'id', 'login', $adminId, 'default_acl'),
                        'action_selection' => adminMenuSelectionBox_DEPRECATED('action', $action, $id),
@@ -75,8 +74,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
 
                // Load row template
                $OUT .= loadTemplate('admin_config_admins_edit_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - foreach
 
        // Load main template
        loadTemplate('admin_config_admins_edit', false, $OUT);
@@ -106,7 +104,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
        loadTemplate('admin_settings_saved', false, '{--ADMIN_ADMINS_ENTRIES_CHANGED--}');
 } elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete ACLs
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Load data for the id
                $result = SQL_QUERY_ESC("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
@@ -117,12 +115,8 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
                // Get admin mode
                $content['access_mode'] = '{--ADMINS_' . strtoupper($content['access_mode']) . '_MODE--}';
 
-               // Add color switch
-               $content['sw'] = $SW;
-
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_config_admins_del_row', true, $content);
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load main template
@@ -201,17 +195,13 @@ VALUES ('%s','%s','%s','%s')",
        // Entries found?
        if (SQL_NUMROWS($result_acls) > 0) {
                // List ACLs
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result_acls)) {
                        // Generate mode string
                        $content['access_mode'] = '{--ADMINS_' . strtoupper($content['access_mode']) . '_MODE--}';
 
-                       // Add color switch
-                       $content['sw'] = $SW;
-
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_config_admins_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index b2246e4..393d943 100644 (file)
@@ -113,7 +113,7 @@ if (isFormSent('add')) {
        } // END - if
 } elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete categories
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                // Load data of category
                $result = SQL_QUERY_ESC("SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
@@ -125,21 +125,19 @@ if (isFormSent('add')) {
 
                // Prepare data for the row template
                $content = array(
-                       'sw'  => $SW,
                        'id'  => $id,
                        'cat' => $cat,
                );
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_del_cats_row', true, $content);
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load main template
        loadTemplate('admin_del_cats', false, $OUT);
 } elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit categories
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                // Load data from the category
                $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
@@ -149,7 +147,6 @@ if (isFormSent('add')) {
 
                // Prepare data for the row template
                $content = array(
-                       'sw'   => $SW,
                        'id'   => $id,
                        'cat'  => $cat,
                        'vis'  => addSelectionBox('yn', $vis, 'vis', $id),
@@ -158,7 +155,6 @@ if (isFormSent('add')) {
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_edit_cats_row', true, $content);
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load main template
@@ -171,12 +167,11 @@ if (isFormSent('add')) {
        $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Init variables
-               $OUT = ''; $SW = 2;
+               $OUT = '';
 
                // List already existing categories for editing
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare data for the row template
-                       $content['sw']  = $SW;
                        $content['vis'] = translateYesNo($content['visible']);
 
                        // Put cat descriptions into variable for the selection box
@@ -186,7 +181,6 @@ if (isFormSent('add')) {
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_config_cats_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index f72905d..8af929b 100644 (file)
@@ -100,7 +100,7 @@ if (isPostRequestParameterSet(('add_max'))) {
        } // END - if
 } elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                // Load data
                $result = SQL_QUERY_ESC("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `id`=%s LIMIT 1",
@@ -108,20 +108,16 @@ if (isPostRequestParameterSet(('add_max'))) {
                $content = SQL_FETCHARRAY($result);
                SQL_FREERESULT($result);
 
-               // Add color switch
-               $content['sw'] = $SW;
-
                // Load row template and switch color
                $OUT .= loadTemplate('admin_config_email_del_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - foreach
        $content['rows'] = $OUT;
 
        // Load main template
        loadTemplate('admin_config_email_del', false, $content);
 } elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
                // Load data
                $result = SQL_QUERY_ESC("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `id`=%s LIMIT 1",
@@ -129,13 +125,9 @@ if (isPostRequestParameterSet(('add_max'))) {
                $content = SQL_FETCHARRAY($result);
                SQL_FREERESULT($result);
 
-               // Add color switch
-               $content['sw'] = $SW;
-
                // Load row template and switch color
                $OUT .= loadTemplate('admin_config_email_edit_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - foreach
        $content['rows'] = $OUT;
 
        // Load main template
@@ -145,14 +137,10 @@ if (isPostRequestParameterSet(('add_max'))) {
        __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List already existing entries for editing
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Prepare data for the row template
-                       $content['sw'] = $SW;
-
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_config_email_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index 610ddfd..f1bdde5 100644 (file)
@@ -83,7 +83,6 @@ WHERE `action`='main' AND `what` != '' AND `what` IS NOT NULL AND `locked`='N'
 ORDER BY `sort` ASC", __FILE__, __LINE__);
 
                // Init variables
-               $SW = 2;
                $OUT = '';
 
                // Process all entries
@@ -99,14 +98,10 @@ ORDER BY `sort` ASC", __FILE__, __LINE__);
                        } // END - if
 
                        // Prepare content
-                       $content['sw'] = $SW;
                        $content['link'] = $newHomeLink;
 
                        // Load row template
                        $OUT .= loadTemplate('admin_config_home_row', true, $content);
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
@@ -119,8 +114,7 @@ ORDER BY `sort` ASC", __FILE__, __LINE__);
        default: // Output selection table
                loadTemplate('admin_config_home_main');
                break;
-
-}
+} // END - switch
 
 // [EOF]
 ?>
index 62791b6..47ea2b3 100644 (file)
@@ -55,16 +55,10 @@ if (isFormSent()) {
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
                // Load all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Add more data
-                       $content['sw'] = $SW;
-
                        // Load row template
                        $OUT .= loadTemplate('admin_list_imprint_row', true, $content);
-
-                       // Switch color
-                       $SW = 3 - $SW;
                } // END - while
 
                // Transfer all rows to $content
index f5e8f3c..aad70b3 100644 (file)
@@ -49,7 +49,7 @@ if (isFormSent('edit')) {
        // Check if at least one module is selected
        if (countPostSelection() > 0) {
                // Output header
-               $OUT = ''; $SW = 2;
+               $OUT = '';
 
                // Edit selected modules
                foreach (postRequestParameter('sel') as $id => $sel) {
@@ -66,7 +66,6 @@ if (isFormSent('edit')) {
 
                        // Prepare array for the template
                        $content = array(
-                               'sw'     => $SW,
                                'mod'    => $data['module'],
                                'id'     => $id,
                                'title'  => $data['title'],
@@ -132,7 +131,7 @@ FROM
 ORDER BY
        `module` ASC', __FILE__, __LINE__);
 
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Reset title to --- if it is NULL
                if (($content['module'] == 'index') || ($content['module'] == 'login')) {
@@ -140,14 +139,8 @@ ORDER BY
                        $content['module'] = '<strong><a href="{%url=modules.php?module=admin&amp;what=stats_mods&amp;mod=' . $content['module'] . '%}">' . $content['module'] . '</a></strong>';
                } // END - if
 
-               // Prepare array for the template
-               $content['sw'] = $SW;
-
                // Load row template
                $OUT .= loadTemplate('admin_list_mods_row', true, $content);
-
-               // Switch colors
-               $SW = 3 - $SW;
        } // END - while
 
        // Free memory
index 810e489..640dc3a 100644 (file)
@@ -123,7 +123,7 @@ LIMIT 1",
                $message = '{--ADMIN_PAYOUT_ENTRIES_CHANGED--}';
        } else {
                $display = false; //Suppress any other outputs
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                        // Load data
                        $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE `id`=%s LIMIT 1",
@@ -133,7 +133,6 @@ LIMIT 1",
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'    => $SW,
                                'id'    => $id,
                                'title' => $title,
                                'rate'  => translateComma($rate),
@@ -143,8 +142,7 @@ LIMIT 1",
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_config_payouts_edit_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Load main template
                loadTemplate('admin_config_payouts_edit', false, $OUT);
@@ -168,7 +166,7 @@ LIMIT 1",
                $message = '{--ADMIN_PAYOUT_ENTRIES_DELETED--}';
        } else {
                $display = false; //Suppress any other outputs
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                        // Secure id number
                        $id = bigintval($id);
@@ -181,7 +179,6 @@ LIMIT 1",
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'    => $SW,
                                'id'    => $id,
                                'title' => $title,
                                'rate'  => translateComma($rate),
@@ -190,8 +187,7 @@ LIMIT 1",
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_config_payouts_del_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Load main template
                loadTemplate('admin_config_payouts_del', false, $OUT);
@@ -213,11 +209,10 @@ ORDER BY
 
 if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
        // List all payout types
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result_type)) {
                // Prepare data for the row template
                $content = array(
-                       'sw'           => $SW,
                        'id'           => $content['id'],
                        'from_account' => $content['from_account'],
                        'type'         => $content['type'],
@@ -227,7 +222,6 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
 
                // Load row template and switch color
                $OUT .= loadTemplate('admin_config_payouts_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Free memory
@@ -235,7 +229,7 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
 
        // Load main template
        loadTemplate('admin_config_payouts', false, $OUT);
-}
+} // END - if
 
 // Does your members request payouts?
 if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
index 06b6f2b..5a3bb69 100644 (file)
@@ -186,7 +186,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
        // 12                  3     32    2                  3     32    2               3            4     43    21
        if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
                // Delete entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
@@ -195,7 +195,6 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $id,
                                'level'    => $content['level'],
                                'percents' => translateComma($content['percents']),
@@ -203,14 +202,13 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_points_del_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Load main template
                loadTemplate('admin_points_del', false, $OUT);
        } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
                // Edit entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
@@ -219,7 +217,6 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $id,
                                'level'    => $content['level'],
                                'percents' => translateComma($content['percents']),
@@ -227,8 +224,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_points_edit_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Load main template
                loadTemplate('admin_points_edit', false, $OUT);
@@ -237,18 +233,16 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
                $result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
                if (SQL_NUMROWS($result) > 0) {
                        // Make referal levels editable and deletable
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
 
                        // List already existing categories for editing
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Prepare data for the row template
-                               $content['sw']       = $SW;
                                $content['percents'] = translateComma($content['percents']);
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_points_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
+                       } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
index 1c78c45..693e7f0 100644 (file)
@@ -123,7 +123,7 @@ LIMIT 1",
                // Check if at last one line is selected
                if (countPostSelection() > 0) {
                        // Make selected editable
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
                                // Load data to selected rallye
                                $result = SQL_QUERY_ESC("SELECT `rallye_id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
@@ -132,12 +132,10 @@ LIMIT 1",
                                SQL_FREERESULT($result);
 
                                // Add more content
-                               $content['sw']             = $SW;
                                $content['rallye_content'] = generateOptionList('rallye_data', 'id', 'title', $content['rallye_id']);
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_config_rallye_edit_row', true, $content);
-                               $SW = 3 - $SW;
                        } // END - foreach
 
                        // Remember row content
@@ -157,7 +155,7 @@ LIMIT 1",
                // Check if at last one line is selected
                if (countPostSelection() > 0) {
                        // List all prices
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
                                // Load data to selected rallye
                                $result = SQL_QUERY_ESC("SELECT `rallye_id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
@@ -165,12 +163,8 @@ LIMIT 1",
                                $content = SQL_FETCHARRAY($result);
                                SQL_FREERESULT($result);
 
-                               // Add color switch
-                               $content['sw'] = $SW;
-
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_config_rallye_del_row', true, $content);
-                               $SW = 3 - $SW;
                        } // END - foreach
                        $content['rows'] = $OUT;
 
@@ -191,14 +185,10 @@ LIMIT 1",
 
                if (SQL_NUMROWS($result) > 0) {
                        // Load all prices for the selected rallye
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
-                               // Add color switch
-                               $content['sw'] = $SW;
-
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_config_rallye_prices_row', true, $content);
-                               $SW = 3 - $SW;
                        } // END - while
 
                        // Free memory
@@ -233,11 +223,10 @@ ORDER BY
        d.start_time DESC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List found rallyes
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare data for the row template
                        $content = array(
-                               'sw'         => $SW,
                                'id'         => $content['id'],
                                'title'      => $content['title'],
                                'admin_id'   => $content['admin_id'],
@@ -248,7 +237,6 @@ ORDER BY
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_list_rallye_prices_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index 0744101..1c6792f 100644 (file)
@@ -66,20 +66,16 @@ if (isFormSent()) {
 
 // List all register values
 $result = SQL_QUERY("SELECT `id`, `field_name`, `field_required` FROM `{?_MYSQL_PREFIX?}_must_register` ORDER BY `id` ASC", __FILE__, __LINE__);
-$OUT = ''; $SW = 2;
+$OUT = '';
 while ($content = SQL_FETCHARRAY($result)) {
        // Get language string
        $content['field_name'] =  getMessage(strtoupper($content['field_name']));
 
        // Add more data
-       $content['sw']        = $SW;
        $content['selection'] = addSelectionBox('yn', $content['field_required'], 'sel[' . $content['id'] . ']');
 
        // @TODO Move this HTML code into a template
        $OUT .= loadTemplate('admin_config_register_row', true, $content);
-
-       // Switch color
-       $SW = 3 - $SW;
 } // END - while
 
 // Free memory
index c684f07..42104a1 100644 (file)
@@ -65,7 +65,7 @@ if (isFormSent()) {
 } else {
        // Load existing modules and generate TR rows for the template
        $result = SQL_QUERY("SELECT `module`, `title` FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY module", __FILE__, __LINE__);
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Already registered module?
                if (isInString($content['module'], getConfig('rewrite_skip'))) {
@@ -81,12 +81,10 @@ if (isFormSent()) {
                // Remember data in array for the dynamic row template
                $content['y_default'] = $y;
                $content['n_default'] = $n;
-               $content['sw']        = $SW;
 
                // Load template and switch colors
                $OUT .= loadTemplate('admin_config_rewrite_rows', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
index c48e0f3..0681df6 100644 (file)
@@ -75,10 +75,9 @@ ORDER BY
 $total = '0';
 if (SQL_NUMROWS($result) > 0) {
        // Output rows
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the row template
-               $content['sw']         = $SW;
                $content['time_trans'] = generateDateTime($content['time_trans'], 3);
 
                // Load row template
@@ -86,7 +85,6 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Sum points and switch colors
                $total += $content['points'];
-               $SW = 3 - $SW;
        } // END - while
 
        // Free memory
index f90c9c1..6cc821b 100644 (file)
@@ -100,14 +100,10 @@ LIMIT 1",
                loadTemplate('admin_settings_saved', false, $content);
        } else {
                // There are mail orders available
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Add color swapping
-                       $content['sw'] = $SW;
-
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_edit_email_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index eba3a14..d083042 100644 (file)
@@ -59,7 +59,7 @@ ORDER BY
        `timestamp` DESC";
 
 // Check for maximum pages
-$result_maximum = SQL_QUERY(, __FILE__, __LINE__);
+$result_maximum = SQL_QUERY($sql, __FILE__, __LINE__);
 
 // Set offset an current page to default values
 if (!isGetRequestParameterSet('page'))   setGetRequestParameter('page'  , 1);
@@ -85,7 +85,7 @@ if (SQL_NUMROWS($result) > 0) {
        $content['bottom_email_nav'] = addEmailNavigation($numPages, getConfig('mails_page'), false, 3, true);
 
        // List all entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($pool = SQL_FETCHARRAY($result)) {
                // Check sent mails and clicks
                $result_mails = SQL_QUERY_ESC("SELECT `max_rec`, `clicks` FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
@@ -101,7 +101,6 @@ if (SQL_NUMROWS($result) > 0) {
                $pool['unconfirmed'] = generateUnconfirmedAdminLink($pool['id'],  ($pool['max_rec'] - $pool['clicks']), 'mid');
 
                // Prepare data for the row template
-               $content['sw'] = $SW;
                $content['timestamp'] = generateDateTime($pool['timestamp'], 0);
 
                // Merge pool data with content
@@ -109,7 +108,6 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_email_archiv_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Remmber generated rows in array
index 9458da0..5c12d48 100644 (file)
@@ -116,7 +116,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                redirectToUrl('modules.php?module=admin&amp;what=extensions&amp;edited=' . countPostSelection());
        } else {
                // Edit selected entries
-               $SW = 2; $OUT = '';
+               $OUT = '';
                foreach (postRequestParameter('sel') as $ext_id => $sel) {
                        // Edit this extension?
                        if (($sel == 'Y') || ($sel != 'Y')) {
@@ -145,7 +145,6 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                                // Prepare data for the row template
                                $content = array(
-                                       'sw'     => $SW,
                                        'id'     => $ext_id,
                                        'name'   => getExtensionName($ext_id),
                                        'active' => addSelectionBox('yn', $active, 'active', $ext_id),
@@ -154,8 +153,7 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_extensions_edit_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
+                       } // END - if
                } // END - foreach
 
                // Load template
@@ -164,7 +162,7 @@ if (isGetRequestParameterSet('reg_ext')) {
        }
 } elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
        // List extensions and when verbose is enabled SQL statements which will be executed
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('sel') as $ext_id => $sel) {
                // Init variables
                $VERBOSE_OUT = '';
@@ -188,7 +186,6 @@ if (isGetRequestParameterSet('reg_ext')) {
 
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $ext_id,
                                'ext_name' => $ext_name,
                                'ext_ver'  => getExtensionVersion($ext_name),
@@ -200,14 +197,12 @@ if (isGetRequestParameterSet('reg_ext')) {
                } else {
                        // Prepare data for the row template
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $ext_id
                        );
 
                        // Not valid!
                        $OUT .= loadTemplate('admin_extensions_delete_row_404', true, $content);
                }
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load template
@@ -272,7 +267,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                // Are there some entries?
                if (SQL_NUMROWS($result) > 0) {
                        // Extensions are registered
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Prepare CSS selection output
                                $cssSelection = '---';
@@ -281,7 +276,6 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
                                // Prepare data for the row template
                                // @TODO Rewrite in template: id->ext_id,name->ext_name,active->ext_active,ver->ext_ver
                                $content = array(
-                                       'sw'      => $SW,
                                        'id'      => $content['ext_id'],
                                        'name'    => $content['ext_name'],
                                        'active'  => translateYesNo($content['ext_active']),
@@ -292,8 +286,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__);
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_extensions_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
+                       } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
index 6e80602..eb779a1 100644 (file)
@@ -59,7 +59,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
 
-       $cnt = '0'; $OUT = ''; $SW = 2;
+       $cnt = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -76,7 +76,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $DATA['action']),
                                        'what'   => adminAddMenuSelectionBox('guest', 'what'  , 'sel_what['   . $sel . ']', $DATA['what']),
                                        'menu'   => $DATA['title'],
-                                       'sw'     => $SW,
                                );
 
                                // Load row template
@@ -84,7 +83,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        } else {
                                // Entry not found
                                $DATA = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $DATA);
@@ -92,7 +90,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Free result and switch color
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
                } // END - if
        } // END - foreach
 
@@ -108,7 +105,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        $cnt = '0';
        $OUT = '';
-       $SW  = 2;
 
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
@@ -122,21 +118,18 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'cnt'  => $cnt,
                                        'menu' => $DATA['title'],
                                        'sel'  => $sel,
-                                       'sw'   => $SW,
                                );
                                $OUT .= loadTemplate('admin_gmenu_delete_row', true, $DATA);
                        } else {
                                // Entry not found?
                                $DATA = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $DATA);
                        }
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
-               }
-       }
+               } // END - if
+       } // END - foreach
        $content['rows'] = $OUT;
        $content['cnt']  = $cnt;
 
@@ -189,7 +182,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
        $content['chk'] = countPostSelection();
 
        // Load template
-       $SW = 2; $cnt = '0'; $OUT = '';
+       $cnt = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -202,7 +195,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'cnt'     => $cnt,
                                        'menu'    => $data['title'],
                                        'sel'     => $sel,
-                                       'sw'      => $SW,
                                        'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel),
                                        'locked'  => addSelectionBox('yn', $data['locked'] , 'locked' , $sel),
                                );
@@ -212,14 +204,12 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        } else {
                                // Entry not found?
                                $data = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $data);
                        }
 
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
                } // END - if
        } // END - foreach
        $content['cnt']  = $cnt;
@@ -278,7 +268,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                $content['sub'] = $SUB;
 
                // Init variables
-               $SW = 2;
                $cnt = '0';
                $OUT = '';
 
@@ -302,7 +291,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Prepapre content
                        $row = array(
-                               'sw'     => $SW,
                                'id'     => $data['id'],
                                'action' => $data['action'],
                                'what'   => $data['what'],
@@ -313,7 +301,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Load row template
                        $OUT .= loadTemplate('admin_menu_overview_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Add rows
index 027187b..aa8f843 100644 (file)
@@ -74,11 +74,10 @@ ORDER BY
 
 if (SQL_NUMROWS($result) > 0) {
        // Ok, we have found some inactive accounts
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the row template
                $content = array(
-                       'sw'          => $SW,
                        'userid'      => $content['userid'],
                        'gender'      => $content['gender'],
                        'surname'     => $content['surname'],
@@ -91,8 +90,7 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load row template
                $OUT .= loadTemplate('admin_list_autopurge_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
index 385b3c2..fb6f1e8 100644 (file)
@@ -89,14 +89,10 @@ ORDER BY
 // Is there at lease one package?
 if (SQL_NUMROWS($result) > 0) {
        // List all packages
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
-               // Add color switch
-               $content['sw']     = $SW;
-
                // Load row template
                $OUT .= loadTemplate('admin_list_bank_package_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Load main template
index f7d401e..5504a22 100644 (file)
@@ -75,7 +75,7 @@ ORDER BY
 
        if (SQL_NUMROWS($result) > 0) {
                // List users
-               $OUT = '';$SW = 2; $cnt = 1; $total = '0';
+               $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Init variables
                        $WIN1 = ''; $WIN2 = '';
@@ -94,7 +94,6 @@ ORDER BY
                                'gender'      => $content['gender'],
                                'turbo'       => $content['beg_points'],
                                'last_online' => generateDateTime($content['last_online'], 2),
-                               'sw'          => $SW,
                                'win1'        => $WIN1,
                                'win2'        => $WIN2,
                                'cnt'         => $cnt,
@@ -102,7 +101,7 @@ ORDER BY
 
                        // Load template and add it
                        $OUT .= loadTemplate('admin_list_beg_rows', true, $content);
-                       $SW = 3 - $SW; $cnt++; $total += $content['beg_points'];
+                       $cnt++; $total += $content['beg_points'];
                } // END - while
 
                $content['rows']  = $OUT;
index a2d500a..5b295dd 100644 (file)
@@ -93,7 +93,7 @@ ORDER BY
 
        if (SQL_NUMROWS($result) > 0) {
                // List users
-               $OUT = '';$SW = 2; $cnt = 1; $total = '0';
+               $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Add total points
                        $total += $content['points'];
@@ -109,14 +109,13 @@ ORDER BY
                        // Prepare content
                        $content['email']       = generateEmailLink($content['email'], 'user_data');
                        $content['last_online'] = generateDateTime($content['last_online'], 2);
-                       $content['sw']     = $SW;
                        $content['win1']   = $WIN1;
                        $content['win2']   = $WIN2;
                        $content['cnt']    = $cnt;
 
                        // Load template and add it
                        $OUT .= loadTemplate('admin_list_bonus_rows', true, $content);
-                       $SW = 3 - $SW; $cnt++;
+                       $cnt++;
                } // END - while
 
                $content['rows']  = $OUT;
index d8ba7c0..9659b0b 100644 (file)
@@ -62,7 +62,7 @@ if (isGetRequestParameterSet('userid')) {
 
                if (SQL_NUMROWS($result_cats) > 0) {
                        // List categories
-                       $cnt = 1; $OUT = ''; $SW = 2;
+                       $cnt = 1; $OUT = '';
                        while ($row = SQL_FETCHARRAY($result_cats)) {
                                // Merge both arrays
                                $content = merge_array($content, $row);
@@ -77,13 +77,12 @@ if (isGetRequestParameterSet('userid')) {
                                if (SQL_NUMROWS($result_user) == 1) $selection = '<font color="#00ee00">{--YES--}</div>';
 
                                // Add more elements
-                               $content['sw']  = $SW;
                                $content['cnt'] = $cnt;
                                $content['sel'] = $selection;
 
-                               // Load row template and switch colors + count up
+                               // Load row template and count up
                                $OUT .= loadTemplate('admin_list_cats_row', true, $content);
-                               $SW = 3 - $SW; $cnt++;
+                               $cnt++;
                        } // END - while
 
                        // Free memory
index f7c4fd1..fe0e6b9 100644 (file)
@@ -101,7 +101,7 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
                }
 
                // Edit all selected country codes
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('id') as $id => $status) {
                        // Load data from DB
                        $result = SQL_QUERY_ESC("SELECT code, descr FROM `{?_MYSQL_PREFIX?}_countries` WHERE `id`=%s LIMIT 1",
@@ -116,7 +116,6 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
                                        'id'    => $id,
                                        'code'  => $code,
                                        'descr' => $descr,
-                                       'sw'    => $SW,
                                );
 
                                if ($post == 'modify') {
@@ -129,9 +128,8 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
 
                                // Insert row template and switch color
                                $OUT .= loadTemplate($row, true, $content);
-                               $SW = 3 - $SW;
-                       }
-               }
+                       } // END - if
+               } // END - foreach
 
                // Prepare content for template
                $content = array(
@@ -179,16 +177,14 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
        __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // List all countries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare array for the template
                        $content['active'] = translateYesNo($content['is_active']);
-                       $content['sw']     = $SW;
 
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_list_country_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - while
 
                // Free memory
                SQL_FREERESULT($result);
index 414c89f..b6573bb 100644 (file)
@@ -59,11 +59,10 @@ ORDER BY
 
 if (SQL_NUMROWS($result) > 0) {
        // List all holiday requests
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the row template
                $content = array(
-                       'sw'          => $SW,
                        'id'          => $content['id'],
                        'userid'      => $content['userid'],
                        'start'       => generateDateTime($content['holiday_start'], 3),
@@ -75,7 +74,6 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Load row template and switch color
                $OUT .= loadTemplate('admin_list_holiday_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Free memory
index bbdfcd4..3d375c3 100644 (file)
@@ -83,7 +83,7 @@ if (isGetRequestParameterSet('userid')) {
                                loadTemplate('admin_settings_saved', false, '{--ADMIN_LINKS_DELETED--}');
                        } else {
                                // Init variables
-                               $OUT = ''; $SW = 2;
+                               $OUT = '';
 
                                // List all unconfirmed mails
                                // @TODO Find a way to rewrite this. See some lines above for different queries
@@ -126,7 +126,6 @@ if (isGetRequestParameterSet('userid')) {
 
                                                // Prepare data for the row template
                                                $content = array(
-                                                       'sw'        => $SW,
                                                        'link'      => $LINK,
                                                        'subject'   => $content['subject'],
                                                        'timestamp' => generateDateTime($content['timestamp'], 0),
@@ -139,15 +138,13 @@ if (isGetRequestParameterSet('userid')) {
                                                // Load template for error
                                                $OUT .= loadTemplate('admin_list_links_problem', true,
                                                        array(
-                                                               'sw'            => $SW,
                                                                'problem'       => $PROBLEM,
                                                                'data'          => $DATA
                                                        )
                                                );
                                        }
 
-                                       // Switch color and free result
-                                       $SW = 3 - $SW;
+                                       // Free result
                                        SQL_FREERESULT($result_data);
                                } // END - while
 
index dfc1bda..b37aee5 100644 (file)
@@ -106,11 +106,8 @@ ORDER BY
        // Do we have entries?
        if ($rows > 0) {
                // List all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
-                       // Add color switching
-                       $row['sw'] = $SW;
-
                        // Add it to network if the type matches selected
                        if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
                                // Matches, then add it for disabling this entry
@@ -119,7 +116,6 @@ ORDER BY
 
                        // Add row template and switch color
                        $OUT .= loadTemplate('admin_list_network_array_translation_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Prepare data for template
index a09cae1..5946800 100644 (file)
@@ -100,11 +100,8 @@ ORDER BY
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
                // List all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
-                       // Add color switching
-                       $row['sw'] = $SW;
-
                        // Add it to network if the type matches selected
                        if ($row['network_type_id'] == postRequestParameter('network_type_id')) {
                                // Matches, then add it for disabling this entry
@@ -116,7 +113,6 @@ ORDER BY
 
                        // Add row template and switch color
                        $OUT .= loadTemplate('admin_list_network_params_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Prepare data for template
index cd5edd0..d5a0dc7 100644 (file)
@@ -85,11 +85,8 @@ ORDER BY
        // Do we have entries?
        if ($rows > 0) {
                // List all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
-                       // Add color switching
-                       $row['sw'] = $SW;
-
                        // Add it to network if the type matches selected
                        if ($row['network_type_id'] == getRequestParameter('network_type_id')) {
                                // Matches, then add it for disabling this entry
@@ -98,7 +95,6 @@ ORDER BY
 
                        // Add row template and switch color
                        $OUT .= loadTemplate('admin_list_network_translations_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Prepare data for template
index c5a01a4..c6ca40c 100644 (file)
@@ -85,10 +85,9 @@ ORDER BY
        // Do we have entries?
        if (SQL_NUMROWS($result) > 0) {
                // List all entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add/translate some data
-                       $row['sw'] = $SW;
                        $row['network_type_banner_url'] = fixNullEmptyToDashes($row['network_type_banner_url'], 3);
 
                        // Set disabled entry
@@ -96,7 +95,6 @@ ORDER BY
 
                        // Add row template and switch color
                        $OUT .= loadTemplate('admin_list_network_types_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Prepare data for template
index 2d931e8..62123ad 100644 (file)
@@ -74,16 +74,10 @@ ORDER BY
 // Do we have entries?
 if (SQL_NUMROWS($result) > 0) {
        // List all
-       $SW = 2; $OUT = '';
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
-               // Add color switching
-               $content['sw'] = $SW;
-
                // Load row template
                $OUT .= loadTemplate('admin_list_networks_row', true, $content);
-
-               // Switch color
-               $SW = 3 - $SW;
        } // END - while
 
        // Load main template
index 23f72e3..2f5d98b 100644 (file)
@@ -235,7 +235,7 @@ ORDER BY
 
        if (SQL_NUMROWS($result) > 0) {
                // List found payouts
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        if ($content['status'] == 'NEW') {
                                // Generate links for direct accepting and rejecting
@@ -262,12 +262,10 @@ ORDER BY
                        } // END - if
 
                        // Add/Translate some data
-                       $content['sw']               = $SW;
                        $content['payout_timestamp'] = generateDateTime($content['payout_timestamp'], 2);
 
                        // Add row and switch color
                        $OUT .= loadTemplate('admin_list_payouts_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index 1d9c037..b49af4e 100644 (file)
@@ -58,10 +58,9 @@ ORDER BY
 // Are there some entries to display?
 if (SQL_NUMROWS($result) > 0) {
        // List all entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Translate some data and add color
-               $content['sw']                = $SW;
                $content['primera_timestamp'] = generateDateTime($content['primera_timestamp'], 2);
 
                // Fix empty message and status
@@ -69,7 +68,6 @@ if (SQL_NUMROWS($result) > 0) {
 
                // Append it and switch colors
                $OUT .= loadTemplate('admin_list_primera_row', true, $content);
-               $SW = 3 - $SW;
        } // END - while
 
        // Load main template
index 509f6d2..76bdd3e 100644 (file)
@@ -181,7 +181,7 @@ if (isFormSent('edit')) {
        // Check for selections
        if (countPostSelection() > 0) {
                // Make all selected and deactivated rallyes editable
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach (postRequestParameter('sel') as $id => $selected) {
                        // Load rallye basic data
                        $result = SQL_QUERY_ESC("SELECT
@@ -216,14 +216,10 @@ LIMIT 1",
 
                        // Remember other values
                        $content['templ']      = addReferalRallyeTemplateSelection('templ['.$id.']', $content['template']);
-                       $content['sw']         = $SW;
                        $content['id']         = $id;
 
                        // Output row
                        $OUT .= loadTemplate('admin_edit_rallyes_row', true, $content);
-
-                       // Color switching
-                       $SW = 3 - $SW;
                } // END - foreach
 
                // Load final template
@@ -244,7 +240,7 @@ ORDER BY
        `userid` ASC",
                array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                $content['rallye'] = getRequestParameter('rallye');
                while ($row = SQL_FETCHARRAY($result)) {
                        // Check for referal count
@@ -263,7 +259,6 @@ ORDER BY
 
                        // Prepare content
                        $row = array(
-                               'sw'      => $SW ,
                                'userid'  => $row['userid'],
                                'bold_l'  => $bl ,
                                'bold_r'  => $br ,
@@ -274,7 +269,6 @@ ORDER BY
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_list_rallye_usr_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Remember rows
@@ -303,7 +297,7 @@ ORDER BY
        // Records found?
        if (SQL_NUMROWS($result) > 0) {
                // List found rallyes
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($data = SQL_FETCHARRAY($result)) {
                        // Load admin login
                        $data['login'] = getAdminLogin($data['admin_id']);
@@ -326,7 +320,6 @@ ORDER BY
                                'admin_id'          => $data['admin_id'],
                                'login'             => $data['login'],
                                'id'                => $data['id'],
-                               'sw'                => $SW,
                                'title'             => $data['title'],
                                'template'          => $data['template'],
                                'users_content'     => $users,
@@ -385,7 +378,6 @@ ORDER BY
 
                        // Output row
                        $OUT .= loadTemplate('admin_list_rallyes_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index 227f507..70ab759 100644 (file)
@@ -75,11 +75,8 @@ ORDER BY
                // Are there some levels (VERY BAD IF NONE!)
                if (SQL_NUMROWS($result_levels) > 0) {
                        // List all ref levels or entries if no refback is installed
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        while ($levels = SQL_FETCHARRAY($result_levels)) {
-                               // Insert more data
-                               $levels['sw']    = $SW;
-
                                // Is the refback still active? ;-)
                                if (isExtensionActive('refback')) {
                                        // Load all refs of this user
@@ -97,7 +94,7 @@ ORDER BY
                                                $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), $menge, $menge_lck);
 
                                                // Init variables
-                                               $OUT_REFS = ''; $SW = 2;
+                                               $OUT_REFS = '';
 
                                                // Load all refs
                                                while ($content = SQL_FETCHARRAY($result_refs)) {
@@ -109,7 +106,6 @@ ORDER BY
                                                                // Prepare data for the template
                                                                // @TODO Try to rewrite some to EL
                                                                $content = array(
-                                                                       'sw'         => $SW,
                                                                        'userid'     => getUserData('userid'),
                                                                        'gender'     => getUserData('gender'),
                                                                        'refs_link'  => 0,
@@ -132,9 +128,6 @@ ORDER BY
 
                                                        // Add content
                                                        $levels['rows'] = $OUT_REFS;
-
-                                                       // Switch colors
-                                                       $SW = 3 - $SW;
                                                } // END - while
                                        } else {
                                                // Output info message
@@ -155,7 +148,6 @@ ORDER BY
 
                                        // Prepare data for the template
                                        $content = array(
-                                               'sw'         => $SW,
                                                'userid'     => $levels['userid'],
                                                'gender'     => $levels['gender'],
                                                'refs_link'  => 0,
@@ -171,9 +163,6 @@ ORDER BY
 
                                        // Load template for level one
                                        $OUT .= loadTemplate('admin_list_refs_row', true, $content);
-
-                                       // Switch colors
-                                       $SW = 3 - $SW;
                                }
                        } // END - while
 
index 72559cd..7a32072 100644 (file)
@@ -131,12 +131,11 @@ ORDER BY
 
        if (SQL_NUMROWS($result_main) > 0) {
                // At least one sponsor found!
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Transfer data to array
                        $content = array(
                                'id'              => $content['id'],
-                               'sw'              => $SW,
                                'gender'          => $content['gender'],
                                'surname'         => $content['surname'],
                                'family'          => $content['family'],
@@ -150,8 +149,7 @@ ORDER BY
 
                        // Load row template
                        $OUT .= loadTemplate('admin_list_sponsor_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - while
 
                // Free memory
                SQL_FREERESULT($result_main);
index b4636b9..3709b0f 100644 (file)
@@ -139,7 +139,7 @@ if (isFormSent('add')) {
        loadTemplate('admin_settings_saved', false, $message);
 } elseif ((isFormSent('edit')) || (isFormSent('del'))) {
        // Load all data
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach (postRequestParameter('id') as $id => $sel) {
                // Load entry
                $result = SQL_QUERY_ESC("SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
@@ -152,7 +152,6 @@ if (isFormSent('add')) {
                        // Transfer data to array
                        $content = array(
                                'id'   => bigintval($id),
-                               'sw'   => bigintval($SW),
                                'name' => htmlspecialchars($name),
                                'rate' => translateComma($rate),
                                'min'  => bigintval($min),
@@ -170,9 +169,6 @@ if (isFormSent('add')) {
                        // Entry invalid
                        $OUT .= loadTemplate('admin_list_sponsor_pay_404', true, $id);
                }
-
-               // Switch colors
-               $SW = 3 - $SW;
        } // END - foreach
 
        // Load main template depending on mode (edit/delete)
@@ -196,13 +192,12 @@ ORDER BY
        // Do we have some paytypes setup?
        if (SQL_NUMROWS($result) > 0) {
                // Prepare variables for listing
-               $OUT = ''; $SW = 2;
+               $OUT = '';
 
                // List alle found payment types
                while ($content = SQL_FETCHARRAY($result)) {
                        // Remember data in array
                        $content = array(
-                               'sw'       => $SW,
                                'id'       => $content['id'],
                                'name'     => $content['pay_name'],
                                'rate'     => translateComma($content['pay_rate']),
@@ -212,9 +207,6 @@ ORDER BY
 
                        // Add row
                        $OUT .= loadTemplate('admin_list_sponsor_pay_row', true, $content);
-
-                       // Switch colors
-                       $SW = 3 - $SW;
                } // END - while
 
                // Load list template
index c290840..3c9061a 100644 (file)
@@ -60,7 +60,7 @@ ORDER BY
 // Entries found?
 if (SQL_NUMROWS($result) > 0) {
        // List all entries
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate" some data
                $content['actions_action'] = getMessage(sprintf("MEMBER_SURFBAR_ACTION_%s_SUBMIT", $content['actions_action']));
@@ -74,14 +74,8 @@ if (SQL_NUMROWS($result) > 0) {
                        $content['actions_new_status'] = '{--SURFBAR_URL_STATUS_NONE--}';
                }
 
-               // Add color
-               $content['sw'] = $SW;
-
                // Load row template
                $OUT .= loadTemplate('admin_list_surfbar_actions_row', true, $content);
-
-               // Switch color
-               $SW = 3 - $SW;
        } // END - while
 
        // Load main template
index ed361f7..105a80b 100644 (file)
@@ -177,18 +177,14 @@ ORDER BY
 // Do we have some URLs left?
 if (SQL_NUMROWS($result) > 0) {
        // List all URLs
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate"/add content
-               $content['sw']              = $SW;
                $content['url_registered']  = generateDateTime($content['url_registered'], 2);
                $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
 
                // Load row template
                $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content);
-
-               // Switch color
-               $SW = 3 - $SW;
        } // END - while
 
        // Load main template
index f487a43..32469ca 100644 (file)
@@ -142,7 +142,7 @@ ORDER BY
                }
 
                // There are uncompleted jobs!
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result_tasks)) {
                        // Init infos
                        $content['infos'] = '';
@@ -169,7 +169,6 @@ ORDER BY
 
                        // Prepare content
                        $content = merge_array($content, array(
-                               'sw'            => $SW,
                                'assign_admin'  => $content['assigned_admin'],
                                'userid'        => $content['userid'],
                                'task_type_msg' => $content['task_type_msg'],
@@ -184,9 +183,6 @@ ORDER BY
                                // Load default row template
                                $OUT .= loadTemplate('admin_list_task_rows', true, $content);
                        }
-
-                       // Switch colors
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free memory
index fe7fea5..a66c6ac 100644 (file)
@@ -56,16 +56,15 @@ ORDER BY
 $total = '0';
 if (SQL_NUMROWS($result) > 0) {
        // Output rows
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the row template
-               $content['sw']          = $SW;
                $content['time_trans']  = generateDateTime($content['time_trans'], 3);
                $content['reason']      = wordwrap($content['reason'], 15);
 
                // Load row template add points and switch color
                $OUT .= loadTemplate('admin_list_transfer_row', true, $content);
-               $total += $content['points']; $SW = 3 - $SW;
+               $total += $content['points'];
        } // END - while
 
        // Free memory
index 0887f45..9ef88e5 100644 (file)
@@ -131,13 +131,12 @@ LIMIT %s",
 
                if ($unconfirmed > 0) {
                        // At least one link left to confirm
-                       $OUT = ''; $SW = 2;
+                       $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // User data found? We can take any field of u.
                                if (!is_null($content['status'])) {
                                        // Prepare data for the row template
                                        $content = array(
-                                               'sw'     => $SW,
                                                'userid' => $content['userid'],
                                                'link'   => $LINK,
                                                'id'     => $ID,
@@ -148,15 +147,9 @@ LIMIT %s",
                                        // Load row template and switch colors
                                        $OUT .= loadTemplate('admin_list_unconfirmed_row', true, $content);
                                } else {
-                                       // Insert color-switch
-                                       $content['sw'] = $SW;
-
                                        // No user data found
                                        $OUT .= loadTemplate('admin_list_unconfirmed_row_404', true, $content);
                                }
-
-                               // Switch color
-                               $SW = 3 - $SW;
                        } // END - while
 
                        // Render it in our new listing
index 3697eb4..3bd4aab 100644 (file)
@@ -86,9 +86,9 @@ if (isExtensionActive('country')) {
 }
 
 // Init unset data
-if (!isGetRequestParameterSet('letter')) { setGetRequestParameter('letter', '{--_ALL2--}'); }
-if (!isGetRequestParameterSet('sortby')) { setGetRequestParameter('sortby', 'userid');            }
-if (!isGetRequestParameterSet('page'))   { setGetRequestParameter('page'  , 1);                 }
+if (!isGetRequestParameterSet('letter')) { setGetRequestParameter('letter', '');       }
+if (!isGetRequestParameterSet('sortby')) { setGetRequestParameter('sortby', 'userid'); }
+if (!isGetRequestParameterSet('page'))   { setGetRequestParameter('page'  , 1);        }
 
 // Set base URL
 $base = '[<a href="{%url=modules.php?module=admin';
@@ -180,9 +180,9 @@ LIMIT 1",
        SQL_FREERESULT($result_user);
 } else {
        $whereStatement = '';
-       if ((getRequestParameter('letter') != getMessage('_ALL2')) && (getRequestParameter('letter') != getMessage('_OTHERS')) && (isGetRequestParameterSet('letter'))) {
+      &nbs