]> git.mxchange.org Git - mailer.git/commitdiff
New naming convention applied to many functions, see #118 for details
authorRoland Häder <roland@mxchange.org>
Fri, 3 Apr 2009 09:32:14 +0000 (09:32 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 3 Apr 2009 09:32:14 +0000 (09:32 +0000)
356 files changed:
DOCS/TODOs.txt
admin.php
agb.php
beg.php
birthday_confirm.php
click.php
confirm.php
css.php
debug.php
doubler.php
img.php
inc/autopurge.php
inc/autopurge/purge-general.php
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-tsks.php
inc/autopurge/purge-unconfirmed.php
inc/check-reset.php
inc/config-functions.php
inc/config.php
inc/databases.php
inc/db/lib-mysql3.php
inc/db/lib.php
inc/doubler_send.php
inc/extensions.php
inc/extensions/ext-admins.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-beg.php
inc/extensions/ext-birthday.php
inc/extensions/ext-bonus.php
inc/extensions/ext-cache.php
inc/extensions/ext-country.php
inc/extensions/ext-debug.php
inc/extensions/ext-doubler.php
inc/extensions/ext-holiday.php
inc/extensions/ext-html_mail.php
inc/extensions/ext-maintenance.php
inc/extensions/ext-mediadata.php
inc/extensions/ext-mydata.php
inc/extensions/ext-nickname.php
inc/extensions/ext-optimize.php
inc/extensions/ext-order.php
inc/extensions/ext-other.php
inc/extensions/ext-payout.php
inc/extensions/ext-rallye.php
inc/extensions/ext-register.php
inc/extensions/ext-rewrite.php
inc/extensions/ext-sponsor.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/extensions/ext-task.php
inc/extensions/ext-theme.php
inc/extensions/ext-transfer.php
inc/extensions/ext-user.php
inc/extensions/ext-yoomedia.php
inc/fatal_errors.php
inc/filters.php
inc/footer.php
inc/functions.php
inc/gen_mediadata.php
inc/gen_refback.php
inc/gen_sql_patches.php
inc/header.php
inc/inc-functions.php
inc/install-inc.php
inc/language.php
inc/libs/admins_functions.php
inc/libs/autopurge_functions.php
inc/libs/beg_functions.php
inc/libs/bonus_functions.php
inc/libs/cache_functions.php
inc/libs/country_functions.php
inc/libs/doubler_functions.php
inc/libs/holiday_functions.php
inc/libs/html_mail_functions.php
inc/libs/mediadata_functions.php
inc/libs/newsletter_functions.php
inc/libs/nickname_functions.php
inc/libs/online_functions.php
inc/libs/payout_functions.php
inc/libs/primera_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/register_functions.php
inc/libs/removeip_functions.php
inc/libs/rewrite_functions.php
inc/libs/security_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/task_functions.php
inc/libs/theme_functions.php
inc/libs/transfer_functions.php
inc/libs/user_functions.php
inc/libs/wernis_functions.php
inc/libs/yoomedia_functions.php
inc/load_cache.php
inc/load_extensions.php
inc/loader/load_cache-revision.php
inc/mails/beg_mails.php
inc/mails/birthday_mails.php
inc/mails/bonus_mails.php
inc/modules/admin.php
inc/modules/admin/action-
inc/modules/admin/action-admins.php
inc/modules/admin/action-bank.php
inc/modules/admin/action-country.php
inc/modules/admin/action-doubler.php
inc/modules/admin/action-email.php
inc/modules/admin/action-holiday.php
inc/modules/admin/action-login.php
inc/modules/admin/action-logout.php
inc/modules/admin/action-menu.php
inc/modules/admin/action-misc.php
inc/modules/admin/action-mods.php
inc/modules/admin/action-newsletter.php
inc/modules/admin/action-payouts.php
inc/modules/admin/action-primera.php
inc/modules/admin/action-rallye.php
inc/modules/admin/action-repair.php
inc/modules/admin/action-setup.php
inc/modules/admin/action-sponsor.php
inc/modules/admin/action-stats.php
inc/modules/admin/action-surfbar.php
inc/modules/admin/action-task.php
inc/modules/admin/action-theme.php
inc/modules/admin/action-transfer.php
inc/modules/admin/action-user.php
inc/modules/admin/action-wernis.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-add_points.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-add_surfbar_url.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-admins_add.php
inc/modules/admin/what-admins_contct.php
inc/modules/admin/what-admins_edit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-cache_stats.php
inc/modules/admin/what-chk_regs.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_autopurge.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_cache.php
inc/modules/admin/what-config_cats.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_email.php
inc/modules/admin/what-config_holiday.php
inc/modules/admin/what-config_home.php
inc/modules/admin/what-config_mediadata.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_newsletter.php
inc/modules/admin/what-config_order.php
inc/modules/admin/what-config_other.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_register2.php
inc/modules/admin/what-config_rewrite.php
inc/modules/admin/what-config_secure.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-config_transfer.php
inc/modules/admin/what-config_wernis.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-del_holiday.php
inc/modules/admin/what-del_sponsor.php
inc/modules/admin/what-del_transfer.php
inc/modules/admin/what-del_user.php
inc/modules/admin/what-edit_emails.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-email_details.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_doubler.php
inc/modules/admin/what-list_holiday.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_newsletter.php
inc/modules/admin/what-list_notifications.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_sponsor_pays.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-lock_sponsor.php
inc/modules/admin/what-lock_user.php
inc/modules/admin/what-logs.php
inc/modules/admin/what-maintenance.php
inc/modules/admin/what-memedit.php
inc/modules/admin/what-optimize.php
inc/modules/admin/what-overview.php
inc/modules/admin/what-payments.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-repair_amnu.php
inc/modules/admin/what-repair_cats.php
inc/modules/admin/what-repair_gmnu.php
inc/modules/admin/what-repair_mmnu.php
inc/modules/admin/what-send_bonus.php
inc/modules/admin/what-send_newsletter.php
inc/modules/admin/what-sub_points.php
inc/modules/admin/what-surfbar_stats.php
inc/modules/admin/what-theme_check.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-updates.php
inc/modules/admin/what-usage.php
inc/modules/admin/what-user_contct.php
inc/modules/admin/what-usr_online.php
inc/modules/chk_login.php
inc/modules/frametester.php
inc/modules/guest/action-
inc/modules/guest/action-admin.php
inc/modules/guest/action-main.php
inc/modules/guest/action-members.php
inc/modules/guest/action-online.php
inc/modules/guest/action-sponsor.php
inc/modules/guest/action-themes.php
inc/modules/guest/what-active.php
inc/modules/guest/what-admin.php
inc/modules/guest/what-beg.php
inc/modules/guest/what-confirm.php
inc/modules/guest/what-doubler.php
inc/modules/guest/what-login.php
inc/modules/guest/what-mediadata.php
inc/modules/guest/what-rallyes.php
inc/modules/guest/what-register.php
inc/modules/guest/what-sponsor_infos.php
inc/modules/guest/what-sponsor_login.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/guest/what-stats.php
inc/modules/guest/what-top10.php
inc/modules/guest/what-welcome.php
inc/modules/guest/what-wernis_portal.php
inc/modules/index.php
inc/modules/loader.php
inc/modules/login.php
inc/modules/member/action-
inc/modules/member/action-account.php
inc/modules/member/action-bank.php
inc/modules/member/action-extras.php
inc/modules/member/action-logout.php
inc/modules/member/action-main.php
inc/modules/member/action-order.php
inc/modules/member/action-rals.php
inc/modules/member/action-stats.php
inc/modules/member/action-surfbar.php
inc/modules/member/action-themes.php
inc/modules/member/what-
inc/modules/member/what-bank_create.php
inc/modules/member/what-bank_deposit.php
inc/modules/member/what-bank_infos.php
inc/modules/member/what-bank_output.php
inc/modules/member/what-bank_withdraw.php
inc/modules/member/what-beg.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-doubler.php
inc/modules/member/what-guest.php
inc/modules/member/what-holiday.php
inc/modules/member/what-html_mail.php
inc/modules/member/what-logout.php
inc/modules/member/what-mydata.php
inc/modules/member/what-newsletter.php
inc/modules/member/what-nickname.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php
inc/modules/member/what-primera.php
inc/modules/member/what-rallyes.php
inc/modules/member/what-refback.php
inc/modules/member/what-reflinks.php
inc/modules/member/what-reflist.php
inc/modules/member/what-sponsor.php
inc/modules/member/what-stats.php
inc/modules/member/what-support.php
inc/modules/member/what-surfbar_book.php
inc/modules/member/what-surfbar_list.php
inc/modules/member/what-surfbar_start.php
inc/modules/member/what-surfbar_stats.php
inc/modules/member/what-themes.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/modules/member/what-welcome.php
inc/modules/member/what-wernis.php
inc/modules/order.php
inc/modules/sponsor/account.php
inc/modules/sponsor/settings.php
inc/modules/sponsor/welcome.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/monthly/monthly_newsletter.php
inc/monthly/monthly_surfbar.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/patch-system.php
inc/pool-update.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/profile-updte.php
inc/request-functions.php
inc/reset/reset_daily.php
inc/reset/reset_holiday.php
inc/reset/reset_surfbar.php
inc/reset/reset_yoomedia.php
inc/security.php
inc/session-functions.php
inc/session.php
inc/stats_bonus.php
inc/stylesheet.php
inc/weekly/weekly_surfbar.php
index.php
install.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
templates/de/html/admin/admin_add_max.tpl
templates/de/html/admin/admin_list_sponsor_pay_edit_row.tpl
templates/de/html/admin/admin_send_bonus_form.tpl
templates/de/html/admin/admin_send_yoomedia.tpl
templates/de/html/index.tpl
templates/de/html/member/member_order_page2.tpl
templates/de/html/member/member_support_form.tpl
templates/de/html/member/member_welcome_header.tpl
templates/de/html/redirect_url.tpl
templates/de/html/task/task_ext_deactivated.tpl
view.php

index 7e0d7807544f8ed7fb8e636d91ea8086dd2e2059..eb4caf60323c04f9613f33991a7909684928f6be 100644 (file)
@@ -2,25 +2,28 @@
 ### DO NOT EDIT THIS FILE. ###
 ./beg.php:196:                         // @TODO Opps, what is missing here???
 ./inc/extensions/ext-sql_patches.php:705:                      // @TODO Rewrite this to a filter!
-./inc/extensions/ext-sql_patches.php:743:              // @TODO Can we remove this? setConfigEntry('verbose_sql'        , "N");
+./inc/extensions/ext-sql_patches.php:743:              // @TODO Can we remove this? setConfigEntry('verbose_sql'        , 'N');
 ./inc/extensions/ext-sql_patches.php:93:       /* @TODO SQL_ALTER_TABLE() should work now properly
+./inc/extensions/ext-surfbar.php:237:  // @TODO Set some constants we need???
 ./inc/extensions.php:343:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions.php:419:              // @TODO Extension is loaded, what next?
-./inc/functions.php:1239:      // @TODO Rewrite this unnice code
-./inc/functions.php:1300:      // @TODO Remove this if() block if all is working fine
-./inc/functions.php:1600:              // @TODO This can be, somehow, rewritten
-./inc/functions.php:2328:// @TODO Rewrite all language constants to this function.
-./inc/functions.php:249:                       // @TODO Fine all templates which are using these direct variables and rewrite them.
-./inc/functions.php:250:                       // @TODO After this step is done, this else-block is history
-./inc/functions.php:2575:                      $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')?
-./inc/functions.php:2577:                      // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')?
-./inc/functions.php:2649:      searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
-./inc/functions.php:2761:              // @TODO Add a little more infos here
-./inc/functions.php:2772:      // @TODO This cannot be rewritten to app_die(), try to find a solution for this.
-./inc/functions.php:2869:// @TODO Implement $compress
-./inc/functions.php:2876:// @TODO Implement $decompress
-./inc/functions.php:2987:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE()
-./inc/functions.php:465:// @TODO Rewrite this to an extension 'smtp'
+./inc/functions.php:1277:      // @TODO Rewrite this unnice code
+./inc/functions.php:1338:      // @TODO Remove this if() block if all is working fine
+./inc/functions.php:1638:              // @TODO This can be, somehow, rewritten
+./inc/functions.php:1991:      // @TODO eregi() should be rewritten here
+./inc/functions.php:2367:// @TODO Rewrite all language constants to this function.
+./inc/functions.php:248:                       // @TODO Fine all templates which are using these direct variables and rewrite them.
+./inc/functions.php:249:                       // @TODO After this step is done, this else-block is history
+./inc/functions.php:2614:                      $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')?
+./inc/functions.php:2616:                      // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')?
+./inc/functions.php:2677:// @TODO Please describe this function
+./inc/functions.php:2689:      searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
+./inc/functions.php:2801:              // @TODO Add a little more infos here
+./inc/functions.php:2812:      // @TODO This cannot be rewritten to app_die(), try to find a solution for this.
+./inc/functions.php:2909:// @TODO Implement $compress
+./inc/functions.php:2916:// @TODO Implement $decompress
+./inc/functions.php:3027:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:464:// @TODO Rewrite this to an extension 'smtp'
 ./inc/language/de.php:1156:// @TODO Rewrite these two constants
 ./inc/language/de.php:1172:// @TODO Rewrite these five constants
 ./inc/language/de.php:756:// @TODO The template 'admin_extensions_installed' is using this. But the template is no longer used.
@@ -38,8 +41,9 @@
 ./inc/libs/rallye_functions.php:661:                   // @TODO Rewrite this to a function
 ./inc/libs/rallye_functions.php:697:           // @TODO Rewrite this to our API function
 ./inc/libs/register_functions.php:53:          // @TODO Rewrite these constants
-./inc/libs/surfbar_functions.php:1425:         // @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:915:  // @TODO Invalid salt should be refused
+./inc/libs/register_functions.php:62:  // @TODO Rewrite these constants, too
+./inc/libs/surfbar_functions.php:1469:         // @TODO This can be somehow rewritten
+./inc/libs/surfbar_functions.php:942:  // @TODO Invalid salt should be refused
 ./inc/libs/task_functions.php:261:             // @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters
 ./inc/libs/user_functions.php:317:                     // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
 ./inc/load_extensions.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php           *
 ./inc/mails/birthday_mails.php:85:                     // @TODO 4 is hard-coded here, should we move it out in config?
 ./inc/modules/admin/admin-inc.php:343:         // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:394:                                 // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/admin/admin-inc.php:508:         // @TODO Rewrite these both constants
-./inc/modules/admin/admin-inc.php:534:         // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
-./inc/modules/admin/overview-inc.php:226:                              // @TODO Rewrite this to something with include files
-./inc/modules/admin/overview-inc.php:265:                                      // @TODO This may also be rewritten to include files
-./inc/modules/admin/overview-inc.php:268:                                      default: // @TODO Unknown support mode
-./inc/modules/admin/overview-inc.php:414:                      // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template
+./inc/modules/admin/admin-inc.php:390:                                 // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/admin/admin-inc.php:504:         // @TODO Rewrite these both constants
+./inc/modules/admin/admin-inc.php:530:         // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
+./inc/modules/admin/overview-inc.php:143:                              // @TODO Rewrite this to a filter
+./inc/modules/admin/overview-inc.php:230:                              // @TODO Rewrite this to something with include files
+./inc/modules/admin/overview-inc.php:269:                                      // @TODO This may also be rewritten to include files
+./inc/modules/admin/overview-inc.php:272:                                      default: // @TODO Unknown support mode
+./inc/modules/admin/overview-inc.php:418:                      // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template
 ./inc/modules/admin.php:257:   // @TODO Rewrite all these constants
 ./inc/modules/admin.php:94:                            // @TODO Why is this set to 'done'?
 ./inc/modules/admin/what-add_points.php:120:                   // @TODO Rewrite these both constants
@@ -74,9 +79,9 @@
 ./inc/modules/admin/what-config_cats.php:199:  // @TODO Rewrite this constant
 ./inc/modules/admin/what-config_mods.php:139:          // @TODO Rewritings: mod->module in template
 ./inc/modules/admin/what-config_mods.php:161:  // @TODO Rewrite this constant
-./inc/modules/admin/what-config_payouts.php:144:               // @TODO Rewrite this constant
-./inc/modules/admin/what-config_payouts.php:230:       // @TODO Rewrite this constant
-./inc/modules/admin/what-config_points.php:262:                                // @TODO Rewritings: lvl->level, per->percents in template
+./inc/modules/admin/what-config_payouts.php:145:               // @TODO Rewrite this constant
+./inc/modules/admin/what-config_payouts.php:231:       // @TODO Rewrite this constant
+./inc/modules/admin/what-config_points.php:269:                                // @TODO Rewritings: lvl->level, per->percents in template
 ./inc/modules/admin/what-config_rallye_prices.php:203:                         // @TODO Rewritings: level->price_level, infos->info in template
 ./inc/modules/admin/what-config_rallye_prices.php:220:                 // @TODO Rewrite these two constants
 ./inc/modules/admin/what-config_rallye_prices.php:248:                 // @TODO Rewritings: aid->admin_id, alogin->login in template
 ./inc/modules/admin/what-logs.php:72:                  // @TODO Fix content-type here
 ./inc/modules/admin/what-mem_add.php:120:                              // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-mem_add.php:78:               // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-memedit.php:255:              // @TODO Rewrite this constant
-./inc/modules/admin/what-memedit.php:291:              // @TODO Rewrite this constant
+./inc/modules/admin/what-memedit.php:252:              // @TODO Rewrite this constant
+./inc/modules/admin/what-memedit.php:288:              // @TODO Rewrite this constant
 ./inc/modules/admin/what-payments.php:154:                     // @TODO Rewritings: title->mail_title, pay->payment in template
 ./inc/modules/admin/what-refbanner.php:127:    // @TODO Rewrite this constant
 ./inc/modules/admin/what-refbanner.php:149:                    // @TODO Rewritings: alt->alternate,cnt->counter,clx->clicks in template
 ./inc/modules/guest/what-mediadata.php:186:// @TODO Rewrite these all if-blocks to filters
 ./inc/modules/guest/what-mediadata.php:49:// @TODO Rewrite all constants
 ./inc/modules/guest/what-mediadata.php:69:     // @TODO Find a better formular than this one
-./inc/modules/guest/what-register.php:201:     // @TODO Rewrite this to a single filter
-./inc/modules/guest/what-register.php:270:     // @TODO Rewrite this to a filter
+./inc/modules/guest/what-register.php:196:     // @TODO Rewrite these all to a single filter
+./inc/modules/guest/what-register.php:273:     // @TODO Rewrite this to a filter
 ./inc/modules/guest/what-sponsor_infos.php:67:         // @TODO Rewritings: conv->conv_rate,name->conv_name in template
 ./inc/modules/guest/what-sponsor_infos.php:87:                 // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency
 ./inc/modules/guest/what-sponsor_reg.php:284:          // @TODO Swap this HTML code to templates
 ./inc/modules/member/what-categories.php:112:          // @TODO Rewrite this to use $OUT .= ...
 ./inc/modules/member/what-order.php:411:                       // @TODO Rewrite this to a filter
 ./inc/modules/member/what-order.php:506:                                       // @TODO Rewrite this old lost code to a template
-./inc/modules/member/what-payout.php:131:                              // @TODO Rewritings: acc->target_account,bank->target_bank in templates
-./inc/modules/member/what-payout.php:147:                      // @TODO Rewrite this constant
-./inc/modules/member/what-payout.php:181:              // @TODO Rewrite these constants
-./inc/modules/member/what-payout.php:189:                              // @TODO Rewrite this constant
+./inc/modules/member/what-payout.php:132:                              // @TODO Rewritings: acc->target_account,bank->target_bank in templates
+./inc/modules/member/what-payout.php:148:                      // @TODO Rewrite this constant
+./inc/modules/member/what-payout.php:182:              // @TODO Rewrite these constants
+./inc/modules/member/what-payout.php:190:                              // @TODO Rewrite this constant
+./inc/modules/member/what-payout.php:235:                                      // @TODO Rewrite this to a filter
 ./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter?
 ./inc/modules/member/what-reflinks.php:105:            // @TODO Rewritings: alt->alternate,cnt->counter,cks->clicks,uid->userid in template
 ./inc/modules/member/what-transfer.php:116:                    // @TODO Rewrite all these constants to array elements
 ./inc/modules/member/what-transfer.php:364:    // @TODO Rewrite these constants
 ./inc/modules/member/what-transfer.php:451:    // @TODO Rewrite all these constants
 ./inc/modules/member/what-unconfirmed.php:134: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1528:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1571:          // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:173:                   // @TODO Nothing helped???
-./inc/mysql-manager.php:1745:                          // @TODO Find a way for updating $_CONFIG here
-./inc/mysql-manager.php:1769:          // @TODO Find a way for updating $_CONFIG here
-./inc/mysql-manager.php:1853:                  // @TODO Rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:2147:          // @TODO This can be somehow rewritten
-./inc/mysql-manager.php:617:   // @TODO Why is this global??? #100
-./inc/mysql-manager.php:946:                   // @TODO Why does this lead into an endless loop but we still need it???
-./inc/mysql-manager.php:947:                   // @TODO Commented out LOAD_URL('admin.php');
+./inc/mysql-manager.php:1549:                  // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1592:          // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1768:                          // @TODO Find a way for updating $_CONFIG here
+./inc/mysql-manager.php:1792:          // @TODO Find a way for updating $_CONFIG here
+./inc/mysql-manager.php:1815:// @TODO Can this be rewritten to a filter?
+./inc/mysql-manager.php:1877:                  // @TODO Rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:199:                   // @TODO Nothing helped???
+./inc/mysql-manager.php:2171:          // @TODO This can be somehow rewritten
+./inc/mysql-manager.php:513:   // @TODO Why is this global??? #100
+./inc/mysql-manager.php:947:                   // @TODO Why does this lead into an endless loop but we still need it???
+./inc/mysql-manager.php:948:                   // @TODO Commented out LOAD_URL('admin.php');
 ./mailid_top.php:208:                                                                  // @TODO Rewrite these blocks to filter
 ./surfbar.php:65:              // @TODO Display quick login form here or redirect as configured
 ### ### DEPRECATION FOLLOWS: ### ###
-./inc/functions.php:2338:              // @DEPRECATED Language array element found in BIG_LETTERS
-./inc/functions.php:2341:              // @DEPRECATED Deprecated constant found
-./inc/functions.php:234:       // @DEPRECATED Try to rewrite the if() condition
-./inc/functions.php:248:                       // @DEPRECATED
+./inc/functions.php:233:       // @DEPRECATED Try to rewrite the if() condition
+./inc/functions.php:2377:              // @DEPRECATED Language array element found in BIG_LETTERS
+./inc/functions.php:2380:              // @DEPRECATED Deprecated constant found
+./inc/functions.php:247:                       // @DEPRECATED
index d8c4f7cec6633a3aec73d533678b9e126cdb7ec7..61891e3b8a32a1e8cee0b1477ca4dec4f6cad1d6 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -55,14 +55,14 @@ if (isInstalled()) {
        // Is the admin logged-in and no sql_patches installed?
        if ((IS_ADMIN()) && (!EXT_IS_ACTIVE('sql_patches'))) {
                // Extension 'sql_patches' is missing!
-               LOAD_URL('modules.php?module=admin&amp;sql_patches=1');
+               redirectToUrl('modules.php?module=admin&amp;sql_patches=1');
        } else {
                // Default redirect
-               LOAD_URL('modules.php?module=admin');
+               redirectToUrl('modules.php?module=admin');
        }
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
diff --git a/agb.php b/agb.php
index a05c889d0b4e5986df3db0a3bc57bb389bc579fe..1c4a033e2f244cf1c8df4e7cf3f6b8400eeefec3 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -53,10 +53,10 @@ require('inc/config.php');
 // Is the script installed?
 if (isInstalled()) {
        // Simply redirect... :-)
-       LOAD_URL('modules.php?module=index&amp;what=agb');
+       redirectToUrl('modules.php?module=index&amp;what=agb');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
diff --git a/beg.php b/beg.php
index f849daf87ee1fc3486c4c6338457dc7fabf5cdde..da8503b9d4758131773d2b975d6d04bcae38033b 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -94,7 +94,7 @@ if (isInstalled()) {
                        list($uid, $clicks, $ref_payout, $status, $last) = SQL_FETCHROW($result);
 
                        // Account confirmed?
-                       if ($status == "CONFIRMED") {
+                       if ($status == 'CONFIRMED') {
                                // Secure userid
                                $uid = bigintval($uid);
 
@@ -107,7 +107,7 @@ if (isInstalled()) {
                                define('__BEG_UID'   , REQUEST_GET('uid'));
                                define('__BEG_CLICKS', ($clicks + 1));
                                define('__BEG_BANNER', LOAD_TEMPLATE("beg_banner", true));
-                               define('__BEG_POINTS', TRANSLATE_COMMA($points));
+                               define('__BEG_POINTS', translateComma($points));
                        } else {
                                // Other status
                                $uid = 0;
@@ -124,8 +124,8 @@ if (isInstalled()) {
                                array($uid), __FILE__, __LINE__);
 
                        // Check for last entry for userid w/o IP number
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND userid=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
-                               array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_beg_ips` WHERE (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_timeout').") OR (timeout > (UNIX_TIMESTAMP() - ".getConfig('beg_uid_timeout').") AND `userid`=%s)) AND (remote_ip='%s' OR sid='%s') LIMIT 1",
+                               array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                        // Entry not found, points set and not logged in?
                        if (((SQL_NUMROWS($result) == 0) || (IS_ADMIN())) && ($points > 0) && (!IS_MEMBER()) && (getConfig('beg_pay_mode') == "NONE")) {
@@ -136,7 +136,7 @@ if (isInstalled()) {
                                        // but only when there is no admin begging.
                                        // Admins shall be able to test it!
                                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_beg_ips` (userid, remote_ip,sid, timeout) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
-                                               array($uid, GET_REMOTE_ADDR(), session_id()), __FILE__, __LINE__);
+                                               array($uid, detectRemoteAddr(), session_id()), __FILE__, __LINE__);
 
                                        // Was is successfull?
                                        if (SQL_AFFECTEDROWS() == 1) {
@@ -152,7 +152,7 @@ if (isInstalled()) {
                                if ($pay === true) {
                                        // Add points to user or begging rallye account
                                        if (BEG_ADD_POINTS($uid, $points)) {
-                                               // Set "done" message
+                                               // Set 'done' message
                                                define('__BEG_MSG', LOAD_TEMPLATE("beg_done", true));
                                        } else {
                                                // Error!
@@ -185,7 +185,7 @@ if (isInstalled()) {
                        SQL_FREERESULT($result);
 
                        // Include header
-                       LOAD_INC_ONCE('inc/header.php');
+                       loadIncludeOnce('inc/header.php');
 
                        // Load final template
                        LOAD_TEMPLATE("beg_link");
@@ -205,11 +205,11 @@ if (isInstalled()) {
                        }
 
                        // Include footer
-                       LOAD_INC_ONCE('inc/footer.php');
-               } elseif (($status != "CONFIRMED") && ($status != "failed")) {
+                       loadIncludeOnce('inc/footer.php');
+               } elseif (($status != 'CONFIRMED') && ($status != "failed")) {
                        // Maybe locked/unconfirmed account?
-                       $msg = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
-               } elseif (($uid == "0") || ($status == "failed")) {
+                       $msg = generateErrorCodeFromUserStatus($status);
+               } elseif (($uid == '0') || ($status == "failed")) {
                        // Inalid or locked account, so let's find out
                        $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
                                array(REQUEST_GET('uid')), __FILE__, __LINE__);
@@ -229,14 +229,14 @@ if (isInstalled()) {
                }
 
                // Reload to index module
-               if ((!empty($msg)) && (!empty($msg))) LOAD_URL('modules.php?module=index&amp;msg='.$msg.'&amp;ext=beg');
+               if ((!empty($msg)) && (!empty($msg))) redirectToUrl('modules.php?module=index&amp;msg='.$msg.'&amp;ext=beg');
        } else {
                // No userid entered
-               LOAD_URL('modules.php?module=index');
+               redirectToUrl('modules.php?module=index');
        }
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index 3d71b7971e9280b479f4562a366feb29e6f36a04..ff57185dad0691d6157e012fd72e637917f068e9 100644 (file)
@@ -68,7 +68,7 @@ INNER JOIN `{!_MYSQL_PREFIX!}_user_data` AS d
 ON b.userid=d.userid
 WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
  array($uid, $chk), __FILE__, __LINE__);
-       //* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk)."/".strlen(REQUEST_GET('check'))."/".SQL_NUMROWS($result).")<br />\n";
+       //* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")<br />\n";
 
        // Is an entry there?
        if (SQL_NUMROWS($result) == 1) {
@@ -96,16 +96,16 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
                                array($uid, $chk), __FILE__, __LINE__);
 
                        // Transfer data to constants for the template
-                       define('__GENDER', TRANSLATE_GENDER($data['gender']));
+                       define('__GENDER', translateGender($data['gender']));
                        define('__SNAME' , $data['surname']);
                        define('__FNAME' , $data['family']);
-                       define('__GIFT'  , TRANSLATE_COMMA($data['points']));
+                       define('__GIFT'  , translateComma($data['points']));
 
                        // Load message from template
                        define('__MSG', LOAD_TEMPLATE('birthday_msg', true));
                } else {
                        // Unconfirmed / locked accounts cannot get points
-                       define('__MSG', sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), TRANSLATE_STATUS($data['status'])));
+                       define('__MSG', sprintf(getMessage('BIRTHDAY_CANNOT_STATUS'), translateUserStatus($data['status'])));
                }
        } else {
                // Cannot load data!
@@ -119,7 +119,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
        $GLOBALS['module'] = 'birthday_confirm';
 
        // Include header
-       LOAD_INC('inc/header.php');
+       loadInclude('inc/header.php');
 
        // Load birthday header template (for your banners, e.g.?)
        define('__BIRTHDAY_HEADER', LOAD_TEMPLATE('birthday_header', true));
@@ -131,10 +131,10 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
        LOAD_TEMPLATE('birthday_confirm');
 
        // Include footer
-       LOAD_INC('inc/footer.php');
+       loadInclude('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index d5addc6764a04728c29f8f502a6a7c6aaa6f6c6a..82ec364614da31412b9e8e6f17eab7e4a45d979d 100644 (file)
--- a/click.php
+++ b/click.php
@@ -52,18 +52,18 @@ require('inc/config.php');
 
 if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
        // Update clicks counter...
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET clicks=clicks+1 WHERE id=%s LIMIT 1", array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET clicks=clicks+1 WHERE `id`=%s LIMIT 1", array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
        if (SQL_AFFECTEDROWS() == 1) {
                if (REQUEST_ISSET_GET(('user'))) {
-                       LOAD_URL('ref.php?refid=' . bigintval(REQUEST_GET('user')));
+                       redirectToUrl('ref.php?refid=' . bigintval(REQUEST_GET('user')));
                } elseif (REQUEST_ISSET_GET(('reseller'))) {
-                       LOAD_URL('shop_reseller.php?reseller=' . bigintval(REQUEST_GET('reseller')));
+                       redirectToUrl('shop_reseller.php?reseller=' . bigintval(REQUEST_GET('reseller')));
                }
        } // END - if
 } // END - if
 
 // Load index page
-LOAD_URL('index.php');
+redirectToUrl('index.php');
 
 // Shutdown
 shutdown();
index 3ca3a5e3be0e1309f87b7b9c349f6bad1bc09208..5caeae5be70579bb70b1feafa25a7e99b2961782 100644 (file)
@@ -63,10 +63,10 @@ if ((isInstalled()) && (isAdminRegistered())) {
        }
 
        // Load the URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
diff --git a/css.php b/css.php
index 3babf5ce26356ea6ac7d5ba34e340fc4d475ea06..2c9c3369f8537fb88a85566ecb8192d065fcb644 100644 (file)
--- a/css.php
+++ b/css.php
@@ -57,13 +57,13 @@ header('Content-type: text/css');
 require('inc/config.php');
 
 // Load header
-LOAD_INC('inc/header.php');
+loadInclude('inc/header.php');
 
 // Load CSS code
-LOAD_INC('inc/stylesheet.php');
+loadInclude('inc/stylesheet.php');
 
 // Load footer
-LOAD_INC('inc/footer.php');
+loadInclude('inc/footer.php');
 
 //
 ?>
index 39248d2dfdef003bf8f0dd1367fddaf8598d5973..654823a20c2fadaffccad19b1deaf06ab6ddbf96 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -69,9 +69,9 @@ if ((isInstalled()) && (getTotalFatalErrors() == 0)) {
                        );
 
                        // Is the module there? Else we log it!
-                       if (INCLUDE_READABLE($INC)) {
+                       if (isIncludeReadable($INC)) {
                                // Load the request module
-                               LOAD_INC($INC);
+                               loadInclude($INC);
                        } else {
                                // Missing request file, may happen while development
                                DEBUG_ABUSE_LOG(__FILE__, __LINE__, 'request_404', REQUEST_POST('request'));
index 189925ac4c8dcbadcdc2bd3afcb710d65e743083..04f02e81777df69a4703cffebe204c52cdca11d1 100644 (file)
@@ -120,7 +120,7 @@ if (isInstalled()) {
                        SQL_FREERESULT($result);
 
                        // Remove any dots and unwanted chars from the points
-                       REQUEST_SET_POST('points', bigintval(round(REVERT_COMMA(REQUEST_POST('points')))));
+                       REQUEST_SET_POST('points', bigintval(round(convertCommaToDot(REQUEST_POST('points')))));
 
                        // Probe for enough points
                        $probe_points = ((REQUEST_POST('points') >= getConfig('doubler_min')) && (REQUEST_POST('points') <= getConfig('doubler_max')));
@@ -137,7 +137,7 @@ if (isInstalled()) {
                                if (($points - getConfig('doubler_left') - REQUEST_POST('points') * getConfig('doubler_charge')) >= 0) 
                                        // Enough points are left so let's continue with the doubling process
                                        // Create doubling "account" width *DOUBLED* points
-                                       SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".GET_REMOTE_ADDR()."', UNIX_TIMESTAMP(), 'N','N')",
+                                       SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s','%s','%s','".detectRemoteAddr()."', UNIX_TIMESTAMP(), 'N','N')",
                                                array($uid, bigintval($GLOBALS['refid']), bigintval(REQUEST_POST('points') * 2)), __FILE__, __LINE__);
 
                                        // Subtract entered points
@@ -145,13 +145,13 @@ if (isInstalled()) {
 
                                        // Add points to "total payed" including charge
                                        $points = REQUEST_POST('points') - REQUEST_POST('points') * getConfig('doubler_charge');
-                                       UPDATE_CONFIG('doubler_points', $points, '+');
+                                       updateConfiguration('doubler_points', $points, '+');
                                        incrementConfigEntry('doubler_points', $points);
 
                                        // Add second line for the referal but only when uid != refid
                                        if (($GLOBALS['refid'] > 0) && ($GLOBALS['refid'] != $uid)) {
                                                // Okay add a refid line and apply refid percents
-                                               SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s',0,'%s','".GET_REMOTE_ADDR()."',UNIX_TIMESTAMP(),'N','Y')",
+                                               SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_doubler` (userid, refid, points, remote_ip, timemark, completed, is_ref) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')",
                                                        array(
                                                                bigintval($GLOBALS['refid']),
                                                                bigintval(REQUEST_POST('points') * 2 * getConfig('doubler_ref'))
@@ -161,7 +161,7 @@ if (isInstalled()) {
                                        } // END - if
 
                                        // Update usage counter
-                                       UPDATE_CONFIG('doubler_counter', 1, '+');
+                                       updateConfiguration('doubler_counter', 1, '+');
 
                                        // Set constant
                                        define('__DOUBLER_MSG', LOAD_TEMPLATE('doubler_reflink', true, REQUEST_POST('userid')));
@@ -208,10 +208,10 @@ if (isInstalled()) {
        if (!defined('__ERROR_MSG'))   define('__ERROR_MSG'  , '');
 
        // Shall I check for points immediately?
-       if (getConfig('doubler_send_mode') == 'DIRECT') LOAD_INC('inc/doubler_send.php');
+       if (getConfig('doubler_send_mode') == 'DIRECT') loadInclude('inc/doubler_send.php');
 
        // Output header
-       LOAD_INC('inc/header.php');
+       loadInclude('inc/header.php');
 
        // Banner in text
        define('__DOUBLER_BANNER', LOAD_TEMPLATE('doubler_banner', true));
@@ -229,11 +229,11 @@ if (isInstalled()) {
        }
 
        // Percent values etc.
-       define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
-       define('__REF_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
-       define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
-       define('__MIN_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_min')));
-       define('__MAX_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_max')));
+       define('__CHARGE_VALUE', translateComma(getConfig('doubler_charge') * 100));
+       define('__REF_VALUE'   , translateComma(getConfig('doubler_ref') * 100));
+       define('__TOTAL_VALUE' , translateComma(getConfig('doubler_points')));
+       define('__MIN_VALUE'   , translateComma(getConfig('doubler_min')));
+       define('__MAX_VALUE'   , translateComma(getConfig('doubler_max')));
 
        // Text "Enter login"
        if (EXT_IS_ACTIVE('nickname')) {
@@ -260,22 +260,22 @@ if (isInstalled()) {
        define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE('0', 'Y', 'N', 'DESC'));
 
        // Generate timemark
-       define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
+       define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
 
        // Usage counter
        define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
 
        // Points left to doubler
-       define('__LEFT_VALUE', TRANSLATE_COMMA(DOUBLER_GET_TOTAL_POINTS_LEFT()));
+       define('__LEFT_VALUE', translateComma(DOUBLER_GET_TOTAL_POINTS_LEFT()));
 
        // Output neccessary form for this
        LOAD_TEMPLATE('doubler_index');
 
        // Output footer
-       LOAD_INC('inc/footer.php');
+       loadInclude('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
diff --git a/img.php b/img.php
index cac96c66482c8a305e8c7f9734658af0f7be18a2..351b7e1137221a00a5a15b713770d38c7f17be3f 100644 (file)
--- a/img.php
+++ b/img.php
@@ -53,7 +53,7 @@ require('inc/config.php');
 // Script installed?
 if (isInstalled()) {
        // Load header
-       LOAD_INC_ONCE('inc/header.php');
+       loadIncludeOnce('inc/header.php');
 
        // Code set?
        if (REQUEST_ISSET_GET(('code'))) {
@@ -66,17 +66,17 @@ if (isInstalled()) {
                );
 
                // Include is readable?
-               if (INCLUDE_READABLE($INC)) {
+               if (isIncludeReadable($INC)) {
                        // Include it
-                       LOAD_INC($INC);
+                       loadInclude($INC);
                } // END - if
        }
 
        // Finish generation here
-       LOAD_INC_ONCE('inc/footer.php');
+       loadIncludeOnce('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index fc56479628fcb886bf170b83f7e64502ca766fda..5f2af6265f74bf608ea741f66e7c2d5923e4613f 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
 
 // Init & set the include pool
 INIT_INC_POOL();
-SET_INC_POOL(GET_DIR_AS_ARRAY('inc/autopurge/', 'purge-'));
+SET_INC_POOL(getArrayFromDirectory('inc/autopurge/', 'purge-'));
 
 // Run the filter
 runFilterChain('load_includes');
index acaacc33ffa7c3619f7ddfbd13d83ec6ff52a8b5..0e4d9ee5220422bc05a53fd82a774c00206ccef7 100644 (file)
@@ -71,7 +71,7 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
                $uid = 0; $points = 0;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Check if confirmation links are purged or not
-                       $result_links = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s LIMIT 1",
+                       $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s LIMIT 1",
                                array(bigintval($content['id'])), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result_links) == 1) {
                                // Free memory
@@ -92,7 +92,7 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
                                        array(bigintval($content['id'])), __FILE__, __LINE__, false));
 
                                // Update status of order
-                               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='DELETED' WHERE id=%s LIMIT 1",
+                               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='DELETED' WHERE `id`=%s LIMIT 1",
                                        array(bigintval($content['pool_id'])), __FILE__, __LINE__, false));
                        } // END - if
                } // END - while
@@ -114,7 +114,7 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
                        $points = 0;
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Check if confirmation links are purged or not
-                               $result_links = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
+                               $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
                                        array(bigintval($content['id'])), __FILE__, __LINE__);
                                if (SQL_NUMROWS($result_links) > 0) {
                                        // At least one link was found, enougth to pay back the points
@@ -128,7 +128,7 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
                                                array(bigintval($content['id'])), __FILE__, __LINE__, false));
 
                                        // Update status of order
-                                       ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='DELETED' WHERE id=%s LIMIT 1",
+                                       ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='DELETED' WHERE `id`=%s LIMIT 1",
                                                array(bigintval($content['id'])), __FILE__, __LINE__, false));
                                } // END - if
                        } // END - while
@@ -147,7 +147,7 @@ WHERE s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s) ORDER BY s.userid",
        // Add points from deleted accounts to jackpot, but here just add to notify mail
        if ($admin_points > 0) {
                // Send mail to admin
-               SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_SUBJECT'), "admin_autopurge_points", TRANSLATE_COMMA($points), "0");
+               sendAdminNotification(getMessage('AUTOPURGE_ADMIN_SUBJECT'), "admin_autopurge_points", translateComma($points), '0');
        } // END - if
 
        // Run all SQLs here
index a69541665e5dbfade803f367d2da1e2535ba807b..285a3abc784828f5d804bc4354af0a909b237ec0 100644 (file)
@@ -92,11 +92,11 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
                        $UIDs .= $content['userid'].", ";
 
                        // Get date/time from timestamp
-                       $content['last_online'] = MAKE_DATETIME($content['last_online'], "0");
+                       $content['last_online'] = generateDateTime($content['last_online'], '0');
 
                        // Load mail template
                        $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_inactive", $content['last_online'], bigintval($content['userid']));
-                       SEND_EMAIL($content['email'], getMessage('AUTOPURGE_MEMBER_INACTIVE_SUBJECT'), $msg);
+                       sendEmail($content['email'], getMessage('AUTOPURGE_MEMBER_INACTIVE_SUBJECT'), $msg);
 
                        // Update this account
                        ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ap_notified=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
@@ -107,7 +107,7 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
                $UIDs = str_replace(", ", "\n", substr($UIDs, 0, -2));
 
                // Send mail notification to admin
-               SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_INACTIVE_SUBJECT'), "admin_autopurge_inactive", $UIDs, '');
+               sendAdminNotification(getMessage('AUTOPURGE_ADMIN_INACTIVE_SUBJECT'), "admin_autopurge_inactive", $UIDs, '');
        } // END - if
 
        // Free memory
@@ -118,9 +118,9 @@ ORDER BY d.userid", array($since, $since, $since), __FILE__, __LINE__);
        $time = getConfig(('ap_in_time'));
        $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
 FROM `{!_MYSQL_PREFIX!}_user_data` AS d
-WHERE `status`='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND last_online < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
+WHERE `status`='CONFIRMED' AND joined < (UNIX_TIMESTAMP() - %s) AND `last_online` < (UNIX_TIMESTAMP() - %s) AND ap_notified < (UNIX_TIMESTAMP() - %s)
 ".$EXCLUDE_LIST."
-ORDER BY userid",
+ORDER BY `userid` ASC",
                array($since, $since, $time), __FILE__, __LINE__);
        if (SQL_NUMROWS($result_inactive) > 0) {
                // Prepare variable...
@@ -132,10 +132,10 @@ ORDER BY userid",
                        $UIDs .= $content['userid'].", ";
 
                        // Get date/time from timestamp
-                       $content['last_online'] = MAKE_DATETIME($content['last_online'], "0");
+                       $content['last_online'] = generateDateTime($content['last_online'], '0');
 
                        // Finnaly delete this inactive account
-                       DELETE_USER_ACCOUNT($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_delete", $content['last_online'], ''));
+                       deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_delete", $content['last_online'], ''));
                } // END - while
 
                // Remove last comma
@@ -143,7 +143,7 @@ ORDER BY userid",
 
                // Send mail notification to admin
                if (getConfig('ap_in_notify') == 'Y') {
-                       SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_DELETE_SUBJECT'), "admin_autopurge_delete", $UIDs, '');
+                       sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DELETE_SUBJECT'), "admin_autopurge_delete", $UIDs, '');
                } // END - if
        } // END - if
 
index 05c3242fb44c6d658deb443d98b5b79c4b0c268f..8599f88107b18de2567b347e65a13050b9c8a401 100644 (file)
@@ -124,7 +124,7 @@ ORDER BY sender ASC",
        // Do we have deleted mails and the admin want's to receive a notification
        if (($DELETED > 0) && (getConfig('ap_dm_notify') == 'Y')) {
                // Send out email to admin
-               SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT'), "admin_autopurge_del_mails", $DELETED, '');
+               sendAdminNotification(getMessage('AUTOPURGE_ADMIN_DEL_MAILS_SUBJECT'), "admin_autopurge_del_mails", $DELETED, '');
        } // END - if
 }
 
index 1903319a0f4b2206e143a550f2fd3b9ffc21c2ba..68ba60ff6703e36954b11ddc4f740f9de1d76139 100644 (file)
@@ -65,7 +65,7 @@ WHERE `status`='DELETED' AND task_created <= (UNIX_TIMESTAMP() - %s)",
        // Do we need to send a notification?
        if (($DELETED > 0) && (getConfig('ap_tasks_notify') == 'Y')) {
                // Send out email to admin
-               SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_TASKS_SUBJECT'), "admin_autopurge_tsks", $DELETED, '');
+               sendAdminNotification(getMessage('AUTOPURGE_ADMIN_TASKS_SUBJECT'), "admin_autopurge_tsks", $DELETED, '');
        } // END - if
 } // END - if
 
index 152689ba989dddf21bfad894f4d5de7c5837ce6e..0ad79fdabf14e55fc0e2e7ca9a9cc9fa50404830 100644 (file)
@@ -68,10 +68,10 @@ ORDER BY userid ASC",
                        $UIDs .= $content['userid'].", ";
 
                        // Get date/time from timestamp
-                       $content['joined'] = MAKE_DATETIME($content['joined'], "0");
+                       $content['joined'] = generateDateTime($content['joined'], '0');
 
                        // Finnaly delete this inactive account
-                       DELETE_USER_ACCOUNT($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $content['joined'], ''));
+                       deleteUserAccount($content['userid'], LOAD_EMAIL_TEMPLATE("member_autopurge_unconfirmed", $content['joined'], ''));
                } // END - while
 
                // Remove last comma
@@ -79,7 +79,7 @@ ORDER BY userid ASC",
 
                // Send mail notification to admin
                if (getConfig('ap_un_notify') == 'Y') {
-                       SEND_ADMIN_NOTIFICATION(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), "admin_autopurge_unconfirmed", $UIDs, '');
+                       sendAdminNotification(getMessage('AUTOPURGE_ADMIN_UNCONFIRMED_SUBJECT'), "admin_autopurge_unconfirmed", $UIDs, '');
                } // END - if
        } // END - if
 
index 1e583da042bef0fef8c81d9581c886c193a42d7c..56ffcadbbce123cc8ba96c00ca6709e52e4ba079 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
 
 // Shall we run the reset scripts? If a day has changed, maybe also a week/month has changed... Simple! :D
 // 01    2              3             32        2         3321    1             221    1           221    1                 221    1                  23          321    1                            10
-if ((date("d", getConfig('last_update')) != date("d", time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET(('register'))) && ($GLOBALS['output_mode'] != 1)) {
+if ((date('d', getConfig('last_update')) != date('d', time())) && (!isInstalling()) && (isInstalled()) && (isAdminRegistered()) && (!REQUEST_ISSET_GET(('register'))) && ($GLOBALS['output_mode'] != 1)) {
        // Tell every module we are in reset-mode!
        enableResetMode();
 
index 3fd823f6c75bc63c95776fd5428e8d1e1073ac65..186ede833979629932d5b0994eec5780746665a1 100644 (file)
@@ -115,7 +115,7 @@ function initConfig () {
 }
 
 // Load configuration and return it as an arry
-function loadConfiguration ($no="0") {
+function loadConfiguration ($no = '0') {
        global $_CONFIG;
 
        // Check for cache extension, cache-array and if the requested configuration is in cache
index 3988d8648ba4f04da88e3ba46e5d261991f0dafd..dfc866fb738637492467e72e92f173053a36bdc4 100644 (file)
@@ -90,9 +90,9 @@ define('MAIN_TITLE', "Your mail-exchanger title");
 define('SLOGAN', "Your cool slogan here");
 
 // Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
-$URL = "http://".getenv('SERVER_NAME') . str_replace("\\", "/", dirname($_SERVER['PHP_SELF']));
-while (substr($URL, -1, 1) == "/") { $URL = substr($URL, 0, -1); }
-$PATH = str_replace("\\", "/", substr(dirname(__FILE__), 0, -3));
+$URL = "http://".getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
+while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
+$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
 
 // CFG: HOST-URL (without trailing '/' !)
 define('URL', $URL);
index 52101360c3bdb23522789c00fe198a97280bf4bf..f06b34c03446c2eacceef3345c9f94b79f0e155b 100644 (file)
@@ -80,14 +80,14 @@ addCode('UNHANDLED_STATUS' , 0x022);
 addCode('MODULE_MEM_ONLY'  , 0x023);
 
 // Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!)
-define('SERVER_URL', "http://www.mxchange.org");
+define('SERVER_URL', 'http://www.mxchange.org');
 
 // Replacement strings
 $GLOBALS['replacer'] = array(
-       'userid'  => "%uid%",           // User-ID
-       'surname' => "%vorname%",       // Surname
-       'family'  => "%nachname%",      // Family name
-       'gender'  => "%anrede%",                // Gender
+       'userid'  => '%uid%',           // User-ID
+       'surname' => '%vorname%',       // Surname
+       'family'  => '%nachname%',      // Family name
+       'gender'  => '%anrede%',        // Gender
 );
 
 // One day
@@ -95,8 +95,8 @@ setConfigEntry('one_day', (60*60*24));
 
 //
 // Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', MAKE_TIME(0, 0, 0, time() - getConfig('one_day')));
-define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
+define('START_YDAY', makeTime(0, 0, 0, time() - getConfig('one_day')));
+define('START_TDAY', makeTime(0, 0, 0, time()));
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
@@ -110,6 +110,9 @@ define('CACHE_BUSTER', mt_rand(1000000, 9999999));
 // CFG: DEBUG-SQL (if enabled and DEBUG_MODE is enabled all SQL queries will be logged to debug.log)
 define('DEBUG_SQL', false);
 
+// CFG: ENCRYPT-SEPERATOR
+define('ENCRYPT_SEPERATOR', ':');
+
 // Extra title is empty by default
 $EXTRA_TITLE = '';
 
index 3ef8c2acc83bfeb22f05fdc34a28ed5759cf72bf..b0de8af3fce16d60a795825c28db6cd3e09cf18c 100644 (file)
@@ -217,7 +217,7 @@ function SQL_CLOSE ($F, $L) {
                incrementConfigEntry('db_hits', getConfig('db_hits_run'));
 
                // Update counter for db/cache
-               UPDATE_CONFIG(array('db_hits', 'cache_hits'), array(getConfig(('db_hits')), getConfig(('cache_hits'))));
+               updateConfiguration(array('db_hits', 'cache_hits'), array(getConfig(('db_hits')), getConfig(('cache_hits'))));
        } // END - if
 
        // Close database link and forget the link
@@ -371,7 +371,7 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // 123           4       4     3    3    4           432    23           4       4     3    3    4            4321
                if (((SQL_NUMROWS($result) == 0) && (ereg("ADD", $sql))) || ((SQL_NUMROWS($result) == 1) && (ereg("DROP", $sql)))) {
                        // Do the query
-                       //* DEBUG: */ print __LINE__.":".$sql."<br />\n";
+                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } elseif ((constant('_TABLE_TYPE') == "InnoDB") && (ereg("FULLTEXT", $sql))) {
@@ -388,11 +388,11 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                        while (strpos($columnName, ",") !== false) {
                                // Use last
                                $columnName = str_replace("`", '', $tableArray[count($tableArray) - $begin]);
-                               //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
 
                                // Remove brackes
                                $columnName = str_replace("(", '', str_replace(")", '', $columnName));
-                               //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."<br />\n";
+                               //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."<br />\n";
 
                                // Continue
                                $begin++;
@@ -422,12 +422,12 @@ function SQL_ALTER_TABLE ($sql, $F, $L) {
                // Shall we run it?
                if (!$skip) {
                        // Send it to the SQL_QUERY() function
-                       //* DEBUG: */ print __LINE__.":".$sql."<br />\n";
+                       //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
                        $result = SQL_QUERY($sql, $F, $L, false);
                } // END - if
        } else {
                // Other ALTER TABLE query
-               //* DEBUG: */ print __LINE__.":".$sql."<br />\n";
+               //* DEBUG: */ print __LINE__.':'.$sql."<br />\n";
                $result = SQL_QUERY($sql, $F, $L, false);
        }
 
index 31e2194b31b6c55825986d1df58d4cd3e624730f..72a1f6a5252da70f095dc0aff7e597c35c9c48f9 100644 (file)
@@ -48,9 +48,9 @@ if (!defined('_DB_TYPE')) define('_DB_TYPE', "mysql3");
 // Create include file name
 $INC = sprintf("inc/db/lib-%s.php", constant('_DB_TYPE'));
 
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Include abstraction layer
-       LOAD_INC_ONCE($INC);
+       loadIncludeOnce($INC);
 } else {
        // Bye, bye...
        die("Cannot load database abstraction layer ".constant('_DB_TYPE')." -&gt; R.I.P.");
index b9f06e01912133c14f8899d0c644f1d97cbe8dcd..9388fc6b82bfd609f80a3e0b8145e2d026519ae4 100644 (file)
@@ -55,7 +55,7 @@ if ($DOUBLER_POINTS == 0) {
 // If not currently doubled set it to zero
 unset($_GET['DOUBLER_UID']);
 unset($_POST['DOUBLER_UID']);
-set_session('DOUBLER_UID', '');
+setSession('DOUBLER_UID', '');
 if (empty($GLOBALS['doubler_uid'])) $GLOBALS['doubler_uid'] = 0;
 
 // Check for doubles which we can pay out
@@ -104,11 +104,11 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y'))
                        // Exclude webmaster from doubling...
                        if ($content['userid'] != getConfig('doubler_uid')) {
                                // Add points
-                               ADD_POINTS_REFSYSTEM(sprintf("doubler_%s", strtolower(getConfig('doubler_send_mode'))), $content['userid'], $content['points'], false, "0", false, "direct");
+                               ADD_POINTS_REFSYSTEM_DIRECT(sprintf("doubler_%s", strtolower(getConfig('doubler_send_mode'))), $content['userid'], $content['points']);
                        } // END - if
 
                        // Set entry as "payed"
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE `id`=%s LIMIT 1",
                                array(bigintval($content['id'])), __FILE__, __LINE__);
 
                        $okay = false;
@@ -134,7 +134,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y'))
                        // Update doubler's account only when others are not updated
                        if (!$okay) {
                                // Add points to used doubler points
-                               UPDATE_CONFIG("doubler_used", $content['points'], "+");
+                               updateConfiguration('doubler_used', $content['points'], '+');
                        } // END - if
 
                        // Update variables to prevent errors
@@ -146,16 +146,16 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == 'Y'))
                                // Doubler transmission ID
                                'id'     => $content['id'],
                                // Doubled points
-                               'points' => TRANSLATE_COMMA($content['points']),
+                               'points' => translateComma($content['points']),
                                // Timemark
-                               'when'   => MAKE_DATETIME($content['timemark'], "2"),
+                               'when'   => generateDateTime($content['timemark'], "2"),
                                // IP number when the member submitted the doubling form
                                'ip'     => $content['remote_ip'],
                        );
 
                        // Load mail template and send mail away...
                        $msg = LOAD_EMAIL_TEMPLATE("member_doubler", $content, $content['userid']);
-                       SEND_EMAIL($content['userid'], getMessage('DOUBLER_MEMBER_SUBJECT'), $msg);
+                       sendEmail($content['userid'], getMessage('DOUBLER_MEMBER_SUBJECT'), $msg);
                } // END - if
        } // END - while
 } // END - if
index 8f1e65b4ab2b301e27b026ea55fed3207913f256..d6c49ad67cf0eae33893234dbfae21fe3d0dfa00 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Load the extension and maybe found language and function files.
-function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run = false) {
+function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = '', $EXT_VER = '', $dry_run = false) {
        // Set current extension name
        EXT_SET_CURR_NAME($ext_name);
 
@@ -69,7 +69,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        $FQFN = constant('PATH') . $INC;
 
        // Is the extension file NOT there?
-       if (!INCLUDE_READABLE($INC)) {
+       if (!isIncludeReadable($INC)) {
                // Debug message
                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Extension %s not found.", $ext_name));
 
@@ -78,32 +78,32 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for language file
-       $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, GET_LANGUAGE());
+       $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, getLanguage());
 
        // Is this include there?
-       if ((FILE_READABLE($langInclude)) && (!isset($GLOBALS['ext_loaded']['lang'][$ext_name]))) {
+       if ((isFileReadable($langInclude)) && (!isset($GLOBALS['ext_loaded']['lang'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Language loaded.");
                $GLOBALS['ext_loaded']['lang'][$ext_name] = true;
-               LOAD_INC_ONCE($langInclude);
+               loadIncludeOnce($langInclude);
        } // END - if
 
        // Construct FQFN for functions file
        $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
        // Is this include there?
-       if ((FILE_READABLE($funcsInclude)) && (!isset($GLOBALS['ext_loaded']['funcs'][$ext_name]))) {
+       if ((isFileReadable($funcsInclude)) && (!isset($GLOBALS['ext_loaded']['funcs'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Functions loaded.");
                $GLOBALS['ext_loaded']['funcs'][$ext_name] = true;
-               LOAD_INC_ONCE($funcsInclude);
+               loadIncludeOnce($funcsInclude);
        } // END - if
 
        // Extensions are not deprecated by default
-       EXT_SET_DEPRECATED("N");
+       EXT_SET_DEPRECATED('N');
 
        // Extensions are not always active by default
-       EXT_SET_ALWAYS_ACTIVE("N");
+       EXT_SET_ALWAYS_ACTIVE('N');
 
        // Extension update notes
        EXT_SET_UPDATE_NOTES("");
@@ -226,7 +226,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                                                // Try to register the extension
                                                //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":ext_update=".$ext_update.",taskId=".$task."<br />\n";
                                                $test = REGISTER_EXTENSION($ext_update, $task, $dry_run, false);
-                                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":"; var_dump($test);
+                                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
                                        } // END - if
                                } elseif ($ext_ver != EXT_GET_VERSION()) {
                                        // Ok, update this extension now
@@ -258,9 +258,9 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                $EXT_LOAD_MODE = 'register';
 
                // Remains true if extension registration reports no failures
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":"; var_dump($test);
+               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
                $test = (($test === true) && (EXT_GET_REPORTS_FAILURE() === false));
-               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":"; var_dump($test);
+               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($test);
 
                // Does everthing before wents ok?
                if ($test === true) {
@@ -275,7 +275,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                                runFilterChain('pre_extension_installed', array('dry_run' => $dry_run));
 
                                // Register extension
-                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME()."/".EXT_GET_VERSION()." - INSERT!<br />\n";
+                               //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!<br />\n";
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_extensions` (ext_name, ext_active, ext_version) VALUES ('%s','%s','%s')",
                                        array(EXT_GET_CURR_NAME(), EXT_GET_ALWAYS_ACTIVE(), EXT_GET_VERSION()), __FUNCTION__, __LINE__);
 
@@ -312,20 +312,20 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr
                        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "".EXT_GET_CURR_NAME());
                        $ret = false;
                }
-       } elseif (($task_id > 0) && (EXT_GET_CURR_NAME() != "")) {
+       } elseif (($task_id > 0) && (EXT_GET_CURR_NAME() != '')) {
                //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME()."<br />\n";
                // Remove task from system when id and extension's name is valid
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND `status`='NEW' LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s AND `status`='NEW' LIMIT 1",
                        array(bigintval($task_id)), __FUNCTION__, __LINE__);
        }
 
        // Is this the sql_patches?
-       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ":".EXT_GET_CURR_NAME()."/{$EXT_LOAD_MODE}");
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ':'.EXT_GET_CURR_NAME()."/{$EXT_LOAD_MODE}");
        if ((EXT_GET_CURR_NAME() == 'sql_patches') && (($EXT_LOAD_MODE == 'register') || ($EXT_LOAD_MODE == 'remove')) && (!$dry_run) && ($test)) {
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
                if ($logout === true) {
                        // Then redirect to logout
-                       LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $EXT_LOAD_MODE . '=sql_patches');
+                       redirectToUrl('modules.php?module=admin&amp;logout=1&amp;' . $EXT_LOAD_MODE . '=sql_patches');
                } else {
                        // Add temporary filter
                        REGISTER_FILTER('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true);
@@ -349,7 +349,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
        $ext_name = GET_EXT_NAME($ext_id);
 
        // If it is not set then maybe there is no extension for that ID number
-       if ($ext_name == "") return false;
+       if ($ext_name == '') return false;
 
        // Set current SQL name
        EXT_SET_CURR_NAME($ext_name);
@@ -379,13 +379,13 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
                // Removal mode?
                if ($load_mode == 'remove') {
                        // Delete this extension (remember to remove it from your server *before* you click on welcome!
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                                array(EXT_GET_CURR_NAME()), __FUNCTION__, __LINE__);
                } // END - if
        } // END - if
 
        // Remove cache file(s) if extension is active
-       if (((EXT_IS_ACTIVE('cache')) || (GET_EXT_VERSION('cache') != "")) && (((SQL_AFFECTEDROWS() == 1)) || ($sqlRan === true) || ($load_mode == 'activate') || ($load_mode == 'deactivate'))) {
+       if (((EXT_IS_ACTIVE('cache')) || (GET_EXT_VERSION('cache') != '')) && (((SQL_AFFECTEDROWS() == 1)) || ($sqlRan === true) || ($load_mode == 'activate') || ($load_mode == 'deactivate'))) {
                // Run filters
                runFilterChain('post_extension_run_sql', EXT_GET_CURR_NAME());
        } // END - if
@@ -395,7 +395,7 @@ function EXTENSION_RUN_SQLS ($ext_id, $load_mode) {
        if ((EXT_GET_CURR_NAME() == 'sql_patches') && (($load_mode == 'register') || ($load_mode == 'remove'))) {
                // Then redirect to logout
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": LOAD!");
-               LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $load_mode . '=sql_patches');
+               redirectToUrl('modules.php?module=admin&amp;logout=1&amp;' . $load_mode . '=sql_patches');
        } // END - if
 }
 
@@ -418,10 +418,10 @@ function EXT_IS_ACTIVE ($ext_name) {
        } elseif (isset($GLOBALS['ext_loaded'][$ext_name])) {
                // @TODO Extension is loaded, what next?
                app_die(__FUNCTION__, __LINE__, "LOADED:$ext_name");
-       } elseif (($ext_name == 'cache') || (GET_EXT_VERSION('cache') == "")) {
+       } elseif (($ext_name == 'cache') || (GET_EXT_VERSION('cache') == '')) {
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "DB! ext_name={$ext_name}");
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($ext_name), __FUNCTION__, __LINE__);
 
                // Entry found?
@@ -439,7 +439,7 @@ function EXT_IS_ACTIVE ($ext_name) {
        } else {
                // Extension not active!
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "ext_name=".$ext_name.": Not active!");
-               $GLOBALS['cache_array']['extensions']['ext_active'][$ext_name] = "N";
+               $GLOBALS['cache_array']['extensions']['ext_active'][$ext_name] = 'N';
        }
 
        // Debug message
@@ -473,7 +473,7 @@ function GET_EXT_VERSION ($ext_name) {
                incrementConfigEntry('cache_hits');
        } elseif (!isCacheInstanceValid()) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT ext_version FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($ext_name), __FUNCTION__, __LINE__);
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, ": DB - ".SQL_NUMROWS($result)."");
 
@@ -530,9 +530,9 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
                        // Load again...
                        LOAD_EXTENSION(EXT_GET_CURR_NAME(), 'update', $GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()], $dry_run);
 
-                       if (EXT_GET_UPDATE_DEPENDS() != "") {
+                       if (EXT_GET_UPDATE_DEPENDS() != '') {
                                // Is the extension there?
-                               if (GET_EXT_VERSION(EXT_GET_UPDATE_DEPENDS()) != "") {
+                               if (GET_EXT_VERSION(EXT_GET_UPDATE_DEPENDS()) != '') {
                                        // Update another extension first!
                                        $test = EXTENSION_UPDATE(EXT_GET_UPDATE_DEPENDS(), GET_EXT_VERSION(EXT_GET_UPDATE_DEPENDS()), $dry_run);
                                } else {
@@ -562,10 +562,10 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
 
                if (!$dry_run) {
                        // Create task
-                       CREATE_EXTENSION_UPDATE_TASK(GET_CURRENT_ADMIN_ID(), EXT_GET_CURR_NAME(), $GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()], SQL_ESCAPE(EXT_GET_NOTES(EXT_GET_NOTES())));
+                       CREATE_EXTENSION_UPDATE_TASK(getCurrentAdminId(), EXT_GET_CURR_NAME(), $GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()], SQL_ESCAPE(EXT_GET_NOTES(EXT_GET_NOTES())));
 
                        // Update extension's version
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE ext_name='%s' LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_version='%s' WHERE `ext_name`='%s' LIMIT 1",
                                array($GLOBALS['cache_array']['update_ver'][EXT_GET_CURR_NAME()], EXT_GET_CURR_NAME()), __FUNCTION__, __LINE__);
 
                        // Remove arrays
@@ -579,7 +579,7 @@ function EXTENSION_UPDATE ($ext_name, $ext_ver, $dry_run = false) {
 }
 
 // Output verbose SQL table for extension
-function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = "", $dashed = "", $switch = false, $width = "100%") {
+function EXTENSION_VERBOSE_TABLE ($queries = array(), $title = '', $dashed = '', $switch = false, $width = "100%") {
        // Empty title?
        if (empty($title)) {
                // Then fix it to default
@@ -653,7 +653,7 @@ function GET_EXT_NAME ($ext_id) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT ext_name FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT ext_name FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `id`=%s LIMIT 1",
                        array(bigintval($ext_id)), __FUNCTION__, __LINE__);
                list($ret) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -673,7 +673,7 @@ function GET_EXT_ID ($ext_name) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($ext_name), __FUNCTION__, __LINE__);
                list($ret) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -686,7 +686,7 @@ function GET_EXT_ID ($ext_name) {
 // Activate given extension
 function ACTIVATE_EXTENSION ($ext_name) {
        // Activate the extension
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='Y' WHERE ext_name='%s' LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='Y' WHERE `ext_name`='%s' LIMIT 1",
                array($ext_name), __FUNCTION__, __LINE__);
 
        // Extension has been activated?
@@ -699,7 +699,7 @@ function ACTIVATE_EXTENSION ($ext_name) {
 // Deactivate given extension
 function DEACTIVATE_EXTENSION($ext_name) {
        // Activate the extension
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='%s' LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='%s' LIMIT 1",
                array($ext_name), __FUNCTION__, __LINE__);
 
        // Extension has been activated?
@@ -711,9 +711,9 @@ function DEACTIVATE_EXTENSION($ext_name) {
                CREATE_EXTENSION_DEACTIVATION_TASK($ext_name);
 
                // Notify the admin
-               SEND_ADMIN_NOTIFICATION(
+               sendAdminNotification(
                        getMessage('ADMIN_SUBJECT_EXTENSION_DEACTIVATED'),
-                       "admin_ext_deactivated",
+                       'admin_ext_deactivated',
                        array('ext_name' => $ext_name)
                );
        } // END - if
@@ -725,8 +725,8 @@ function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
        $currVersion = GET_EXT_VERSION($ext_name);
 
        // Remove all dots from both versions
-       $currVersion = str_replace(".", '', $currVersion);
-       $ext_ver = str_replace(".", '', $ext_ver);
+       $currVersion = str_replace('.', '', $currVersion);
+       $ext_ver = str_replace('.', '', $ext_ver);
 
        // Now compare both and return the result
        return ($currVersion < $ext_ver);
@@ -735,10 +735,10 @@ function EXT_VERSION_IS_OLDER ($ext_name, $ext_ver) {
 // Creates a new task for updated extension
 function CREATE_EXTENSION_UPDATE_TASK ($admin_id, $ext_name, $ext_ver, $notes) {
        // Create subject line
-       $subject = "[UPDATE-".$ext_name."-".$ext_ver.":] {--ADMIN_UPDATE_EXT_SUBJ--}";
+       $subject = '[UPDATE-'.$ext_name.'-'.$ext_ver.':] {--ADMIN_UPDATE_EXT_SUBJ--}';
 
        // Is the extension there?
-       if (GET_EXT_VERSION($ext_name) != "") {
+       if (GET_EXT_VERSION($ext_name) != '') {
                // Check if task is not there
                if (DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) {
                        // Task not created so it's a brand-new extension which we need to register and create a task for!
@@ -751,11 +751,11 @@ function CREATE_EXTENSION_UPDATE_TASK ($admin_id, $ext_name, $ext_ver, $notes) {
 // Creates a new task for newly installed extension
 function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
        // Not installed and do we have created a task for the admin?
-       if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == "")) {
+       if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == '')) {
                // Template file
                $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
                        constant('PATH'),
-                       GET_LANGUAGE(),
+                       getLanguage(),
                        $ext
                );
 
@@ -763,9 +763,9 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
                $msg = sprintf(getMessage('ADMIN_EXT_TEXT_FILE_MISSING'), $ext);
 
                // Load text for task if found
-               if (FILE_READABLE($tpl)) {
+               if (isFileReadable($tpl)) {
                        // Load extension's own text template (HTML!)
-                       $msg = LOAD_TEMPLATE("ext_" . $ext, true);
+                       $msg = LOAD_TEMPLATE('ext_' . $ext, true);
                } else {
                        // Write this in debug.log as well
                        DEBUG_LOG(__FUNCTION__, __LINE__, $msg);
@@ -789,13 +789,13 @@ function CREATE_EXTENSION_DEACTIVATION_TASK ($ext) {
        $subject = sprintf("[%s:] %s", $ext, getMessage('TASK_SUBJ_EXTENSION_DEACTIVATED'));
 
        // Not installed and do we have created a task for the admin?
-       if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) != "")) {
+       if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) != '')) {
                // Task not created so add it
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (assigned_admin, userid, status, task_type, subject, text, task_created)
 VALUES (0, 0, 'NEW', 'EXTENSION_DEACTIVATION', '%s', '%s', UNIX_TIMESTAMP())",
                        array(
                                $subject,
-                               SQL_ESCAPE(LOAD_TEMPLATE("task_ext_deactivated", true, $ext)),
+                               SQL_ESCAPE(LOAD_TEMPLATE('task_ext_deactivated', true, $ext)),
                        ),  __FUNCTION__, __LINE__, true, false
                );
        } // END - if
@@ -840,13 +840,13 @@ function MODULE_HAS_MENU ($mod, $forceDb = false) {
 
                // Free memory
                SQL_FREERESULT($result);
-       } elseif (GET_EXT_VERSION('sql_patches') == "") {
+       } elseif (GET_EXT_VERSION('sql_patches') == '') {
                // No sql_patches installed, so maybe in admin area or no admin registered?
                $ret = (((IS_ADMIN()) || (!isAdminRegistered())) && ($mod == 'admin')); // Then there is a menu!
        }
 
        // Return status
-       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().":"; var_dump($ret);
+       //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:currName=".EXT_GET_CURR_NAME().':'; var_dump($ret);
        return $ret;
 }
 
@@ -856,7 +856,7 @@ function DETERMINE_EXTENSION_TASK_ID ($ext_name) {
        $task_id = 0;
 
        // Search for extension task's id
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE task_type='EXTENSION' AND subject='[%s:]' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_task_system` WHERE task_type='EXTENSION' AND subject='[%s:]' LIMIT 1",
                array($ext_name), __FUNCTION__, __LINE__);
 
        // Entry found?
@@ -878,7 +878,7 @@ function DETERMINE_TASK_ID_BY_SUBJECT ($subject) {
        $task_id = 0;
 
        // Search for task id
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE subject LIKE '%s%%' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_task_system` WHERE subject LIKE '%s%%' LIMIT 1",
                array($subject), __FUNCTION__, __LINE__);
 
        // Entry found?
@@ -1007,7 +1007,7 @@ function EXT_ADD_UPDATE_DEPENDS ($updateDepends) {
 
        // Is it not yet added?
        if (!in_array($updateDepends, $GLOBALS['ext_running_updates'])) {
-               //* DEBUG */ DEBUG_LOG(__FUNCTION__, __LINE__, "currName=".EXT_GET_CURR_NAME()."/".$updateDepends);
+               //* DEBUG */ DEBUG_LOG(__FUNCTION__, __LINE__, "currName=".EXT_GET_CURR_NAME().'/'.$updateDepends);
                // Add it to the list of extension update depencies map
                $GLOBALS['ext_update_depends'][EXT_GET_CURR_NAME()][] = (string) $updateDepends;
 
@@ -1104,7 +1104,7 @@ function EXT_GET_UPDATE_ITERATOR () {
        if (!isset($GLOBALS['ext_depend_iterator'][EXT_GET_CURR_NAME()])) EXT_INIT_UPDATE_ITERATOR();
 
        // Return it
-       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "currName=".EXT_GET_CURR_NAME()."/".$GLOBALS['ext_depend_iterator'][EXT_GET_CURR_NAME()]);
+       //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "currName=".EXT_GET_CURR_NAME().'/'.$GLOBALS['ext_depend_iterator'][EXT_GET_CURR_NAME()]);
        return $GLOBALS['ext_depend_iterator'][EXT_GET_CURR_NAME()];
 }
 
@@ -1241,7 +1241,7 @@ function REDIRECT_ON_UNINSTALLED_EXTENSION ($ext_name) {
        // So is the extension there?
        if (!EXT_IS_ACTIVE($ext_name)) {
                // Redirect to index
-               LOAD_URL('modules.php?module=index&amp;msg=' . getCode('EXTENSION_PROBLEM') . '&amp;ext=' . $ext_name);
+               redirectToUrl('modules.php?module=index&amp;msg=' . getCode('EXTENSION_PROBLEM') . '&amp;ext=' . $ext_name);
        } // END - if
 }
 
index da94d02963df0589ee84dc1f6b2b38d79755209f..5702053bc2a3e7f29982d0056646db83f2302191 100644 (file)
@@ -99,7 +99,7 @@ case 'update': // Update an extension
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` ADD default_acl ENUM('deny','allow') NOT NULL DEFAULT 'deny'");
 
                // But allow current admin everything (THIS SHALL BE YOU!)
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admins` SET default_acl='allow' WHERE login='".get_session('admin_login')."' LIMIT 1");
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admins` SET default_acl='allow' WHERE login='".getSession('admin_login')."' LIMIT 1");
                ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_admins_acls`");
                ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_admins_acls` (
 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -270,7 +270,7 @@ PRIMARY KEY (id)
 
        case '0.6.8': // SQL queries for v0.6.8
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
+               EXT_SET_UPDATE_NOTES("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
                break;
 
        case '0.6.9': // SQL queries for v0.6.9
@@ -319,7 +319,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 78f3c9baf087049e704557cab2c30731272b9c6b..439280c270eb6a530764d8db8c1952756b836147 100644 (file)
@@ -175,12 +175,12 @@ case 'update': // Update an extension
 
        case '0.2.7': // SQL queries for v0.2.7
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.2.8': // SQL queries for v0.2.8
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.2.9': // SQL queries for v0.2.9
@@ -265,7 +265,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 4b90e4b27e8ef6b24bbf1ab8b1a5d166ec5f09c2..1fe6c89720240c3c849e595c2cad8b12ec1e71e4 100644 (file)
@@ -138,7 +138,7 @@ case 'update': // Update an extension
 
        case '0.0.9': // SQL queries for v0.0.9
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die beg-Templates (Ordner: {!PATH!}/templates/".GET_LANGUAGE()."/html/) in den neuen Order beg!");
+               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die beg-Templates (Ordner: {!PATH!}/templates/".getLanguage()."/html/) in den neuen Order beg!");
                break;
 
        case '0.1.0': // SQL queries for v0.2.1
@@ -159,8 +159,8 @@ case 'update': // Update an extension
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD beg_rallye ENUM('Y','N') NOT NULL DEFAULT 'N'");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD beg_points FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000");
 
-               $VIS = "N"; $LOCKED = "Y";
-               if (EXT_IS_ACTIVE('beg')) { $VIS = "Y"; $LOCKED = "N"; }
+               $VIS = 'N'; $LOCKED = 'Y';
+               if (EXT_IS_ACTIVE('beg')) { $VIS = 'Y'; $LOCKED = 'N'; }
 
                ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('main','beg2','Bettel-Rallye','".$VIS."','".$LOCKED."','7')");
                ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12')");
index 2d18f815496adf804d381b61a47ae661cf50224c..fe6cebbd3ae40dc3e21e0b891d53beb5e82b32af 100644 (file)
@@ -149,7 +149,7 @@ PRIMARY KEY(id)
 
        case '0.3.3': // SQL queries for v0.3.3
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die birthday-Templates (Ordner: {!PATH!}/templates/".GET_LANGUAGE()."/html/) in den neuen Order birthday!");
+               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die birthday-Templates (Ordner: {!PATH!}/templates/".getLanguage()."/html/) in den neuen Order birthday!");
                break;
 
        case '0.3.4': // SQL queries for v0.3.4
index bbe4664e28710a57e61751bf88e0ed59f60db15f..11316d03606945c6d8f02d672770e6f95619b6c2 100644 (file)
@@ -133,7 +133,7 @@ case 'update': // Update an extension
                // Use actual month for this update
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000");
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000");
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='bonus' AND ext_has_css='N' LIMIT 1");
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE `ext_name`='bonus' AND ext_has_css='N' LIMIT 1");
 
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Login-Bonus und Turbo-Klick-Bonus intergriert.");
@@ -357,8 +357,8 @@ KEY userid (userid)
 
        case '0.5.6': // SQL queries for v0.5.6
                // Get current month
-               $curr = date("m", time());
-               if (strlen($curr) == 1) $curr = "0".$curr;
+               $curr = date('m', time());
+               if (strlen($curr) == 1) $curr = '0'.$curr;
                if ($curr == "00") $curr = "12";
 
                // Generate timemark...
@@ -366,8 +366,8 @@ KEY userid (userid)
 
                // Update accounts which are not active last months
                ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET turbo_bonus=0, login_bonus=0, bonus_order=0, bonus_stats=0, bonus_ref=0
-WHERE last_online < ".$mark." ORDER BY userid");
+SET `turbo_bonus`=0, `login_bonus`=0, `bonus_order`=0, `bonus_stats`=0, `bonus_ref`=0
+WHERE `last_online` < ".$mark." ORDER BY `userid` ASC");
 
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Ein weiterer Scriptfehler hat nur die Gewinner aus der Aktiv-Rallye genommen. Die anderen Mitglieder sind somit &quot;nach oben gerutsch&quot;.");
index 1dd7055d2ef5ca3be00197d1ef063caa41df5529..5720fb421938c28cda3403d2abfb9001abc67463 100644 (file)
@@ -248,10 +248,10 @@ case 'test': // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Create instance on class
-       if ($GLOBALS['cache_mode'] != "init") {
+       if ($GLOBALS['cache_mode'] != 'init') {
                // Initialize cache system only when it's needed
                $GLOBALS['cache_instance'] = new CacheSystem(getConfig('cache_update'), "inc/".getConfig('cache_path'), getConfig('cache_tested'));
-               if ($GLOBALS['cache_instance']->getStatus() != "done") {
+               if ($GLOBALS['cache_instance']->getStatus() != 'done') {
                        // Failed to initialize cache sustem
                        addFatalMessage(__FILE__, __LINE__, "(<font color=\"#0000aa\">".__LINE__."</font>): ".getMessage('CACHE_CANNOT_INITIALIZE'));
                } // END - if
@@ -260,7 +260,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 8ed70b39b71ec89db420793a55cedd24451c8f81..58c20692383059c6615afba01b4c63c1ba3d5c21 100644 (file)
@@ -123,7 +123,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 165c5f215a50612db5b4d08b961886fe99902251..94c0a7808c6aed4e19e68f298cd06f786476663b 100644 (file)
@@ -178,7 +178,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 282cffbf938f37e4e0b4335c4fb7f9340212bbd9..26b47623fd6b9ddf6714da3e4b4d197bdf7ab985 100644 (file)
@@ -189,7 +189,7 @@ case 'update': // Update an extension
 
        case '0.0.8': // SQL queries for v0.0.8
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die doubler-Templates (Ordner: {!PATH!}/templates/".GET_LANGUAGE()."/html/) in den neuen Order doubler!");
+               EXT_SET_UPDATE_NOTES("Bitte verschieben Sie die doubler-Templates (Ordner: {!PATH!}/templates/".getLanguage()."/html/) in den neuen Order doubler!");
                break;
 
        case '0.0.9': // SQL queries for v0.0.9
index 259077c9d1800ba631cc751625318048da69e3c5..a54950bc13e80f7ef62744f3b2a336ffdc8b3888 100644 (file)
@@ -133,7 +133,7 @@ case 'update': // Update an extension
 
        case '0.0.8': // SQL queries for v0.0.8
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.0.9': // SQL queries for v0.0.9
index 0d20e30f7b8c71583f8268c706bd45bc36751c14..b32605ae41ddf6468c2851df62643f396126c662 100644 (file)
@@ -141,27 +141,27 @@ case 'test': // For testing purposes. For details see file inc/modules/admin/wha
 default: // Do stuff when extension is loaded
        // Valid HTML tags (only simple and no attributes!)
        $GLOBALS['html_tags'] = array(
-               "b",
-               "i",
-               "u",
-               "ol",
-               "ul",
-               "li",
-               "strong",
-               "center",
-               "left",
-               "right",
-               "br",
+               'b',
+               'i',
+               'u',
+               'ol',
+               'ul',
+               'li',
+               'strong',
+               'center',
+               'left',
+               'right',
+               'br',
        );
 
        // URL ends which are used to indentify the end of an URL or email link
        // Don't use these chars in links... ;-)
        //
        $GLOBALS['url_ends'] = array(
-               " ",
+               ' ',
                "\n",
                "\r",
-               ")",
+               ')',
        );
 
        // Valid email chars (without @, or do you want to have another @ inside your email addy?)
index e2a38bafb09dde2e8a888407f5fad1344fb6455f..3e1c405d72ceb54c2aaf88a1e2793d857e18e9b0 100644 (file)
@@ -117,7 +117,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index a3e03c74d038d29a352dd19afb4310a50c0246be..d98c9512601b6df40a727d4a9bd19032181ac8b4 100644 (file)
@@ -155,7 +155,7 @@ if ((isset($dry_run)) && (isset($EXT_LOAD_MODE))) {
 } // END - if
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 04732f2eea8dad82abbfbfdfd9615e3c6412fb6f..39338716728bb8b6156795d3c51f2b855ad99089 100644 (file)
@@ -127,7 +127,7 @@ case 'update': // Update an extension
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <a href=\"{!URL!}/modules.php?module=admin&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</a> m&uuml;ssen.<br />
 <br />
-<strong>Wichtig: Laden Sie noch die Template member_mydata_overview und member_mydata_edit (beide zu finden unter templates/".GET_LANGUAGE()."/html/member/ !) mit hoch!</strong>");
+<strong>Wichtig: Laden Sie noch die Template member_mydata_overview und member_mydata_edit (beide zu finden unter templates/".getLanguage()."/html/member/ !) mit hoch!</strong>");
 
                // Depends on 'country'!
                EXT_ADD_UPDATE_DEPENDS('country');
index 266e224bf2c2af3998d9b31027dcd3b149b8ebad..53e42ef4e0c2a501f442793d707e9ad27ec80351 100644 (file)
@@ -78,7 +78,7 @@ case 'update': // Update an extension
        switch ($EXT_VER)
        {
        case '0.0.1': // SQL queries for v0.0.1
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='nickname' AND ext_has_css='N' LIMIT 1");
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE `ext_name`='nickname' AND ext_has_css='N' LIMIT 1");
 
                // This update depends on sql_patches update!
                EXT_ADD_UPDATE_DEPENDS('sql_patches');
index de106a14cac928aa37a13ac14834acfd16f4c3cb..6dc8c6eed06c7dbc6b14e591dee8864a89d95f95 100644 (file)
@@ -122,7 +122,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 9131000301b257ceb9edfb2b897fcb11e619e6fe..044217af8bf45bea45bef16017870e9bd8868337 100644 (file)
@@ -264,7 +264,7 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us
 
        case '0.4.4': // SQL queries for v0.4.4
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Ein <strong>WHERE ext_active='Y'</strong> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.");
+               EXT_SET_UPDATE_NOTES("Ein <strong>WHERE &#96;ext_active&#96;='Y'</strong> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.");
                break;
 
        case '0.4.5': // SQL queries for v0.4.5
index dcb4ddf277cf6faff66eeab6d05c9ce4e4efbba2..36d58b5a2fb0a8e5531344ceeb90ef2e6a253301 100644 (file)
@@ -210,7 +210,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 246d48770d6eed33143d0e2615ad2fdb47a77964..f050ce94897535c8c4430f1862d1d3aaa050f862 100644 (file)
@@ -178,7 +178,7 @@ case 'update': // Update an extension
 
        case '0.2.7': // SQL queries for v0.2.7
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.2.8': // SQL queries for v0.2.8
index d57f91383c2514e3d69f8967af2f89a1fc2fe165..90b7f0d1ecdef69989835b0259ac76596cc8ae84 100644 (file)
@@ -215,7 +215,7 @@ case 'update': // Update an extension
 
        case '0.1.9': // SQL queries for v0.1.9
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Funktion ADMIN_USER_PROFILE_LINK() mit Verlinkung auf Referal-Liste implementiert.");
+               EXT_SET_UPDATE_NOTES("Funktion <u>generateUserProfileLink()</u> mit Verlinkung auf Referal-Liste implementiert.");
                break;
 
        case '0.2.0': // SQL queries for v0.2.0
@@ -228,7 +228,7 @@ case 'update': // Update an extension
   <li>&#36;DATA&#91;min_users&#93;</li>
   <li>&#36;DATA&#91;min_prices&#93;</li>
 </ul>
-Zudem sollten Sie mindestens folgende Templates (in <strong>templates/".GET_LANGUAGE()."/html/guest/</strong> !) aktualisieren:<br />
+Zudem sollten Sie mindestens folgende Templates (in <strong>templates/".getLanguage()."/html/guest/</strong> !) aktualisieren:<br />
 <ul>
   <li><strong>guest_rallye_footer.tpl</strong></li>
   <li><strong>guest_rallye_header.tpl</strong></li>
@@ -329,9 +329,9 @@ case 'test': // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Do stuff only when not in CSS mode
-       if (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1") && ($GLOBALS['cache_mode'] != "init")) {
+       if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1') && ($GLOBALS['cache_mode'] != 'init')) {
                // Get total member count
-               $total = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
+               $total = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
 
                // Add more data on higher versions
                $ADD1 = ''; $ADD2 = ''; $OR = '';
index f225207f4e42bca62f73f7e3da44ccf32e98e50b..b5d4a308373696d89f58ae3f9ff9f53a4b2048f5 100644 (file)
@@ -98,7 +98,7 @@ PRIMARY KEY(id)
                break;
 
        case '0.1.1': // SQL queries for v0.1.1
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='register' AND ext_has_css='N' LIMIT 1");
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE `ext_name`='register' AND ext_has_css='N' LIMIT 1");
 
                // This update depends on sql_patches update!
                EXT_ADD_UPDATE_DEPENDS('sql_patches');
@@ -209,7 +209,7 @@ PRIMARY KEY(id)
                // Update notes (these will be set as task text!)
                EXT_SET_UPDATE_NOTES("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <a href=\"{!URL!}/modules.php?module=admin&amp;what=extensions&amp;do=search\">meiner Seite herunterladen</a> m&uuml;ssen.<br />
 <br />
-<strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".GET_LANGUAGE()."/html/guest/ zu finden ist!</strong>");
+<strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
 
                // Depends on 'country'
                EXT_ADD_UPDATE_DEPENDS('country');
@@ -265,7 +265,7 @@ PRIMARY KEY(id)
                ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `what`='config_register2' WHERE `what`='config_reg' LIMIT 1");
 
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das &Auml;ndern des Templates <strong>templates/".GET_LANGUAGE()."/html/guest/guest_register.tpl</strong> ist nicht mehr n&ouml;tig.");
+               EXT_SET_UPDATE_NOTES("Bei der Anmeldung kann die Standart-Auswahl zwischen Ja/Nein umgeschaltet werden. Das &Auml;ndern des Templates <strong>templates/".getLanguage()."/html/guest/guest_register.tpl</strong> ist nicht mehr n&ouml;tig.");
                break;
 
        case '0.4.3': // SQL queries for v0.4.3
@@ -290,7 +290,7 @@ PRIMARY KEY(id)
 
        case '0.4.7': // SQL queries for v0.4.7
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
+               EXT_SET_UPDATE_NOTES("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
                break;
 
        case '0.4.8': // SQL queries for v0.4.8
@@ -305,7 +305,7 @@ PRIMARY KEY(id)
 
        case '0.5.0': // SQL queries for v0.5.0
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function REGISTER_ADD_CATEGORY_TABLE() in <strong>{!PATH!}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></em> beseitigt.");
+               EXT_SET_UPDATE_NOTES("Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{!PATH!}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></em> beseitigt.");
                break;
 
        case '0.5.1': // SQL queries for v0.5.1
index 0a72c21c0541144b03f2571e2f96581f5e180b70..15f0bc6d73f78a70bc6c6a5716f9155228d9b371 100644 (file)
@@ -52,7 +52,7 @@ switch ($EXT_LOAD_MODE)
 {
 case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called)
        // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+       if (!isApacheModuleLoaded('mod_rewrite')){
                EXT_SET_REPORTS_FAILURE(true);
                addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
        } // END - if
@@ -68,8 +68,8 @@ case 'remove': // Do stuff when removing extension
 
 case 'activate': // Do stuff when admin activates this extension
        // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')) {
-               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__);
+       if (!isApacheModuleLoaded('mod_rewrite')) {
+               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
                EXT_SET_REPORTS_FAILURE(true);
                addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
         } // END - if
@@ -148,7 +148,7 @@ case 'update': // Update an extension
                break;
        case '0.1.3':
                // Check if mod_rewrite is loadeded
-               if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+               if (!isApacheModuleLoaded('mod_rewrite')){
                        EXT_SET_REPORTS_FAILURE(true);
                        //addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
                } // END - if
@@ -165,9 +165,9 @@ case 'test': // For testing purposes. For details see file inc/modules/admin/wha
 
 default: // Do stuff when extension is loaded
        // Check if mod_rewrite is loadeded
-       if (!IF_APACHE_MODULE_LOADED('mod_rewrite')){
+       if (!isApacheModuleLoaded('mod_rewrite')){
                EXT_SET_REPORTS_FAILURE(true);
-               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='N' WHERE ext_name='rewrite' LIMIT 1", __FILE__, __LINE__);
+               SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='N' WHERE `ext_name`='rewrite' LIMIT 1", __FILE__, __LINE__);
                if (!IS_ADMIN()) addFatalMessage(__FILE__, __LINE__, getMessage('MOD_REWRITE_ERROR'));
         } // END - if
        break;
index 8a90db8a6e14d3126c49321e57bf915a4ddb1811..94a8dfacec66e331ff54ed710cb229653ea15c0d 100644 (file)
@@ -297,7 +297,7 @@ PRIMARY KEY(id)
        //
        // Add default entries
        //
-       ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_registry` (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".GET_CURRENT_ADMIN_ID().",UNIX_TIMESTAMP())");
+       ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_registry` (ext_name, is_active, aid, stamp_added) VALUES ('sponsor','N',".getCurrentAdminId().",UNIX_TIMESTAMP())");
        ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_action_convert` (ext_name, conv_rate, conv_name) VALUES ('sponsor','10','Mails')");
        ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Standart-Paket', 5, 1000.00000, '&euro;')");
        ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_min_count, pay_rate, pay_currency) VALUES ('Spar-Paket', 1, 200.00000, '&euro;')");
index 75672cd5f7b533dc7ffd0e4d0b2ccd5d33e18339..994690552338b21372f0b9079b773e94feb578ac 100644 (file)
@@ -301,10 +301,10 @@ case 'update': // Update an extension
                break;
 
        case '0.2.4': // SQL queries for v0.2.4
-               $auto_type = "png"; // PNG image is the default
-               if ((INCLUDE_READABLE("theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
+               $auto_type = 'png'; // PNG image is the default
+               if ((isIncludeReadable('theme/'.getCurrentTheme().'/images/code_bg.jpg')) && function_exists('imagecreatefromjpeg')) {
                        // Switch to JPEG format
-                       $auto_type = "jpg";
+                       $auto_type = 'jpg';
                }
                ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD img_type ENUM('jpg','png') NOT NULL DEFAULT '".$auto_type."'");
 
@@ -697,15 +697,15 @@ default: // Do stuff when extension is loaded
                setConfigEntry('secret_key', '');
 
                // Read key from secret file
-               if ((getConfig('file_hash') == "") || (getConfig('master_salt') == "") || (getConfig('pass_scramble') == "")) {
+               if ((getConfig('file_hash') == '') || (getConfig('master_salt') == '') || (getConfig('pass_scramble') == '')) {
                        // Cache instance
                        // Maybe need setup of secret key!
-                       LOAD_INC_ONCE("inc/gen_sql_patches.php");
+                       loadIncludeOnce('inc/gen_sql_patches.php');
 
                        // @TODO Rewrite this to a filter!
                        if ((GET_EXT_VERSION('cache') >= '0.1.2') && (isCacheInstanceValid())) {
                                // Remove extensions and mod_reg cache file
-                               LOAD_INC_ONCE("inc/libs/cache_functions.php");
+                               loadIncludeOnce('inc/libs/cache_functions.php');
                                require(sprintf("%sinc/extensions/ext-cache.php", constant('PATH')));
                                if ($GLOBALS['cache_instance']->loadCacheFile("extensions", true)) $GLOBALS['cache_instance']->destroyCacheFile();
                                if ($GLOBALS['cache_instance']->loadCacheFile("modreg"))           $GLOBALS['cache_instance']->destroyCacheFile();
@@ -713,15 +713,15 @@ default: // Do stuff when extension is loaded
                } // END - if
 
                // Test again
-               if ((getConfig('file_hash') != "") && (getConfig('master_salt') != "") && (getConfig('pass_scramble') != "")) {
+               if ((getConfig('file_hash') != '') && (getConfig('master_salt') != '') && (getConfig('pass_scramble') != '')) {
                        // File hash fas generated so we can also file the secret file... hopefully.
                        $hashFile = sprintf("%sinc/.secret/.%s", constant('PATH'), getConfig('file_hash'));
-                       if (FILE_READABLE($hashFile)) {
+                       if (isFileReadable($hashFile)) {
                                // Read file
-                               setConfigEntry('secret_key', READ_FILE($hashFile));
+                               setConfigEntry('secret_key', readFromFile($hashFile));
                        } else {
                                // Remove it from database
-                               UPDATE_CONFIG("file_hash", '');
+                               updateConfiguration('file_hash', '');
 
                                // Cannot read secret file!
                                app_die(__FILE__, __LINE__, "Cannot read secret file! Please try to reload");
@@ -737,10 +737,10 @@ default: // Do stuff when extension is loaded
        } else {
                // Set some lame ( ;-) ) default settings
                setConfigEntry('def_refid'        , 0);
-               setConfigEntry('enable_title_deco', "N");
-               setConfigEntry('title_mod_show'   , "Y");
-               setConfigEntry('title_middle'     , "-");
-               // @TODO Can we remove this? setConfigEntry('verbose_sql'        , "N");
+               setConfigEntry('enable_title_deco', 'N');
+               setConfigEntry('title_mod_show'   , 'Y');
+               setConfigEntry('title_middle'     , '-');
+               // @TODO Can we remove this? setConfigEntry('verbose_sql'        , 'N');
                define('MT_WORD' , getMessage('DEFAULT_MT_WORD'));
                define('MT_WORD2', getMessage('DEFAULT_MT_WORD2'));
                define('MT_WORD3', getMessage('DEFAULT_MT_WORD3'));
@@ -750,7 +750,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 2deb3ece01ede6126456d2b24c370de003899663..a272bb5b0a79f88ad064ac6ca39c876ad23c5bd1 100644 (file)
@@ -234,8 +234,8 @@ case 'test': // For testing purposes. For details see file inc/modules/admin/wha
        break;
 
 default: // Do stuff when extension is loaded
-       // Set some constants we need???
-       define('edit', "edit");
+       // @TODO Set some constants we need???
+       define('edit', 'edit');
        break;
 }
 
index b091f6f880142e095ac3bd85a285e14e27389248..92064c86152d02198ccc0d68277f76ec9bdfb8df 100644 (file)
@@ -76,7 +76,7 @@ case 'update': // Update an extension
        switch ($EXT_VER)
        {
        case '0.0.1': // SQL queries for v0.0.1
-               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE ext_name='task' AND ext_has_css='N' LIMIT 1");
+               ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='Y' WHERE `ext_name`='task' AND ext_has_css='N' LIMIT 1");
 
                // This update depends on sql_patches update!
                EXT_ADD_UPDATE_DEPENDS('sql_patches');
@@ -137,7 +137,7 @@ case 'update': // Update an extension
 
        case '0.1.3': // SQL queries for v0.1.3
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.1.4': // SQL queries for v0.1.4
@@ -258,7 +258,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 4787ac47c59131c0a353ce47ae0bb4dd593c89d6..be1cc942d6901afc3e6b53b61da3f447f6d8fd79 100644 (file)
@@ -103,7 +103,7 @@ case 'update': // Update an extension
 
        case '0.0.5': // SQL queries for v0.0.5
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
+               EXT_SET_UPDATE_NOTES("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
                break;
 
        case '0.0.6': // SQL queries for v0.0.6
index 9b12b401dcf6296c2098f04c5a37e6bf2356b956..c9f433d9c3db302c7ba094f1a7d7d4707b82c00b 100644 (file)
@@ -189,7 +189,7 @@ case 'update': // Update an extension
 
        case '0.1.4': // SQL queries for v0.1.4
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.1.5': // SQL queries for v0.1.5
index ba3cad02c19223fdf2557f052e3290f86340e301..8b4a1c8b75f567367faad5ed4f6b392a89e61999 100644 (file)
@@ -251,7 +251,7 @@ case 'update': // Update an extension
 
        case '0.1.9': // SQL queries for v0.1.9
                // Update notes (these will be set as task text!)
-               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>ADMIN_USER_PROFILE_LINK()</u> ausgelagert.");
+               EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion <u>generateUserProfileLink()</u> ausgelagert.");
                break;
 
        case '0.2.0': // SQL queries for v0.2.0
@@ -379,7 +379,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 // [EOF]
 ?>
index bf67af29c1ec1da3ad824fd6f96effa5eeabe28e..e03be7fc2ce6d30548f405c431a010d72b29af15 100644 (file)
@@ -50,7 +50,7 @@ EXT_SET_VERSION('0.0');
 EXT_SET_VER_HISTORY(array('0.0'));
 
 // This extension is deprecated!
-// Only since 'network' is ready! EXT_SET_DEPRECATED("Y");
+// Only since 'network' is ready! EXT_SET_DEPRECATED('Y');
 
 switch ($EXT_LOAD_MODE)
 {
@@ -144,7 +144,7 @@ default: // Do stuff when extension is loaded
 }
 
 // Keep this extension always active!
-EXT_SET_ALWAYS_ACTIVE("Y");
+EXT_SET_ALWAYS_ACTIVE('Y');
 
 //
 ?>
index 46dcce0fa63a0ce0f30b5a19e2edc3a356055828..3d4a97a7fc8e03ce4be84eda8e61fef787669f59 100644 (file)
@@ -89,7 +89,7 @@ if (getTotalFatalErrors() > 0) {
        $CORR = getMessage('FATAL_REPORT_ERRORS');
 
        // PHP warnings fixed
-       if ($check == "done") {
+       if ($check == 'done') {
                if (IS_ADMIN()) $CORR = getMessage('FATAL_CORRECT_ERRORS');
        } // END - if
 
index 35f5d6d90bc387a17100f5d4f842d2532afcce2e..74cda8e85b8eea7d71b122241ff1306f477ae650 100644 (file)
@@ -118,14 +118,14 @@ ORDER BY `filter_id` ASC", __FUNCTION__, __LINE__);
        // Filters for post-extension-registration
        REGISTER_FILTER('post_extension_installed', 'AUTO_ACTIVATE_EXTENSION');
        REGISTER_FILTER('post_extension_installed', 'SOLVE_TASK');
-       REGISTER_FILTER('post_extension_installed', 'LOAD_INCLUDES');
+       REGISTER_FILTER('post_extension_installed', 'loadIncludeLUDES');
        REGISTER_FILTER('post_extension_installed', 'REMOVE_UPDATES');
 
        // Solving tasks
        REGISTER_FILTER('solve_task', 'SOLVE_TASK');
 
        // Loading includes in general
-       REGISTER_FILTER('load_includes', 'LOAD_INCLUDES');
+       REGISTER_FILTER('load_includes', 'loadIncludeLUDES');
 
        // Run SQLs
        REGISTER_FILTER('run_sqls', 'RUN_SQLS');
@@ -163,7 +163,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo
        // Shall we add it?
        if (!$dry_run) {
                // Simply add it to the array
-               $GLOBALS['filters']['chains'][$filterName][$filterFunction] = "Y";
+               $GLOBALS['filters']['chains'][$filterName][$filterFunction] = 'Y';
                $GLOBALS['filters']['counter'][$filterName][$filterFunction] = 0;
        } // END - if
 }
@@ -349,7 +349,7 @@ function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () {
        // Is the element set?
        if (isset($GLOBALS['ext_load_mode'])) {
                // Redirect here
-               LOAD_URL('modules.php?module=admin&amp;logout=1&amp;' . $GLOBALS['ext_load_mode'] . '=sql_patches');
+               redirectToUrl('modules.php?module=admin&amp;logout=1&amp;' . $GLOBALS['ext_load_mode'] . '=sql_patches');
        } // END - if
 
        // This should not happen!
@@ -388,7 +388,7 @@ function FILTER_SOLVE_TASK ($data) {
 }
 
 // Filter to load include files
-function FILTER_LOAD_INCLUDES () {
+function FILTER_loadIncludeLUDES () {
        // Default is $data as inclusion list
        $data = GET_INC_POOL();
 
@@ -405,7 +405,7 @@ function FILTER_LOAD_INCLUDES () {
        if (COUNT_INC_POOL() > 0) {
                // Loads every include file
                foreach (GET_INC_POOL() as $FQFN) {
-                       LOAD_INC_ONCE($FQFN);
+                       loadIncludeOnce($FQFN);
                } // END - foreach
 
                // Reset array
@@ -458,7 +458,7 @@ function FILTER_UPDATE_LOGIN_DATA () {
        if (!IS_MEMBER()) return false;
 
        // Secure user ID
-       setUserId(get_session('userid'));
+       setUserId(getSession('userid'));
 
        // Load last module and last online time
        $result = SQL_QUERY_ESC("SELECT last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
@@ -481,15 +481,15 @@ function FILTER_UPDATE_LOGIN_DATA () {
                if (empty($GLOBALS['what'])) {
                        // Fix it to default
                        $GLOBALS['what'] = "welcome";
-                       if (getConfig('index_home') != "") $GLOBALS['what'] = getConfig('index_home');
+                       if (getConfig('index_home') != '') $GLOBALS['what'] = getConfig('index_home');
                } // END - if
 
                // Update last module / online time
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `last_module`='%s', last_online=UNIX_TIMESTAMP(), REMOTE_ADDR='%s' WHERE userid=%s LIMIT 1",
-                       array($GLOBALS['what'], GET_REMOTE_ADDR(), getUserId()), __FUNCTION__, __LINE__);
+                       array($GLOBALS['what'], detectRemoteAddr(), getUserId()), __FUNCTION__, __LINE__);
        }  else {
                // Destroy session, we cannot update!
-               destroy_user_session();
+               destroyUserSession();
        }
 
        // Free the result
@@ -507,11 +507,11 @@ function FILTER_CHECK_ADMIN_ACL () {
                $action = SQL_ESCAPE($GLOBALS['action']);
                if (!empty($GLOBALS['what'])) {
                        // Get action value by what-value
-                       $action = GET_ACTION('admin', $GLOBALS['what']);
+                       $action = getModeAction('admin', $GLOBALS['what']);
                } // END - if
 
                // Check for access control line of current menu entry
-               $ret = ADMINS_CHECK_ACL($action, $GLOBALS['what']);
+               $ret = adminsCheckAdminAcl($action, $GLOBALS['what']);
        } // END - if
 
        // Return result
index 6732002b383af47939257eba29aea1656bb5abad..556022f0bff0d16b97ce3e44dcd5e84f2760360a 100644 (file)
@@ -49,7 +49,7 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != "1") &&
        // Output the generated HTML code or do nothing in direct-mode
        if (getTotalFatalErrors() > 0) {
                // Output fatal error messages
-               LOAD_INC_ONCE("inc/fatal_errors.php");
+               loadIncludeOnce("inc/fatal_errors.php");
        } // END - if
 
        // Shall we display the copyright notice?
@@ -67,7 +67,7 @@ if ((((!isset($GLOBALS['footer_sent'])) || (($GLOBALS['footer_sent'] != "1") &&
        // Shall we display the parsing time and number of queries?
        if ((GET_EXT_VERSION('sql_patches') >= '0.4.1') && (getConfig('show_timings') == 'Y') && (!REQUEST_ISSET_GET(('frame'))) && ($GLOBALS['header_sent'] == "2")) {
                // Then display it here
-               DISPLAY_PARSING_TIME_FOOTER();
+               displayParsingTime();
        } // END - if
 
        // Load page footer
index 66da69fa61f5cb46a9a58d806fe5103edcf7c4e3..49ecee6906b7c82217b5860fd49e96f0b1144cc5 100644 (file)
@@ -55,7 +55,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                        // That's why you don't need any \n at the end of your HTML code... :-)
                        if (constant('_OB_CACHING') == "on") {
                                // Output into PHP's internal buffer
-                               OUTPUT_RAW($HTML);
+                               outputRawCode($HTML);
 
                                // That's why you don't need any \n at the end of your HTML code... :-)
                                if ($newLine) echo "\n";
@@ -68,12 +68,12 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                        }
                        break;
 
-               case "direct":
+               case 'direct':
                        // If we are switching from render to direct output rendered code
-                       if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != "on")) { OUTPUT_RAW($OUTPUT); $OUTPUT = ''; }
+                       if ((!empty($OUTPUT)) && (constant('_OB_CACHING') != "on")) { outputRawCode($OUTPUT); $OUTPUT = ''; }
 
                        // The same as above... ^
-                       OUTPUT_RAW($HTML);
+                       outputRawCode($HTML);
                        if ($newLine) echo "\n";
                        break;
 
@@ -116,7 +116,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
 
                // Extension 'rewrite' installed?
                if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
-                       $OUTPUT = REWRITE_LINKS($OUTPUT);
+                       $OUTPUT = rewriteLinksInCode($OUTPUT);
                } // END - if
 
                // Compile and run finished rendered HTML code
@@ -135,11 +135,11 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                } // END - while
 
                // Output code here, DO NOT REMOVE! ;-)
-               OUTPUT_RAW($OUTPUT);
+               outputRawCode($OUTPUT);
        } elseif ((constant('OUTPUT_MODE') == "render") && (!empty($OUTPUT))) {
                // Rewrite links when rewrite extension is active
                if ((EXT_IS_ACTIVE('rewrite')) && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) {
-                       $OUTPUT = REWRITE_LINKS($OUTPUT);
+                       $OUTPUT = rewriteLinksInCode($OUTPUT);
                } // END - if
 
                // Compile and run finished rendered HTML code
@@ -149,12 +149,12 @@ function OUTPUT_HTML ($HTML, $newLine = true) {
                } // END - while
 
                // Output code here, DO NOT REMOVE! ;-)
-               OUTPUT_RAW($OUTPUT);
+               outputRawCode($OUTPUT);
        }
 }
 
 // Output the raw HTML code
-function OUTPUT_RAW ($HTML) {
+function outputRawCode ($HTML) {
        // Output stripped HTML code to avoid broken JavaScript code, etc.
        echo stripslashes(stripslashes($HTML));
 
@@ -177,7 +177,6 @@ function getFatalArray () {
 
 // Add a fatal error message to the queue array
 function addFatalMessage ($F, $L, $message, $extra='') {
-       debug_report_bug($message);
        if (is_array($extra)) {
                // Multiple extras for a message with masks
                $message = call_user_func_array('sprintf', $extra);
@@ -223,9 +222,9 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        incrementConfigEntry('num_templates');
 
        // Prepare IP number and User Agent
-       $REMOTE_ADDR     = GET_REMOTE_ADDR();
+       $REMOTE_ADDR     = detectRemoteAddr();
        if (!defined('REMOTE_ADDR')) define('REMOTE_ADDR', $REMOTE_ADDR);
-       $HTTP_USER_AGENT = GET_USER_AGENT();
+       $HTTP_USER_AGENT = detectUserAgent();
 
        // Init some data
        $ret = '';
@@ -243,7 +242,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                        $content = merge_array($content, SQL_FETCHARRAY($result));
 
                        // Translate gender
-                       $content['gender'] = TRANSLATE_GENDER($content['gender']);
+                       $content['gender'] = translateGender($content['gender']);
                } else {
                        // @DEPRECATED
                        // @TODO Fine all templates which are using these direct variables and rewrite them.
@@ -251,7 +250,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                        list($gender, $surname, $family, $email) = SQL_FETCHROW($result);
 
                        // Translate gender
-                       $gender = TRANSLATE_GENDER($gender);
+                       $gender = translateGender($gender);
                        DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("DEPRECATION-WARNING: content is not array (%s).", gettype($content)));
                }
 
@@ -260,10 +259,10 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        } // END - if
 
        // Generate date/time string
-       $date_time = MAKE_DATETIME(time(), "1");
+       $date_time = generateDateTime(time(), "1");
 
        // Base directory
-       $basePath = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
+       $basePath = sprintf("%stemplates/%s/html/", constant('PATH'), getLanguage());
        $mode = '';
 
        // Check for admin/guest/member templates
@@ -290,7 +289,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                $test = substr($template, 0, strpos($template, "_"));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
-                       $mode = $test."/";
+                       $mode = $test.'/';
                }
        }
 
@@ -309,22 +308,22 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
                );
 
                // Probe for it...
-               if (FILE_READABLE($file2)) $FQFN = $file2;
+               if (isFileReadable($file2)) $FQFN = $file2;
 
                // Remove variable from memory
                unset($file2);
        }
 
        // Does the special template exists?
-       if (!FILE_READABLE($FQFN)) {
+       if (!isFileReadable($FQFN)) {
                // Reset to default template
                $FQFN = $basePath.$template.".tpl";
        } // END - if
 
        // Now does the final template exists?
-       if (FILE_READABLE($FQFN)) {
+       if (isFileReadable($FQFN)) {
                // The local file does exists so we load it. :)
-               $tmpl_file = READ_FILE($FQFN);
+               $tmpl_file = readFromFile($FQFN);
 
                // Replace ' to our own chars to preventing them being quoted
                while (strpos($tmpl_file, "'") !== false) { $tmpl_file = str_replace("'", '{QUOT}', $tmpl_file); }
@@ -375,7 +374,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
 }
 
 // Send mail out to an email address
-function SEND_EMAIL($toEmail, $subject, $message, $HTML = "N", $mailHeader = "") {
+function sendEmail($toEmail, $subject, $message, $HTML = 'N', $mailHeader = '') {
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):TO={$toEmail},SUBJECT={$subject}<br />\n";
 
        // Compile subject line (for POINTS constant etc.)
@@ -405,7 +404,7 @@ function SEND_EMAIL($toEmail, $subject, $message, $HTML = "N", $mailHeader = "")
                        // Free result
                        SQL_FREERESULT($result_email);
                }
-       } elseif ("$toEmail" == "0") {
+       } elseif ("$toEmail" == '0') {
                // Is the webmaster!
                $toEmail = constant('WEBMASTER');
        }
@@ -440,7 +439,7 @@ function SEND_EMAIL($toEmail, $subject, $message, $HTML = "N", $mailHeader = "")
        eval($eval);
 
        // Fix HTML parameter (default is no!)
-       if (empty($HTML)) $HTML = "N";
+       if (empty($HTML)) $HTML = 'N';
        if (isDebugModeEnabled()) {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
                print("<pre>
@@ -465,7 +464,7 @@ Message : ".$message."
 // @TODO Rewrite this to an extension 'smtp'
 // @private
 function CHECK_PHPMAILER_USAGE() {
-       return ((defined('SMTP_HOSTNAME')) && (defined('SMTP_USER')) && (defined('SMTP_PASSWORD')) && (constant('SMTP_HOSTNAME') != "") && (constant('SMTP_USER') != ""));
+       return ((defined('SMTP_HOSTNAME')) && (defined('SMTP_USER')) && (defined('SMTP_PASSWORD')) && (constant('SMTP_HOSTNAME') != '') && (constant('SMTP_USER') != ''));
 }
 
 /*
@@ -475,8 +474,8 @@ function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
        // Shall we use PHPMailer class or legacy mode?
        if (CHECK_PHPMAILER_USAGE()) {
                // Use PHPMailer class with SMTP enabled
-               LOAD_INC_ONCE("inc/phpmailer/class.phpmailer.php");
-               LOAD_INC_ONCE("inc/phpmailer/class.smtp.php");
+               loadIncludeOnce("inc/phpmailer/class.phpmailer.php");
+               loadIncludeOnce("inc/phpmailer/class.smtp.php");
 
                // get new instance
                $mail = new PHPMailer();
@@ -513,15 +512,14 @@ function SEND_RAW_EMAIL ($toEmail, $subject, $msg, $from) {
                @mail($toEmail, $subject, decodeEntities($msg), $from);
        }
 }
-//
 
 // Generate a password in a specified length or use default password length
-function GEN_PASS ($LEN = 0) {
+function generatePassword ($LEN = 0) {
        // Auto-fix invalid length of zero
        if ($LEN == 0) $LEN = getConfig('pass_len');
 
        // Initialize array with all allowed chars
-       $ABC = 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,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,0,1,2,3,4,5,6,7,8,9,-,+,_,/");
+       $ABC = 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,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,0,1,2,3,4,5,6,7,8,9,-,+,_,/');
 
        // Start creating password
        $PASS = '';
@@ -529,7 +527,8 @@ function GEN_PASS ($LEN = 0) {
                $PASS .= $ABC[mt_rand(0, count($ABC) -1)];
        } // END - for
 
-       // When the size is below 40 we can also add additional security by scrambling it
+       // When the size is below 40 we can also add additional security by scrambling
+       // it. Otherwise we may corrupt hashes
        if (strlen($PASS) <= 40) {
                // Also scramble the password
                $PASS = scrambleString($PASS);
@@ -538,37 +537,38 @@ function GEN_PASS ($LEN = 0) {
        // Return the password
        return $PASS;
 }
-//
-function MAKE_DATETIME ($time, $mode="0")
-{
+
+// Generates a human-readable timestamp from the Uni* stamp
+function generateDateTime ($time, $mode = '0') {
+       // Filter out numbers
+       $time = bigintval($time);
+
+       // If the stamp is zero it mostly didn't "happen"
        if ($time == 0) {
                // Never happend
-               return NEVER_HAPPENED;
-       } else {
-               // Filter out numbers
-               $time = bigintval($time);
-       }
+               return getMessage('NEVER_HAPPENED');
+       } // END - if
 
-       switch (GET_LANGUAGE())
+       switch (getLanguage())
        {
-       case "de": // German date / time format
+       case 'de': // German date / time format
                switch ($mode) {
-                       case "0": $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
-                       case "1": $ret = strtolower(date("d.m.Y - H:i", $time)); break;
-                       case "2": $ret = date("d.m.Y|H:i", $time); break;
-                       case "3": $ret = date("d.m.Y", $time); break;
+                       case '0': $ret = date("d.m.Y \u\m H:i \U\h\\r", $time); break;
+                       case '1': $ret = strtolower(date("d.m.Y - H:i", $time)); break;
+                       case '2': $ret = date("d.m.Y|H:i", $time); break;
+                       case '3': $ret = date("d.m.Y", $time); break;
                        default:
                                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                break;
                }
                break;
 
-       default:        // Default is the US date / time format!
+       default: // Default is the US date / time format!
                switch ($mode) {
-                       case "0": $ret = date("r", $time); break;
-                       case "1": $ret = date("Y-m-d - g:i A", $time); break;
-                       case "2": $ret = date("y-m-d|H:i", $time); break;
-                       case "3": $ret = date("y-m-d", $time); break;
+                       case '0': $ret = date("r", $time); break;
+                       case '1': $ret = date("Y-m-d - g:i A", $time); break;
+                       case '2': $ret = date("y-m-d|H:i", $time); break;
+                       case '3': $ret = date("y-m-d", $time); break;
                        default:
                                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
                                break;
@@ -577,10 +577,45 @@ function MAKE_DATETIME ($time, $mode="0")
        return $ret;
 }
 
+// Translates Y/N to yes/no
+function translateYesNo ($yn) {
+       // Default
+       $translated = "??? (".$yn.")";
+       switch ($yn) {
+               case 'Y': $translated = getMessage('YES'); break;
+               case 'N': $translated = getMessage('NO'); break;
+               default:
+                       // Log unknown value
+                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown value %s. Expected Y/N!", $yn));
+                       break;
+       }
+
+       // Return it
+       return $translated;
+}
+
+// Translates the "pool type" into human-readable
+function translatePoolType ($type) {
+       // Default?type is unknown
+       $translated = sprintf(getMessage('POOL_TYPE_UNKNOWN'), $type);
+
+       // Generate constant
+       $constName = sprintf("POOL_TYPE_%s", $type);
+
+       // Does it exist?
+       if (defined($constName)) {
+               // Then use it
+               $translated = getMessage($constName);
+       } // END - if
+
+       // Return "translation"
+       return $translated;
+}
+
 // Translates the american decimal dot into a german comma
-function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
+function translateComma ($dotted, $cut = true, $max = 0) {
        // Default is 3 you can change this in admin area "Misc -> Misc Options"
-       if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', "3");
+       if (!isConfigEntrySet('max_comma')) setConfigEntry('max_comma', '3');
 
        // Use from config is default
        $maxComma = getConfig('max_comma');
@@ -591,7 +626,7 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
        // Cut zeros off?
        if (($cut) && ($max == 0)) {
                // Test for commata if in cut-mode
-               $com = explode(".", $dotted);
+               $com = explode('.', $dotted);
                if (count($com) < 2) {
                        // Don't display commatas even if there are none... ;-)
                        $maxComma = 0;
@@ -602,13 +637,13 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "dotted={$dotted},maxComma={$maxComma}");
 
        // Translate it now
-       switch (GET_LANGUAGE()) {
-       case "de":
-               $dotted = number_format($dotted, $maxComma, ",", ".");
+       switch (getLanguage()) {
+       case 'de':
+               $dotted = number_format($dotted, $maxComma, ',', '.');
                break;
 
        default:
-               $dotted = number_format($dotted, $maxComma, ".", ",");
+               $dotted = number_format($dotted, $maxComma, '.', ',');
                break;
        }
 
@@ -616,20 +651,8 @@ function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
        return $dotted;
 }
 
-//
-function DEREFERER ($URL) {
-       // Don't de-refer our own links!
-       if (substr($URL, 0, strlen(URL)) != URL) {
-               // De-refer this link
-               $URL = 'modules.php?module=loader&amp;url=' . encodeString(compileUriCode($URL));
-       } // END - if
-
-       // Return link
-       return $URL;
-}
-
 // Translate Uni*-like gender to human-readable
-function TRANSLATE_GENDER ($gender) {
+function translateGender ($gender) {
        // Default
        $ret = '!' . $gender . '!';
 
@@ -648,33 +671,8 @@ function TRANSLATE_GENDER ($gender) {
        return $ret;
 }
 
-//
-function FRAMETESTER ($URL) {
-       // Prepare frametester URL
-       $frametesterUrl = sprintf("{!URL!}/modules.php?module=frametester&amp;url=%s",
-               encodeString(compileUriCode($URL))
-       );
-       return $frametesterUrl;
-}
-
-//
-function SELECTION_COUNT ($array) {
-       $ret = 0;
-       if (is_array($array)) {
-               foreach ($array as $key => $selected) {
-                       if (!empty($selected)) $ret++;
-               }
-       }
-       return $ret;
-}
-
-//
-function IMG_CODE ($code, $type, $DATA, $uid) {
-       return '<IMG border="0" alt="Code" src="{!URL!}/mailid_top.php?uid=' . $uid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
-}
-
-//
-function TRANSLATE_STATUS ($status) {
+// "Translates" the user status
+function translateUserStatus ($status) {
        switch ($status)
        {
        case 'UNCONFIRMED':
@@ -697,8 +695,51 @@ function TRANSLATE_STATUS ($status) {
        // Return it
        return $ret;
 }
-//
-function GET_LANGUAGE() {
+
+// Generates an URL for the dereferer
+function DEREFERER ($URL) {
+       // Don't de-refer our own links!
+       if (substr($URL, 0, strlen(constant('URL'))) != constant('URL')) {
+               // De-refer this link
+               $URL = 'modules.php?module=loader&amp;url=' . encodeString(compileUriCode($URL));
+       } // END - if
+
+       // Return link
+       return $URL;
+}
+
+// Generates an URL for the frametester
+function FRAMETESTER ($URL) {
+       // Prepare frametester URL
+       $frametesterUrl = sprintf("{!URL!}/modules.php?module=frametester&amp;url=%s",
+               encodeString(compileUriCode($URL))
+       );
+       return $frametesterUrl;
+}
+
+// Count entries from e.g. a selection box
+function countSelection ($array) {
+       $ret = 0;
+       if (is_array($array)) {
+               foreach ($array as $key => $selected) {
+                       if (!empty($selected)) $ret++;
+               }
+       }
+       return $ret;
+}
+
+// Wrapper for $_POST['sel']
+function countPostSelection () {
+       return countSelection(REQUEST_POST('sel'));
+}
+
+// Generate XHTML code for the CAPTCHA
+function generateCaptchaCode ($code, $type, $DATA, $uid) {
+       return '<IMG border="0" alt="Code" src="{!URL!}/mailid_top.php?uid=' . $uid . '&amp;' . $type . '=' . $DATA . '&amp;mode=img&amp;code=' . $code . '" />';
+}
+
+// "Getter" for language
+function getLanguage () {
        // Set default return value to default language from config
        $ret = constant('DEFAULT_LANG');
 
@@ -714,13 +755,13 @@ function GET_LANGUAGE() {
                $ret = $GLOBALS['cache_array']['language'];
        } elseif (!empty($lang)) {
                // Check if main language file does exist
-               if (FILE_READABLE(constant('PATH').'inc/language/'.$lang.'.php')) {
+               if (isFileReadable(constant('PATH').'inc/language/'.$lang.'.php')) {
                        // Okay found, so let's update cookies
-                       SET_LANGUAGE($lang);
+                       setLanguage($lang);
                }
        } elseif (!isSessionVariableSet('mx_lang')) {
                // Return stored value from cookie
-               $ret = get_session('mx_lang');
+               $ret = getSession('mx_lang');
 
                // Fixes a warning before the session has the mx_lang constant
                if (empty($ret)) $ret = constant('DEFAULT_LANG');
@@ -732,16 +773,18 @@ function GET_LANGUAGE() {
        // Return value
        return $ret;
 }
-//
-function SET_LANGUAGE ($lang) {
+
+// "Setter" for language
+function setLanguage ($lang) {
        // Accept only first 2 chars!
        $lang = substr(SQL_ESCAPE(strip_tags($lang)), 0, 2);
 
        // Set cookie
-       set_session('mx_lang', $lang);
+       setSession('mx_lang', $lang);
 }
-//
-function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
+
+// Loads an email template and compiles it
+function LOAD_EMAIL_TEMPLATE ($template, $content = array(), $UID = '0') {
        global $DATA, $_CONFIG;
 
        // Make sure all template names are lowercase!
@@ -751,8 +794,8 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        $nick = '---';
 
        // Prepare IP number and User Agent
-       $REMOTE_ADDR     = GET_REMOTE_ADDR();
-       $HTTP_USER_AGENT = GET_USER_AGENT();
+       $REMOTE_ADDR     = detectRemoteAddr();
+       $HTTP_USER_AGENT = detectUserAgent();
 
        // Default admin
        $ADMIN = constant('MAIN_TITLE');
@@ -760,22 +803,23 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        // Is the admin logged in?
        if (IS_ADMIN()) {
                // Get admin id
-               $aid = GET_CURRENT_ADMIN_ID();
+               $aid = getCurrentAdminId();
 
                // Load Admin data
-               $ADMIN = GET_ADMIN_EMAIL($aid);
+               $ADMIN = getAdminEmail($aid);
        } // END - if
 
        // Neutral email address is default
        $email = constant('WEBMASTER');
 
        // Expiration in a nice output format
+       // NOTE: Use $content[expiration] in your templates instead of $EXPIRATION
        if (getConfig('auto_purge') == 0) {
                // Will never expire!
                $EXPIRATION = getMessage('MAIL_WILL_NEVER_EXPIRE');
        } else {
                // Create nice date string
-               $EXPIRATION = CREATE_FANCY_TIME(getConfig('auto_purge'));
+               $EXPIRATION = createFancyTime(getConfig('auto_purge'));
        }
 
        // Is content an array?
@@ -810,7 +854,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        } // END - if
 
        // Translate M to male or F to female if present
-       if (isset($content['gender'])) $content['gender'] = TRANSLATE_GENDER($content['gender']);
+       if (isset($content['gender'])) $content['gender'] = translateGender($content['gender']);
 
        // Overwrite email from data if present
        if (isset($content['email'])) $email = $content['email'];
@@ -819,41 +863,41 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        $DATA['email'] = $email;
 
        // Base directory
-       $basePath = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
+       $basePath = sprintf("%stemplates/%s/emails/", constant('PATH'), getLanguage());
 
        // Check for admin/guest/member templates
-       if (strpos($template, "admin_") > -1) {
+       if (strpos($template, 'admin_') > -1) {
                // Admin template found
-               $FQFN = $basePath."admin/".$template.".tpl";
-       } elseif (strpos($template, "guest_") > -1) {
+               $FQFN = $basePath.'admin/'.$template.'.tpl';
+       } elseif (strpos($template, 'guest_') > -1) {
                // Guest template found
-               $FQFN = $basePath."guest/".$template.".tpl";
-       } elseif (strpos($template, "member_") > -1) {
+               $FQFN = $basePath.'guest/'.$template.'.tpl';
+       } elseif (strpos($template, 'member_') > -1) {
                // Member template found
-               $FQFN = $basePath."member/".$template.".tpl";
+               $FQFN = $basePath.'member/'.$template.'.tpl';
        } else {
                // Test for extension
-               $test = substr($template, 0, strpos($template, "_"));
+               $test = substr($template, 0, strpos($template, '_'));
                if (EXT_IS_ACTIVE($test)) {
                        // Set extra path to extension's name
-                       $FQFN = $basePath.$test."/".$template.".tpl";
+                       $FQFN = $basePath.$test.'/'.$template.'.tpl';
                } else {
                        // No special filename
-                       $FQFN = $basePath.$template.".tpl";
+                       $FQFN = $basePath.$template.'.tpl';
                }
        }
 
        // Does the special template exists?
-       if (!FILE_READABLE($FQFN)) {
+       if (!isFileReadable($FQFN)) {
                // Reset to default template
-               $FQFN = $basePath.$template.".tpl";
+               $FQFN = $basePath.$template.'.tpl';
        } // END - if
 
        // Now does the final template exists?
        $newContent = '';
-       if (FILE_READABLE($FQFN)) {
+       if (isFileReadable($FQFN)) {
                // The local file does exists so we load it. :)
-               $tmpl_file = READ_FILE($FQFN);
+               $tmpl_file = readFromFile($FQFN);
                $tmpl_file = SQL_ESCAPE($tmpl_file);
 
                // Run code
@@ -890,25 +934,27 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID='0') {
        // Return compiled content
        return COMPILE_CODE($newContent);
 }
-//
-function MAKE_TIME ($H, $M, $S, $stamp) {
+
+// Generates a timestamp (wrapper for mktime())
+function makeTime ($H, $M, $S, $stamp) {
        // Extract day, month and year from given timestamp
-       $DAY   = date("d", $stamp);
-       $MONTH = date("m", $stamp);
-       $YEAR  = date('Y', $stamp);
+       $day   = date('d', $stamp);
+       $month = date('m', $stamp);
+       $year  = date('Y', $stamp);
 
        // Create timestamp for wished time which depends on extracted date
-       return mktime($H, $M, $S, $MONTH, $DAY, $YEAR);
+       return mktime($H, $M, $S, $month, $day, $year);
 }
-//
-function LOAD_URL ($URL, $addUrlData=true) {
+
+// Redirects to an URL and if neccessarry extends it with own base URL
+function redirectToUrl ($URL, $addUrlData=true) {
        // Compile out URI codes
        $URL = compileUriCode($URL);
 
        // Check if http(s):// is there
-       if ((substr($URL, 0, 7) != "http://") && (substr($URL, 0, 8) != "https://")) {
+       if ((substr($URL, 0, 7) != 'http://') && (substr($URL, 0, 8) != 'https://')) {
                // Make all URLs full-qualified
-               $URL = "".$URL;
+               $URL = constant('URL') . '/' . $URL;
        } // END - if
 
        // Three different debug ways...
@@ -916,6 +962,15 @@ function LOAD_URL ($URL, $addUrlData=true) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, $URL);
        //* DEBUG: */ die($URL);
 
+       // Default 'rel' value is external, nofollow is evil from Google and hurts the Internet
+       $rel = ' rel="external"';
+
+       // Do we have internal or external URL?
+       if (substr($URL, 0, strlen(constant('URL'))) == constant('URL')) {
+               // Own (=internal) URL
+               $rel = '';
+       } // END - if
+
        // Get output buffer
        $OUTPUT = ob_get_contents();
 
@@ -925,31 +980,31 @@ function LOAD_URL ($URL, $addUrlData=true) {
        } // END - if
 
        // Add some data to URL if cookies are not accepted
-       if (((!defined('__COOKIES')) || (!constant('__COOKIES'))) && ($addUrlData)) $URL = ADD_URL_DATA($URL);
+       if ((!isBooleanConstantAndTrue('__COOKIES')) && ($addUrlData === true)) $URL = addUrlData($URL);
 
-       // Probe for bot from search engine
-       if ((eregi("spider", GET_USER_AGENT())) || (eregi("bot", GET_USER_AGENT()))) {
-               // Search engine bot detected so let's rewrite many chars for the link
-               $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
+       // Secure the URL against bad things such als HTML insertions and so on...
+       $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
 
+       // Simple probe for bots/spiders from search engines
+       if ((strpos(detectUserAgent(), 'spider') !== false) || (strpos(detectUserAgent(), 'bot') !== false)) {
                // Output new location link as anchor
-               OUTPUT_HTML("<a href=\"".$URL."\">".$URL."</a>");
+               OUTPUT_HTML('<a href="' . $URL . '"' . $rel . '>' . $URL . '</a>');
        } elseif (!headers_sent()) {
                // Load URL when headers are not sent
                //* DEBUG: */ debug_report_bug("URL={$URL}");
-               header ("Location: ".str_replace("&amp;", "&", $URL));
+               header ('Location: '.str_replace('&amp;', '&', $URL));
        } else {
                // Output error message
-               LOAD_INC('inc/header.php');
-               LOAD_TEMPLATE("redirect_url", false, str_replace("&amp;", "&", $URL));
-               LOAD_INC('inc/footer.php');
+               loadInclude('inc/header.php');
+               LOAD_TEMPLATE('redirect_url', false, str_replace('&amp;', '&', $URL));
+               loadInclude('inc/footer.php');
        }
 
        // Shut the mailer down here
        shutdown();
 }
 
-// Wrapper for LOAD_URL but URL comes from a configuration entry
+// Wrapper for redirectToUrl but URL comes from a configuration entry
 function LOAD_CONFIGURED_URL ($configEntry) {
        // Get the URL
        $URL = getConfig($configEntry);
@@ -961,7 +1016,7 @@ function LOAD_CONFIGURED_URL ($configEntry) {
        } // END - if
 
        // Load the URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 }
 
 //
@@ -1047,7 +1102,7 @@ function COMPILE_CODE ($code, $simple = false, $constants = true, $full = true)
        // Return compiled code
        return $code;
 }
-//
+
 /************************************************************************
  *                                                                      *
  * Gaenderter Sortier-Algorythmus, $array wird nach dem Array (!)       *
@@ -1100,7 +1155,7 @@ function array_pk_sort (&$array, $a_sort, $primary_key = 0, $order = -1, $nums =
 }
 
 //
-function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
+function ADD_SELECTION ($type, $default, $prefix = '', $id = '0') {
        $OUT = '';
 
        if ($type == 'yn') {
@@ -1119,7 +1174,7 @@ function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
        case "day": // Day
                for ($idx = 1; $idx < 32; $idx++) {
                        $OUT .= "<option value=\"".$idx."\"";
-                       if ($DEFAULT == $idx) $OUT .= ' selected="selected"';
+                       if ($default == $idx) $OUT .= ' selected="selected"';
                        $OUT .= ">".$idx."</option>\n";
                } // END - for
                break;
@@ -1127,37 +1182,37 @@ function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
        case "month": // Month
                foreach ($GLOBALS['month_descr'] as $month => $descr) {
                        $OUT .= "<option value=\"".$month."\"";
-                       if ($DEFAULT == $month) $OUT .= ' selected="selected"';
+                       if ($default == $month) $OUT .= ' selected="selected"';
                        $OUT .= ">".$descr."</option>\n";
                } // END - for
                break;
 
        case "year": // Year
                // Get current year
-               $YEAR = date('Y', time());
+               $year = date('Y', time());
 
                // Use configured min age or fixed?
                if (GET_EXT_VERSION('other') >= '0.2.1') {
                        // Configured
-                       $startYear = $YEAR - getConfig('min_age');
+                       $startYear = $year - getConfig('min_age');
                } else {
                        // Fixed 16 years
-                       $startYear = $YEAR - 16;
+                       $startYear = $year - 16;
                }
 
                // Calculate earliest year (100 years old people can still enter Internet???)
-               $minYear = $YEAR - 100;
+               $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++) {
+               if (($default > $minYear) && ($default >= $year)) {
+                       for ($idx = $year; $idx < ($year + 11); $idx++) {
                                $OUT .= "<option value=\"".$idx."\"";
-                               if ($DEFAULT == $idx) $OUT .= ' selected="selected"';
+                               if ($default == $idx) $OUT .= ' selected="selected"';
                                $OUT .= ">".$idx."</option>\n";
                        } // END - for
-               } elseif ($DEFAULT == -1) {
+               } elseif ($default == -1) {
                        // Current year minus 1
-                       for ($idx = $startYear; $idx <= ($YEAR + 1); $idx++)
+                       for ($idx = $startYear; $idx <= ($year + 1); $idx++)
                        {
                                $OUT .= "<option value=\"".$idx."\">".$idx."</option>\n";
                        }
@@ -1167,16 +1222,16 @@ function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
                        // Calculate earliest year depending on extension version
                        if (GET_EXT_VERSION('other') >= '0.2.1') {
                                // Use configured minimum age
-                               $YEAR = date('Y', time()) - getConfig('min_age');
+                               $year = date('Y', time()) - getConfig('min_age');
                        } else {
                                // Use fixed 16 years age
-                               $YEAR = date('Y', time()) - 16;
+                               $year = date('Y', time()) - 16;
                        }
 
                        // Construct year selection list
-                       for ($idx = $minYear; $idx <= $YEAR; $idx++) {
+                       for ($idx = $minYear; $idx <= $year; $idx++) {
                                $OUT .= "<option value=\"".$idx."\"";
-                               if ($DEFAULT == $idx) $OUT .= ' selected="selected"';
+                               if ($default == $idx) $OUT .= ' selected="selected"';
                                $OUT .= ">".$idx."</option>\n";
                        } // END - for
                }
@@ -1185,27 +1240,27 @@ function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
        case "sec":
        case "min":
                for ($idx = 0; $idx < 60; $idx+=5) {
-                       if (strlen($idx) == 1) $idx = "0".$idx;
+                       if (strlen($idx) == 1) $idx = '0'.$idx;
                        $OUT .= "<option value=\"".$idx."\"";
-                       if ($DEFAULT == $idx) $OUT .= ' selected="selected"';
+                       if ($default == $idx) $OUT .= ' selected="selected"';
                        $OUT .= ">".$idx."</option>\n";
                } // END - for
                break;
 
        case "hour":
                for ($idx = 0; $idx < 24; $idx++) {
-                       if (strlen($idx) == 1) $idx = "0".$idx;
+                       if (strlen($idx) == 1) $idx = '0'.$idx;
                        $OUT .= "<option value=\"".$idx."\"";
-                       if ($DEFAULT == $idx) $OUT .= ' selected="selected"';
+                       if ($default == $idx) $OUT .= ' selected="selected"';
                        $OUT .= ">".$idx."</option>\n";
                } // END - for
                break;
 
        case 'yn':
                $OUT .= "<option value=\"Y\"";
-               if ($DEFAULT == 'Y') $OUT .= ' selected="selected"';
+               if ($default == 'Y') $OUT .= ' selected="selected"';
                $OUT .= ">{--YES--}</option>\n<option value=\"N\"";
-               if ($DEFAULT == 'N') $OUT .= ' selected="selected"';
+               if ($default == 'N') $OUT .= ' selected="selected"';
                $OUT .= ">{--NO--}</option>\n";
                break;
        }
@@ -1213,64 +1268,47 @@ function ADD_SELECTION ($type, $DEFAULT, $prefix="", $id="0") {
        return $OUT;
 }
 
-//
-function TRANSLATE_YESNO ($yn) {
-       // Default
-       $translated = "??? (".$yn.")";
-       switch ($yn) {
-               case 'Y': $translated = getMessage('YES'); break;
-               case 'N': $translated = getMessage('NO'); break;
-               default:
-                       // Log unknown value
-                       DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown value %s. Expected Y/N!", $yn));
-                       break;
-       }
-
-       // Return it
-       return $translated;
-}
-
 //
 // Deprecated : $length
 // Optional   : $DATA
 //
-function generateRandomCodde ($length, $code, $uid, $DATA="") {
+function generateRandomCodde ($length, $code, $uid, $DATA = '') {
        // Fix missing _MAX constant
        // @TODO Rewrite this unnice code
        if (!defined('_MAX')) define('_MAX', 15235);
 
        // Build server string
-       $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(constant('PATH')."inc/databases.php");
+       $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().":'.':".filemtime(constant('PATH')."inc/databases.php");
 
        // Build key string
-       $keys   = constant('SITE_KEY').":".constant('DATE_KEY');
-       if (isConfigEntrySet('secret_key'))  $keys .= ":".getConfig('secret_key');
-       if (isConfigEntrySet('file_hash'))   $keys .= ":".getConfig('file_hash');
-       $keys .= ":".date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
-       if (isConfigEntrySet('master_salt')) $keys .= ":".getConfig('master_salt');
+       $keys = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY');
+       if (isConfigEntrySet('secret_key'))  $keys .= constant('ENCRYPT_SEPERATOR').getConfig('secret_key');
+       if (isConfigEntrySet('file_hash'))   $keys .= constant('ENCRYPT_SEPERATOR').getConfig('file_hash');
+       $keys .= constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime')));
+       if (isConfigEntrySet('master_salt')) $keys .= constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
 
        // Build string from misc data
-       $data   = $code.":".$uid.":".$DATA;
+       $data   = $code.constant('ENCRYPT_SEPERATOR').$uid.constant('ENCRYPT_SEPERATOR').$DATA;
 
        // Add more additional data
-       if (isSessionVariableSet('u_hash'))                     $data .= ":".get_session('u_hash');
-       if (isUserIdSet())                                                      $data .= ":".getUserId();
-       if (isSessionVariableSet('mxchange_theme'))             $data .= ":".get_session('mxchange_theme');
-       if (isSessionVariableSet('mx_lang'))                    $data .= ":".GET_LANGUAGE();
-       if (isset($GLOBALS['refid']))                                   $data .= ":".$GLOBALS['refid'];
+       if (isSessionVariableSet('u_hash'))         $data .= constant('ENCRYPT_SEPERATOR').getSession('u_hash');
+       if (isUserIdSet())                          $data .= constant('ENCRYPT_SEPERATOR').getUserId();
+       if (isSessionVariableSet('mxchange_theme')) $data .= constant('ENCRYPT_SEPERATOR').getSession('mxchange_theme');
+       if (isSessionVariableSet('mx_lang'))        $data .= constant('ENCRYPT_SEPERATOR').getLanguage();
+       if (isset($GLOBALS['refid']))               $data .= constant('ENCRYPT_SEPERATOR').$GLOBALS['refid'];
 
        // Calculate number for generating the code
        $a = $code + constant('_ADD') - 1;
 
        if (isConfigEntrySet('master_hash')) {
                // Generate hash with master salt from modula of number with the prime number and other data
-               $saltedHash = generateHash(($a % constant('_PRIME')).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, getConfig('master_salt'));
+               $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, getConfig('master_salt'));
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, strlen(getConfig('master_salt')), 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
        } else {
                // Generate hash with "hash of site key" from modula of number with the prime number and other data
-               $saltedHash = generateHash(($a % constant('_PRIME')).":".$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a, substr(sha1(constant('SITE_KEY')), 0, 8));
+               $saltedHash = generateHash(($a % constant('_PRIME')).constant('ENCRYPT_SEPERATOR').$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a, substr(sha1(constant('SITE_KEY')), 0, 8));
 
                // Create number from hash
                $rcode = hexdec(substr($saltedHash, 8, 9)) / abs(constant('_MAX') - $a + sqrt(constant('_ADD'))) / pi();
@@ -1298,7 +1336,7 @@ function bigintval ($num, $castValue = true) {
 
        // Has the whole value changed?
        // @TODO Remove this if() block if all is working fine
-       if ("".$ret."" != "".$num."") {
+       if ("".$ret."" != ''.$num."") {
                // Log the values
                debug_report_bug("{$ret}<>{$num}");
        } // END - if
@@ -1318,8 +1356,8 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
        }
 
        // Load image
-       $img = sprintf("%s/theme/%s/images/code_bg.%s", constant('PATH'), GET_CURR_THEME(), getConfig('img_type'));
-       if (FILE_READABLE($img)) {
+       $img = sprintf("%s/theme/%s/images/code_bg.%s", constant('PATH'), getCurrentTheme(), getConfig('img_type'));
+       if (isFileReadable($img)) {
                // Switch image type
                switch (getConfig('img_type'))
                {
@@ -1358,16 +1396,16 @@ function GENERATE_IMAGE ($img_code, $headerSent=true) {
        imagedestroy($image);
 }
 // Create selection box or array of splitted timestamp
-function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="center", $return_array=false) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align="center", $return_array=false) {
        // Calculate 2-seconds timestamp
        $stamp = round($timestamp);
-       //* DEBUG: */ print("*".$stamp."/".$timestamp."*<br />");
+       //* DEBUG: */ print("*".$stamp.'/'.$timestamp."*<br />");
 
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
-       $M1 = date("m", time());
-       $M2 = date("m", (time() + $timestamp));
+       $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');
@@ -1440,7 +1478,7 @@ function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="ce
                        $OUT .= "  <td align=\"center\" class=\"admin_title bottom\"><div class=\"tiny\">{--_HOURS--}</strong></td>\n";
                }
 
-               if (ereg("m", $display) || (empty($display))) {
+               if (ereg('m', $display) || (empty($display))) {
                        $OUT .= "  <td align=\"center\" class=\"admin_title bottom\"><div class=\"tiny\">{--_MINUTES--}</strong></td>\n";
                }
 
@@ -1517,7 +1555,7 @@ function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="ce
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
                }
 
-               if (ereg("m", $display) || (empty($display))) {
+               if (ereg('m', $display) || (empty($display))) {
                        // Generate minute selection
                        $OUT .= "  <td align=\"center\"><select class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 59; $idx++) {
@@ -1551,14 +1589,14 @@ function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="ce
 }
 
 //
-function CREATE_TIMESTAMP_FROM_SELECTIONS ($prefix, $POST) {
+function createTimestampFromSelections ($prefix, $POST) {
        // Initial return value
        $ret = 0;
 
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
-       $M1   = date("m", time());
+       $M1   = date('m', time());
        // 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") && ($POST[$prefix."_mo"] > "02"))  $SWITCH = getConfig('one_day');
        // First add years...
@@ -1623,7 +1661,7 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
                                        $UID
                                ));
                        }
-               } elseif ($aid == "0") {
+               } elseif ($aid == '0') {
                        // Select all email adresses
                        $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`",
                                __FUNCTION__, __LINE__);
@@ -1636,17 +1674,17 @@ function SEND_ADMIN_EMAILS_PRO ($subj, $template, $content, $UID) {
 
        // Load email addresses and send away
        while ($content = SQL_FETCHARRAY($result)) {
-               SEND_EMAIL($content['email'], $subj, $msg);
+               sendEmail($content['email'], $subj, $msg);
        } // END - while
 
        // Free memory
        SQL_FREERESULT($result);
 }
 
-//
-function CREATE_FANCY_TIME ($stamp) {
+// Creates a 'fancy' human-readable timestamp from a Uni* stamp
+function createFancyTime ($stamp) {
        // Get data array with years/months/weeks/days/...
-       $data = CREATE_TIME_SELECTIONS($stamp, '', '', '', true);
+       $data = createTimeSelections($stamp, '', '', '', true);
        $ret = '';
        foreach($data as $k => $v) {
                if ($v > 0) {
@@ -1705,7 +1743,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
 
                // Add seperator if we have not yet reached total pages
                if ($page < $PAGES) $NAV .= "&nbsp;|&nbsp;";
-       }
+       } // END - for
 
        // Define constants only once
        if (!defined('__NAV_OUTPUT')) {
@@ -1713,7 +1751,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
                define('__NAV_COLSPAN', $colspan);
                define('__NAV_TOP'    , $TOP);
                define('__NAV_SEP'    , $SEP);
-       }
+       } // END - if
 
        // Load navigation template
        $OUT = LOAD_TEMPLATE("admin_email_nav_row", true);
@@ -1728,7 +1766,7 @@ function ADD_EMAIL_NAV ($PAGES, $offset, $show_form, $colspan, $return=false) {
 }
 
 // Extract host from script name
-function EXTRACT_HOST (&$script) {
+function extractHostnameFromUrl (&$script) {
        // Use default SERVER_URL by default... ;) So?
        $url = constant('SERVER_URL');
 
@@ -1736,14 +1774,14 @@ function EXTRACT_HOST (&$script) {
        if (substr($script, 0, 7) == "http://") {
                // Use the hostname from script URL as new hostname
                $url = substr($script, 7);
-               $extract = explode("/", $url);
+               $extract = explode('/', $url);
                $url = $extract[0];
                // Done extracting the URL :)
        } // END - if
 
        // Extract host name
        $host = str_replace("http://", '', $url);
-       if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
+       if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
 
        // Generate relative URL
        //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
@@ -1756,26 +1794,26 @@ function EXTRACT_HOST (&$script) {
        }
 
        //* DEBUG: */ print("SCRIPT=".$script."<br />\n");
-       if (substr($script, 0, 1) == "/") $script = substr($script, 1);
+       if (substr($script, 0, 1) == '/') $script = substr($script, 1);
 
        // Return host name
        return $host;
 }
 
 // Send a GET request
-function GET_URL ($script) {
+function sendGetRequest ($script) {
        // Compile the script name
        $script = COMPILE_CODE($script);
 
        // Extract host name from script
-       $host = EXTRACT_HOST($script);
+       $host = extractHostnameFromUrl($script);
 
        // Generate GET request header
        $request  = "GET /" . trim($script) . " HTTP/1.1\r\n";
        $request .= "Host: " . $host . "\r\n";
        $request .= "Referer: " . constant('URL') . "/admin.php\r\n";
        if (defined('FULL_VERSION')) {
-               $request .= "User-Agent: " . constant('TITLE') . "/" . constant('FULL_VERSION') . "\r\n";
+               $request .= "User-Agent: " . constant('TITLE') . '/' . constant('FULL_VERSION') . "\r\n";
        } else {
                $request .= "User-Agent: " . constant('TITLE') . "/?.?.?\r\n";
        }
@@ -1784,26 +1822,26 @@ function GET_URL ($script) {
        $request .= "Connection: Close\r\n\r\n";
 
        // Send the raw request
-       $response = SEND_RAW_REQUEST($host, $request);
+       $response = sendRawRequest($host, $request);
 
        // Return the result to the caller function
        return $response;
 }
 
 // Send a POST request
-function POST_URL ($script, $postData) {
+function sendPostRequest ($script, $postData) {
        // Is postData an array?
        if (!is_array($postData)) {
                // Abort here
                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("postData is not an array. Type: %s", gettype($postData)));
-               return array("", '', '');
+               return array('', '', '');
        } // END - if
 
        // Compile the script name
        $script = COMPILE_CODE($script);
 
        // Extract host name from script
-       $host = EXTRACT_HOST($script);
+       $host = extractHostnameFromUrl($script);
 
        // Construct request
        $data = http_build_query($postData, '','&');
@@ -1812,7 +1850,7 @@ function POST_URL ($script, $postData) {
        $request  = "POST /" . trim($script) . " HTTP/1.1\r\n";
        $request .= "Host: " . $host . "\r\n";
        $request .= "Referer: " . constant('URL') . "/admin.php\r\n";
-       $request .= "User-Agent: " . constant('TITLE') . "/" . constant('FULL_VERSION') . "\r\n";
+       $request .= "User-Agent: " . constant('TITLE') . '/' . constant('FULL_VERSION') . "\r\n";
        $request .= "Content-type: application/x-www-form-urlencoded\r\n";
        $request .= "Content-length: " . strlen($data) . "\r\n";
        $request .= "Cache-Control: no-cache\r\n";
@@ -1820,22 +1858,22 @@ function POST_URL ($script, $postData) {
        $request .= $data;
 
        // Send the raw request
-       $response = SEND_RAW_REQUEST($host, $request);
+       $response = sendRawRequest($host, $request);
 
        // Return the result to the caller function
        return $response;
 }
 
 // Sends a raw request to another host
-function SEND_RAW_REQUEST ($host, $request) {
+function sendRawRequest ($host, $request) {
        // Initialize array
-       $response = array("", '', '');
+       $response = array('', '', '');
 
        // Default is not to use proxy
        $useProxy = false;
 
        // Are proxy settins set?
-       if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) {
+       if ((getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0)) {
                // Then use it
                $useProxy = true;
        } // END - if
@@ -1861,9 +1899,9 @@ function SEND_RAW_REQUEST ($host, $request) {
                $proxyTunnel .= "Host: ".$host."\r\n";
 
                // Use login data to proxy? (username at least!)
-               if (getConfig('proxy_username') != "") {
+               if (getConfig('proxy_username') != '') {
                        // Add it as well
-                       $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).":".COMPILE_CODE(getConfig('proxy_password')));
+                       $encodedAuth = base64_encode(COMPILE_CODE(getConfig('proxy_username')).constant('ENCRYPT_SEPERATOR').COMPILE_CODE(getConfig('proxy_password')));
                        $proxyTunnel .= "Proxy-Authorization: Basic ".$encodedAuth."\r\n";
                } // END - if
 
@@ -1882,8 +1920,8 @@ function SEND_RAW_REQUEST ($host, $request) {
 
                // Read the first line
                $resp = trim(fgets($fp, 10240));
-               $respArray = explode(" ", $resp);
-               if ((strtolower($respArray[0]) !== "http/1.0") || ($respArray[1] != "200")) {
+               $respArray = explode(' ', $resp);
+               if ((strtolower($respArray[0]) !== 'http/1.0') || ($respArray[1] != '200')) {
                        // Invalid response!
                        return $response;
                } // END - if
@@ -1919,16 +1957,16 @@ function SEND_RAW_REQUEST ($host, $request) {
        //* DEBUG: */ print("<strong>Response:</strong><pre>".print_r($response, true)."</pre>");
 
        // Proxy agent found?
-       if ((substr(strtolower($response[0]), 0, 11) == "proxy-agent") && ($useProxy)) {
+       if ((substr(strtolower($response[0]), 0, 11) == 'proxy-agent') && ($useProxy)) {
                // Proxy header detected, so remove two lines
                array_shift($response);
                array_shift($response);
        } // END - if
 
        // Was the request successfull?
-       if ((!eregi("200 OK", $response[0])) || (empty($response[0]))) {
+       if ((!eregi('200 OK', $response[0])) || (empty($response[0]))) {
                // Not found / access forbidden
-               $response = array("", '', '');
+               $response = array('', '', '');
        } // END - if
 
        // Return response
@@ -1947,14 +1985,15 @@ function VALIDATE_EMAIL ($email) {
        $domain = "[a-z0-9-]+(\.[a-z0-9-]{2,5})+";
 
        // Generate pattern
-       $regex = "^".$first."@".$domain."$";
+       $regex = '^'.$first.'@'.$domain.'$';
 
        // Return check result
+       // @TODO eregi() should be rewritten here
        return eregi($regex, $email);
 }
 
 // Function taken from user comments on www.php.net / function eregi()
-function VALIDATE_URL ($URL, $compile=true) {
+function isUrlValid ($URL, $compile=true) {
        // Trim URL a little
        $URL = trim(urldecode($URL));
        //* DEBUG: */ echo $URL."<br />";
@@ -1964,10 +2003,10 @@ function VALIDATE_URL ($URL, $compile=true) {
        //* DEBUG: */ echo $URL."<br />";
 
        // Check for the extension filter
-       if (EXT_IS_ACTIVE("filter")) {
+       if (EXT_IS_ACTIVE('filter')) {
                // Use the extension's filter set
-               return FILTER_VALIDATE_URL($URL, false);
-       }
+               return FILTER_isUrlValid($URL, false);
+       } // END - if
 
        // If not installed, perform a simple test. Just make it sure there is always a http:// or
        // https:// in front of the URLs
@@ -1975,17 +2014,17 @@ function VALIDATE_URL ($URL, $compile=true) {
 }
 
 // Generate a list of administrative links to a given userid
-function MEMBER_ACTION_LINKS ($uid, $status = "") {
+function generateMemberAdminActionLinks ($uid, $status = '') {
        // Define all main targets
-       $TARGETS = array("del_user", "edit_user", "lock_user", "add_points", "sub_points");
+       $TARGETS = array('del_user', 'edit_user', 'lock_user', 'add_points', 'sub_points');
 
        // Begin of navigation links
        $eval = "\$OUT = \"[&nbsp;";
 
        foreach ($TARGETS as $tar) {
                $eval .= "<span class=\\\"admin_user_link\\\"><a href=\\\"{!URL!}/modules.php?module=admin&amp;what=".$tar."&amp;uid=".$uid."\\\" title=\\\"{--ADMIN_LINK_";
-               //* DEBUG: */ echo "*".$tar."/".$status."*<br />\n";
-               if (($tar == "lock_user") && ($status == "LOCKED")) {
+               //* DEBUG: */ echo "*".$tar.'/'.$status."*<br />\n";
+               if (($tar == "lock_user") && ($status == 'LOCKED')) {
                        // Locked accounts shall be unlocked
                        $eval .= "UNLOCK_USER";
                } else {
@@ -1993,7 +2032,7 @@ function MEMBER_ACTION_LINKS ($uid, $status = "") {
                        $eval .= strtoupper($tar);
                }
                $eval .= "_TITLE--}\\\">{--ADMIN_";
-               if (($tar == "lock_user") && ($status == "LOCKED")) {
+               if (($tar == "lock_user") && ($status == 'LOCKED')) {
                        // Locked accounts shall be unlocked
                        $eval .= "UNLOCK_USER";
                } else {
@@ -2012,31 +2051,31 @@ function MEMBER_ACTION_LINKS ($uid, $status = "") {
 }
 
 // Generate an email link
-function CREATE_EMAIL_LINK ($email, $table = 'admins') {
+function generateMemberEmailLink ($email, $table = 'admins') {
        // Default email link (INSECURE! Spammer can read this by harvester programs)
-       $EMAIL = "mailto:".$email;
+       $EMAIL = 'mailto:' . $email;
 
        // Check for several extensions
        if ((EXT_IS_ACTIVE('admins')) && ($table == 'admins')) {
                // Create email link for contacting admin in guest area
-               $EMAIL = ADMINS_CREATE_EMAIL_LINK($email);
-               } elseif ((EXT_IS_ACTIVE('user')) && (GET_EXT_VERSION('user') >= '0.3.3') && ($table == "user_data")) {
+               $EMAIL = adminsCreateEmailLink($email);
+               } elseif ((EXT_IS_ACTIVE('user')) && (GET_EXT_VERSION('user') >= '0.3.3') && ($table == 'user_data')) {
                // Create email link for contacting a member within admin area (or later in other areas, too?)
-               $EMAIL = USER_CREATE_EMAIL_LINK($email);
-       } elseif ((EXT_IS_ACTIVE('sponsor')) && ($table == "sponsor_data")) {
+               $EMAIL = USER_generateMemberEmailLink($email);
+       } elseif ((EXT_IS_ACTIVE('sponsor')) && ($table == 'sponsor_data')) {
                // Create email link to contact sponsor within admin area (or like the link above?)
-               $EMAIL = SPONSOR_CREATE_EMAIL_LINK($email);
+               $EMAIL = SPONSOR_generateMemberEmailLink($email);
        }
 
        // Shall I close the link when there is no admin?
-       if ((!IS_ADMIN()) && ($EMAIL == $email)) $EMAIL = "#"; // Closed!
+       if ((!IS_ADMIN()) && ($EMAIL == $email)) $EMAIL = '#'; // Closed!
 
        // Return email link
        return $EMAIL;
 }
 
 // Generate a hash for extra-security for all passwords
-function generateHash ($plainText, $salt = "") {
+function generateHash ($plainText, $salt = '') {
        // Is the required extension 'sql_patches' there and a salt is not given?
        if (((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (!EXT_IS_ACTIVE('sql_patches'))) && (empty($salt))) {
                // Extension sql_patches is missing/outdated so we hash the plain text with MD5
@@ -2046,25 +2085,25 @@ function generateHash ($plainText, $salt = "") {
        // Do we miss an arry element here?
        if (!isConfigEntrySet('file_hash')) {
                // Stop here
-               debug_report_bug("Missing file_hash in ".__FUNCTION__.".");
+               debug_report_bug('Missing file_hash in ' . __FUNCTION__ . '.');
        } // END - if
 
        // When the salt is empty build a new one, else use the first x configured characters as the salt
        if (empty($salt)) {
-               // Build server string
-               $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(constant('PATH')."inc/databases.php");
+               // Build server string (inc/databases.php is no longer updated with every commit)
+               $server = $_SERVER['PHP_SELF'].constant('ENCRYPT_SEPERATOR').detectUserAgent().constant('ENCRYPT_SEPERATOR').getenv('SERVER_SOFTWARE').constant('ENCRYPT_SEPERATOR').detectRemoteAddr();
 
                // Build key string
-               $keys   = constant('SITE_KEY').":".constant('DATE_KEY').":".getConfig('secret_key').":".getConfig('file_hash').":".date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).":".getConfig('master_salt');
+               $keys   = constant('SITE_KEY').constant('ENCRYPT_SEPERATOR').constant('DATE_KEY').constant('ENCRYPT_SEPERATOR').getConfig('secret_key').constant('ENCRYPT_SEPERATOR').getConfig('file_hash').constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", getConfig(('patch_ctime'))).constant('ENCRYPT_SEPERATOR').getConfig('master_salt');
 
                // Additional data
-               $data = $plainText.":".uniqid(mt_rand(), true).":".time();
+               $data = $plainText.constant('ENCRYPT_SEPERATOR').uniqid(mt_rand(), true).constant('ENCRYPT_SEPERATOR').time();
 
                // Calculate number for generating the code
                $a = time() + constant('_ADD') - 1;
 
                // Generate SHA1 sum from modula of number and the prime number
-               $sha1 = sha1(($a % constant('_PRIME')).$server.":".$keys.":".$data.":".date("d-m-Y (l-F-T)", time()).":".$a);
+               $sha1 = sha1(($a % constant('_PRIME')).$server.constant('ENCRYPT_SEPERATOR').$keys.constant('ENCRYPT_SEPERATOR').$data.constant('ENCRYPT_SEPERATOR').date("d-m-Y (l-F-T)", time()).constant('ENCRYPT_SEPERATOR').$a);
                //* DEBUG: */ echo "SHA1=".$sha1." (".strlen($sha1).")<br />";
                $sha1 = scrambleString($sha1);
                //* DEBUG: */ echo "Scrambled=".$sha1." (".strlen($sha1).")<br />";
@@ -2095,10 +2134,10 @@ function scrambleString($str) {
                return $str;
        } elseif (strlen($str) == 40) {
                // From database
-               $scrambleNums = explode(":", getConfig('pass_scramble'));
+               $scrambleNums = explode(':', getConfig('pass_scramble'));
        } else {
                // Generate new numbers
-               $scrambleNums = explode(":", genScrambleString(strlen($str)));
+               $scrambleNums = explode(':', genScrambleString(strlen($str)));
        }
 
        // Scramble string here
@@ -2122,7 +2161,7 @@ function descrambleString($str) {
        if (strlen($str) != 40) return $str;
 
        // Load numbers from config
-       $scrambleNums = explode(":", getConfig('pass_scramble'));
+       $scrambleNums = explode(':', getConfig('pass_scramble'));
 
        // Validate numbers
        if (count($scrambleNums) != 40) return $str;
@@ -2160,21 +2199,21 @@ function genScrambleString ($len) {
        } // END - for
 
        // So let's create the string for storing it in database
-       $scrambleString = implode(":", $scrambleNumbers);
+       $scrambleString = implode(':', $scrambleNumbers);
        return $scrambleString;
 }
 
 // Append data like session ID or referal ID to the given URL which would
 // normally be stored in cookies
-function ADD_URL_DATA ($URL) {
+function addUrlData ($URL) {
        // Init add
        $add = '';
 
        // Determine URL binder
-       $BIND = "?";
-       if (strpos($URL, "?") !== false) $BIND = "&amp;";
+       $BIND = '?';
+       if (strpos($URL, '?') !== false) $BIND = '&amp;';
 
-       if ((!defined('__COOKIES')) || ((!__COOKIES))) {
+       if ((!defined('__COOKIES')) || ((!constant('__COOKIES')))) {
                // Cookies are not accepted
                if ((REQUEST_ISSET_GET(('refid'))) && (strpos($URL, "refid=") == 0)) {
                        // Cookie found in URL
@@ -2195,7 +2234,7 @@ function generatePassString ($passHash) {
        $ret = $passHash;
 
        // Is a secret key and master salt already initialized?
-       if ((getConfig('secret_key') != "") && (getConfig('master_salt') != "")) {
+       if ((getConfig('secret_key') != '') && (getConfig('master_salt') != '')) {
                // Only calculate when the secret key is generated
                $newHash = ''; $start = 9;
                for ($idx = 0; $idx < 10; $idx++) {
@@ -2209,7 +2248,7 @@ function generatePassString ($passHash) {
                        }
                        $mod = substr(round($mod), 0, 4);
                        $mod = str_repeat('0', 4-strlen($mod)).$mod;
-                       //* DEBUG: */ echo "*".$start."=".$mod."*<br />";
+                       //* DEBUG: */ echo "*".$start.'='.$mod."*<br />";
                        $start += 4;
                        $newHash .= $mod;
                } // END - for
@@ -2229,15 +2268,15 @@ function generatePassString ($passHash) {
 }
 
 // Fix "deleted" cookies
-function FIX_DELETED_COOKIES ($cookies) {
+function fixDeletedCookies ($cookies) {
        // Is this an array with entries?
        if ((is_array($cookies)) && (count($cookies) > 0)) {
                // Then check all cookies if they are marked as deleted!
                foreach ($cookies as $cookieName) {
                        // Is the cookie set to "deleted"?
-                       if (get_session($cookieName) == "deleted") {
-                               set_session($cookieName, '');
-                       }
+                       if (getSession($cookieName) == 'deleted') {
+                               setSession($cookieName, '');
+                       } // END - if
                } // END - foreach
        } // END - if
 }
@@ -2245,7 +2284,7 @@ function FIX_DELETED_COOKIES ($cookies) {
 // Output error messages in a fasioned way and die...
 function app_die ($F, $L, $msg) {
        // Load header
-       LOAD_INC_ONCE('inc/header.php');
+       loadIncludeOnce('inc/header.php');
 
        // Prepare message for output
        $msg = sprintf(getMessage('MXCHANGE_HAS_DIED'), basename($F), $L, $msg);
@@ -2254,14 +2293,14 @@ function app_die ($F, $L, $msg) {
        LOAD_TEMPLATE('admin_settings_saved', false, $msg);
 
        // Load footer
-       LOAD_INC_ONCE('inc/footer.php');
+       loadIncludeOnce('inc/footer.php');
 
        // Exit explicitly
        shutdown();
 }
 
 // Display parsing time and number of SQL queries in footer
-function DISPLAY_PARSING_TIME_FOOTER() {
+function displayParsingTime() {
        // Is the timer started?
        if (!isset($GLOBALS['startTime'])) {
                // Abort here
@@ -2272,11 +2311,11 @@ function DISPLAY_PARSING_TIME_FOOTER() {
        $endTime = microtime(true);
 
        // "Explode" both times
-       $start = explode(" ", $GLOBALS['startTime']);
-       $end = explode(" ", $endTime);
+       $start = explode(' ', $GLOBALS['startTime']);
+       $end = explode(' ', $endTime);
        $runTime = $end[0] - $start[0];
        if ($runTime < 0) $runTime = 0;
-       $runTime = TRANSLATE_COMMA($runTime);
+       $runTime = translateComma($runTime);
 
        // Prepare output
        $content = array(
@@ -2286,7 +2325,7 @@ function DISPLAY_PARSING_TIME_FOOTER() {
        );
 
        // Load the template
-       LOAD_TEMPLATE("show_timings", false, $content);
+       LOAD_TEMPLATE('show_timings', false, $content);
 }
 
 // Check wether a boolean constant is set
@@ -2319,7 +2358,7 @@ function isBooleanConstantAndTrue ($constName) { // : Boolean
 }
 
 // Checks if a given apache module is loaded
-function IF_APACHE_MODULE_LOADED ($apacheModule) {
+function isApacheModuleLoaded ($apacheModule) {
        // Check it and return result
        return (((function_exists('apache_get_modules')) && (in_array($apacheModule, apache_get_modules()))) || (!function_exists('apache_get_modules')));
 }
@@ -2328,7 +2367,7 @@ function IF_APACHE_MODULE_LOADED ($apacheModule) {
 // @TODO Rewrite all language constants to this function.
 function getMessage ($messageId) {
        // Default is not found!
-       $return = "!".$messageId."!";
+       $return = '!'.$messageId.'!';
 
        // Is the language string found?
        if (isset($GLOBALS['msg'][strtolower($messageId)])) {
@@ -2350,58 +2389,58 @@ function getMessage ($messageId) {
 }
 
 // Get current theme name
-function GET_CURR_THEME() {
+function getCurrentTheme() {
        // The default theme is 'default'... ;-)
-       $ret = "default";
+       $ret = 'default';
 
        // Load default theme if not empty from configuration
-       if (getConfig('default_theme') != "") $ret = getConfig('default_theme');
+       if (getConfig('default_theme') != '') $ret = getConfig('default_theme');
 
        if (!isSessionVariableSet('mxchange_theme')) {
                // Set default theme
-               set_session('mxchange_theme', $ret);
+               setSession('mxchange_theme', $ret);
        } elseif ((isSessionVariableSet('mxchange_theme')) && (GET_EXT_VERSION('sql_patches') >= '0.1.4')) {
                //die("<pre>".print_r($GLOBALS['cache_array']['themes'], true)."</pre>");
                // Get theme from cookie
-               $ret = get_session('mxchange_theme');
+               $ret = getSession('mxchange_theme');
 
                // Is it valid?
-               if (THEME_GET_ID($ret) == 0) {
+               if (getThemeId($ret) == 0) {
                        // Fix it to default
-                       $ret = "default";
+                       $ret = 'default';
                } // END - if
        } elseif ((!isInstalled()) && ((isInstalling()) || ($GLOBALS['output_mode'] == true)) && ((REQUEST_ISSET_GET('theme')) || (REQUEST_ISSET_POST('theme')))) {
                // Prepare FQFN for checking
                $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), REQUEST_GET('theme'));
 
                // Installation mode active
-               if ((REQUEST_ISSET_GET('theme')) && (FILE_READABLE($theme))) {
+               if ((REQUEST_ISSET_GET('theme')) && (isFileReadable($theme))) {
                        // Set cookie from URL data
-                       set_session('mxchange_theme', REQUEST_GET('theme'));
-               } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE(REQUEST_POST('theme'))))) {
+                       setSession('mxchange_theme', REQUEST_GET('theme'));
+               } elseif (isFileReadable(sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE(REQUEST_POST('theme'))))) {
                        // Set cookie from posted data
-                       set_session('mxchange_theme', SQL_ESCAPE(REQUEST_POST('theme')));
+                       setSession('mxchange_theme', SQL_ESCAPE(REQUEST_POST('theme')));
                }
 
                // Set return value
-               $ret = get_session('mxchange_theme');
+               $ret = getSession('mxchange_theme');
        } else {
                // Invalid design, reset cookie
-               set_session('mxchange_theme', $ret);
+               setSession('mxchange_theme', $ret);
        }
 
        // Add (maybe) found theme.php file to inclusion list
        $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($ret));
 
        // Try to load the requested include file
-       if (INCLUDE_READABLE($INC)) ADD_INC_TO_POOL($INC);
+       if (isIncludeReadable($INC)) ADD_INC_TO_POOL($INC);
 
        // Return theme value
        return $ret;
 }
 
 // Get id from theme
-function THEME_GET_ID ($name) {
+function getThemeId ($name) {
        // Is the extension 'theme' installed?
        if (!EXT_IS_ACTIVE('theme')) {
                // Then abort here
@@ -2420,7 +2459,7 @@ function THEME_GET_ID ($name) {
                incrementConfigEntry('cache_hits');
        } elseif (GET_EXT_VERSION('cache') != '0.1.8') {
                // Check if current theme is already imported or not
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_path='%s' LIMIT 1",
                        array($name), __FUNCTION__, __LINE__);
 
                // Entry found?
@@ -2438,14 +2477,14 @@ function THEME_GET_ID ($name) {
 }
 
 // Read a given file
-function READ_FILE ($FQFN, $sqlPrepare = false) {
+function readFromFile ($FQFN, $sqlPrepare = false) {
        // Load the file
        if (function_exists('file_get_contents')) {
                // Use new function
                $content = file_get_contents($FQFN);
        } else {
                // Fall-back to implode-file chain
-               $content = implode("", file($FQFN));
+               $content = implode('', file($FQFN));
        }
 
        // Prepare SQL queries?
@@ -2460,9 +2499,9 @@ function READ_FILE ($FQFN, $sqlPrepare = false) {
 }
 
 // Writes content to a file
-function WRITE_FILE ($FQFN, $content) {
+function writeToFile ($FQFN, $content) {
        // Is the file writeable?
-       if ((FILE_READABLE($FQFN)) && (!is_writeable($FQFN)) && (!chmod($FQFN, 0644))) {
+       if ((isFileReadable($FQFN)) && (!is_writeable($FQFN)) && (!chmod($FQFN, 0644))) {
                // Not writeable!
                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("File %s not writeable.", basename($FQFN)));
 
@@ -2479,7 +2518,7 @@ function WRITE_FILE ($FQFN, $content) {
                $return = file_put_contents($FQFN, $content);
        } else {
                // Write it with fopen
-               $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN)."!");
+               $fp = fopen($FQFN, 'w') or app_die(__FUNCTION__, __LINE__, "Cannot write file ".basename($FQFN).'!');
                fwrite($fp, $content);
                fclose($fp);
 
@@ -2492,7 +2531,7 @@ function WRITE_FILE ($FQFN, $content) {
 }
 
 // Generates an error code from given account status
-function GEN_ERROR_CODE_FROM_ACCOUNT_STATUS ($status) {
+function generateErrorCodeFromUserStatus ($status) {
        // Default error code if unknown account status
        $errorCode = getCode('UNKNOWN_STATUS');
 
@@ -2517,7 +2556,7 @@ function clearOutputBuffer () {
        // Trigger an error on failure
        if (!ob_end_clean()) {
                // Failed!
-               debug_report_bug(__FUNCTION__.": Failed to clean output buffer.");
+               debug_report_bug(__FUNCTION__.': Failed to clean output buffer.');
        } // END - if
 }
 
@@ -2528,23 +2567,23 @@ function searchDirsRecursive ($dir, &$last_changed) {
        // Does it match what we are looking for? (We skip a lot files already!)
     // RegexPattern to exclude  ., .., .revision,  .svn, debug.log or .cache in the filenames
        $excludePattern = '@(\.|\.\.|\.revision|\.svn|debug\.log|\.cache|config\.php)$@';
-       $ds = GET_DIR_AS_ARRAY($dir, '', true, false, $excludePattern);
+       $ds = getArrayFromDirectory($dir, '', true, false, $excludePattern);
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ds[]=".count($ds)."<br />\n";
 
        // Walk through all entries
        foreach ($ds as $d) {
                // Generate proper FQFN
-               $FQFN = str_replace("//", "/", constant('PATH') . $dir. "/". $d);
+               $FQFN = str_replace("//", '/', constant('PATH') . $dir. '/'. $d);
 
                // Is it a file and readable?
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):FQFN={$FQFN}<br />\n";
                if (isDirectory($FQFN)) {
                         // $FQFN is a directory so also crawl into this directory
                        $newDir = $d;
-                       if (!empty($dir)) $newDir = $dir . "/". $d;
+                       if (!empty($dir)) $newDir = $dir . '/'. $d;
                        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):DESCENT: ".$newDir."<br />\n";
                        searchDirsRecursive($newDir, $last_changed);
-               } elseif (FILE_READABLE($FQFN)) {
+               } elseif (isFileReadable($FQFN)) {
                        // $FQFN is a filename and no directory
                        $time = filemtime($FQFN);
                        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):File: ".$d." found. (".($last_changed['time'] - $time).")<br />\n";
@@ -2578,7 +2617,7 @@ function getActualVersion ($type = 'Revision') {
                        unset($GLOBALS['cache_array']['revision']);
 
                        // Reload load_cach-revison.php
-                       LOAD_INC('inc/loader/load_cache-revision.php');
+                       loadInclude('inc/loader/load_cache-revision.php');
                } // END - if
 
                // Return found value
@@ -2596,19 +2635,19 @@ function getActualVersion ($type = 'Revision') {
                        $new = true;
                } else {
                        // Check for revision file
-                       if (!FILE_READABLE($FQFN)) {
+                       if (!isFileReadable($FQFN)) {
                                // Not found, so we need to create it
                                $new = true;
                        } else {
                                // Revision file found
-                               $ins_vers = explode("\n", READ_FILE($FQFN));
+                               $ins_vers = explode("\n", readFromFile($FQFN));
 
                                // Get array for mapping information
                                $mapper = array_flip(getSearchFor());
                                //* DEBUG: */ print("<pre>".print_r($mapper, true).print_r($ins_vers, true)."</pre>");
 
                                // Is the content valid?
-                               if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == "") || ($ins_vers[0]) == "new") {
+                               if ((!is_array($ins_vers)) || (count($ins_vers) <= 0) || (!isset($ins_vers[$mapper[$type]])) || (trim($ins_vers[$mapper[$type]]) == '') || ($ins_vers[0]) == "new") {
                                        // File needs update!
                                        $new = true;
                                } else {
@@ -2620,13 +2659,13 @@ function getActualVersion ($type = 'Revision') {
 
                // Has it been updated?
                if ($new === true)  {
-                       WRITE_FILE($FQFN, implode("\n", getAkt_vers()));
+                       writeToFile($FQFN, implode("\n", getArrayFromActualVersion()));
                } // END - if
        }
 }
 
 // Repares an array we are looking for
-// The returned Array is needed twice (in getAkt_vers() and in getActualVersion() in the old .revision-fallback) so I puted it in an extra function to not polute the global namespace
+// The returned Array is needed twice (in getArrayFromActualVersion() and in getActualVersion() in the old .revision-fallback) so I puted it in an extra function to not polute the global namespace
 function getSearchFor () {
        // Add Revision, Date, Tag and Author
        $searchFor = array('Revision', 'Date', 'Tag', 'Author');
@@ -2635,11 +2674,12 @@ function getSearchFor () {
        return $searchFor;
 }
 
-function getAkt_vers () {
+// @TODO Please describe this function
+function getArrayFromActualVersion () {
        // Init variables
        $next_dir = ''; // Directory to start with search
        $last_changed = array(
-               'path_name' => "",
+               'path_name' => '',
                'time'      => 0
        );
        $akt_vers = array(); // Init return array
@@ -2649,7 +2689,7 @@ function getAkt_vers () {
        searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time);
 
        // Get file
-       $last_file = READ_FILE($last_changed['path_name']);
+       $last_file = readFromFile($last_changed['path_name']);
 
        // Get all the keywords to search for
        $searchFor = getSearchFor();
@@ -2683,7 +2723,7 @@ function getAkt_vers () {
 
        } else {
                // No valid Data from the last modificated file so read the Revision from the Server. Fallback-solution!! Should not be removed I think.
-               $version = GET_URL("check-updates3.php");
+               $version = sendGetRequest('check-updates3.php');
 
                // Prepare content
                // Only sets not setted or not proper values to the Online-Server-Fallback-Solution
@@ -2699,12 +2739,12 @@ function getAkt_vers () {
 
 
 // Loads an include file and logs any missing files for debug purposes
-function LOAD_INC ($INC) {
+function loadInclude ($INC) {
        // Add the path. This is why we need a trailing slash in config.php
        $FQFN = constant('PATH') . $INC;
 
        // Is the include file there?
-       if (!INCLUDE_READABLE($INC)) {
+       if (!isIncludeReadable($INC)) {
                // Not there so log it
                debug_report_bug(sprintf("Include file %s not found.", $INC));
                return false;
@@ -2715,11 +2755,11 @@ function LOAD_INC ($INC) {
 }
 
 // Loads an include file once
-function LOAD_INC_ONCE ($INC) {
+function loadIncludeOnce ($INC) {
        // Is it not loaded?
        if (!isset($GLOBALS['load_once'][$INC])) {
                // Then try to load it
-               LOAD_INC($INC);
+               loadInclude($INC);
 
                // And mark it as loaded
                $GLOBALS['load_once'][$INC] = "loaded";
@@ -2748,7 +2788,7 @@ function debug_get_printable_backtrace () {
 }
 
 // Output a debug backtrace to the user
-function debug_report_bug ($message = "") {
+function debug_report_bug ($message = '') {
        // Init message
        $debug = '';
        // Is the optional message set?
@@ -2827,21 +2867,21 @@ function convertCodeToMessage ($code) {
 }
 
 // Generate a "link" for the given admin id (aid)
-function GENERATE_AID_LINK ($aid) {
+function generateAdminLink ($aid) {
        // No assigned admin is default
        $admin = "<span class=\"admin_note\">{--ADMIN_NO_ADMIN_ASSIGNED--}</span>";
 
        // Zero? = Not assigned
        if (bigintval($aid) > 0) {
                // Load admin's login
-               $login = GET_ADMIN_LOGIN($aid);
+               $login = getAdminLogin($aid);
 
                // Is the login valid?
-               if ($login != "***") {
+               if ($login != '***') {
                        // Is the extension there?
                        if (EXT_IS_ACTIVE('admins')) {
                                // Admin found
-                               $admin = "<a href=\"".ADMINS_CREATE_EMAIL_LINK(GET_ADMIN_EMAIL($aid))."\">".$login."</a>";
+                               $admin = "<a href=\"".adminsCreateEmailLink(getAdminEmail($aid))."\">".$login."</a>";
                        } else {
                                // Extension not found
                                $admin = sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'admins');
@@ -2857,12 +2897,12 @@ function GENERATE_AID_LINK ($aid) {
 }
 
 // Checks wether an include file (non-FQFN better) is readable
-function INCLUDE_READABLE ($INC) {
+function isIncludeReadable ($INC) {
        // Construct FQFN
        $FQFN = constant('PATH') . $INC;
 
        // Is it readable?
-       return FILE_READABLE($FQFN);
+       return isFileReadable($FQFN);
 }
 
 // Encode strings
@@ -2885,15 +2925,15 @@ function compileUriCode ($code, $simple=true) {
        if (!$simple) $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 = 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
        )))))))));
 
@@ -2925,9 +2965,9 @@ function isUrlValid ($url) {
        $pattern['d2dpg1']  = $http.$domain2.$dir.$page.$getstring1;
        $pattern['ipdpg1']  = $http.$ip.$dir.$page.$getstring1;
        // Pattern for URLs like http://url/dir/?var=value
-       $pattern['d1dg1']  = $http.$domain1.$dir."/".$getstring1;
-       $pattern['d2dg1']  = $http.$domain2.$dir."/".$getstring1;
-       $pattern['ipdg1']  = $http.$ip.$dir."/".$getstring1;
+       $pattern['d1dg1']  = $http.$domain1.$dir.'/'.$getstring1;
+       $pattern['d2dg1']  = $http.$domain2.$dir.'/'.$getstring1;
+       $pattern['ipdg1']  = $http.$ip.$dir.'/'.$getstring1;
        // Pattern for URLs like http://url/dir/page.ext
        $pattern['d1dp']  = $http.$domain1.$dir.$page;
        $pattern['d1dp']  = $http.$domain2.$dir.$page;
@@ -2937,9 +2977,9 @@ function isUrlValid ($url) {
        $pattern['d2d']  = $http.$domain2.$dir;
        $pattern['ipd']  = $http.$ip.$dir;
        // Pattern for URLs like http://url/?var=value
-       $pattern['d1g1']  = $http.$domain1."/".$getstring1;
-       $pattern['d2g1']  = $http.$domain2."/".$getstring1;
-       $pattern['ipg1']  = $http.$ip."/".$getstring1;
+       $pattern['d1g1']  = $http.$domain1.'/'.$getstring1;
+       $pattern['d2g1']  = $http.$domain2.'/'.$getstring1;
+       $pattern['ipg1']  = $http.$ip.'/'.$getstring1;
        // Pattern for URLs like http://url?var=value
        $pattern['d1g12']  = $http.$domain1.$getstring1;
        $pattern['d2g12']  = $http.$domain2.$getstring1;
@@ -2952,7 +2992,7 @@ function isUrlValid ($url) {
                        $pat = str_replace("[:alnum:]", "0-9a-zA-Z", $pat);
                        $pat = str_replace("[:alpha:]", "a-zA-Z", $pat);
                        $pat = str_replace("[:digit:]", "0-9", $pat);
-                       $pat = str_replace(".", "\.", $pat);
+                       $pat = str_replace('.', "\.", $pat);
                        $pat = str_replace("@", "\@", $pat);
                        echo $key."=&nbsp;".$pat."<br />";
                }
@@ -2984,7 +3024,7 @@ function decodeEntities ($str) {
 }
 
 // Wtites data to a config.php-style file
-// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE()
+// @TODO Rewrite this function to use readFromFile() and writeToFile()
 function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
        // Initialize some variables
        $done = false;
@@ -2993,7 +3033,7 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
        $found = false;
 
        // Is the file there and read-/write-able?
-       if ((FILE_READABLE($FQFN)) && (is_writeable($FQFN))) {
+       if ((isFileReadable($FQFN)) && (is_writeable($FQFN))) {
                $search = "CFG: ".$comment;
                $tmp = $FQFN.".tmp";
 
@@ -3055,7 +3095,7 @@ function changeDataInFile ($FQFN, $comment, $prefix, $suffix, $DATA, $seek=0) {
        return false;
 }
 // Send notification to admin
-function SEND_ADMIN_NOTIFICATION ($subject, $templateName, $content=array(), $uid="0") {
+function sendAdminNotification ($subject, $templateName, $content=array(), $uid = '0') {
        if (GET_EXT_VERSION('admins') >= '0.4.1') {
                // Send new way
                SEND_ADMIN_EMAILS_PRO($subject, $templateName, $content, $uid);
@@ -3109,35 +3149,35 @@ function runResetIncludes () {
        } // END - if
 
        // Get more daily reset scripts
-       SET_INC_POOL(GET_DIR_AS_ARRAY("inc/reset/", "reset_"));
+       SET_INC_POOL(getArrayFromDirectory('inc/reset/', 'reset_'));
 
        // Update database
-       if (!defined('DEBUG_RESET')) UPDATE_CONFIG("last_update", time());
+       if (!defined('DEBUG_RESET')) updateConfiguration('last_update', time());
 
        // Is the config entry set?
        if (GET_EXT_VERSION('sql_patches') >= '0.4.2') {
                // Create current week mark
-               $currWeek = date("W", time());
+               $currWeek = date('W', time());
 
                // Has it changed?
                if (getConfig('last_week') != $currWeek) {
                        // Include weekly reset scripts
-                       MERGE_INC_POOL(GET_DIR_AS_ARRAY("inc/weekly/", "weekly_"));
+                       MERGE_INC_POOL(getArrayFromDirectory('inc/weekly/', 'weekly_'));
 
                        // Update config
-                       if (!defined('DEBUG_WEEKLY')) UPDATE_CONFIG("last_week", $currWeek);
+                       if (!defined('DEBUG_WEEKLY')) updateConfiguration('last_week', $currWeek);
                } // END - if
 
                // Create current month mark
-               $currMonth = date("m", time());
+               $currMonth = date('m', time());
 
                // Has it changed?
                if (getConfig('last_month') != $currMonth) {
                        // Include monthly reset scripts
-                       MERGE_INC_POOL(GET_DIR_AS_ARRAY("inc/monthly/", "monthly_"));
+                       MERGE_INC_POOL(getArrayFromDirectory('inc/monthly/', 'monthly_'));
 
                        // Update config
-                       if (!defined('DEBUG_MONTHLY')) UPDATE_CONFIG("last_month", $currMonth);
+                       if (!defined('DEBUG_MONTHLY')) updateConfiguration('last_month', $currMonth);
                } // END - if
        } // END - if
 
@@ -3146,7 +3186,7 @@ function runResetIncludes () {
 }
 
 // Handle extra values
-function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
+function handleExtraValues ($filterFunction, $value, $extraValue) {
        // Default is the value itself
        $ret = $value;
 
@@ -3179,13 +3219,13 @@ function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
 }
 
 // Check if given FQFN is a readable file
-function FILE_READABLE ($FQFN) {
+function isFileReadable ($FQFN) {
        // Check all...
        return ((file_exists($FQFN)) && (is_file($FQFN)) && (is_readable($FQFN)));
 }
 
 // Converts timestamp selections into a timestamp
-function CONVERT_SELECTIONS_TO_TIMESTAMP (&$POST, &$DATA, &$id, &$skip) {
+function convertSelectionsToTimestamp (&$POST, &$DATA, &$id, &$skip) {
        // Init test variable
        $test2 = '';
 
@@ -3193,17 +3233,17 @@ function CONVERT_SELECTIONS_TO_TIMESTAMP (&$POST, &$DATA, &$id, &$skip) {
        $test = substr($id, -3);
 
        // Improved way of checking! :-)
-       if (in_array($test, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) {
+       if (in_array($test, array('_ye', '_mo', '_we', '_da', '_ho', '_mi', '_se'))) {
                // Found a multi-selection for timings?
                $test = substr($id, 0, -3);
-               if ((isset($POST[$test."_ye"])) && (isset($POST[$test."_mo"])) && (isset($POST[$test."_we"])) && (isset($POST[$test."_da"])) && (isset($POST[$test."_ho"])) && (isset($POST[$test."_mi"])) && (isset($POST[$test."_se"])) && ($test != $test2)) {
+               if ((isset($POST[$test.'_ye'])) && (isset($POST[$test.'_mo'])) && (isset($POST[$test.'_we'])) && (isset($POST[$test.'_da'])) && (isset($POST[$test.'_ho'])) && (isset($POST[$test.'_mi'])) && (isset($POST[$test.'_se'])) && ($test != $test2)) {
                        // Generate timestamp
-                       $POST[$test] = CREATE_TIMESTAMP_FROM_SELECTIONS($test, $POST);
+                       $POST[$test] = createTimestampFromSelections($test, $POST);
                        $DATA[] = sprintf("%s='%s'", $test, $POST[$test]);
 
                        // Remove data from array
-                       foreach (array("ye", "mo", "we", "da", "ho", "mi", "se") as $rem) {
-                               unset($POST[$test."_".$rem]);
+                       foreach (array('ye', 'mo', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
+                               unset($POST[$test.'_'.$rem]);
                        } // END - foreach
 
                        // Skip adding
@@ -3217,23 +3257,23 @@ function CONVERT_SELECTIONS_TO_TIMESTAMP (&$POST, &$DATA, &$id, &$skip) {
 }
 
 // Reverts the german decimal comma into Computer decimal dot
-function REVERT_COMMA ($str) {
+function convertCommaToDot ($str) {
        // Default float is not a float... ;-)
        $float = false;
 
        // Which language is selected?
-       switch (GET_LANGUAGE()) {
-               case "de": // German language
+       switch (getLanguage()) {
+               case 'de': // German language
                        // Remove german thousand dots first
-                       $str = str_replace(".", '', $str);
+                       $str = str_replace('.', '', $str);
 
                        // Replace german commata with decimal dot and cast it
-                       $float = (float)str_replace(",", ".", $str);
+                       $float = (float)str_replace(',', '.', $str);
                        break;
 
                default: // US and so on
                        // Remove thousand dots first and cast
-                       $float = (float)str_replace(",", '', $str);
+                       $float = (float)str_replace(',', '', $str);
                        break;
        }
 
@@ -3249,21 +3289,21 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
        // Is the session data set?
        if ((isSessionVariableSet('mxchange_'.$accessLevel.'_failures')) && (isSessionVariableSet('mxchange_'.$accessLevel.'_last_fail'))) {
                // Ignore zero values
-               if (get_session('mxchange_'.$accessLevel.'_failures') > 0) {
+               if (getSession('mxchange_'.$accessLevel.'_failures') > 0) {
                        // Non-guest has login failures found, get both data and prepare it for template
                        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):accessLevel={$accessLevel}<br />\n";
                        $content = array(
-                               'login_failures' => get_session('mxchange_'.$accessLevel.'_failures'),
-                               'last_failure'   => MAKE_DATETIME(get_session('mxchange_'.$accessLevel.'_last_fail'), "2")
+                               'login_failures' => getSession('mxchange_'.$accessLevel.'_failures'),
+                               'last_failure'   => generateDateTime(getSession('mxchange_'.$accessLevel.'_last_fail'), "2")
                        );
 
                        // Load template
-                       $OUT = LOAD_TEMPLATE("login_failures", true, $content);
+                       $OUT = LOAD_TEMPLATE('login_failures', true, $content);
                } // END - if
 
                // Reset session data
-               set_session('mxchange_'.$accessLevel.'_failures', '');
-               set_session('mxchange_'.$accessLevel.'_last_fail', '');
+               setSession('mxchange_'.$accessLevel.'_failures', '');
+               setSession('mxchange_'.$accessLevel.'_last_fail', '');
        } // END - if
 
        // Return rendered content
@@ -3271,7 +3311,7 @@ function HANDLE_LOGIN_FAILTURES ($accessLevel) {
 }
 
 // Rebuild cache
-function rebuildCacheFiles ($cache, $inc="") {
+function rebuildCacheFiles ($cache, $inc = '') {
        // Shall I remove the cache file?
        if ((EXT_IS_ACTIVE('cache')) && (isCacheInstanceValid())) {
                // Rebuild cache
@@ -3286,10 +3326,10 @@ function rebuildCacheFiles ($cache, $inc="") {
                        $INC = sprintf("inc/loader/load_cache-%s.php", $inc);
 
                        // Is the include there?
-                       if (INCLUDE_READABLE($INC)) {
+                       if (isIncludeReadable($INC)) {
                                // And rebuild it from scratch
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />\n";
-                               LOAD_INC($INC);
+                               loadInclude($INC);
                        } else {
                                // Include not found!
                                DEBUG_LOG(__FUNCTION__, __LINE__, "Include {$inc} not found. cache={$cache}");
@@ -3299,7 +3339,7 @@ function rebuildCacheFiles ($cache, $inc="") {
 }
 
 // Purge admin menu cache
-function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
+function cachePurgeAdminMenu ($id=0, $action = '', $what = '', $str = '') {
        // Is the cache extension enabled or no cache instance or admin menu cache disabled?
        if (!EXT_IS_ACTIVE('cache')) {
                // Cache extension not active
@@ -3317,24 +3357,6 @@ function CACHE_PURGE_ADMIN_MENU ($id=0, $action="", $what="", $str="") {
        debug_report_bug("<strong>Experimental feature:</strong> You have to delete the admin_*.cache files by yourself at this point.");
 }
 
-// Translates the "pool type" into human-readable
-function TRANSLATE_POOL_TYPE ($type) {
-       // Default?type is unknown
-       $translated = sprintf(getMessage('POOL_TYPE_UNKNOWN'), $type);
-
-       // Generate constant
-       $constName = sprintf("POOL_TYPE_%s", $type);
-
-       // Does it exist?
-       if (defined($constName)) {
-               // Then use it
-               $translated = getMessage($constName);
-       } // END - if
-
-       // Return "translation"
-       return $translated;
-}
-
 // Determines the real remote address
 function determineRealRemoteAddress () {
        // Is a proxy in use?
@@ -3360,7 +3382,7 @@ function determineRealRemoteAddress () {
 }
 
 // "Getter" for remote IP number
-function GET_REMOTE_ADDR () {
+function detectRemoteAddr () {
        // Get remote ip from environment
        $remoteAddr = determineRealRemoteAddress();
 
@@ -3375,7 +3397,7 @@ function GET_REMOTE_ADDR () {
 }
 
 // "Getter" for remote hostname
-function GET_REMOTE_HOST () {
+function detectRemoteHostname () {
        // Get remote ip from environment
        $remoteHost = getenv('REMOTE_HOST');
 
@@ -3390,7 +3412,7 @@ function GET_REMOTE_HOST () {
 }
 
 // "Getter" for user agent
-function GET_USER_AGENT () {
+function detectUserAgent () {
        // Get remote ip from environment
        $userAgent = getenv('HTTP_USER_AGENT');
 
@@ -3405,7 +3427,7 @@ function GET_USER_AGENT () {
 }
 
 // "Getter" for referer
-function GET_REFERER () {
+function detectReferer () {
        // Get remote ip from environment
        $referer = getenv('HTTP_REFERER');
 
@@ -3421,17 +3443,17 @@ function GET_REFERER () {
 
 // Adds a bonus mail to the queue
 // This is a high-level function!
-function ADD_NEW_BONUS_MAIL ($data, $mode="", $output=true) {
+function addNewBonusMail ($data, $mode = '', $output=true) {
        // Use mode from data if not set and availble ;-)
        if ((empty($mode)) && (isset($data['mode']))) $mode = $data['mode'];
 
        // Generate receiver list
-       $RECEIVER = GENERATE_RECEIVER_LIST($data['cat'], $data['receiver'], $mode);
+       $RECEIVER = generateReceiverList($data['cat'], $data['receiver'], $mode);
 
        // Receivers added?
        if (!empty($RECEIVER)) {
                // Add bonus mail to queue
-               ADD_BONUS_MAIL_TO_QUEUE(
+               addBonusMailToQueue(
                        $data['subject'],
                        $data['text'],
                        $RECEIVER,
@@ -3469,10 +3491,10 @@ function DETERMINE_REFID () {
        } elseif (!empty($_GET['ref'])) {
                // Set refid=ref (the referal link uses such variable)
                $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
-       } elseif ((isSessionVariableSet('refid')) && (get_session('refid') != 0)) {
+       } elseif ((isSessionVariableSet('refid')) && (getSession('refid') != 0)) {
                // Set session refid als global
-               $GLOBALS['refid'] = bigintval(get_session('refid'));
-       } elseif ((GET_EXT_VERSION('sql_patches') != "") && (getConfig('def_refid') > 0)) {
+               $GLOBALS['refid'] = bigintval(getSession('refid'));
+       } elseif ((GET_EXT_VERSION('sql_patches') != '') && (getConfig('def_refid') > 0)) {
                // Set default refid as refid in URL
                $GLOBALS['refid'] = getConfig(('def_refid'));
        } elseif ((GET_EXT_VERSION('user') >= '0.3.4') && (getConfig('select_user_zero_refid')) == 'Y') {
@@ -3484,9 +3506,9 @@ function DETERMINE_REFID () {
        }
 
        // Set cookie when default refid > 0
-       if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && (getConfig('def_refid') > 0))) {
+       if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == '0') && (getConfig('def_refid') > 0))) {
                // Set cookie
-               set_session('refid', $GLOBALS['refid']);
+               setSession('refid', $GLOBALS['refid']);
        } // END - if
 
        // Return determined refid
@@ -3585,7 +3607,7 @@ function isDirectory ($FQFN) {
        $baseName = basename($FQFN);
 
        // Check it
-       $isDirectory = ((is_dir($FQFN)) && ($baseName != ".") && ($baseName != "..") && ($baseName != ".svn"));
+       $isDirectory = ((is_dir($FQFN)) && ($baseName != '.') && ($baseName != '..') && ($baseName != ".svn"));
 
        // Return the result
        return $isDirectory;
index 73a8bce909615b50ceed9fe0ba87d75e326340ce..911cfa54b7274a1abf4f6c9ceaa4d5692cf7a7f0 100644 (file)
@@ -76,7 +76,7 @@ FROM `{!_MYSQL_PREFIX!}_bonus`', __FILE__, __LINE__);
 } // END - if
 
 // Load (maybe) missing file
-LOAD_INC_ONCE('inc/libs/mediadata_functions.php');
+loadIncludeOnce('inc/libs/mediadata_functions.php');
 
 // Insert info to database
 MEDIA_UPDATE_ENTRY(array('total_send'  , 'normal_send')  , 'init', $nsent);
index 0a4796575b9bdbd0b47ee106112b40cbc7d41ea5..aa7f4f420fe1809fd53cb62d6148c55de387831f 100644 (file)
@@ -43,10 +43,10 @@ if (!defined('__SECURITY')) {
 }
 
 // Make sure our functions are there
-LOAD_INC_ONCE("inc/libs/refback_functions.php");
+loadIncludeOnce('inc/libs/refback_functions.php');
 
 // Sanity-check: Do we have ref level 0?
-$result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_refsystem` WHERE level=0", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refsystem` WHERE level=0", __FILE__, __LINE__);
 if (SQL_NUMROWS($result) > 0) {
        // Remove index temporaly
        SQL_ALTER_TABLE("ALTER TABLE `{!_MYSQL_PREFIX!}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
@@ -82,7 +82,7 @@ if (SQL_NUMROWS($result_direct) > 0) {
 
                // Update refback table
                //* DEBUG: */ echo "uid={$content['userid']}<br />\n";
-               UPDATE_REFBACK_TABLE($content['userid']);
+               updateRefbackTable($content['userid']);
        } // END - while
 } // END - if
 
index ba56d1388191b5b8f34b04b107010b63e60faeff..58283c56cb2362f9554a6b43c3dc7c5cea50d2d1 100644 (file)
@@ -46,7 +46,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 if (GET_EXT_VERSION('sql_patches') < '0.3.6') return false;
 
 // Check if there is no scrambling string
-if (getConfig('pass_scramble') == "") {
+if (getConfig('pass_scramble') == '') {
        // Generate 40 chars long scramble string
        $scrambleString = genScrambleString(40);
 
@@ -60,10 +60,10 @@ if (getConfig('pass_scramble') == "") {
 } // END - if
 
 // Check if there is no master salt string
-if (getConfig('master_salt') == "") {
+if (getConfig('master_salt') == '') {
        // Generate the master salt which is the first chars minus 40 chars of this random hash
        // We do an extra scrambling here...
-       $masterSalt = scrambleString(substr(sha1(GEN_PASS(mt_rand(128, 256))), 0, -40));
+       $masterSalt = scrambleString(substr(sha1(generatePassword(mt_rand(128, 256))), 0, -40));
 
        // ... and store it there for future usage
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_config` SET master_salt='%s' WHERE config=0 LIMIT 1",
@@ -74,9 +74,9 @@ if (getConfig('master_salt') == "") {
        unset($masterSalt);
 } // END - if
 
-if (getConfig('file_hash') == "") {
+if (getConfig('file_hash') == '') {
        // Create filename from hashed random string
-       $fileHash = sha1(GEN_PASS(mt_rand(128, 256)));
+       $fileHash = sha1(generatePassword(mt_rand(128, 256)));
        $FQFN = sprintf("%sinc/.secret/.%s",
                constant('PATH'),
                $fileHash
@@ -86,17 +86,17 @@ if (getConfig('file_hash') == "") {
        $nums = mt_rand(40, 45);
 
        // Generate secret key from a randomized string
-       $secretKey = substr(sha1(GEN_PASS(mt_rand(128, 256))), -$nums);
+       $secretKey = substr(sha1(generatePassword(mt_rand(128, 256))), -$nums);
 
        // File hash was never created
-       WRITE_FILE($FQFN, $secretKey);
+       writeToFile($FQFN, $secretKey);
 
        // Is the file there?
-       if (FILE_READABLE($FQFN)) {
+       if (isFileReadable($FQFN)) {
                //* DEBUG: */ unlink($FQFN);
-               //* DEBUG: */ $test = hexdec(get_session('u_hash')) / hexdec($secretKey);
+               //* DEBUG: */ $test = hexdec(getSession('u_hash')) / hexdec($secretKey);
                //* DEBUG: */ $test = generateHash(str_replace('.', '', $test));
-               //* DEBUG: */ die("Secret-Key: ".$secretKey."<br />Cookie: ".get_session('u_hash')."<br />Test: ".$test);
+               //* DEBUG: */ die("Secret-Key: ".$secretKey."<br />Cookie: ".getSession('u_hash')."<br />Test: ".$test);
 
                // Write $fileHash to database
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_config` SET file_hash='%s' WHERE config=0 LIMIT 1",
@@ -108,9 +108,9 @@ if (getConfig('file_hash') == "") {
                );
 
                // Is the .htaccess file there?
-               if (!FILE_READABLE($FQFN)) {
+               if (!isFileReadable($FQFN)) {
                        // Also create .htaccess file
-                       WRITE_FILE($FQFN, "Deny from all\n");
+                       writeToFile($FQFN, "Deny from all\n");
                } // END - if
 
                // Also update configuration
index f729ec3ed0926cad6ff7ac782986fcbaf74b859f..5c904093df1782a87afb5070670b04b1e3632f5f 100644 (file)
@@ -56,7 +56,7 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                        // Config and database connection valid?
                        if ((isConfigLoaded()) && (SQL_IS_LINK_UP())) {
                                // Title decoration enabled?
-                               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != "")) $TITLE .= trim(getConfig('title_left'))." ";
+                               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_left') != '')) $TITLE .= trim(getConfig('title_left'))." ";
 
                                // Do we have some extra title?
                                if (!empty($EXTRA_TITLE)) {
@@ -68,16 +68,16 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                                $TITLE .= constant('MAIN_TITLE');
 
                                // Add title of module? (middle decoration will also be added!)
-                               if ((getConfig('enable_mod_title') == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == 'admin')) $TITLE .= " ".trim(getConfig('title_middle'))." ".ADD_MODULE_TITLE($GLOBALS['module']);
+                               if ((getConfig('enable_mod_title') == 'Y') || ((empty($GLOBALS['what'])) && (empty($GLOBALS['action']))) || ($GLOBALS['module'] == 'admin')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleTitle($GLOBALS['module']);
 
                                // Add title from what file
                                $mode = '';
                                if ($GLOBALS['module'] == "login") $mode = 'member';
                                 elseif ($GLOBALS['module'] == 'index') $mode = 'guest';
-                               if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".GET_MOD_DESCR($mode, $GLOBALS['what']);
+                               if ((!empty($mode)) && (getConfig('enable_what_title') == 'Y')) $TITLE .= " ".trim(getConfig('title_middle'))." ".getModuleDescription($mode, $GLOBALS['what']);
 
                                // Add title decorations? (right)
-                               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != "")) $TITLE .= " ".trim(getConfig('title_right'));
+                               if ((getConfig('enable_title_deco') == 'Y') && (getConfig('title_right') != '')) $TITLE .= " ".trim(getConfig('title_right'));
 
                                // Remember title in constant for the template
                                define('__PAGE_TITLE', $TITLE);
@@ -107,7 +107,7 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                        // Add meta description to header
                        if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
                                // Add meta description not in admin and login module and when the script is installed
-                               META_DESCRIPTION($GLOBALS['module'], $GLOBALS['what']);
+                               generateMetaDescriptionCode($GLOBALS['module'], $GLOBALS['what']);
                        } // END - if
                } // END - if
 
@@ -115,7 +115,7 @@ if (($GLOBALS['header_sent'] != "1") && ($GLOBALS['header_sent'] != "2")) {
                LOAD_TEMPLATE("header");
 
                // Include stylesheet
-               LOAD_INC_ONCE("inc/stylesheet.php");
+               loadIncludeOnce("inc/stylesheet.php");
        } // END - if
 
        // Closing HEAD tag
index e5965bb874812f163e0bea20355d013908e03de2..7dc1946e0c7583b519c993f494cf07d6eb013d6f 100644 (file)
@@ -35,6 +35,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
  * MA  02110-1301  USA                                                  *
  ************************************************************************/
+
 // Some security stuff...
 if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
@@ -42,12 +43,12 @@ if (!defined('__SECURITY')) {
 }
 
 // Check if our config file is writeable or not
-function IS_INC_WRITEABLE ($inc) {
+function isIncludeWriteable ($inc) {
        // Generate FQFN
        $FQFN = sprintf("%sinc/%s.php", constant('PATH'), $inc);
 
        // Abort by simple test
-       if ((FILE_READABLE($FQFN)) && (!is_writeable($FQFN))) {
+       if ((isFileReadable($FQFN)) && (!is_writeable($FQFN))) {
                return false;
        } // END - if
 
@@ -56,7 +57,7 @@ function IS_INC_WRITEABLE ($inc) {
 }
 
 // Reads a directory with PHP files in and gets only files back
-function GET_DIR_AS_ARRAY ($baseDir, $prefix, $includeDirs = false, $addBaseDir = true, $excludePattern = '@(\.|\.\.)$@') {
+function getArrayFromDirectory ($baseDir, $prefix, $includeDirs = false, $addBaseDir = true, $excludePattern = '@(\.|\.\.)$@') {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix} - Entered!");
        // Init includes
        $INCs = array();
@@ -69,7 +70,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix, $includeDirs = false, $addBaseDir
                // Steps over this returned $baseFile-Name, when it matches the $excludePattern
                if (preg_match($excludePattern, $baseFile, $match)) {
                        // These Lines are only for debugging!!
-                   //$INC = $baseDir . "/" . $baseFile;
+                   //$INC = $baseDir . '/' . $baseFile;
                        //$FQFN = constant('PATH') . $INC;
                        //echo '<pre>$baseDir:'.print_r($baseDir, true).'</pre>';
                        //echo '<pre>$baseDir:'.print_r(constant('PATH') . $baseDir, true).'</pre>';
@@ -79,7 +80,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix, $includeDirs = false, $addBaseDir
                } // END - if
 
                // Construct include filename and FQFN
-               $INC = $baseDir . "/" . $baseFile;
+               $INC = $baseDir . '/' . $baseFile;
                $FQFN = constant('PATH') . $INC;
 
                // repalecment of // to / is needed, whenn $baseDir is an emty String
@@ -87,7 +88,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix, $includeDirs = false, $addBaseDir
 
                // Is this a valid reset file?
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "baseDir={$baseDir},prefix={$prefix},baseFile={$baseFile}");
-               if (((FILE_READABLE($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) || (($includeDirs) && (isDirectory($FQFN)))) {
+               if (((isFileReadable($FQFN)) && (substr($baseFile, 0, strlen($prefix)) == $prefix) && (substr($baseFile, -4, 4) == ".php")) || (($includeDirs) && (isDirectory($FQFN)))) {
                        // Remove both for extension name
                        $extName = substr($baseFile, strlen($prefix), -4);
 
index cf051fd03384f6a6329f25f7bb45882ab73bd72a..6073f4e66d211a08f437efa8c3ec24d813e6e1d8 100644 (file)
@@ -283,16 +283,16 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                                // Seems to work, also right database?
                                if (SQL_SELECT_DB($mysql['dbase'], __FILE__, __LINE__) === true) {
                                        // Automatically run install.sql
-                                       if ((FILE_READABLE(REQUEST_POST('spath').'install/tables.sql')) && (FILE_READABLE(REQUEST_POST('spath').'install/menu-'.GET_LANGUAGE().'.sql'))) {
+                                       if ((isFileReadable(REQUEST_POST('spath').'install/tables.sql')) && (isFileReadable(REQUEST_POST('spath').'install/menu-'.getLanguage().'.sql'))) {
                                                // Both exists so import them
-                                               foreach (array('tables', 'menu-'.GET_LANGUAGE()) as $dump) {
+                                               foreach (array('tables', 'menu-'.getLanguage()) as $dump) {
                                                        // Should be save here because file_exists() is there but we check it again. :)
                                                        $FQFN = REQUEST_POST('spath') . 'install/' . $dump . '.sql';
 
                                                        // Is the file readable?
-                                                       if (FILE_READABLE($FQFN)) {
+                                                       if (isFileReadable($FQFN)) {
                                                                // Read the file
-                                                               $fileContent = READ_FILE($FQFN, true);
+                                                               $fileContent = readFromFile($FQFN, true);
 
                                                                // Replace the {!prefix/type!} with actual one
                                                                foreach (array('prefix', 'type') as $replace) {
@@ -368,7 +368,7 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                                LOAD_TEMPLATE('install_fatal_errors');
                        } else {
                                // Installation is done!
-                               LOAD_URL('install.php?page=finalize');
+                               redirectToUrl('install.php?page=finalize');
                        }
                } elseif (isInstalled()) {
                        // Redirection after writing data... :-)
@@ -376,7 +376,7 @@ if ((!isInstalled()) || (!isAdminRegistered()))
                } else {
                        // Something goes wrong during installation! :-(
                        addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_FINALIZER_FAILED'));
-                       LOAD_INC('inc/fatal_errors.php');
+                       loadInclude('inc/fatal_errors.php');
                }
                break;
 
index 9bd6f297cdc288c3eeb2306b8b3a42d110c2c308..60ca78fb9cd89b7117f09d563e72c3f6170eecdd 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Try to get language from session
-$mx_lang = get_session('mx_lang');
+$mx_lang = getSession('mx_lang');
 
 // Set default language if it is not (yet) set
 if (is_null($mx_lang)) $mx_lang = constant('DEFAULT_LANG');
@@ -55,20 +55,20 @@ $INC = sprintf("inc/language/%s.php", SQL_ESCAPE($mx_lang));
 $FQFN = constant('PATH') . $INC;
 
 // Look for file
-if (!FILE_READABLE($FQFN)) {
+if (!isFileReadable($FQFN)) {
        // Switch to default (DO NOT CHANGE!!!)
        $mx_lang = constant('DEFAULT_LANG');
-       set_session('mx_lang', $mx_lang);
+       setSession('mx_lang', $mx_lang);
        $INC = sprintf("inc/language/%s.php", $mx_lang);
 } // END - if
 
 // Load language file
-LOAD_INC_ONCE($INC);
+loadIncludeOnce($INC);
 
 // Check for installation mode
 if ((isInstalling()) || (!isInstalled()) || (!isAdminRegistered())) {
        // Load matching language file
-       LOAD_INC('inc/language/install_' . $mx_lang . '.php');
+       loadInclude('inc/language/install_' . $mx_lang . '.php');
 }
 
 // Remove no more needed variables
index fd8fb3da97c7f479fc1b154036362ad575057238..86f375c200895a208233898a96ac6f3f77d23f03 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Check ACL for menu combination
-function ADMINS_CHECK_ACL($act, $wht) {
+function adminsCheckAdminAcl ($act, $wht) {
        // If action is login or logout allow allways!
        $default = "allow";
        if (($act == "login") || ($act == "logout")) return true;
@@ -52,18 +52,18 @@ function ADMINS_CHECK_ACL($act, $wht) {
        $ret = false;
 
        // Get admin's ID
-       $aid = GET_CURRENT_ADMIN_ID();
+       $aid = getCurrentAdminId();
 
        // Get admin's defult access right
-       $default = GET_ADMIN_DEFAULT_ACL($aid);
+       $default = getAdminDefaultAcl($aid);
 
        if (!empty($wht)) {
                // Check for parent menu:
                // First get it's action value
-               $parent_action = GET_ACTION('admin', $wht);
+               $parent_action = getModeAction('admin', $wht);
 
                // Check with this function...
-               $parent = ADMINS_CHECK_ACL($parent_action, '');
+               $parent = adminsCheckAdminAcl($parent_action, '');
        } else {
                // Anything else is true!
                $parent = false;
@@ -120,7 +120,7 @@ function ADMINS_CHECK_ACL($act, $wht) {
 }
 
 // Create email link to admins's account
-function ADMINS_CREATE_EMAIL_LINK ($email, $mod='admin') {
+function adminsCreateEmailLink ($email, $mod='admin') {
        // Is it an email?
        if (strpos($email, "@") !== false) {
                // Create email link
@@ -150,7 +150,7 @@ WHERE `email`='%s' LIMIT 1",
 }
 
 // Change a lot admin account
-function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
+function adminsChangeAdminAccount ($POST) {
        // Begin the update
        $cache_update = 0;
        foreach ($POST['login'] as $id => $login) {
@@ -169,28 +169,28 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
                        if (!empty($POST['pass1'][$id])) $add = sprintf(", password='%s'", SQL_ESCAPE($hash));
 
                        // Get admin's ID
-                       $aid = GET_CURRENT_ADMIN_ID();
+                       $aid = getCurrentAdminId();
                        $salt = substr(GET_ADMIN_HASH($aid), 0, -40);
 
                        // Rewrite cookie when it's own account
                        if ($aid == $id) {
                                // Set timeout cookie
-                               set_session('admin_last', time());
+                               setSession('admin_last', time());
 
-                               if ($login != get_session('admin_login')) {
+                               if ($login != getSession('admin_login')) {
                                        // Update login cookie
-                                       set_session('admin_login', $login);
+                                       setSession('admin_login', $login);
 
                                        // Update password cookie as well?
-                                       if (!empty($add)) set_session('admin_md5', $hash);
-                               } elseif (generateHash($POST['pass1'][$id], $salt) != get_session('admin_md5')) {
+                                       if (!empty($add)) setSession('admin_md5', $hash);
+                               } elseif (generateHash($POST['pass1'][$id], $salt) != getSession('admin_md5')) {
                                        // Update password cookie
-                                       set_session('admin_md5', $hash);
+                                       setSession('admin_md5', $hash);
                                }
                        } // END - if
 
                        // Get default ACL from admin to check if we can allow him to change the default ACL
-                       $default = GET_ADMIN_DEFAULT_ACL(GET_CURRENT_ADMIN_ID());
+                       $default = getAdminDefaultAcl(getCurrentAdminId());
 
                        // Update admin account
                        if ($default == "allow") {
@@ -200,7 +200,7 @@ login='%s'".$add.",
 email='%s',
 default_acl='%s',
 la_mode='%s'
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
                                        array(
                                                $login,
                                                $POST['email'][$id],
@@ -214,7 +214,7 @@ WHERE id=%s LIMIT 1",
 login='%s'".$add.",
 email='%s',
 la_mode='%s'
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
                                        array(
                                                $login,
                                                $POST['email'][$id],
@@ -224,7 +224,7 @@ WHERE id=%s LIMIT 1",
                        }
 
                        // Purge cache
-                       CACHE_PURGE_ADMIN_MENU($id);
+                       cachePurgeAdminMenu($id);
 
                        // Admin account saved
                        $message = ADMIN_ACCOUNT_SAVED;
@@ -244,9 +244,9 @@ WHERE id=%s LIMIT 1",
 }
 
 // Make admin accounts editable
-function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) {
+function adminsEditAdminAccount ($POST) {
        // "Resolve" current's admin access mode
-       $currMode = GET_ADMIN_DEFAULT_ACL(GET_CURRENT_ADMIN_ID());
+       $currMode = getAdminDefaultAcl(getCurrentAdminId());
 
        // Begin the edit loop
        $OUT = ''; $SW = 2;
@@ -255,7 +255,7 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) {
                $id = bigintval($id);
 
                // Get the admin's data
-               $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array($id), __FUNCTION__, __LINE__);
                if ((SQL_NUMROWS($result) == 1) && ($selected == 1)) {
                        // Entry found
@@ -269,12 +269,12 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) {
                        // Shall we allow changing default ACL?
                        if ($currMode == "allow") {
                                // Allow chaning it
-                               $content['mode']    = ADD_OPTION_LINES("/ARRAY/", array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
+                               $content['mode']    = generateOptionList("/ARRAY/", array("allow", "deny"), array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')), $content['mode']);
                        } else {
                                // Don't allow it
                                $content['mode'] = "&nbsp;";
                        }
-                       $content['la_mode'] = ADD_OPTION_LINES("/ARRAY/", array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
+                       $content['la_mode'] = generateOptionList("/ARRAY/", array("global", "OLD", "NEW"), array(ADMINS_GLOBAL_LA_SETTING, ADMINS_OLD_LA_SETTING, ADMINS_NEW_LA_SETTING), $content['la_mode']);
 
                        // Load row template and switch color
                        $OUT .= LOAD_TEMPLATE("admin_edit_admins_row", true, $content);
@@ -288,9 +288,9 @@ function ADMINS_EDIT_ADMIN_ACCOUNTS ($POST) {
 }
 
 // Delete given admin accounts
-function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
+function adminsDeleteAdminAccount ($POST) {
        // Check if this account is the last one which cannot be deleted...
-       $result_main = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admins`", __FUNCTION__, __LINE__);
+       $result_main = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins`", __FUNCTION__, __LINE__);
        $accounts = SQL_NUMROWS($result_main);
        SQL_FREERESULT($result_main);
        if ($accounts > 1) {
@@ -301,7 +301,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
                        $id = bigintval($id);
 
                        // Get the admin's data
-                       $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT login, email, default_acl AS mode, la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                                array($id), __FUNCTION__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found
@@ -330,7 +330,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
 }
 
 // Remove the given accounts
-function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
+function adminsRemoveAdminAccount ($POST) {
        // Begin removal
        $cache_update = 0;
        foreach ($POST['sel'] as $id => $del) {
@@ -338,17 +338,17 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
                $id = bigintval($id);
 
                // Delete only when it's not your own account!
-               if (($del == 1) && (GET_CURRENT_ADMIN_ID() != $id)) {
+               if (($del == 1) && (getCurrentAdminId() != $id)) {
                        // Rewrite his tasks to all admins
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE assigned_admin=%s",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `assigned_admin`=0 WHERE `assigned_admin`=%s",
                         array($id), __FUNCTION__, __LINE__);
 
                        // Remove account
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                                array($id), __FUNCTION__, __LINE__);
 
                        // Purge cache
-                       CACHE_PURGE_ADMIN_MENU($id);
+                       cachePurgeAdminMenu($id);
                        $cache_update = "1";
                }
        }
@@ -358,7 +358,7 @@ function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
 }
 
 // List all admin accounts
-function ADMINS_LIST_ADMIN_ACCOUNTS() {
+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;
@@ -369,7 +369,7 @@ function ADMINS_LIST_ADMIN_ACCOUNTS() {
 
                // Prepare some more data
                $content['sw']         = $SW;
-               $content['email_link'] = CREATE_EMAIL_LINK($content['id']);
+               $content['email_link'] = generateMemberEmailLink($content['id']);
 
                // Load row template and switch color
                $OUT .= LOAD_TEMPLATE("admin_list_admins_row", true, $content);
@@ -385,7 +385,7 @@ function ADMINS_LIST_ADMIN_ACCOUNTS() {
 }
 
 // Filter for adding extra data to the query
-function FILTER_ADD_EXTRA_SQL_DATA ($add = "") {
+function FILTER_ADD_EXTRA_SQL_DATA ($add = '') {
        // Is the admins extension updated? (should be!)
        if (GET_EXT_VERSION('admins') >= '0.3.0')   $add .= ", default_acl AS def_acl";
        if (GET_EXT_VERSION('admins') >= '0.6.7') $add .= ", la_mode";
index c9e5a66ecd364acc980e599c753bb6bdaff84656..b0c8a2e38a258cbb452659f4cacc60d8979dfbe2 100644 (file)
@@ -52,7 +52,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points) {
        if (($payout > 0) && (!empty($payout))) {
                // Yes, he has.
                $target = "locked_points";
-       } elseif ($payout == "0") {
+       } elseif ($payout == '0') {
                // No, he has not
                $target = "points";
        }
@@ -75,8 +75,8 @@ function AUTOPURGE_ADD_POINTS($uid, $points) {
                }
 
                // Send out mail to user
-               $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_points", TRANSLATE_COMMA($points), $uid);
-               SEND_EMAIL($uid, AUTOPURGE_MEMBER_SUBJECT, $msg);
+               $msg = LOAD_EMAIL_TEMPLATE("member_autopurge_points", translateComma($points), $uid);
+               sendEmail($uid, getMessage('AUTOPURGE_MEMBER_SUBJECT'), $msg);
        }
 }
 
index c4b83983ea72596e3f6fbba741f5bbc6e045fe1b..c80c3e129dde7fde43c784c128ef4c22c3f9676c 100644 (file)
@@ -56,7 +56,7 @@ function BEG_ADD_POINTS ($uid, $points) {
        } else {
                // Add points to account
                unset($GLOBALS['ref_level']);
-               ADD_POINTS_REFSYSTEM('beg', $uid, $points, false, "0", $locked, strtolower(getConfig('beg_mode')));
+               ADD_POINTS_REFSYSTEM('beg', $uid, $points, false, '0', $locked, strtolower(getConfig('beg_mode')));
        }
 
        // Subtract begged points from member account if the admin has selected one
index 4f66122397515b5008fe7a95a2ec55c8ff9c0c31..109e740f1dfaed1f7a84b420c44fcf3d0677537a 100644 (file)
@@ -121,26 +121,26 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
        $ranks = count(explode(';', getConfig('turbo_rates'))) + 1;
 
        // Load current user's data
-       $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND userid=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT level, points, timemark FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s AND `userid`=%s LIMIT 1",
                array($type, $data, $uid), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Load data
                list($rank, $points, $mark) = SQL_FETCHROW($result);
 
                // Remember all values for later use
-               $self  = true; $points = TRANSLATE_COMMA($points);
+               $self  = true; $points = translateComma($points);
 
                // Transfer data to template
                define('__YR_LEVEL' , $rank);
                define('__YR_POINTS', $points);
-               define('__YR_TMARK' , MAKE_DATETIME($mark, "1"));
+               define('__YR_TMARK' , generateDateTime($mark, "1"));
 
                // Load template
                define('__YOUR_RANKING_LINE', LOAD_TEMPLATE("show_bonus_yr", true));
        } // END - if
 
        // Load rankings
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s ORDER BY level LIMIT %s",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE %s=%s ORDER BY level LIMIT %s",
                array($type, $data, getConfig('bonus_lines')), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Start generating the ranking list
@@ -161,7 +161,7 @@ function BONUS_MAKE_RANK_ROWS ($data, $type, $uid) {
                                list($userid, $points, $mark) = SQL_FETCHROW($result_users);
 
                                // Translate comma
-                               $points = TRANSLATE_COMMA($points);
+                               $points = translateComma($points);
                        } // END - if
 
                        // Output row
@@ -194,9 +194,9 @@ function BONUS_POINTS_HANDLER ($mode) {
        if (getConfig('bonus_active') != 'Y') return;
 
        // Switch to jackpot-mode when no UID is supplied but userid-mode is selected
-       if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == "0")) {
+       if ((getConfig('bonus_mode') == "UID") && (getConfig('bonus_uid') == '0')) {
                // Update database & config
-               UPDATE_CONFIG('bonus_mode', "JACKPOT");
+               updateConfiguration('bonus_mode', 'JACKPOT');
        } // END - if
 
        if ($mode == "login_bonus") {
@@ -210,7 +210,7 @@ function BONUS_POINTS_HANDLER ($mode) {
        // Subtract points from...
        switch (getConfig('bonus_mode'))
        {
-       case "JACKPOT": // ... jackpot
+       case 'JACKPOT': // ... jackpot
                if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
                        // Check points amount first...
                        $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
@@ -241,7 +241,7 @@ function BONUS_PURGE_EXPIRED_TURBO_BONUS() {
        $result = SQL_QUERY("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus_turbo` WHERE timemark < (UNIX_TIMESTAMP() - ".getConfig('bonus_timeout').")", __FUNCTION__, __LINE__);
        if (SQL_AFFECTEDROWS() > 0) {
                // Send out email to admin
-               SEND_ADMIN_NOTIFICATION(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
+               sendAdminNotification(AUTOPURGE_ADMIN_TURBO_SUBJECT, "admin_autopurge_turbo", SQL_AFFECTEDROWS(), '');
        }
 }
 //
index 64fa865595b343c4b5205e72d04d45b08407a108..b5804821a5c00cb58aadc714b154d2156b655b87 100644 (file)
@@ -74,14 +74,14 @@ class CacheSystem {
                        touch($fqfn, 'w');
 
                        // Is the file there?
-                       if (FILE_READABLE($fqfn)) {
+                       if (isFileReadable($fqfn)) {
                                // Yes, we can do. So let's remove it
                                unlink($fqfn);
 
                                // Is there a .htaccess file?
-                               if (FILE_READABLE($path . '.htaccess')) {
+                               if (isFileReadable($path . '.htaccess')) {
                                        // Update database that we have tested it
-                                       UPDATE_CONFIG('cache_tested', 1);
+                                       updateConfiguration('cache_tested', 1);
 
                                        // All done!
                                        $this->ret = $this->statusDone;
@@ -101,7 +101,7 @@ class CacheSystem {
                // Remember cache file
                $this->name = $cacheName;
 
-               // Construct include filename for LOAD_INC_ONCE() call
+               // Construct include filename for loadIncludeOnce() call
                $this->inc = $this->path . $cacheName . $this->extension;
 
                // Construct FQFN (full qualified file name)
@@ -418,7 +418,7 @@ class CacheSystem {
 
        // Checks wether the current cache file is readable
        function isCacheReadable () {
-               return INCLUDE_READABLE($this->inc);
+               return isIncludeReadable($this->inc);
        }
 
 } // END - class
@@ -466,7 +466,7 @@ function FILTER_CACHE_DESTROY_ALL () {
 // Filter for purging entire admin menu cache
 function FILTER_CACHE_PURGE_ADMIN_MENU () {
        // Just call the function
-       CACHE_PURGE_ADMIN_MENU();
+       cachePurgeAdminMenu();
 }
 
 //
index d8cd7d7781528482380878a66c896039cd898be2..6da1d355a5e29a36ea0e8546fc415872d11805d8 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 // Generate a human-readable country description with code
 function COUNTRY_GENERATE_INFO ($id) {
        // Load code and description
-       $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE `id`=%s LIMIT 1",
                array(bigintval($id)), __FUNCTION__, __LINE__);
 
        // Is there an entry?
index a5ab337851787127fcd52100af827005d06b79ed..16179e2569aa7504027b4afbc10ec08f90e02bb6 100644 (file)
@@ -44,12 +44,12 @@ if (!defined('__SECURITY')) {
 
 // Generates a HTML table based on given data
 // @TODO Lame description
-function DOUBLER_GENERATE_TABLE ($uid="0", $done='N', $ref='N', $sort="ASC") {
+function DOUBLER_GENERATE_TABLE ($uid = '0', $done='N', $ref='N', $sort="ASC") {
        if (empty($cnt)) $cnt = 0;
        $add = ''; $DT_MODE = 0;
        if ($uid > 0) {
                // Load entries only from a single user
-               $add = " AND userid='".bigintval($uid)."'";
+               $add = " AND `userid`='".bigintval($uid)."'";
                $mode = 'member'; $COLS = "4"; $DT_MODE = "2";
                $NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
        } else {
@@ -83,16 +83,16 @@ LIMIT ".$limit, __FUNCTION__, __LINE__);
                        // Rewrite userid/refid only if admin is in
                        if (IS_ADMIN()) {
                                // Set links to admin area
-                               if ($content['userid'] > 0) { $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']); } else { $content['userid'] = '---'; }
-                               if ($content['refid'] > 0)  { $content['refid']  = ADMIN_USER_PROFILE_LINK($content['refid']);  } else { $content['refid']  = '---'; }
+                               if ($content['userid'] > 0) { $content['userid'] = generateUserProfileLink($content['userid']); } else { $content['userid'] = '---'; }
+                               if ($content['refid'] > 0)  { $content['refid']  = generateUserProfileLink($content['refid']);  } else { $content['refid']  = '---'; }
                        } // END - if
 
                        // Prepare data for the row template
                        $content = array(
                                'uid'    => $content['userid'],
                                'rid'    => $content['refid'],
-                               'points' => TRANSLATE_COMMA($content['points']),
-                               'stamp'  => MAKE_DATETIME($content['timemark'], $DT_MODE),
+                               'points' => translateComma($content['points']),
+                               'stamp'  => generateDateTime($content['timemark'], $DT_MODE),
                                'sw'     => $SW,
                        );
 
index 6f62bfac5fd95252ba60f261af826bd78c2721f7..58dba68cb614096cf76c6b7b0ac012b3c2eb62d0 100644 (file)
@@ -48,7 +48,7 @@ function HOLIDAY_STOP_HOLIDAYS () {
        $result_stop = SQL_QUERY("SELECT userid, holiday_start, holiday_end, comments
 FROM `{!_MYSQL_PREFIX!}_user_holidays`
 WHERE holiday_end <= UNIX_TIMESTAMP()
-ORDER BY userid", __FUNCTION__, __LINE__);
+ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result_stop) > 0) {
                // We foud at least one
                $admin = '';
@@ -63,26 +63,27 @@ ORDER BY userid", __FUNCTION__, __LINE__);
 
                        // Unlock account
                        ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
-SET `holiday_active`='N', holiday_activated='0'
-WHERE userid=%s LIMIT 1", array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
+SET `holiday_active`='N', `holiday_activated`=0
+WHERE `userid`=%s
+LIMIT 1", array(bigintval($content['userid'])), __FUNCTION__, __LINE__, false));
 
                        // Prepare array
                        $content = array(
-                               'holiday_end'      => MAKE_DATETIME($content['holiday_end']  , "3"),
-                               'holiday_start'    => MAKE_DATETIME($content['holiday_start'], "3"),
+                               'holiday_end'      => generateDateTime($content['holiday_end']  , "3"),
+                               'holiday_start'    => generateDateTime($content['holiday_start'], "3"),
                                'holiday_comments' => $content['comments']
                        );
 
                        // Send mail to user
                        $msg = LOAD_EMAIL_TEMPLATE("member_holiday_unlock", $content, $content['userid']);
-                       SEND_EMAIL($content['userid'], getMessage('HOLIDAY_MEMBER_UNLOCK_SUBJ'), $msg);
+                       sendEmail($content['userid'], getMessage('HOLIDAY_MEMBER_UNLOCK_SUBJ'), $msg);
 
                        // Remember userid for admin
                        $admin .= $content['userid']."\n";
                } // END - if
 
                // Send mail to admins
-               SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_UNLOCK_SUBJ'), "admin_holiday_unlock", $admin, "0");
+               sendAdminNotification(getMessage('HOLIDAY_ADMIN_UNLOCK_SUBJ'), "admin_holiday_unlock", $admin, '0');
 
                // Run all SQLs
                runFilterChain('run_sqls');
index 3676e4cc50cf6ebf10ed522846b195891214494b..e2bcafab29ba4b5cbae7b30e2389222daec74ac2 100644 (file)
@@ -57,7 +57,7 @@ function HTML_CHECK_TAGS ($html) {
        $test = stripslashes($html);
        while (ereg("<", $test) && ereg(">", $test)) {
                $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1));
-               $check = str_replace("/", '', $check);
+               $check = str_replace('/', '', $check);
                if (!in_array($check, $GLOBALS['html_tags'])) {
                        // Invalid tag found!
                        return "";
@@ -156,7 +156,7 @@ function SEND_HTML_EMAIL($to, $subject, $message, $FROM) {
        if (EXT_IS_ACTIVE('html_mail')) {
                // Send mail away as HTML
                $FROM = "Content-Type: text/html\n".$FROM;
-               SEND_EMAIL($to, $subject, $message, 'N', $FROM);
+               sendEmail($to, $subject, $message, 'N', $FROM);
        }
 }
 
index 55acec32dd30678ab6593b0ffc90611286422614..dfa0e4f5fbb3131c01b2f7348e34848fa7396290 100644 (file)
@@ -43,38 +43,29 @@ if (!defined('__SECURITY')) {
 }
 
 //
-function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value)
-{
-       if (is_array($keys_array) && ($value > 0))
-       {
+function MEDIA_UPDATE_ENTRY($keys_array, $mode, $value) {
+       if (is_array($keys_array) && ($value > 0)) {
                // Is an array so we can run it through
-               foreach ($keys_array as $key)
-               {
+               foreach ($keys_array as $key) {
                        // First check if it does exist
                        $result_media = SQL_QUERY_ESC("SELECT media_key FROM `{!_MYSQL_PREFIX!}_mediadata`
 WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__);
-                       if (SQL_NUMROWS($result_media) == 0)
-                       {
+                       if (SQL_NUMROWS($result_media) == 0) {
                                // Not found so we create it (mode will be ignored here!)
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_mediadata` (media_key, media_value) VALUES ('%s', '%s')",
                                        array($key, $value), __FUNCTION__, __LINE__);
-                       }
-                        else
-                       {
+                       } else {
                                // Update entry
-                               switch ($mode)
-                               {
-                                       case 'add': $mode = "+"; break;
-                                       case 'sub': $mode = "-"; break;
+                               switch ($mode) {
+                                       case 'add': $mode = '+'; break;
+                                       case 'sub': $mode = '-'; break;
                                }
-                               if ($mode == "init")
-                               {
+
+                               if ($mode == 'init') {
                                        // Initialize entry
                                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=%s WHERE media_key='%s' LIMIT 1",
                                                array($value, $key), __FUNCTION__, __LINE__);
-                               }
-                                else
-                               {
+                               } else {
                                        // Update entry
                                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mediadata` SET media_value=media_value".$mode."%s WHERE media_key='%s' LIMIT 1",
                                                array($value, $key), __FUNCTION__, __LINE__);
@@ -83,9 +74,9 @@ WHERE media_key = '%s' LIMIT 1", array($key), __FUNCTION__, __LINE__);
                }
        }
 }
+
 //
-function MEDIA_GET_ENTRY($key)
-{
+function MEDIA_GET_ENTRY ($key) {
        // Return nothing by default
        $value = '';
 
@@ -100,5 +91,6 @@ function MEDIA_GET_ENTRY($key)
        // Return data
        return $value;
 }
+
 //
 ?>
index 0f0e276de00f94475cf3c3c6b487af50451981cf..40a38a8311c14e2504db88b639b289de3d5035df 100644 (file)
@@ -58,7 +58,7 @@ function NL_CHECK_TAGS ($html) {
        $test = stripslashes($html);
        while (ereg("<", $test) && ereg(">", $test)) {
                $check = strtolower(substr($test, strpos($test, "<") + 1, strpos($test, ">") - strpos($test, "<") - 1));
-               $check = str_replace("/", '', $check);
+               $check = str_replace('/', '', $check);
                if (!in_array($check, $GLOBALS['html_tags'])) {
                        // Invalid tag found!
                        return "";
@@ -159,17 +159,17 @@ function SEND_NEWSLETTER ($to, $subject, $message, $mode) {
                // Automatically insert URLs into newsletter
                if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) {
                        // Send HTML mail
-                       SEND_EMAIL($to, $subject, HTML_INSERT_URLS($message), "Y");
+                       sendEmail($to, $subject, HTML_INSERT_URLS($message), 'Y');
                } else {
                        // Send normal mail
-                       SEND_EMAIL($to, $subject, NL_INSERT_URLS($message), "N");
+                       sendEmail($to, $subject, NL_INSERT_URLS($message), 'N');
                }
        } else {
                // Regular send-out
                if ((EXT_IS_ACTIVE('html_mail')) && ($mode == 'html')) {
-                       SEND_EMAIL($to, $subject, $message, "Y");
+                       sendEmail($to, $subject, $message, 'Y');
                } else {
-                       SEND_EMAIL($to, $subject, $message, "N");
+                       sendEmail($to, $subject, $message, 'N');
                }
        }
 }
index f2f9366987f76f2a1eddf734dc1753abe67fbdfc..71eabb03aa939bf667b3da7b364cacd32a033abb 100644 (file)
@@ -110,7 +110,7 @@ function NICKNAME_GET_NICK ($userid) {
 
 // Simple wrapper function
 function NICKNAME_PROBE_ON_USERID ($uid) {
-       return (NICKNAME_GET_NICK($uid) != "");
+       return (NICKNAME_GET_NICK($uid) != '');
 }
 
 //
index 3fb29330ed0062d07152e010ecea6fe724cfc021..3d8578fc8443a47fa64efd2a290f238864980609 100644 (file)
@@ -48,24 +48,24 @@ function FILTER_UPDATE_ONLINE_LIST () {
        if (!EXT_IS_ACTIVE('online', true)) return;
 
        // Empty session?
-       if (session_id() == "") {
+       if (session_id() == '') {
                // This is invalid here!
                debug_report_bug("Invalid session.");
        } // END - if
 
        // Initialize variables
-       $uid = 0; $rid = 0; $MEM = "N"; $ADMIN = "N";
+       $uid = 0; $rid = 0; $MEM = 'N'; $ADMIN = 'N';
 
        // Valid userid?
        if ((isUserIdSet()) && (getUserId() > 0) && (IS_MEMBER())) {
                // Is valid user
                $uid = getUserId();
-               $MEM = "Y";
+               $MEM = 'Y';
        } // END - if
 
        if (IS_ADMIN()) {
                // Is administrator
-               $ADMIN = "Y";
+               $ADMIN = 'Y';
        } // END - if
 
        if (!empty($GLOBALS['refid'])) {
@@ -99,7 +99,7 @@ WHERE sid='%s' LIMIT 1",
                                $rid,
                                $MEM,
                                $ADMIN,
-                               GET_REMOTE_ADDR(),
+                               detectRemoteAddr(),
                                session_id()
                        ), __FUNCTION__, __LINE__
                );
@@ -115,7 +115,7 @@ WHERE sid='%s' LIMIT 1",
                                $MEM,
                                $ADMIN,
                                session_id(),
-                               GET_REMOTE_ADDR()
+                               detectRemoteAddr()
                        ), __FUNCTION__, __LINE__
                );
        }
index edce2bed432e2845b5cd17f7342661c5e3b60df1..84357a9f77d19751c07683abd07a9a1cf30504bc 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 //
 function PAYOUT_OUTPUT_PAYOUT_LIST ($points) {
        // Replace german decimal comma with CPU's decimal dot
-       $points = REVERT_COMMA($points);
+       $points = convertCommaToDot($points);
 
        // Enougth points?
        if ($points > 0) {
index 1d2cee613bca845bb3e6af4cd61c65bb43465076..26c282c6effb5068d83d00874807cd318d9bdd1a 100644 (file)
@@ -45,7 +45,7 @@
  *
  *     Die komplette Rückgabe des Interfaces wird als assoziatives Array in der Klassen-
  *     variable __data gespeichert:
- *     __data => array("status" => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
+ *     __data => array('status' => Rückgabecode (PI_DONE, PI_SENDER_ERROR, ...),
  *                     "statustext" => Status in Worten (z.B.: "Transaktion erfolgreich durchgeführt"),
  *                     ")
  *
@@ -109,16 +109,16 @@ class PrimeraApi {
        var $path = "/transfer.interface.2.0.php";
 
        var $errno = 0;
-       var $err = "";
+       var $err = '';
 
-       var $seperator = ":";
+       var $seperator = ':';
 
-       var $username = "";
-       var $password = "";
+       var $username = '';
+       var $password = '';
 
        var $data = array();
 
-       var $headers = "";
+       var $headers = '';
 
        /**
         * Konstruktor
@@ -134,17 +134,17 @@ class PrimeraApi {
         */
        function queryApi ( $data = array() ) {
                // Base64-encode username and password hash
-               $data["PrimusInterface_Username"] = base64_encode($this->username);
-               $data["PrimusInterface_Password"] = base64_encode($this->password);
+               $data['PrimusInterface_Username'] = base64_encode($this->username);
+               $data['PrimusInterface_Password'] = base64_encode($this->password);
 
                // Send POST request
-               $return = POST_URL($this->host.$this->path, $data);
+               $return = sendPostRequest($this->host.$this->path, $data);
 
                // Convert the array into a full string
                $returnStr = implode("\n", $return);
 
                // Extract the real content, strip header away
-               $content = explode("<!-- return-start -->", $returnStr);
+               $content = explode('<!-- return-start -->', $returnStr);
 
                // Store headers away for debugging
                $this->headers = $content[0];
@@ -160,7 +160,7 @@ class PrimeraApi {
                $x = explode("\n", $content);
                $return = array();
                foreach($x as $currentLine) {
-                       $line_exploded = explode(":", $currentLine,2);
+                       $line_exploded = explode(':', $currentLine,2);
                        if (count($line_exploded) > 1) {
                                $return[$line_exploded[0]] = $line_exploded[1];
                        }
@@ -173,17 +173,17 @@ class PrimeraApi {
         * @param int $Amount Betrag in ganzzahligen Primera
         * @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
         */
-       function payPrimera ($Receiver, $Amount, $Description = "") {
+       function payPrimera ($Receiver, $Amount, $Description = '') {
                $valid = false;
-               $postData = array("PrimusInterface_Action" => "Pay",
-                       "PrimusInterface_Receiver" => base64_encode($Receiver),
-                       "PrimusInterface_Amount" => base64_encode($Amount),
-                       "PrimusInterface_Description" => base64_encode($Description) );
+               $postData = array('PrimusInterface_Action' => 'Pay',
+                       'PrimusInterface_Receiver' => base64_encode($Receiver),
+                       'PrimusInterface_Amount' => base64_encode($Amount),
+                       'PrimusInterface_Description' => base64_encode($Description) );
 
                $postReturn = $this->parseContent( $this->queryApi($postData) );
 
                $this->data = $postReturn;
-               if ($postReturn["status"] == "200") {
+               if ($postReturn['status'] == '200') {
                        $valid = true;
                }
                return $valid;
@@ -197,14 +197,14 @@ class PrimeraApi {
         */
        function CheckPrimusUser($User) {
                $valid = false;
-               $postData = array("PrimusInterface_Action"=> "CheckPrimusUser",
-                       "PrimusInterface_CheckPrimusUser" => $User);
+               $postData = array('PrimusInterface_Action'=> 'CheckPrimusUser',
+                       'PrimusInterface_CheckPrimusUser' => $User);
 
                $postReturn = $this->parseContent( $this->queryApi($postData) );
 
                $this->data = $postReturn;
 
-               if ($postReturn["status"] == self::PI_USER_CHECK_OK) {
+               if ($postReturn['status'] == self::PI_USER_CHECK_OK) {
                        $valid = true;
                }
                return $valid;
@@ -215,11 +215,11 @@ class PrimeraApi {
         */
        function getPrimera() {
                $primera = false;
-               $postData = array( "PrimusInterface_Action" => "GetPrimera" );
+               $postData = array( 'PrimusInterface_Action' => 'GetPrimera' );
                $postReturn = $this->parseContent( $this->queryApi($postData) );
 
                $this->data = $postReturn;
-               if ($postReturn["status"] == self::PI_GET_PRIMERA_DONE) {
+               if ($postReturn['status'] == self::PI_GET_PRIMERA_DONE) {
                        $primera = $postReturn['primera'];
                }
                return $primera;
@@ -256,7 +256,7 @@ function PRIMERA_EXECUTE_WITHDRAW ($primusNick, $userMd5, $amount) {
        $api = new PrimeraApi($primusNick, $userMd5);
 
        // Prepare purpose
-       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), get_session('sponsorid')))."\";";
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('PRIMERA_API_PURPOSE_WITHDRAW'), getSession('sponsorid')))."\";";
        eval($eval);
 
        // Pay the Primera
index be5457cb612ef6583b562a5e7cddf0831762bb72..9183a06d0d7df44a3472cb5dcdffa2b3766f159d 100644 (file)
@@ -53,17 +53,17 @@ function RALLYE_AUTOSTART_RALLYES ($result) {
        SQL_FREERESULT($result);
 
        // Set notified to Y
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET notified='Y' WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET notified='Y' WHERE `id`=%s LIMIT 1",
                array(bigintval($id)), __FUNCTION__, __LINE__);
 
        // Do a snapshot off all user refs
-       $result_user = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY userid", __FUNCTION__, __LINE__);
+       $result_user = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
 
        // Transfer all neccessary data to the global $DATA array
        $DATA['uid_cnt']    = SQL_NUMROWS($result_user);
-       $DATA['start']      = MAKE_DATETIME($start, "2");
-       $DATA['end']        = MAKE_DATETIME($end  , "2");
-       $DATA['now_t']      = MAKE_DATETIME(time(), "2");
+       $DATA['start']      = generateDateTime($start, "2");
+       $DATA['end']        = generateDateTime($end  , "2");
+       $DATA['now_t']      = generateDateTime(time(), "2");
        $DATA['title']      = $title;
        $DATA['id']         = $id;  // ID for the rallye details link
 
@@ -83,7 +83,7 @@ function RALLYE_AUTOSTART_RALLYES ($result) {
                if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
 
                // Check if line is already included...
-               $result_ref = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1",
+               $result_ref = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND `userid`=%s LIMIT 1",
                        array(bigintval($id), bigintval($content['userid'])), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result_ref) == 0) {
                        // Free memory
@@ -115,7 +115,7 @@ VALUES ('%s','%s','%s','%s')",
                if (($notify == 'Y') && ($un)) {
                        // Load email template and send it to the user
                        $msg = LOAD_EMAIL_TEMPLATE("member_rallye_notify", array('prices' => $prices), $content['userid']);
-                       SEND_EMAIL($content['userid'], sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $msg);
+                       sendEmail($content['userid'], sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $msg);
                } // END - if
        } // END - while
 
@@ -124,7 +124,7 @@ VALUES ('%s','%s','%s','%s')",
        if ($notify == 'Y') $templ = "admin_rallye_notify";
 
        // Send email to admin
-       SEND_ADMIN_NOTIFICATION(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, "0");
+       sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_NOTIFY'), $title), $templ, $prices, '0');
 
        // Free memory
        SQL_FREERESULT($result_user);
@@ -170,7 +170,7 @@ function RALLYE_ADD_PRICES ($rallye, $mode='email') {
 //
 function RALLYE_ADD_TOPUSERS ($rallye, $default=0) {
        // First check how many prices are set
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
                array(bigintval($rallye)), __FUNCTION__, __LINE__);
        $prices = SQL_NUMROWS($result);
        SQL_FREERESULT($result);
@@ -207,7 +207,7 @@ LIMIT 1", array(bigintval($content['userid']), getConfig('ref_payout')), __FUNCT
                // Init userid for list
                $_uid = '---';
                // List only users with at least one ref!
-               //* DEBUG: */ echo "*".$cnt."/".$content['userid']."/".$content['curr_points']."/".$refpoints."*<br />\n";
+               //* DEBUG: */ echo "*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />\n";
                if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_uid = $content['userid']; } else { $cnt = ''; }
 
                // Save values to array
@@ -277,7 +277,7 @@ function RALLYE_AUTOADD_USER ($uid) {
                SQL_FREERESULT($result);
 
                // Check if line is already included...
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND userid=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s AND `userid`=%s LIMIT 1",
                        array(bigintval($id), bigintval($uid)), __FUNCTION__, __LINE__);
 
                // Is this user added?
@@ -293,9 +293,9 @@ VALUES ('%s','%s','0')",
 
                if ($notify == 'Y') {
                        // Transfer all neccessary data to the global $DATA array
-                       $DATA['start'] = MAKE_DATETIME($start, "2");
-                       $DATA['end']   = MAKE_DATETIME($end  , "2");
-                       $DATA['now_t'] = MAKE_DATETIME(time(), "2");
+                       $DATA['start'] = generateDateTime($start, "2");
+                       $DATA['end']   = generateDateTime($end  , "2");
+                       $DATA['now_t'] = generateDateTime(time(), "2");
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
                        $DATA['ref']   = 0;
@@ -310,7 +310,7 @@ VALUES ('%s','%s','0')",
 
                        // Send notification to member
                        $msg = LOAD_EMAIL_TEMPLATE("member_rallye_notify", array('prices' => $prices), $uid);
-                       SEND_EMAIL($uid, sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $msg);
+                       sendEmail($uid, sprintf(getMessage('RALLYE_MEMBER_NOTIFY'), $title), $msg);
                } // END - if
        } // END - if
 }
@@ -330,9 +330,9 @@ function RALLYE_EXPIRE_RALLYES ($result) {
        $DATA = array(); $cnt = 0;
        $users = array();
        $DATA['title']  = $title;
-       $DATA['start']  = MAKE_DATETIME($start, "1");
-       $DATA['end']    = MAKE_DATETIME($end  , "1");
-       $DATA['now_t']  = MAKE_DATETIME(time(), "1");
+       $DATA['start']  = generateDateTime($start, "1");
+       $DATA['end']    = generateDateTime($end  , "1");
+       $DATA['now_t']  = generateDateTime(time(), "1");
 
        // Just count...
        $total = 0;
@@ -362,7 +362,7 @@ LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__);
        } // END - if
 
        // Expire rallye
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET expired='Y' WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET expired='Y' WHERE `id`=%s LIMIT 1",
                array(bigintval($id)), __FUNCTION__, __LINE__);
 
        // Run array through (by uid is the most important 2nd-level-array)
@@ -392,7 +392,7 @@ LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__);
 
                        if ($DATA['points'] > 0) {
                                // Add points directly to user's account
-                               ADD_POINTS_REFSYSTEM("rallye_winner" . $winnerLevel, $uid, $DATA['points'], false, "0", false, "direct");
+                               ADD_POINTS_REFSYSTEM_DIRECT('rallye_winner' . $winnerLevel, $uid, $DATA['points']);
                        } // END - if
 
                        if ($notify == 'Y') {
@@ -410,7 +410,7 @@ LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__);
 
                                // Load template
                                $msg = LOAD_EMAIL_TEMPLATE($template, $DATA, $uid);
-                               SEND_EMAIL($uid, sprintf(getMessage('RALLYE_MEMBER_EXPIRED_SUBJ'), $DATA['level']), $msg);
+                               sendEmail($uid, sprintf(getMessage('RALLYE_MEMBER_EXPIRED_SUBJ'), $DATA['level']), $msg);
                        } // END - if
 
                        // Count userid
@@ -429,7 +429,7 @@ LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__);
        }
 
        // Send mail to admin
-       SEND_ADMIN_NOTIFICATION(sprintf(getMessage('RALLYE_ADMIN_EXPIRED_SUBJ'), $title), $templ, $cnt, 0);
+       sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_EXPIRED_SUBJ'), $title), $templ, $cnt, 0);
 
        // Add task
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (status, task_type, subject, text, task_created)
@@ -453,7 +453,7 @@ function RALLYE_LOAD_USER_DATA ($uids_array) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Construct the message masked and add it
                $ret .= sprintf("%s %s %s (%s) - %s\n",
-                       TRANSLATE_GENDER($content['gender']),
+                       translateGender($content['gender']),
                        $content['surname'],
                        $content['family'],
                        $content['email'],
@@ -495,7 +495,7 @@ function RALLYE_LOAD_PRICES_ARRAY ($rallye) {
 //
 function RALLYE_LOAD_USERS_ARRAY ($rallye) {
        // Fix zero points to 0.00000
-       if (getConfig('ref_payout') == "0") setConfigEntry('ref_payout', "0.00000");
+       if (getConfig('ref_payout') == '0') setConfigEntry('ref_payout', "0.00000");
 
        // Init multi array
        $users = array(
@@ -505,7 +505,7 @@ function RALLYE_LOAD_USERS_ARRAY ($rallye) {
        );
 
        // Load users                          uid    old  points earned
-       $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid",
+       $result_user = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY `userid` ASC",
                array(bigintval($rallye)), __FUNCTION__, __LINE__);
        while ($content = SQL_FETCHARRAY($result_user)) {
                // Load current ref count
@@ -558,7 +558,7 @@ WHERE d.`status`='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND
 //
 function RALLYE_LIST_WINNERS ($rallye, $default=0) {
        // First check how many prices are set
-       $result_prices = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
+       $result_prices = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s ORDER BY price_level",
                array(bigintval($rallye)), __FUNCTION__, __LINE__);
        $prices = SQL_NUMROWS($result_prices);
        SQL_FREERESULT($result_prices);
@@ -579,7 +579,7 @@ function RALLYE_LIST_WINNERS ($rallye, $default=0) {
                SQL_FREERESULT($result_active);
 
                if (empty($DATA['uid'][$idx])) $DATA['uid'][$idx] = '---';
-               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == "0") || (empty($DATA['cpoints'][$idx]))) {
+               if ((empty($DATA['ref'][$idx])) || ($DATA['ref'][$idx] == 0) || ($active == 0) || ("".round($DATA['cpoints'][$idx])."" == '0') || (empty($DATA['cpoints'][$idx]))) {
                        // Allow valid and active users with at least one ref to get points
                        $DATA['ref'][$idx]   = '---';
                        $DATA['uid'][$idx]   = '---';
@@ -642,15 +642,15 @@ WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'",
                while ($content = SQL_FETCHARRAY($result_rallye)) {
                        // Prepare data for mail template
                        $DATA['title']  = $content['title'];
-                       $DATA['start']  = MAKE_DATETIME($content['start_time'], "1");
-                       $DATA['end']    = MAKE_DATETIME($content['end_time']  , "1");
-                       $DATA['now_t']  = MAKE_DATETIME(time(), "1");
+                       $DATA['start']  = generateDateTime($content['start_time'], "1");
+                       $DATA['end']    = generateDateTime($content['end_time']  , "1");
+                       $DATA['now_t']  = generateDateTime(time(), "1");
 
                        // Send mail to admin
-                       SEND_ADMIN_NOTIFICATION(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), "admin_rallye_purged", '', 0);
+                       sendAdminNotification(sprintf(getMessage('RALLYE_ADMIN_PURGED_SUBJ'), $content['title']), "admin_rallye_purged", '', 0);
 
                        // Purge whole rallye
-                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1",
+                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE `id`=%s LIMIT 1",
                                array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
                        ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s LIMIT 1",
                                array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
@@ -673,17 +673,17 @@ VALUES ('NEW','RALLYE_PURGED','{--RALLYE_ADMIN_PURGED--}: %s','{--RALLYE_ADMIN_P
 }
 
 //
-function RALLYE_TEMPLATE_SELECTION ($name="template", $default="") {
+function RALLYE_TEMPLATE_SELECTION ($name="template", $default = '') {
        // Check templates directory
        $OUT = ''; $ral = array();
-       $basePath = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), GET_LANGUAGE());
+       $basePath = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), getLanguage());
        $dir = opendir($basePath) or mxchange_die(sprintf("Cannot open dir %s.", $basePath));
        while ($read = readdir($dir)) {
                // If it is no dir (so a file)
                if (!isDirectory($basePath.$read)) {
                        // Accept only templates matching with rallye_????.tpl.xx
                        if (eregi("^rallye_.*\.tpl", $read)) {
-                               $read = substr($read, 7, strpos($read, ".") - 7);
+                               $read = substr($read, 7, strpos($read, '.') - 7);
                                // Accept only template names between 1 and 255 chars length
                                if ((strlen($read) < 256) && (!empty($read))) $ral[] = $read;
                        } // END - if
@@ -727,7 +727,7 @@ function RALLYE_GET_REFCOUNT ($uid, $old=0) {
                                        if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
                                                // Level does exist so abort here
                                                $cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
-                                               //* DEBUG: */ echo "*".$uid."/".$cnt."*<br />";
+                                               //* DEBUG: */ echo "*".$uid.'/'.$cnt."*<br />";
                                                break;
                                        } elseif ($level > 1) {
                                                // Not interesting here...
@@ -750,7 +750,7 @@ function RALLYE_GET_REFCOUNT ($uid, $old=0) {
                        incrementConfigEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ echo "+".$cnt."/".$old."+<br />";
+                       //* DEBUG: */ echo '+'.$cnt.'/'.$old."+<br />";
                        $cnt -= $old;
                } // END - if
        } else {
@@ -770,7 +770,7 @@ WHERE s.userid=%s AND s.level=1", array(bigintval($uid)), __FUNCTION__, __LINE__
        }
 
        // Return count
-       //* DEBUG: */ echo "*".$uid."/".$old."/".$cnt."*<br />";
+       //* DEBUG: */ echo "*".$uid.'/'.$old.'/'.$cnt."*<br />";
        return $cnt;
 }
 
index 386eb564d26455cd3f8242cc61ef90c3814939cd..22d611da747f8ddac5fdcb2e0c36149c13268ea7 100644 (file)
@@ -83,7 +83,7 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points, $ref_points) {
 
                                // Add points again, but only directly
                                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />\n";
-                               ADD_POINTS_REFSYSTEM(sprintf("refback:%s", $refid), $uid, $refback, false, "0", false, "direct");
+                               ADD_POINTS_REFSYSTEM_DIRECT(sprintf("refback:%s", $refid), $uid, $refback);
 
                                // Reduce points if refid is found
                                if ($refid == $ref) {
@@ -173,7 +173,7 @@ ORDER BY userid ASC",
 }
 
 // Update "refback table"
-function UPDATE_REFBACK_TABLE ($uid) {
+function updateRefbackTable ($uid) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        // Make it sure referal level zero (member him-/herself) is at least selected
        if (empty($GLOBALS['cache_array']['back_level'])) $GLOBALS['cache_array']['back_level'] = 1;
@@ -208,7 +208,7 @@ function UPDATE_REFBACK_TABLE ($uid) {
                                } // END - if
 
                                // Check existence
-                               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
                                        array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
                                // Do we have no entry?
@@ -220,7 +220,7 @@ function UPDATE_REFBACK_TABLE ($uid) {
                                                array(bigintval($uid), $GLOBALS['cache_array']['back_level'], bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
                                        // Move to next referal level and count his counter one up!
-                                       $GLOBALS['cache_array']['back_level']++; UPDATE_REFBACK_TABLE($GLOBALS['cache_array']['up_refid'][($GLOBALS['cache_array']['back_level'] - 1)]);
+                                       $GLOBALS['cache_array']['back_level']++; updateRefbackTable($GLOBALS['cache_array']['up_refid'][($GLOBALS['cache_array']['back_level'] - 1)]);
                                } // END - if
 
                                // Do we have another level here?
@@ -229,7 +229,7 @@ function UPDATE_REFBACK_TABLE ($uid) {
                                        $uid = $old;
 
                                        // Shall we add this as well?
-                                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' AND refid=%s LIMIT 1",
                                                array(bigintval($uid), ($GLOBALS['cache_array']['back_level']-$minus), bigintval($GLOBALS['cache_array']['up_refid'][$GLOBALS['cache_array']['back_level']])), __FUNCTION__, __LINE__);
 
                                        // Do we have no entry?
@@ -314,7 +314,7 @@ function GET_USER_REF_ENTRY ($id) {
        $id = bigintval($id);
 
        // Get entry from database
-       $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE id=%s AND userid=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT id, refid, refback, level FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE `id`=%s AND `userid`=%s LIMIT 1",
                array($id, getUserId()), __FUNCTION__, __LINE__);
 
        // Is there an entry?
@@ -342,7 +342,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
                // No member!
                $status['message'] = getMessage('MEMBER_REFBACK_ERROR_NO_MEMBER');
                return $status;
-       } elseif ("".$id."" != "".($id + 0)."") {
+       } elseif ("".$id."" != ''.($id + 0)."") {
                // No number!
                $status['message'] = getMessage('MEMBER_REFBACK_ERROR_INVALID_ID_NUMBER');
                return $status;
@@ -363,10 +363,10 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        } // END - if
 
        // Revert german commata
-       $percents = REVERT_COMMA($percents);
+       $percents = convertCommaToDot($percents);
 
        // Update entry
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE id=%s AND userid=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_refs` SET refback='%s' WHERE `id`=%s AND `userid`=%s LIMIT 1",
                array($percents, $id, getUserId()), __FUNCTION__, __LINE__);
 
        // Entry updated?
@@ -378,7 +378,7 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
 
        // Prepare email content
        $content = array(
-               'percents' => TRANSLATE_COMMA($percents),
+               'percents' => translateComma($percents),
                'refid'    => $dummy['refid'],
                'level'    => $dummy['level']
        );
@@ -387,10 +387,10 @@ function REFBACK_CHANGE_MEMBER_PERCENTS ($id, $percents) {
        $mail = LOAD_EMAIL_TEMPLATE("member_refback", $content, getUserId());
 
        // Send email to user
-       SEND_EMAIL($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail);
+       sendEmail($dummy['refid'], getMessage('MEMBER_REFBACK_SUBJECT'), $mail);
 
        // Send admin notification
-       SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_REFBACK_SUBJECT'), "admin_refback", $content, getUserId());
+       sendAdminNotification(getMessage('ADMIN_REFBACK_SUBJECT'), "admin_refback", $content, getUserId());
 
        // All fine!
        $status['ok'] = true;
index 575f193a548304c1a68b9e10089c61a0083aa855..8ed526a227bdc66e81344fd1b042fa6d70ae22c1 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 //
-function REGISTER_FILL_MUST_CONSTANTS () {
+function registerMustFillout () {
        $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`",
                __FUNCTION__, __LINE__);
 
@@ -59,6 +59,7 @@ function REGISTER_FILL_MUST_CONSTANTS () {
        SQL_FREERESULT($result);
 
        // Also fill other constants
+       // @TODO Rewrite these constants, too
        define('MUST_GENDER', "<div class=\"guest_failed\">&nbsp;(*)</div>");
        define('MUST_ADDY'  , "<div class=\"guest_failed\">&nbsp;(*)</div>");
        define('MUST_BIRTH' , "<div class=\"guest_failed\">&nbsp;(*)</div>");
@@ -82,7 +83,7 @@ function REGISTER_CHECK_REQUIRED_FIELDS (&$array) {
                        if ((empty($value)) && ($chk == 'Y') && (!$country))
                        {
                                // Required field not set
-                               $array[$key] = "!";
+                               $array[$key] = '!';
                                $ret = true;
                        }
                }
@@ -95,13 +96,13 @@ function REGISTER_CHECK_REQUIRED_FIELDS (&$array) {
 
 //
 function REGISTER_OUTPUT_REQUIRE_CHECK (&$array) {
-       $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY("SELECT `field_name`, `field_required` FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__);
        while ($content = SQL_FETCHARRAY($result)) {
-               if (($array[$content['field_name']] == "!") && ($content['field_required'] == 'Y')) {
+               if (($array[$content['field_name']] == '!') && ($content['field_required'] == 'Y')) {
                        // Empty entry found
                        $array[$content['field_name']] = '';
                        $OUT = constant('REGISTER_'.strtoupper($content['field_name']).'_REQUIRED');
-                       OUTPUT_HTML("<div class=\"register_failed\">".$OUT."</div>");
+                       registerOutputFailedMessage('', $OUT);
                } // END - if
        } // END - while
 
@@ -109,8 +110,8 @@ function REGISTER_OUTPUT_REQUIRE_CHECK (&$array) {
        SQL_FREERESULT($result);
 }
 
-//
-function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
+// Generates a 'category table' for the registration form
+function registerGenerateCategoryTable ($mode, $return=false) {
        $OUT = '';
 
        // Guests are mostly not interested in how many members has
@@ -121,7 +122,7 @@ function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
        if (IS_ADMIN()) $AND = '';
 
        // Look for categories
-       $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`",
+       $result = SQL_QUERY("SELECT `id`, `cat`, `visible` FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort` ASC",
                __FUNCTION__, __LINE__);
 
        if (SQL_NUMROWS($result) > 0) {
@@ -139,8 +140,8 @@ function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
                        $content = array(
                                'sw'    => $SW,
                                'cat'   => $content['cat'],
-                               'def_y' => "",
-                               'def_n' => "",
+                               'def_y' => '',
+                               'def_n' => '',
                                'id'    => $content['id'],
                        );
 
@@ -171,5 +172,15 @@ function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
                OUTPUT_HTML($OUT);
        }
 }
+
+// Outputs a 'failed message'
+function registerOutputFailedMessage ($messageId, $extra='') {
+       if (empty($messageId)) {
+               OUTPUT_HTML('<div class="register_failed">' . $extra . '</div>');
+       } else {
+               OUTPUT_HTML('<div class="register_failed">{--' . $messageId . '--}' . $extra . '</div>');
+       }
+}
+
 //
 ?>
index 31c312e361a599129f4177c9f9aaa65793db607b..84cf2ce3ae04d2b9a90e62d7bb77767636725e5f 100644 (file)
@@ -54,7 +54,7 @@ function GET_ANONYMOUS_REMOTE_ADDR ($remoteAddr) {
                                break;
 
                        case "RANDOM": // Pseudo-random IP number
-                               $remoteAddr = mt_rand(1,254).".".mt_rand(0,254).".".mt_rand(0,254).".".mt_rand(1,254);
+                               $remoteAddr = mt_rand(1,254).'.'.mt_rand(0,254).'.'.mt_rand(0,254).'.'.mt_rand(1,254);
                                break;
                } // END - switch
        } // END - if
@@ -78,7 +78,7 @@ function GET_ANONYMOUS_USER_AGENT ($userAgent) {
        // Is config enabled?
        if (getConfig('removeip_anon_ua') == 'Y') {
                // Set anon user agent
-               $userAgent = "-";
+               $userAgent = '-';
        } // END - if
 
        // Return it
@@ -89,7 +89,7 @@ function GET_ANONYMOUS_REFERER ($referer) {
        // Is config enabled?
        if (getConfig('removeip_anon_ref') == 'Y') {
                // Set anon user agent
-               $referer = "-";
+               $referer = '-';
        } // END - if
 
        // Return it
index ef3d16ea36445974c1cf49162523be6b46788600..467e6babfbbdcf8649ce0c3eb170973201098eb2 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Rewrite links in HTML for better SEO (ugly part of mx!)
-function REWRITE_LINKS ($HTML) {
+function rewriteLinksInCode ($HTML) {
        // Skip rewriting for configured modules
        if (eregi($GLOBALS['module'], getConfig('rewrite_skip')) !== false) return $HTML;
 
@@ -66,17 +66,17 @@ function REWRITE_LINKS ($HTML) {
        } // END - if
 
        // Strip slashes as above for the main URL
-       $target2 = preg_quote($target, "/");
+       $target2 = preg_quote($target, '/');
 
        // Action variable
        $act = $target."\$1/act/";
 
        // Convert &amp;|&action=...
-       $output = preg_replace("/" . $target2 . "(.*)&amp;action=/i", $act, $output);
+       $output = preg_replace('/' . $target2 . "(.*)&amp;action=/i", $act, $output);
 
        // "The same procedure as last variable"... now for &amp;what=
        $wht = $target."\$1/wht/";
-       $output = preg_replace("/" . $target2 . "(.*)&amp;what=/i", $wht, $output);
+       $output = preg_replace('/' . $target2 . "(.*)&amp;what=/i", $wht, $output);
 
        // Repair missed &amp;what=??? entries
        while (preg_match("/&amp;what=(.*)\/(.*)\/(.*)/i", $output)) {
index 9dc3238a3044f84d697b32d3176063e3d8b6889f..9d1cf456250de2fb19a4f9403aa467bb0c7663d1 100644 (file)
@@ -90,7 +90,7 @@ if (!isset($_POST)) {
 // Generate arrays which holds the relevante chars to replace
 $GLOBALS['security_chars'] = array(
        // The chars we are looking for...
-       'from' => array("{", "}", "/", ".", "'", "$", "(", ")", '{--', '--}', "%", ';', "[", "]", ":", "--"),
+       'from' => array("{", "}", '/', '.', "'", "$", "(", ")", '{--', '--}', "%", ';', "[", "]", ':', "--"),
        // ... and we will replace to.
        'to'   => array(
                "{OPEN_ANCHOR2}",
@@ -120,7 +120,7 @@ $GLOBALS['url_chars'] = array(
        // Search for these secured characters
        'to'   => array("{SLASH}", "{DOT}", "{PER}", "{DBL_DOT}", "{COMMENT}"),
        // Replace with these characters
-       'from' => array("/", ".", "%", ":", "--")
+       'from' => array('/', '.', "%", ':', "--")
 );
 
 // Overworked security part:
@@ -193,7 +193,7 @@ while (ereg(".php", $SELF_DIR)) {
 }
 
 // Put both together again and let's pray it is secured now...
-$_SERVER['PHP_SELF'] = $SELF_DIR."/".$SELF_FILE;
+$_SERVER['PHP_SELF'] = $SELF_DIR.'/'.$SELF_FILE;
 
 // Remove uneccessary variables
 unset($SELF_DIR);
index cd03892d855ca18c8ab6a7af28b5b35c5116ec18..1d19320d9319ee0f9f31bcb5244e820d866a7f9e 100644 (file)
@@ -74,7 +74,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                        $SAVE = false;
                                } else {
                                        // Do we want to add a new sponsor or update his data?
-                                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE email='%s' LIMIT 1",
                                                array($POST['email']), __FUNCTION__, __LINE__);
 
                                        // Is a sponsor alread in the db?
@@ -103,12 +103,12 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                                break;
 
                        case "url":
-                               if (!VALIDATE_URL($v)) $SAVE = false;
+                               if (!isUrlValid($v)) $SAVE = false;
                                break;
 
                        default:
                                // Test if there is are time selections
-                               CONVERT_SELECTIONS_TO_TIMESTAMP($POST, $DATA, $k, $skip);
+                               convertSelectionsToTimestamp($POST, $DATA, $k, $skip);
                                break;
                        }
 
@@ -136,7 +136,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                        }
 
                        // Remove last ", " from SQL string
-                       $sql = substr($sql, 0, -2)." WHERE id='%s' LIMIT 1";
+                       $sql = substr($sql, 0, -2)." WHERE `id`='%s' LIMIT 1";
                        $DATA['values'][] = bigintval(REQUEST_GET('id'));
 
                        // Generate message
@@ -145,7 +145,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
                } elseif ((!$ALREADY) || (($POST['force'] == "1") && (IS_ADMIN()))) {
                        // Add new sponsor, first add more data
                        $DATA['keys'][] = "sponsor_created"; $DATA['values'][] = time();
-                       $DATA['keys'][] = "status";
+                       $DATA['keys'][] = 'status';
                        if ((!$NO_UPDATE) && (IS_ADMIN()) && ($GLOBALS['what'] == "add_sponsor")) {
                                // Only allowed for admin
                                $DATA['values'][] = "PENDING";
@@ -155,17 +155,17 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
 
                                // Generate hash code
                                $DATA['keys'][] = "hash";
-                               $DATA['values'][] = md5(session_id().":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time());
+                               $DATA['values'][] = md5(session_id().':'.$POST['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time());
                                $DATA['keys'][] = "remote_addr";
-                               $DATA['values'][] = GET_REMOTE_ADDR();
+                               $DATA['values'][] = detectRemoteAddr();
                        }
 
                        // Implode all data into strings
                        $KEYS   = implode(", "  , $DATA['keys']);
-                       $VALUES = str_repeat("%s', '", count($DATA['values']) - 1);
+                       $valueS = str_repeat("%s', '", count($DATA['values']) - 1);
 
                        // Generate string
-                       $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$VALUES."%s')";
+                       $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_data` (".$KEYS.") VALUES ('".$valueS."%s')";
 
                        // Generate message
                        $message = SPONSOR_GET_MESSAGE(getMessage('ADMIN_SPONSOR_ADDED'), "added", $messageArray);
@@ -210,7 +210,7 @@ function SPONSOR_HANDLE_SPONSOR (&$POST, $NO_UPDATE=false, $messageArray=array()
        if ($RET_STATUS) return $ret;
 }
 //
-function SPONSOR_TRANSLATE_STATUS ($status) {
+function sponsorTranslateUserStatus ($status) {
        // Construct constant name
        $constantName = sprintf("ACCOUNT_%s", $status);
 
@@ -254,9 +254,9 @@ function IS_SPONSOR () {
        $ret = false;
        if ((isSessionVariableSet('sponsorid')) && (isSessionVariableSet('sponsorpass'))) {
                // Check cookies against database records...
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' AND `status`='CONFIRMED' LIMIT 1",
-                       array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FUNCTION__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data`
+WHERE `id`='%s' AND password='%s' AND `status`='CONFIRMED' LIMIT 1",
+                       array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // All is fine
                        $ret = true;
@@ -340,9 +340,9 @@ ORDER BY `sort`",
 function GENERATE_SPONSOR_CONTENT ($what) {
        $OUT = '';
        $INC = sprintf("inc/modules/sponsor/%s.php", $what);
-       if (INCLUDE_READABLE($INC)) {
+       if (isIncludeReadable($INC)) {
                // Every sponsor action will output nothing directly. It will be written into $OUT!
-               LOAD_INC_ONCE($INC);
+               loadIncludeOnce($INC);
        } else {
                // File not found!
                $OUT .= LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_CONTENT_404'), $what));
@@ -362,8 +362,8 @@ function UPDATE_SPONSOR_LOGIN () {
                // Update last online timestamp
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data`
 SET last_online=UNIX_TIMESTAMP()
-WHERE id='%s' AND password='%s' LIMIT 1",
-                       array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FUNCTION__, __LINE__);
+WHERE `id`='%s' AND password='%s' LIMIT 1",
+                       array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FUNCTION__, __LINE__);
 
                // This update went fine?
                $login = (SQL_AFFECTEDROWS() == 1);
@@ -425,7 +425,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                        $sql .= " `status`='EMAIL', hash='%s',";
 
                        // Generate hash code
-                       $HASH = md5(session_id().":".$POST['email'].":".GET_REMOTE_ADDR().":".GET_USER_AGENT().":".time());
+                       $HASH = md5(session_id().':'.$POST['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time());
                        $DATA[] = $HASH;
                } // END - if
        } // END - if
@@ -434,9 +434,9 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
        $sql = substr($sql, 0, -1);
 
        // Add SQL tail data
-       $sql .= " WHERE id='%s' AND password='%s' LIMIT 1";
-       $DATA[] = bigintval(get_session('sponsorid'));
-       $DATA[] = get_session('sponsorpass');
+       $sql .= " WHERE `id`='%s' AND password='%s' LIMIT 1";
+       $DATA[] = bigintval(getSession('sponsorid'));
+       $DATA[] = getSession('sponsorpass');
 
        // Saving data was completed... ufff...
        switch ($GLOBALS['what'])
@@ -455,8 +455,8 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
 
        case "settings": // Change settings
                // Translate some data
-               $content['receive']  = TRANSLATE_YESNO($content['receive_warnings']);
-               $content['interval'] = CREATE_FANCY_TIME($content['warning_interval']);
+               $content['receive']  = translateYesNo($content['receive_warnings']);
+               $content['interval'] = createFancyTime($content['warning_interval']);
 
                // Set message template and subject for admin
                $message   = getMessage('SPONSOR_SETTINGS_SAVED');
@@ -481,13 +481,13 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                        $DATA = $POST;
 
                        // Change some data
-                       if (isset($content['gender'])) $content['gender'] = TRANSLATE_GENDER($content['gender']);
-                       if (isset($DATA['gender']))    $DATA['gender']    = TRANSLATE_GENDER($DATA['gender']);
-                       if (isset($content['receive_warnings'])) $DATA['receive']     = TRANSLATE_YESNO($POST['receive_warnings']);
-                       if (isset($content['warning_interval'])) $DATA['interval']    = CREATE_FANCY_TIME($POST['warning_interval']);
+                       if (isset($content['gender'])) $content['gender'] = translateGender($content['gender']);
+                       if (isset($DATA['gender']))    $DATA['gender']    = translateGender($DATA['gender']);
+                       if (isset($content['receive_warnings'])) $DATA['receive']     = translateYesNo($POST['receive_warnings']);
+                       if (isset($content['warning_interval'])) $DATA['interval']    = createFancyTime($POST['warning_interval']);
 
                        // Send email to admins
-                       SEND_ADMIN_NOTIFICATION($subj, $templ, $content);
+                       sendAdminNotification($subj, $templ, $content);
 
                        // Shall we send mail to the sponsor's new email address?
                        if ($content['receive_warnings'] == 'Y') {
@@ -499,7 +499,7 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
                                {
                                case "account": // Change account data
                                        $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_data", $content);
-                                       SEND_EMAIL($content['email'], getMessage('SPONSOR_ACC_DATA_SUBJ'), $email_msg);
+                                       sendEmail($content['email'], getMessage('SPONSOR_ACC_DATA_SUBJ'), $email_msg);
 
                                        if ($EMAIL === true) {
                                                // Add hash code to content array
@@ -507,14 +507,14 @@ function SPONSOR_SAVE_DATA ($POST, $content) {
 
                                                // Second mail goes to the new address
                                                $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_change_email", $content);
-                                               SEND_EMAIL($content['email'], getMessage('SPONSOR_ACC_EMAIL_SUBJ'), $email_msg);
+                                               sendEmail($content['email'], getMessage('SPONSOR_ACC_EMAIL_SUBJ'), $email_msg);
                                        }
                                        break;
 
                                case "settings": // Change settings
                                        // Send email
                                        $email_msg = LOAD_EMAIL_TEMPLATE("sponsor_settings", $content);
-                                       SEND_EMAIL($content['email'], getMessage('SPONSOR_SETTINGS_SUBJ'), $email_msg);
+                                       sendEmail($content['email'], getMessage('SPONSOR_SETTINGS_SUBJ'), $email_msg);
                                        break;
                                }
                        } // END - if
index 131ab3b23ff406362b3c76f3c64eed0cb6e87c28..7c9f58af84b22c6dfbfbe5a8c8829127232a3856 100644 (file)
@@ -52,33 +52,34 @@ function SURFBAR_ADMIN_ADD_URL ($url, $limit, $reload) {
        if (!IS_ADMIN()) {
                // Not an admin
                return false;
-       } elseif (!VALIDATE_URL($url)) {
+       } elseif (!isUrlValid($url)) {
                // URL invalid
                return false;
-       } elseif (SURFBAR_LOOKUP_BY_URL($url, "0")) {
+       } elseif (SURFBAR_LOOKUP_BY_URL($url, '0')) {
                // URL already found in surfbar!
                return false;
        } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
                // No more allowed!
                return false;
-       } elseif ("".($limit + 0)."" != "".$limit."") {
+       } elseif (''.($limit + 0).'' != ''.$limit.'') {
                // Invalid amount entered
                return false;
-       } elseif ("".($reload + 0)."" != "".$reload."") {
+       } elseif (''.($reload + 0).'' != ''.$reload.'') {
                // Invalid amount entered
                return false;
        }
 
        // Register the new URL
-       return SURFBAR_REGISTER_URL($url, "0", "ACTIVE", "unlock", array('limit' => $limit, 'reload' => $reload));
+       return SURFBAR_REGISTER_URL($url, '0', 'ACTIVE', 'unlock', array('limit' => $limit, 'reload' => $reload));
 }
+
 // Admin unlocked an email so we can migrate the URL
 function SURFBAR_ADMIN_MIGRATE_URL ($url, $uid) {
        // Do some pre-checks
        if (!IS_ADMIN()) {
                // Not an admin
                return false;
-       } elseif (!VALIDATE_URL($url)) {
+       } elseif (!isUrlValid($url)) {
                // URL invalid
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, $uid)) {
@@ -90,8 +91,9 @@ function SURFBAR_ADMIN_MIGRATE_URL ($url, $uid) {
        }
 
        // Register the new URL
-       return SURFBAR_REGISTER_URL($url, $uid, "MIGRATED", "migrate");
+       return SURFBAR_REGISTER_URL($url, $uid, 'MIGRATED', 'migrate');
 }
+
 // Admin function for unlocking URLs
 function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
        // Is this an admin or invalid array?
@@ -112,12 +114,13 @@ function SURFBAR_ADMIN_UNLOCK_URL_IDS ($IDs) {
        // Update the status for all ids
        foreach ($IDs as $id => $dummy) {
                // Test all ids through (ignores failed)
-               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "ACTIVE")));
+               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, 'PENDING', 'ACTIVE')));
        } // END - if
 
        // Return total status
        return $done;
 }
+
 // Admin function for rejecting URLs
 function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) {
        // Is this an admin or invalid array?
@@ -138,12 +141,13 @@ function SURFBAR_ADMIN_REJECT_URL_IDS ($IDs) {
        // Update the status for all ids
        foreach ($IDs as $id => $dummy) {
                // Test all ids through (ignores failed)
-               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, "PENDING", "REJECTED")));
+               $done = (($done) && (SURFBAR_CHANGE_STATUS($id, 'PENDING', 'REJECTED')));
        } // END - if
 
        // Return total status
        return $done;
 }
+
 //
 // -----------------------------------------------------------------------------
 //                               Member functions
@@ -155,7 +159,7 @@ function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
        if (!IS_MEMBER()) {
                // Not a member
                return false;
-       } elseif (!VALIDATE_URL($url)) {
+       } elseif (!isUrlValid($url)) {
                // URL invalid
                return false;
        } elseif (SURFBAR_LOOKUP_BY_URL($url, getUserId())) {
@@ -164,18 +168,19 @@ function SURFBAR_MEMBER_ADD_URL ($url, $limit) {
        } elseif (!SURFBAR_IF_USER_BOOK_MORE_URLS(getUserId())) {
                // No more allowed!
                return false;
-       } elseif ("".($limit + 0)."" != "".$limit."") {
+       } elseif (''.($limit + 0).'' != ''.$limit.'') {
                // Invalid amount entered
                return false;
        }
 
        // Register the new URL
-       return SURFBAR_REGISTER_URL($url, getUserId(), "PENDING", "reg", array('limit' => $limit));
+       return SURFBAR_REGISTER_URL($url, getUserId(), 'PENDING', 'reg', array('limit' => $limit));
 }
+
 // Create list of actions depending on status for the user
 function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
        // Load all actions in an array for given status
-       $actionArray = SURFBAR_GET_ACTION_ARRAY($status);
+       $actionArray = SURFBAR_getModeAction_ARRAY($status);
 
        // Init HTML code
        $OUT = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">
@@ -185,9 +190,9 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
        $width = round(100 / count($actionArray));
 
        // "Walk" through all actions and create forms
-       foreach ($actionArray as $actionId=>$action) {
+       foreach ($actionArray as $actionId => $action) {
                // Add form for this action
-               $OUT .= sprintf(LOAD_TEMPLATE("member_surfbar_list_form", true),
+               $OUT .= sprintf(LOAD_TEMPLATE('member_surfbar_list_form', true),
                        $width,
                        bigintval($urlId),
                        strtolower($action),
@@ -203,6 +208,7 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
        // Return code
        return $OUT;
 }
+
 // Do the member form request
 function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
        // By default no action is performed
@@ -254,6 +260,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
        // Return status
        return $performed;
 }
+
 // Validate if the requested action can be performed on current URL status
 function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) {
        // Search for the requested action/status combination in database
@@ -275,6 +282,7 @@ function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) {
        // Return status
        return $isValid;
 }
+
 //
 // -----------------------------------------------------------------------------
 //                               Member actions
@@ -290,6 +298,7 @@ function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) {
        // Simply change the status here
        return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data);
 }
+
 // Book an URL now (from migration)
 function SURFBAR_MEMBER_BOOKNOW_ACTION ($urlData) {
        // Create the data array for next function call
@@ -300,32 +309,36 @@ function SURFBAR_MEMBER_BOOKNOW_ACTION ($urlData) {
        // Simply change the status here
        return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data);
 }
+
 // Show edit form or do the changes
 function SURFBAR_MEMBER_EDIT_ACTION ($urlData) {
        // Is the "execute" flag there?
        if (isset($urlData['edit']['execute'])) {
                // Execute the changes
-               return SURFBAR_MEMBER_EXECUTE_ACTION("edit", $urlData);
+               return SURFBAR_MEMBER_EXECUTE_ACTION('edit', $urlData);
        } // END - if
 
        // Display form
-       return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("edit", $urlData);
+       return SURFBAR_MEMBER_DISPLAY_ACTION_FORM('edit', $urlData);
 }
+
 // Show delete form or do the changes
 function SURFBAR_MEMBER_DELETE_ACTION ($urlData) {
        // Is the "execute" flag there?
        if (isset($urlData['delete']['execute'])) {
                // Execute the changes
-               return SURFBAR_MEMBER_EXECUTE_ACTION("delete", $urlData);
+               return SURFBAR_MEMBER_EXECUTE_ACTION('delete', $urlData);
        } // END - if
 
        // Display form
-       return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("delete", $urlData);
+       return SURFBAR_MEMBER_DISPLAY_ACTION_FORM('delete', $urlData);
 }
+
 // Pause active banner
 function SURFBAR_MEMBER_PAUSE_ACTION ($urlData) {
        return SURFBAR_CHANGE_STATUS($urlData['id'], $urlData['status'], $urlData['new_status'], array($urlData['id'] => $urlData));
 }
+
 // Unpause stopped banner
 function SURFBAR_MEMBER_UNPAUSE_ACTION ($urlData) {
        // Fix missing entry for template
@@ -336,18 +349,20 @@ function SURFBAR_MEMBER_UNPAUSE_ACTION ($urlData) {
        // Return status change
        return SURFBAR_CHANGE_STATUS($urlData['id'], $urlData['status'], $urlData['new_status'], array($urlData['id'] => $urlData));
 }
+
 // Resubmit locked URL
 function SURFBAR_MEMBER_RESUBMIT_ACTION ($urlData) {
        return SURFBAR_CHANGE_STATUS($urlData['id'], $urlData['status'], $urlData['new_status'], array($urlData['id'] => $urlData));
 }
+
 // Display selected "action form"
 function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // Translate some data
-       $urlData['registered']    = MAKE_DATETIME($urlData['registered'], "2");
-       $urlData['views_total']   = TRANSLATE_COMMA($urlData['views_total']);
-       $urlData['views_max']     = TRANSLATE_COMMA($urlData['views_max']);
-       $urlData['views_allowed'] = TRANSLATE_COMMA($urlData['views_allowed']);
-       $urlData['last_locked']   = MAKE_DATETIME($urlData['last_locked'], "2");
+       $urlData['registered']    = generateDateTime($urlData['registered'], '2');
+       $urlData['views_total']   = translateComma($urlData['views_total']);
+       $urlData['views_max']     = translateComma($urlData['views_max']);
+       $urlData['views_allowed'] = translateComma($urlData['views_allowed']);
+       $urlData['last_locked']   = generateDateTime($urlData['last_locked'], '2');
 
        // Is the lock reason empty?
        if (empty($urlData['lock_reason'])) {
@@ -356,18 +371,18 @@ function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        } // END - if
 
        // Include fields only for action 'edit'
-       if ($action == "edit") {
+       if ($action == 'edit') {
                // Default is not limited
                $urlData['limited_yes'] = '';
                $urlData['limited_no']  = ' chkecked="checked"';
-               $urlData['limited']     = "false";
+               $urlData['limited']     = 'false';
 
                // Is this URL limited?
                if ($urlData['views_max'] > 0) {
                        // Then rewrite form data
                        $urlData['limited_yes'] = ' chkecked="checked"';
                        $urlData['limited_no']  = '';
-                       $urlData['limited']     = "true";
+                       $urlData['limited']     = 'true';
                } // END - if
        } // END - if
 
@@ -377,6 +392,7 @@ function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
        // All fine by default ... ;-)
        return true;
 }
+
 // Execute choosen action
 function SURFBAR_MEMBER_EXECUTE_ACTION ($action, $urlData) {
        // By default nothing is executed
@@ -425,7 +441,7 @@ function SURFBAR_MEMBER_EXECUTE_EDIT_ACTION ($urlData) {
        if (true) {
        //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
                // Run the query
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE id=%s AND `status`='%s' LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE `id`=%s AND `status`='%s' LIMIT 1",
                        array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['status']), __FUNCTION__, __LINE__);
 
                // All fine
@@ -456,7 +472,7 @@ function SURFBAR_HANDLE_SELF_MAINTENANCE () {
 // Handle URLs which limit has depleted
 function SURFBAR_HANDLE_DEPLETED_VIEWS () {
        // Get all URLs
-       $urlArray = SURFBAR_GET_URL_DATA("0", "views_max", "id", "ASC", "id", " AND views_allowed>0 AND `status`='ACTIVE'");
+       $urlArray = SURFBAR_GET_URL_DATA('0', 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
 
        // Do we have some entries?
        if (count($urlArray) > 0) {
@@ -469,7 +485,7 @@ function SURFBAR_HANDLE_DEPLETED_VIEWS () {
                        $urlData[$id] = $data;
 
                        // Handle the status
-                       SURFBAR_CHANGE_STATUS($id, "ACTIVE", "DEPLETED", $urlData);
+                       SURFBAR_CHANGE_STATUS($id, 'ACTIVE', 'DEPLETED', $urlData);
                } // END - foreach
        } // END - if
 }
@@ -486,14 +502,14 @@ function SURFBAR_HANDLE_LOW_POINTS () {
                        // Prepare content
                        $content = array(
                                'uid'      => $uid,
-                               'low'      => TRANSLATE_COMMA(getConfig('surfbar_warn_low_points')),
-                               'points'   => TRANSLATE_COMMA($UIDs['points'][$uid]),
-                               'notified' => MAKE_DATETIME($UIDs['notified'][$uid]),
-                               'interval' => CREATE_FANCY_TIME(getConfig('surfbar_low_interval'))
+                               'low'      => translateComma(getConfig('surfbar_warn_low_points')),
+                               'points'   => translateComma($UIDs['points'][$uid]),
+                               'notified' => generateDateTime($UIDs['notified'][$uid]),
+                               'interval' => createFancyTime(getConfig('surfbar_low_interval'))
                        );
 
                        // Notify this user
-                       SURFBAR_NOTIFY_USER("low_points", $content);
+                       SURFBAR_NOTIFY_USER('low_points', $content);
 
                        // Update last notified
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET surfbar_low_notified=NOW() WHERE userid=%s LIMIT 1",
@@ -511,14 +527,14 @@ function SURFBAR_HANDLE_LOW_POINTS () {
 // Looks up by an URL
 function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
        // Now lookup that given URL by itself
-       $urlArray = SURFBAR_GET_URL_DATA($url, "url", "id", "ASC", "id", sprintf(" AND userid=%s", bigintval($uid)));
+       $urlArray = SURFBAR_GET_URL_DATA($url, 'url', 'id', 'ASC', 'id', sprintf(" AND `userid`=%s", bigintval($uid)));
 
        // Was it found?
        return (count($urlArray) > 0);
 }
 
 // Load URL data by given search term and column
-function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add="") {
+function SURFBAR_GET_URL_DATA ($searchTerm, $column="id", $order="id", $sort="ASC", $group="id", $add = '') {
        // By default nothing is found
        $GLOBALS['last_url_data'] = array();
 
@@ -591,7 +607,7 @@ function SURFBAR_REGISTER_URL ($url, $uid, $status="PENDING", $addMode="reg", $e
        } // END - if
 
        // Translate status and limit
-       $content['limit'] = SURFBAR_TRANSLATE_LIMIT($content['limit']);
+       $content['limit'] = surfbarTranslateLimit($content['limit']);
 
        // If in reg-mode we notify admin
        if (($addMode == "reg") || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
@@ -641,21 +657,21 @@ function SURFBAR_NOTIFY_ADMIN ($messageType, $content) {
        ));
 
        // Is the subject line there?
-       if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) {
+       if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
                // Set default subject if following eval() wents wrong
                $subject = getMessage('ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT');
        } // END - if
 
        // Translate some data if present
-       if (isset($content['status']))        $content['status']        = SURFBAR_TRANSLATE_STATUS($content['status']);
-       if (isset($content['registered']))    $content['registered']    = MAKE_DATETIME($content['registered'], "2");
-       if (isset($content['last_locked']))   $content['last_locked']   = MAKE_DATETIME($content['last_locked'], "2");
-       if (isset($content['views_total']))   $content['views_total']   = TRANSLATE_COMMA($content['views_total']);
-       if (isset($content['views_allowed'])) $content['views_allowed'] = TRANSLATE_COMMA($content['views_allowed']);
-       if (isset($content['views_max']))     $content['views_max']     = TRANSLATE_COMMA($content['views_max']);
+       if (isset($content['status']))        $content['status']        = surfbarTranslateUserStatus($content['status']);
+       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], "2");
+       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], "2");
+       if (isset($content['views_total']))   $content['views_total']   = translateComma($content['views_total']);
+       if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
+       if (isset($content['views_max']))     $content['views_max']     = translateComma($content['views_max']);
 
        // Send the notification out
-       return SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']);
+       return sendAdminNotification($subject, $templateName, $content, $content['uid']);
 }
 
 // Notify the user about the performed action
@@ -674,46 +690,48 @@ function SURFBAR_NOTIFY_USER ($messageType, $content) {
        ));
 
        // Is the subject line there?
-       if ((substr($subject, 0, 1) == "!") && (substr($subject, -1, 1) == "!")) {
+       if ((substr($subject, 0, 1) == '!') && (substr($subject, -1, 1) == '!')) {
                // Set default subject if following eval() wents wrong
                $subject = getMessage('MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT');
        } // END - if
 
        // Translate some data if present
-       if (isset($content['status']))        $content['status']        = SURFBAR_TRANSLATE_STATUS($content['status']);
-       if (isset($content['registered']))    $content['registered']    = MAKE_DATETIME($content['registered'], "2");
-       if (isset($content['last_locked']))   $content['last_locked']   = MAKE_DATETIME($content['last_locked'], "2");
-       if (isset($content['views_total']))   $content['views_total']   = TRANSLATE_COMMA($content['views_total']);
-       if (isset($content['views_allowed'])) $content['views_allowed'] = TRANSLATE_COMMA($content['views_allowed']);
-       if (isset($content['views_max']))     $content['views_max']     = TRANSLATE_COMMA($content['views_max']);
+       if (isset($content['status']))        $content['status']        = surfbarTranslateUserStatus($content['status']);
+       if (isset($content['registered']))    $content['registered']    = generateDateTime($content['registered'], "2");
+       if (isset($content['last_locked']))   $content['last_locked']   = generateDateTime($content['last_locked'], "2");
+       if (isset($content['views_total']))   $content['views_total']   = translateComma($content['views_total']);
+       if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
+       if (isset($content['views_max']))     $content['views_max']     = translateComma($content['views_max']);
 
        // Load template
        $mailText = LOAD_EMAIL_TEMPLATE($templateName, $content, $content['uid']);
 
        // Send the email
-       return SEND_EMAIL($content['uid'], $subject, $mailText);
+       return sendEmail($content['uid'], $subject, $mailText);
 }
+
 // Translates the limit
-function SURFBAR_TRANSLATE_LIMIT ($limit) {
+function surfbarTranslateLimit ($limit) {
        // Is this zero?
        if ($limit == 0) {
                // Unlimited!
-               $return = MEMBER_SURFBAR_UNLIMITED_VIEWS;
+               $return = getMessage('MEMBER_SURFBAR_UNLIMITED_VIEWS');
        } else {
                // Translate comma
-               $return = TRANSLATE_COMMA($limit);
+               $return = translateComma($limit);
        }
 
        // Return value
        return $return;
 }
+
 // Translate the URL status
-function SURFBAR_TRANSLATE_STATUS ($status) {
+function surfbarTranslateUserStatus ($status) {
        // Create constant name
        $constantName = sprintf("SURFBAR_URL_STATUS_%s", strtoupper($status));
 
        // Set default translated status
-       $statusTranslated = "!".$constantName."!";
+       $statusTranslated = '!'.$constantName.'!';
 
        // Is the constant there?
        if (defined($constantName)) {
@@ -724,13 +742,14 @@ function SURFBAR_TRANSLATE_STATUS ($status) {
        // Return result
        return $statusTranslated;
 }
+
 // Determine reward
 function SURFBAR_DETERMINE_REWARD ($onlyMin=false) {
        // Static values are default
        $reward = getConfig('surfbar_static_reward');
 
        // Do we have static or dynamic?
-       if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+       if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
                // "Calculate" dynamic reward
                if ($onlyMin) {
                        $reward += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
@@ -742,13 +761,14 @@ function SURFBAR_DETERMINE_REWARD ($onlyMin=false) {
        // Return reward
        return $reward;
 }
+
 // Determine costs
 function SURFBAR_DETERMINE_COSTS ($onlyMin=false) {
        // Static costs is default
        $costs  = getConfig('surfbar_static_costs');
 
        // Do we have static or dynamic?
-       if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+       if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
                // "Calculate" dynamic costs
                if ($onlyMin) {
                        $costs += SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE();
@@ -760,6 +780,7 @@ function SURFBAR_DETERMINE_COSTS ($onlyMin=false) {
        // Return costs
        return $costs;
 }
+
 // "Calculate" dynamic add
 function SURFBAR_CALCULATE_DYNAMIC_ADD () {
        // Get min/max values
@@ -769,6 +790,7 @@ function SURFBAR_CALCULATE_DYNAMIC_ADD () {
        // "Calculate" dynamic part and return it
        return mt_rand($min, $max);
 }
+
 // Determine right template name
 function SURFBAR_DETERMINE_TEMPLATE_NAME() {
        // Default is the frameset
@@ -785,6 +807,7 @@ function SURFBAR_DETERMINE_TEMPLATE_NAME() {
        // Return result
        return $templateName;
 }
+
 // Check if the "reload lock" of the current user is full, call this function
 // before you call SURFBAR_CHECK_RELOAD_LOCK().
 function SURFBAR_CHECK_RELOAD_FULL() {
@@ -796,7 +819,7 @@ function SURFBAR_CHECK_RELOAD_FULL() {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Fixed surf lock is ".getConfig('surfbar_static_lock')."", false);
 
        // Do we have dynamic model?
-       if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+       if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
                // "Calculate" dynamic lock
                $GLOBALS['cache_array']['surfbar']['surf_lock'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
        } // END - if
@@ -832,8 +855,9 @@ LIMIT 1",
        // Return result
        return $isFull;
 }
+
 // Get total amount of URLs of given status for current user or of ACTIVE URLs by default
-function SURFBAR_GET_TOTAL_URLS ($status="ACTIVE", $excludeUserId=0) {
+function SURFBAR_GET_TOTAL_URLS ($status = 'ACTIVE', $excludeUserId = 0) {
        // Determine depleted user account
        $UIDs = SURFBAR_DETERMINE_DEPLETED_USERIDS();
 
@@ -859,13 +883,15 @@ WHERE userid NOT IN (".implode(",", $UIDs['uid']).") AND `status`='%s'",
        // Return result
        return $cnt;
 }
+
 // Check wether the user is allowed to book more URLs
 function SURFBAR_IF_USER_BOOK_MORE_URLS ($uid=0) {
        // Is this admin and userid is zero or does the user has some URLs left to book?
        return ((($uid == 0) && (IS_ADMIN())) || (SURFBAR_GET_TOTAL_USER_URLS($uid, '', array("REJECTED")) < getConfig('surfbar_max_order')));
 }
+
 // Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status="",$exclude="") {
+function SURFBAR_GET_TOTAL_USER_URLS ($uid=0, $status = '',$exclude = '') {
        // Is the user 0 and user is logged in?
        if (($uid == 0) && (IS_MEMBER())) {
                // Then use this userid
@@ -910,8 +936,9 @@ LIMIT %s",
        // Return result
        return $cnt;
 }
+
 // Generate a validation code for the given id number
-function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
+function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt = '') {
        // @TODO Invalid salt should be refused
        $GLOBALS['cache_array']['surfbar']['salt'] = "INVALID";
 
@@ -927,7 +954,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
                // Is the salt set?
                if (empty($salt)) {
                        // Generate random hashed string
-                       $GLOBALS['cache_array']['surfbar']['salt'] = sha1(GEN_PASS(255));
+                       $GLOBALS['cache_array']['surfbar']['salt'] = sha1(generatePassword(255));
                        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "newSalt=".SURFBAR_GET_SALT()."", false);
                } else {
                        // Use this as salt!
@@ -936,7 +963,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
                }
 
                // ... and now the validation code
-               $valCode = generateRandomCodde($length, sha1(SURFBAR_GET_SALT().":".$urlId), getUserId());
+               $valCode = generateRandomCodde($length, sha1(SURFBAR_GET_SALT().':'.$urlId), getUserId());
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "valCode={$valCode}", false);
        } // END - while
 
@@ -950,6 +977,7 @@ function SURFBAR_GENERATE_VALIDATION_CODE ($urlId, $salt="") {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "finalValCode={$valHashedCode}", false);
        return $valHashedCode;
 }
+
 // Check validation code
 function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
        // Secure id number
@@ -963,6 +991,7 @@ function SURFBAR_CHECK_VALIDATION_CODE ($urlId, $check, $salt) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "+++".$salt."|".SURFBAR_GET_DATA('last_salt')."+++", false);
        return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
 }
+
 // Lockdown the userid/id combination (reload lock)
 function SURFBAR_LOCKDOWN_ID ($urlId) {
        //* DEBUG: */ print "LOCK!");
@@ -972,9 +1001,10 @@ function SURFBAR_LOCKDOWN_ID ($urlId) {
                array(getUserId(), bigintval($urlId)), __FUNCTION__, __LINE__);
 
        // Remove the salt from database
-       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_surfbar_salts` WHERE url_id=%s AND userid=%s LIMIT 1",
+       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_surfbar_salts` WHERE url_id=%s AND `userid`=%s LIMIT 1",
                array(bigintval($urlId), getUserId()), __FUNCTION__, __LINE__);
 }
+
 // Pay points to the user and remove it from the sender if userid is given else it is a "sponsored surf"
 function SURFBAR_PAY_POINTS () {
        // Remove it from the URL owner
@@ -987,6 +1017,7 @@ function SURFBAR_PAY_POINTS () {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "uid=".getUserId().",reward=".SURFBAR_GET_REWARD()."", false);
        ADD_POINTS_REFSYSTEM(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), getUserId(), SURFBAR_GET_DATA('reward'));
 }
+
 // Updates the statistics of current URL/userid
 function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
        // Init add
@@ -1002,7 +1033,7 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
        } // END - if
 
        // Update URL stats
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$add." WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET views_total=views_total+1".$add." WHERE `id`=%s LIMIT 1",
                array(SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
 
        // Update the stats entry
@@ -1023,15 +1054,16 @@ function SURFBAR_UPDATE_INSERT_STATS_RECORD () {
        incrementConfigEntry('surfbar_monthly_counter');
 
        // Update config as well
-       UPDATE_CONFIG(array("surfbar_total_counter", "surfbar_daily_counter", "surfbar_weekly_counter", "surfbar_monthly_counter"), array(1,1,1,1), "+");
+       updateConfiguration(array('surfbar_total_counter', 'surfbar_daily_counter', 'surfbar_weekly_counter', 'surfbar_monthly_counter'), array(1,1,1,1), '+');
 }
+
 // Update the salt for validation and statistics
 function SURFBAR_UPDATE_SALT_STATS () {
        // Update statistics record
        SURFBAR_UPDATE_INSERT_STATS_RECORD();
 
        // Simply store the salt from cache away in database...
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND userid=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_salts` SET last_salt='%s' WHERE url_id=%s AND `userid`=%s LIMIT 1",
                array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getUserId()), __FUNCTION__, __LINE__);
 
        // Debug message
@@ -1050,6 +1082,7 @@ function SURFBAR_UPDATE_SALT_STATS () {
        // Return if the update was okay
        return (SQL_AFFECTEDROWS() == 1);
 }
+
 // Check if the reload lock is active for given id
 function SURFBAR_CHECK_RELOAD_LOCK ($urlId) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "id={$urlId}", false);
@@ -1072,6 +1105,7 @@ LIMIT 1",
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "cnt={$cnt},".SURFBAR_GET_SURF_LOCK()."", false);
        return ($cnt == 1);
 }
+
 // Determine which user hash no more points left
 function SURFBAR_DETERMINE_DEPLETED_USERIDS ($limit=0) {
        // Init array
@@ -1133,6 +1167,7 @@ ORDER BY u.userid ASC", __FUNCTION__, __LINE__);
        // Return result
        return $UIDs;
 }
+
 // Determine how many users are Online in surfbar
 function SURFBAR_DETERMINE_TOTAL_ONLINE () {
        // Count all users in surfbar modue and return the value
@@ -1151,6 +1186,7 @@ GROUP BY userid",
        // Return result
        return $cnt;
 }
+
 // Determine waiting time for one URL 
 function SURFBAR_DETERMINE_WAIT_TIME () {
        // Get fixed reload lock
@@ -1166,7 +1202,7 @@ function SURFBAR_DETERMINE_WAIT_TIME () {
        $time = getConfig('surfbar_static_time');
 
        // Which payment model do we have?
-       if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+       if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
                // "Calculate" dynamic time
                $time += SURFBAR_CALCULATE_DYNAMIC_ADD();
        } // END - if
@@ -1174,6 +1210,7 @@ function SURFBAR_DETERMINE_WAIT_TIME () {
        // Return value
        return $time;
 }
+
 // Changes the status of an URL from given to other
 function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) {
        // Make new status always lower-case
@@ -1200,7 +1237,7 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array())
 
        // Update the status now
        // ---------- Comment out for debugging/developing member actions! ---------
-       //SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET `status`='%s' WHERE id=%s LIMIT 1",
+       //SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_surfbar_urls` SET `status`='%s' WHERE `id`=%s LIMIT 1",
        //      array($newStatus, bigintval($urlId)), __FUNCTION__, __LINE__);
        // ---------- Comment out for debugging/developing member actions! ---------
 
@@ -1215,13 +1252,13 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array())
        // Prepare content for notification routines
        $data[$urlId]['uid']         = $data[$urlId]['userid'];
        $data[$urlId]['frametester'] = FRAMETESTER($data[$urlId]['url']);
-       $data[$urlId]['reward']      = TRANSLATE_COMMA(getConfig('surfbar_static_reward'));
-       $data[$urlId]['costs']       = TRANSLATE_COMMA(getConfig('surfbar_static_costs'));
+       $data[$urlId]['reward']      = translateComma(getConfig('surfbar_static_reward'));
+       $data[$urlId]['costs']       = translateComma(getConfig('surfbar_static_costs'));
 
        // Do some dirty fixing here:
-       if (($data[$urlId]['status'] == "STOPPED") && ($newStatus == "pending")) {
+       if (($data[$urlId]['status'] == 'STOPPED') && ($newStatus == 'pending')) {
                // Fix for template change
-               $newStatus = "continued";
+               $newStatus = 'continued';
        } // END - if
 
        // Send admin notification
@@ -1233,6 +1270,7 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array())
        // All done!
        return true;
 }
+
 // Calculate minimum value for dynamic payment model
 function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        // Addon is zero by default
@@ -1242,7 +1280,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
 
        // Get total users
-       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
+       $totalUsers = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
 
        // Get online users
        $onlineUsers = SURFBAR_DETERMINE_TOTAL_ONLINE();
@@ -1251,10 +1289,10 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        $addon += abs(log($onlineUsers / $totalUsers + 1) * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0");
+       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
 
        // Get user's total URLs
-       $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, "ACTIVE");
+       $userUrls = SURFBAR_GET_TOTAL_USER_URLS(0, 'ACTIVE');
 
        // Calculate addon
        if ($totalUrls > 0) {
@@ -1266,6 +1304,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE () {
        // Return addon
        return $addon;
 }
+
 // Calculate maximum value for dynamic payment model
 function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        // Addon is zero by default
@@ -1278,13 +1317,13 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        $percent = abs(log(getConfig('surfbar_dynamic_percent') / 100 + 1));
 
        // Get total users
-       $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
+       $totalUsers = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
 
        // Calculate addon
        $addon += abs($max * $percent * $totalUsers);
 
        // Get total URLs
-       $totalUrls = SURFBAR_GET_TOTAL_URLS("ACTIVE", "0");
+       $totalUrls = SURFBAR_GET_TOTAL_URLS('ACTIVE', '0');
 
        // Calculate addon
        $addon += abs($max * $percent * $totalUrls);
@@ -1292,6 +1331,7 @@ function SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE () {
        // Return addon
        return $addon;
 }
+
 // Calculate dynamic lock
 function SURFBAR_CALCULATE_DYNAMIC_LOCK () {
        // Default lock is 30 seconds
@@ -1306,6 +1346,7 @@ function SURFBAR_CALCULATE_DYNAMIC_LOCK () {
        // Return value
        return $addon;
 }
+
 // "Getter" for lock ids array
 function SURFBAR_GET_LOCK_IDS () {
        // Prepare some arrays
@@ -1326,7 +1367,7 @@ ORDER BY
        // Load all entries
        while ($content = SQL_FETCHARRAY($result)) {
                // Debug message
-               //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "next - lid={$content['id']},url={$content['url_id']},rest=".(time() - $last)."/".SURFBAR_GET_SURF_LOCK()."", false);
+               //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "next - lid={$content['id']},url={$content['url_id']},rest=".(time() - $last).'/'.SURFBAR_GET_SURF_LOCK()."", false);
 
                // Skip entries that are too old
                if (($last > (time() - SURFBAR_GET_SURF_LOCK())) && (!in_array($content['url_id'], $ignored))) {
@@ -1359,6 +1400,7 @@ ORDER BY
        // Return array
        return $USE;
 }
+
 // "Getter" for maximum random number
 function SURFBAR_GET_MAX_RANDOM ($UIDs, $add) {
        // Count max availabe entries
@@ -1383,6 +1425,7 @@ GROUP BY sbu.id", __FUNCTION__, __LINE__);
        // Return value
        return $maxRand;
 }
+
 // Load all URLs of the current user and return it as an array
 function SURFBAR_GET_USER_URLS () {
        // Init array
@@ -1410,8 +1453,9 @@ ORDER BY u.id ASC",
        // Return the array
        return $URLs;
 }
+
 // "Getter" for member action array for given status
-function SURFBAR_GET_ACTION_ARRAY ($status) {
+function SURFBAR_getModeAction_ARRAY ($status) {
        // Init array
        $returnArray = array();
 
@@ -1434,12 +1478,13 @@ function SURFBAR_GET_ACTION_ARRAY ($status) {
        // Return result
        return $returnArray;
 }
+
 // Reload to configured stop page
-function SURFBAR_RELOAD_TO_STOP_PAGE($page="stop") {
+function SURFBAR_RELOAD_TO_STOP_PAGE ($page="stop") {
        // Internal or external?
-       if ((getConfig('surfbar_pause_mode') == "INTERNAL") || (getConfig('surfbar_pause_url') == "")) {
+       if ((getConfig('surfbar_pause_mode') == 'INTERNAL') || (getConfig('surfbar_pause_url') == '')) {
                // Reload to internal page
-               LOAD_URL("surfbar.php?frame=".$page);
+               redirectToUrl("surfbar.php?frame=".$page);
        } else {
                // Reload to external page
                LOAD_CONFIGURED_URL('surfbar_pause_url');
@@ -1543,7 +1588,7 @@ LIMIT 1",
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "BASE/STATIC - reward=".SURFBAR_GET_REWARD()."|costs=".SURFBAR_GET_COSTS()."", false);
 
                // Only in dynamic model add the dynamic bonus!
-               if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+               if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
                        // Calculate dynamic reward/costs and add it
                        $GLOBALS['cache_array']['surfbar']['reward'] += SURFBAR_CALCULATE_DYNAMIC_ADD();
                        $GLOBALS['cache_array']['surfbar']['costs']  += SURFBAR_CALCULATE_DYNAMIC_ADD();
@@ -1561,6 +1606,7 @@ LIMIT 1",
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "nextId={$nextId}", false);
        return $nextId;
 }
+
 // -----------------------------------------------------------------------------
 // PLEASE DO NOT ADD ANY OTHER FUNCTIONS BELOW THIS LINE IF THEY DON'T "WRAP"
 // THE $GLOBALS['cache_array']['surfbar'] ARRAY!
@@ -1587,60 +1633,72 @@ function SURFBAR_GET_DATA ($element) {
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "element[$element]={$data}", false);
        return $data;
 }
+
 // Getter for reward from cache
 function SURFBAR_GET_REWARD () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('reward');
 }
+
 // Getter for costs from cache
 function SURFBAR_GET_COSTS () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('costs');
 }
+
 // Getter for URL from cache
 function SURFBAR_GET_URL () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('url');
 }
+
 // Getter for salt from cache
 function SURFBAR_GET_SALT () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('salt');
 }
+
 // Getter for id from cache
 function SURFBAR_GET_ID () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('id');
 }
+
 // Getter for userid from cache
 function SURFBAR_GET_USERID () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('userid');
 }
+
 // Getter for user reload locks
 function SURFBAR_GET_USER_LOCKS () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('user_locks');
 }
+
 // Getter for reload time
 function SURFBAR_GET_RELOAD_TIME () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('time');
 }
+
 // Getter for allowed views
 function SURFBAR_GET_VIEWS_ALLOWED () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('views_allowed');
 }
+
 // Getter for fixed reload
 function SURFBAR_GET_FIXED_RELOAD () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('fixed_reload');
 }
+
 // Getter for surf lock
 function SURFBAR_GET_SURF_LOCK () {
        // Get data element and return its contents
        return SURFBAR_GET_DATA('surf_lock');
 }
-//
+
+// [EOF]
 ?>
index fb0366a84e7548a2b018b017406cdcd0d73c470f..78c842db866f7652e2e66b17c2614bce80a862bf 100644 (file)
@@ -67,133 +67,133 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
 
        if (!$jobsDone) {
                // New extensions or updates found
-               $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND `status`='NEW' AND task_type='EXTENSION_UPDATE'");
+               $value = GET_TOTAL_DATA(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND `task_type`='EXTENSION_UPDATE'");
 
                if ($value > 0) {
                        define('__TASK_UPDATE_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task&amp;type=updates\">".$value."</a>");
                } else {
-                       define('__TASK_UPDATE_VALUE', "0");
+                       define('__TASK_UPDATE_VALUE', '0');
                }
        } else {
-               define('__TASK_UPDATE_VALUE', "0");
+               define('__TASK_UPDATE_VALUE', '0');
        }
 
        //
        // First check for all account status seperately
        //
        // Confirmed accounts
-       $value = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
+       $value = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
 
        if ($value > 0) {
                define('__CONFIRMED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_user&amp;status=confirmed\">".$value."</a>");
        } else {
-               define('__CONFIRMED_VALUE', "0");
+               define('__CONFIRMED_VALUE', '0');
        }
 
        // Unconfirmed accounts
-       $value = GET_TOTAL_DATA("UNCONFIRMED", "user_data", 'userid', "status", true);
+       $value = GET_TOTAL_DATA('UNCONFIRMED', 'user_data', 'userid', 'status', true);
 
        if ($value > 0) {
                define('__UNCONFIRMED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=chk_regs\">".$value."</a>");
        } else {
-               define('__UNCONFIRMED_VALUE', "0");
+               define('__UNCONFIRMED_VALUE', '0');
        }
 
        // And locked accounts
-       $value = GET_TOTAL_DATA("LOCKED", "user_data", 'userid', "status", true);
+       $value = GET_TOTAL_DATA('LOCKED', 'user_data', 'userid', 'status', true);
 
        if ($value > 0) {
                define('__LOCKED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_user&amp;status=locked\">".$value."</a>");
        } else {
-               define('__LOCKED_VALUE', "0");
+               define('__LOCKED_VALUE', '0');
        }
 
        //
        // Unassigned tasks
        //
-       $value = GET_TOTAL_DATA("0", "task_system", "id", "assigned_admin", true, " AND `status` != 'DELETED'");
+       $value = GET_TOTAL_DATA('0', 'task_system', 'id', 'assigned_admin', true, " AND `status` != 'DELETED'");
 
        if ($value > 0) {
                define('__TASK_NEW_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task&amp;type=unassigned\">".$value."</a>");
        } else {
-               define('__TASK_NEW_VALUE', "0");
+               define('__TASK_NEW_VALUE', '0');
        }
 
        //
        // Closed tasks
        //
-       $value = GET_TOTAL_DATA("CLOSED", "task_system", "id", "status", true);
+       $value = GET_TOTAL_DATA('CLOSED', 'task_system', 'id', 'status', true);
 
        if ($value > 0) {
                define('__TASK_CLOSED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task&amp;type=closed\">".$value."</a>");
        } else {
-               define('__TASK_CLOSED_VALUE', "0");
+               define('__TASK_CLOSED_VALUE', '0');
        }
 
        //
        // Deleted tasks
        //
-       $value = GET_TOTAL_DATA("DELETED", "task_system", "id", "status", true);
+       $value = GET_TOTAL_DATA('DELETED', 'task_system', 'id', 'status', true);
 
        if ($value > 0) {
                define('__TASK_DELETED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task&amp;type=deleted\">".$value."</a>");
        } else {
-               define('__TASK_DELETED_VALUE', "0");
+               define('__TASK_DELETED_VALUE', '0');
        }
 
        //
        // Solved tasks
        //
-       $value = GET_TOTAL_DATA("SOLVED", "task_system", "id", "status", true, sprintf(" AND assigned_admin=%s", GET_CURRENT_ADMIN_ID()));
+       $value = GET_TOTAL_DATA('SOLVED', 'task_system', 'id', 'status', true, sprintf(" AND `assigned_admin`=%s", getCurrentAdminId()));
 
        if ($value > 0) {
                define('__TASK_SOLVED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task&amp;type=solved\">".$value."</a>");
        } else {
-               define('__TASK_SOLVED_VALUE', "0");
+               define('__TASK_SOLVED_VALUE', '0');
        }
 
        //
        // Your tasks
        //
-       $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND status = 'NEW' AND task_type != 'EXTENSION_UPDATE'");
+       $value = GET_TOTAL_DATA(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', true, " AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'");
 
        if ($value > 0) {
                define('__TASK_YOUR_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=list_task\">".$value."</a>");
        } else {
-               define('__TASK_YOUR_VALUE', "0");
+               define('__TASK_YOUR_VALUE', '0');
        }
 
        //
        // Mails waiting to be approved
        //
-       $value = GET_TOTAL_DATA("ADMIN", "pool", "id", "data_type", true);
+       $value = GET_TOTAL_DATA('ADMIN', 'pool', 'id', 'data_type', true);
 
        if ($value > 0) {
                define('__MAIL_ADMIN_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=unlock_emails\">".$value."</a>");
        } else {
-               define('__MAIL_ADMIN_VALUE', "0");
+               define('__MAIL_ADMIN_VALUE', '0');
        }
 
        //
        // Unfinished mail orders
        //
-       $value = GET_TOTAL_DATA("TEMP", "pool", "id", "data_type", true);
+       $value = GET_TOTAL_DATA('TEMP', 'pool', 'id', 'data_type', true);
 
        if ($value > 0) {
                define('__MAIL_TEMP_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=email_details\">".$value."</a>");
        } else {
-               define('__MAIL_TEMP_VALUE', "0");
+               define('__MAIL_TEMP_VALUE', '0');
        }
 
        //
        // Sent mail orders
        //
-       $value = GET_TOTAL_DATA("SEND", "pool", "id", "data_type", true);
+       $value = GET_TOTAL_DATA('SEND', 'pool', 'id', 'data_type', true);
 
        if ($value > 0) {
                define('__MAIL_SEND_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=email_archiv\">".$value."</a>");
        } else {
-               define('__MAIL_SEND_VALUE', "0");
+               define('__MAIL_SEND_VALUE', '0');
        }
 
        //
@@ -201,12 +201,12 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
        //
        if (EXT_IS_ACTIVE('autopurge')) {
                // Get auto-purged mails
-               $value = GET_TOTAL_DATA("DELETED", "pool", "id", "data_type", true);
+               $value = GET_TOTAL_DATA('DELETED', 'pool', 'id', 'data_type', true);
 
                if ($value > 0) {
                        define('__MAIL_DELETED_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=email_details\">".$value."</a>");
                } else {
-                       define('__MAIL_DELETED_VALUE', "0");
+                       define('__MAIL_DELETED_VALUE', '0');
                }
 
                //
@@ -214,12 +214,12 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
                //
                if (GET_EXT_VERSION('bonus') >= '0.1.8') {
                        // Get auto-purged bonus mails
-                       $value = GET_TOTAL_DATA("DELETED", 'bonus', "id", "data_type", true);
+                       $value = GET_TOTAL_DATA('DELETED', 'bonus', 'id', 'data_type', true);
 
                        if ($value > 0) {
                                define('__MAIL_BONUS_AP_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=email_details\">".$value."</a>");
                        } else {
-                               define('__MAIL_BONUS_AP_VALUE', "0");
+                               define('__MAIL_BONUS_AP_VALUE', '0');
                        }
                } elseif (EXT_IS_ACTIVE('bonus')) {
                        define('__MAIL_BONUS_AP_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8')));
@@ -236,12 +236,12 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
        //
        if (GET_EXT_VERSION('bonus') >= '0.1.8') {
                // Get sent bonus mails (but not notifications)
-               $value = GET_TOTAL_DATA("SEND", 'bonus', "id", "data_type", true, " AND is_notify='N'");
+               $value = GET_TOTAL_DATA('SEND', 'bonus', 'id', 'data_type', true, " AND `is_notify`='N'");
 
                if ($value > 0) {
                        define('__MAIL_BONUS_SEND_VALUE', "<a href=\"{!URL!}/modules.php?module=admin&amp;what=email_details\">".$value."</a>");
                } else {
-                       define('__MAIL_BONUS_SEND_VALUE', "0");
+                       define('__MAIL_BONUS_SEND_VALUE', '0');
                }
        } elseif (EXT_IS_ACTIVE('bonus')) {
                define('__MAIL_BONUS_SEND_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', '0.1.8')));
@@ -270,59 +270,59 @@ FROM `{!_MYSQL_PREFIX!}_user_data` AS d
 WHERE d.`status`='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND d.ap_notified < (UNIX_TIMESTAMP() - ".$since.")
 ".$EXCLUDE_LIST."
 ORDER BY d.userid");
-               $WHATs[]  = "list_autopurge";
+               $WHATs[]  = 'list_autopurge';
                $DESCRs[] = getMessage('ADMIN_TASK_INACTIVE_AUTOPURGE');
                $TITLEs[] = getMessage('ADMIN_TASK_INACTIVE_AUTOPURGE_TITLE');
        }
 
        if (GET_EXT_VERSION('sql_patches') >= '0.3.4') {
                // Check for accounts without referal
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid='0' ORDER BY userid");
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `refid`=0 ORDER BY `userid` ASC");
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_ACCOUNT_NOREF');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_ACCOUNT_NOREF_TITLE');
-               $WHATs[]  = "list_user&amp;mode=norefs";
+               $WHATs[]  = 'list_user&amp;mode=norefs';
        }
 
        if (EXT_IS_ACTIVE('payout')) {
                // List new payout requests
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `status`='NEW' ORDER BY userid");
-               $WHATs[]  = "list_payouts";
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `status`='NEW' ORDER BY `userid` ASC");
+               $WHATs[]  = 'list_payouts';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_WAITING');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE');
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` ORDER BY userid");
-               $WHATs[]  = "list_payouts";
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_payouts` ORDER BY `userid` ASC");
+               $WHATs[]  = 'list_payouts';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE');
        }
 
        if (EXT_IS_ACTIVE('wernis')) {
                // List new wernis requests
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_wernis` ORDER BY userid");
-               $WHATs[]  = "list_wernis";
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_wernis` ORDER BY `userid` ASC");
+               $WHATs[]  = 'list_wernis';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_WERNIS_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_WERNIS_ALL_TITLE');
        }
 
        if (EXT_IS_ACTIVE('primera')) {
                // List new primera requests
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_primera` ORDER BY userid");
-               $WHATs[]  = "list_primera";
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_primera` ORDER BY `userid` ASC");
+               $WHATs[]  = 'list_primera';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_PRIMERA_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_PRIMERA_ALL_TITLE');
        }
 
        if (EXT_IS_ACTIVE('holiday')) {
                // List holiday requests
-               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_holidays` ORDER BY userid");
-               $WHATs[]  = "list_holiday";
+               ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_holidays` ORDER BY `userid` ASC");
+               $WHATs[]  = 'list_holiday';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_HOLIDAYS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_HOLIDAYS_TITLE');
        }
 
        if (GET_EXT_VERSION('bonus') >= '0.8.7') {
                // List all notifications
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC");
-               $WHATs[]  = "list_notifications";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC");
+               $WHATs[]  = 'list_notifications';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS_TITLE');
        } // END - if
@@ -331,30 +331,30 @@ ORDER BY d.userid");
                // Active rallye
                if (GET_EXT_VERSION('bonus') >= '0.6.9') {
                        // Add more bonus points here
-                       $USE = "(0";
-                       if (getConfig('bonus_click_yn') == 'Y') $USE .= " + turbo_bonus";
-                       if (getConfig('bonus_login_yn') == 'Y') $USE .= " + login_bonus";
-                       if (getConfig('bonus_order_yn') == 'Y') $USE .= " + bonus_order";
-                       if (getConfig('bonus_stats_yn') == 'Y') $USE .= " + bonus_stats";
-                       if (getConfig('bonus_ref_yn')   == 'Y') $USE .= " + bonus_ref";
-                       $USE .= ")";
+                       $USE = '(0';
+                       if (getConfig('bonus_click_yn') == 'Y') $USE .= ' + `turbo_bonus`';
+                       if (getConfig('bonus_login_yn') == 'Y') $USE .= ' + `login_bonus`';
+                       if (getConfig('bonus_order_yn') == 'Y') $USE .= ' + `bonus_order`';
+                       if (getConfig('bonus_stats_yn') == 'Y') $USE .= ' + `bonus_stats`';
+                       if (getConfig('bonus_ref_yn')   == 'Y') $USE .= ' + `bonus_ref`';
+                       $USE .= ')';
                } else {
                        // Old version ???
-                       $USE = "turbo_bonus";
+                       $USE = 'turbo_bonus';
                }
 
                // Autopurge installed?
                $lastOnline = '';
                if ((EXT_IS_ACTIVE('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
                        // Use last online timestamp to keep inactive members away from here
-                       $lastOnline   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
+                       $lastOnline   = sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
                }
 
                ADD_SQL("SELECT ".$USE." AS points
 FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE `status`='CONFIRMED' AND ".$USE.">0".$lastOnline."
 ORDER BY points DESC, userid");
-               $WHATs[]  = "list_bonus";
+               $WHATs[]  = 'list_bonus';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_BONUS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_BONUS_TITLE');
        }
@@ -366,25 +366,25 @@ ORDER BY points DESC, userid");
                $lastOnline = '';
                if ((EXT_IS_ACTIVE('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
                        // Use last online timestamp to keep inactive members away from here
-                       $lastOnline   = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
+                       $lastOnline   = sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
                }
 
                ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE `status`='CONFIRMED' AND beg_points>0".$lastOnline."
 ORDER BY beg_points DESC, userid");
-               $WHATs[]  = "list_beg";
+               $WHATs[]  = 'list_beg';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_BEG');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_BEG_TITLE');
        }
 
        if (EXT_IS_ACTIVE('doubler')) {
                // List waiting payouts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY `id`");
-               $WHATs[]  = "list_doubler&amp;mode=waiting&amp;select=all";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY `id`");
+               $WHATs[]  = 'list_doubler&amp;mode=waiting&amp;select=all';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE');
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_doubler` ORDER BY `id`");
-               $WHATs[]  = "list_doubler";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` ORDER BY `id`");
+               $WHATs[]  = 'list_doubler';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_ALL_TITLE');
        }
@@ -392,139 +392,139 @@ ORDER BY beg_points DESC, userid");
        //
        // All referal banner
        //
-       ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` ORDER BY `id`");
-       $WHATs[] = "refbanner";
+       ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refbanner` ORDER BY `id`");
+       $WHATs[] = 'refbanner';
        $DESCRs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ALL');
        $TITLEs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ALL_TITLE');
 
        //
        // All activated referal banner
        //
-       ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y' ORDER BY `id`");
-       $WHATs[] = "refbanner";
+       ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `visible`='Y' ORDER BY `id`");
+       $WHATs[] = 'refbanner';
        $DESCRs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ACTIVE');
        $TITLEs[] = getMessage('ADMIN_TASK_LIST_REFBANNER_ACTIVE_TITLE');
 
        //
        // All extensions
        //
-       ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` ORDER BY `id`");
-       $WHATs[] = "extensions";
+       ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` ORDER BY `id`");
+       $WHATs[] = 'extensions';
        $DESCRs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ALL');
        $TITLEs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE');
 
        //
        // All activated extensions
        //
-       ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_active='Y' ORDER BY `id`");
-       $WHATs[]  = "extensions&amp;active=Y";
+       ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_active`='Y' ORDER BY `id`");
+       $WHATs[]  = 'extensions&amp;active=Y';
        $DESCRs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ACTIVE');
        $TITLEs[] = getMessage('ADMIN_TASK_LIST_EXTENSIONS_ACTIVE_TITLE');
 
-       if (EXT_IS_ACTIVE("engine")) {
+       if (EXT_IS_ACTIVE('engine')) {
                // List all export accounts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_engine_accounts` ORDER BY `id`");
-               $WHATs[]  = "list_engine";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_accounts` ORDER BY `id`");
+               $WHATs[]  = 'list_engine';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_TITLE');
 
                // List all pending accounts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
-               $WHATs[]  = "unlock_engine";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_accounts` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
+               $WHATs[]  = 'unlock_engine';
                $DESCRs[] = getMessage('ADMIN_TASK_UNLOCK_ENGINE');
                $TITLEs[] = getMessage('ADMIN_TASK_UNLOCK_ENGINE_TITLE');
 
                // List all safes
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_engine_safe` ORDER BY `id`");
-               $WHATs[]  = "list_engine&amp;mode=safe";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_safe` ORDER BY `id`");
+               $WHATs[]  = 'list_engine&amp;mode=safe';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE_SAFES');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_SAFES_TITLE');
 
                // List all export URLs
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_engine_urls` ORDER BY `id`");
-               $WHATs[]  = "engine_urls";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_engine_urls` ORDER BY `id`");
+               $WHATs[]  = 'engine_urls';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_ENGINE_URLS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_ENGINE_URLS_TITLE');
-       }
+       } // END - if
 
        if (EXT_IS_ACTIVE('sponsor')) {
                // List all sponsors
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`");
-               $WHATs[]  = "list_sponsor";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`");
+               $WHATs[]  = 'list_sponsor';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_TITLE');
 
                // List confirmed sponsor accounts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id`");
-               $WHATs[]  = "list_sponsor";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='CONFIRMED' ORDER BY `id`");
+               $WHATs[]  = 'list_sponsor';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_CONFIRMED');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_CONFIRMED_TITLE');
 
                // List unconfirmed sponsor accounts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
-               $WHATs[]  = "list_sponsor";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='UNCONFIRMED' ORDER BY `id`");
+               $WHATs[]  = 'list_sponsor';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_UNCONFIRMED_TITLE');
 
                // List locked sponsor accounts
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id`");
-               $WHATs[]  = "list_sponsor";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='LOCKED' ORDER BY `id`");
+               $WHATs[]  = 'list_sponsor';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_LOCKED');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_LOCKED_TITLE');
 
                // List waiting sponsor accounts to be approved
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id`");
-               $WHATs[]  = "unlock_sponsor";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `status`='PENDING' ORDER BY `id`");
+               $WHATs[]  = 'unlock_sponsor';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_PENDING');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_PENDING_TITLE');
 
                // Waiting payments
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id`");
-               $WHATs[]  = "list_sponsor_pays";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_orders` WHERE `pay_status`='PENDING' ORDER BY `id`");
+               $WHATs[]  = 'list_sponsor_pays';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SPONSOR_ORDERS_TITLE');
        }
 
        if (EXT_IS_ACTIVE('country')) {
                // List country codes
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY `id`");
-               $WHATs[]  = "list_country";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_countries` ORDER BY `id`");
+               $WHATs[]  = 'list_country';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_COUNTRY');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_COUNTRY_TITLE');
        }
 
        if (EXT_IS_ACTIVE('theme')) {
                // List all themes
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`");
-               $WHATs[]  = "theme_edit";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY `id`");
+               $WHATs[]  = 'theme_edit';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_THEME_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_THEME_ALL_TITLE');
 
                // List active themes
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_active='Y' ORDER BY `id`");
-               $WHATs[]  = "theme_edit";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_themes` WHERE theme_active='Y' ORDER BY `id`");
+               $WHATs[]  = 'theme_edit';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_THEME_ACTIVE_TITLE');
        }
 
        if (EXT_IS_ACTIVE('admins')) {
                // List all administrator logins
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`");
-               $WHATs[]  = "admins_edit";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id`");
+               $WHATs[]  = 'admins_edit';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_ADMINS_ALL_TITLE');
        }
 
        if (EXT_IS_ACTIVE('surfbar')) {
                // List all URLs in surfbar
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_surfbar_urls` ORDER BY `id`");
-               $WHATs[]  = "list_surfbar_urls";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_surfbar_urls` ORDER BY `id`");
+               $WHATs[]  = 'list_surfbar_urls';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE');
 
                // List all pending URLs in surfbar
-               ADD_SQL("SELECT id FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE `status`='PENDING' ORDER BY `id`");
-               $WHATs[]  = "unlock_surfbar_urls";
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_surfbar_urls` WHERE `status`='PENDING' ORDER BY `id`");
+               $WHATs[]  = 'unlock_surfbar_urls';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE');
        }
@@ -533,13 +533,13 @@ ORDER BY beg_points DESC, userid");
        $EXTRAS .= TASK_CREATE_EXTRA_ROWS($WHATs, $DESCRs, $TITLEs);
 
        // If empty just keep a forced-space left for CSS issues
-       if (empty($EXTRAS)) $EXTRAS = "&nbsp;";
+       if (empty($EXTRAS)) $EXTRAS = '&nbsp;';
 
        // Add compiled string to constant for final template
        define('__OVERVIEW_EXTRA_TABLE', $EXTRAS);
 
        // Simply load the template... :-)
-       LOAD_TEMPLATE("admin_overview_task");
+       LOAD_TEMPLATE('admin_overview_task');
 }
 
 //
@@ -562,11 +562,11 @@ function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
                $content = array(
                        'row_descr' => $DESCRs[$key],
                        'row_sw'    => $SW,
-                       'bottom'    => "",
+                       'bottom'    => '',
                );
 
                // Rewrite CSS class if not last entry is reached
-               if ($key < (COUNT_SQLS() - 1)) $content['bottom'] = "bottom2";
+               if ($key < (COUNT_SQLS() - 1)) $content['bottom'] = 'bottom2';
 
                if (($value > 0) && (!empty($WHATs[$key]))) {
                        if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('ADMIN_TASK_UNKNOWN_LIST_TITLE');
@@ -576,14 +576,14 @@ function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
                }
 
                // And insert the final string into extras template
-               $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
+               $OUT .= LOAD_TEMPLATE('admin_overview_task_rows', true, $content);
 
                // Switch color
                $SW = 3 - $SW;
        } // END - if
 
        // Return output in the template
-       return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);
+       return LOAD_TEMPLATE('admin_overview_task_extras', true, $OUT);
 }
 
 //
index 2e4b807dbec1170a46dd19965596c411eadc4ee9..d2e5da8b03344cfbb234edf509553cb8f239d698 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Create a selection box with installed and activated themes
-function THEME_SELECTION_BOX ($mod, $act, $wht, $result) {
+function generateThemeSelectionBox ($mod, $act, $wht, $result) {
        // Construction URL
        $formAction = "{!URL!}/modules.php?module=".$mod;
        if (!empty($act)) $formAction .= "&amp;action=".$act;
@@ -59,9 +59,9 @@ function THEME_SELECTION_BOX ($mod, $act, $wht, $result) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Load it's theme.php file
                $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($content['theme_path']));
-               if (INCLUDE_READABLE($INC)) {
+               if (isIncludeReadable($INC)) {
                        // And save all data in array
-                       LOAD_INC($INC);
+                       loadInclude($INC);
                        $themesArray['theme_unix'][] = $content['theme_path'];
                        $themesArray['theme_name'][] = $GLOBALS['theme_data']['name'];
                } // END - if
@@ -74,7 +74,7 @@ function THEME_SELECTION_BOX ($mod, $act, $wht, $result) {
        $OUT = '';
        foreach ($themesArray['theme_unix'] as $key => $theme) {
                $OUT .= "  <option value=\"".$theme."\"";
-               if ($theme == GET_CURR_THEME()) $OUT .= ' selected="selected"';
+               if ($theme == getCurrentTheme()) $OUT .= ' selected="selected"';
                $OUT .= ">".$themesArray['theme_name'][$key]."</option>\n";
        } // END - foreach
 
@@ -126,13 +126,13 @@ function THEME_GET_VERSION ($name) {
 }
 
 // Checks wether a theme is found in db
-function THEME_CHECK_EXIST ($name) {
+function ifThemeExists ($name) {
        // Get theme and is it not nul?
-       return (THEME_GET_ID($name) > 0);
+       return (getThemeId($name) > 0);
 }
 
 // Checks if a theme is active
-function THEME_IS_ACTIVE ($name) {
+function isThemeActive ($name) {
        // Is the extension 'theme' installed?
        if (!EXT_IS_ACTIVE('theme')) {
                // Then abort here
@@ -166,7 +166,7 @@ function THEME_IS_ACTIVE ($name) {
 }
 
 // Gets current human-readable theme name
-function GET_CURR_THEME_NAME () {
+function getCurrentThemeName () {
        // Is the extension 'theme' installed?
        if (!EXT_IS_ACTIVE('theme')) {
                // Then abort here
@@ -174,7 +174,7 @@ function GET_CURR_THEME_NAME () {
        } // END - if
 
        // Get the Uni* name
-       $name = GET_CURR_THEME();
+       $name = getCurrentTheme();
 
        // Is the cache entry there?
        if (isset($GLOBALS['cache_array']['themes']['theme_name'][$name])) {
@@ -200,7 +200,7 @@ function GET_CURR_THEME_NAME () {
 }
 
 // Initialize variables
-$GLOBALS['curr_theme'] = GET_CURR_THEME();
+$GLOBALS['curr_theme'] = getCurrentTheme();
 
 // Check if new theme is selcted
 if ((REQUEST_ISSET_POST(('new_theme'))) && (REQUEST_POST('new_theme') != $GLOBALS['curr_theme'])) {
@@ -208,7 +208,7 @@ if ((REQUEST_ISSET_POST(('new_theme'))) && (REQUEST_POST('new_theme') != $GLOBAL
        $newTheme = REQUEST_POST('new_theme');
 
        // Change to new theme
-       set_session('mxchange_theme', $newTheme);
+       setSession('mxchange_theme', $newTheme);
 
        // Remove current from array and set new
        $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $GLOBALS['curr_theme']);
index dfeb509d4d2e871ec97b373d0517efbb309772d4..cdd28764eacd767db64a7887419b2b22e430e721 100644 (file)
@@ -45,23 +45,23 @@ if (!defined('__SECURITY')) {
 //
 function TRANSFER_AUTPPURGE($max, $age) {
        // First get total in-going lines
-       $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_in` ORDER BY `id`", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_transfers_in` ORDER BY `id`", __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) > $max) {
                // Update overdue transfers
                $remove = SQL_NUMROWS($result) - $max;
 
                // This will make it really old, so the final removal query will find it
-               $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_in` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__);
+               $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_in` SET `time_trans`=0 ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__);
        }
 
        // Second get total out-going lines
-       $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY `id`", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_transfers_out` ORDER BY `id`", __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) > $max) {
                // Update overdue transfers
                $remove = SQL_NUMROWS($result) - $max;
 
                // This will make it really old, so the final removal query will find it
-               $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_out` SET time_trans='0' ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__);
+               $result = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_transfers_out` SET `time_trans`=0 ORDER BY `id` LIMIT ".$remove, __FUNCTION__, __LINE__);
        }
 
        // Remove old in-going transfers
@@ -74,7 +74,7 @@ function TRANSFER_AUTPPURGE($max, $age) {
 
        // Only send email to admin(s) when we have removed entries
        if ($REMOVE > 0) {
-               SEND_ADMIN_NOTIFICATION(TRANSFER_ADMIN_AUTOPURGE, "admin_transfer_ap", $REMOVE, 0);
+               sendAdminNotification(TRANSFER_ADMIN_AUTOPURGE, "admin_transfer_ap", $REMOVE, 0);
        }
 }
 //
index 32be05f4b6aed24ae2c5d0a3234322fae09e436e..1b72e2065efaaf37f6da424ed89229d50bc92bc1 100644 (file)
@@ -49,7 +49,7 @@ function alpha ($sortby, $colspan, $return=false) {
        if (REQUEST_ISSET_GET(('mode'))) $add .= "&amp;mode=".REQUEST_GET(('mode'));
 
        /* Creates the list of letters and makes them a link. */
-       $alphabet = array(getMessage('_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",getMessage('_OTHERS'));
+       $alphabet = explode(',', getMessage('_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' . getMessage('_OTHERS'));
        $num = count($alphabet) - 1;
        $OUT = '';
        while (list($counter, $ltr) = each($alphabet)) {
@@ -103,7 +103,7 @@ function SortLinks ($letter, $sortby, $colspan, $return=false) {
        $list = array(
                'userid'                => getMessage('_UID'),
                'family'                => getMessage('FAMILY_NAME'),
-               'email'         => getMessage('ADDY'),
+               'email'                 => getMessage('ADDY'),
                'REMOTE_ADDR'   => getMessage('REMOTE_IP')
        );
 
@@ -195,7 +195,7 @@ function ADD_PAGENAV ($PAGES, $offset, $show_form, $colspan,$return=false) {
 }
 
 // Create email link to user's account
-function USER_CREATE_EMAIL_LINK($email, $mod='admin') {
+function USER_generateMemberEmailLink($email, $mod='admin') {
        // Show contact link only if user is confirmed by default
        $locked = " AND `status`='CONFIRMED'";
 
@@ -229,7 +229,7 @@ function SELECT_RANDOM_REFID () {
        // Is the extension version fine?
        if (GET_EXT_VERSION('user') >= '0.3.4') {
                // Get all user ids
-               $totalUsers = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
+               $totalUsers = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
 
                // Do we have at least one?
                if ($totalUsers > 0) {
@@ -343,7 +343,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
                        setUserId($uid);
 
                        // Try to set session data (which shall normally always work!)
-                       if ((set_session('userid', $uid )) && (set_session('u_hash', $content['hash']))) {
+                       if ((setSession('userid', $uid )) && (setSession('u_hash', $content['hash']))) {
                                // Update database records
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET total_logins=total_logins+1".$add." WHERE userid=%s LIMIT 1",
                                        array($uid), __FUNCTION__, __LINE__);
@@ -384,7 +384,7 @@ function USER_DO_LOGIN ($uid, $passwd) {
                        list($status) = SQL_FETCHROW($result);
 
                        // Create an error code from given status
-                       $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+                       $errorCode = generateErrorCodeFromUserStatus($status);
                } else {
                        // ID not found!
                        $errorCode = getCode('WRONG_ID');
@@ -436,7 +436,7 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
 
                if ($status == 'CONFIRMED') {
                        // Ooppps, this was missing! ;-) We should update the database...
-                       $NEW_PASS = GEN_PASS();
+                       $NEW_PASS = generatePassword();
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET password='%s' WHERE userid=%s LIMIT 1",
                                array(generateHash($NEW_PASS), $uid), __FUNCTION__, __LINE__);
 
@@ -444,16 +444,16 @@ function USER_DO_NEW_PASSWORD ($email, $uid) {
                        $msg = LOAD_EMAIL_TEMPLATE('new-pass', array('new_pass' => $NEW_PASS), $uid);
 
                        // ... and send it away
-                       SEND_EMAIL($uid, getMessage('GUEST_NEW_PASSWORD'), $msg);
+                       sendEmail($uid, getMessage('GUEST_NEW_PASSWORD'), $msg);
 
                        // Output note to user
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('GUEST_NEW_PASSWORD_SEND'));
                } else {
                        // Account is locked or unconfirmed
-                       $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+                       $errorCode = generateErrorCodeFromUserStatus($status);
 
                        // Load URL
-                       LOAD_URL('modules.php?module=index&amp;what=login&amp;login='.$errorCode);
+                       redirectToUrl('modules.php?module=index&amp;what=login&amp;login='.$errorCode);
                }
        } else {
                // ID or email is wrong
index 8327e6da3998db899c71de26c5dfd22468426e03..56302d59e66111f31ec5a272116ca2c2fa10f152 100644 (file)
@@ -55,10 +55,10 @@ function GET_WERNIS_ERROR_MESSAGE () {
                return $GLOBALS['wernis_data']['message'];
        } elseif (isset($GLOBALS['wernis_data']['status'])) {
                // Fall-back to status
-               return sprintf(WERNIS_ERROR_STATUS, $GLOBALS['wernis_data']['status']);
+               return sprintf(getMessage('WERNIS_ERROR_STATUS'), $GLOBALS['wernis_data']['status']);
        } else {
                // Something bad happend
-               return WERNIS_UNKNOWN_ERROR;
+               return getMessage('WERNIS_UNKNOWN_ERROR');
        }
 }
 
@@ -69,7 +69,7 @@ function GET_WERNIS_ERROR_CODE () {
                return $GLOBALS['wernis_data']['status'];
        } else {
                // Something bad happend
-               return WERNIS_UNKNOWN_ERROR;
+               return getMessage('WERNIS_UNKNOWN_ERROR');
        }
 }
 
@@ -79,36 +79,36 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData =  array()) {
        if (!is_array($requestData)) {
                // Then abort here!
                return array(
-                       'status'  => "failed_general",
-                       'message' => WERNIS_API_REQUEST_DATA_INVALID
+                       'status'  => 'failed_general',
+                       'message' => getMessage('WERNIS_API_REQUEST_DATA_INVALID')
                );
        } // END - if
 
        // Is the API id and MD5 hash there?
-       if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
+       if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
                // Abort here...
                return array(
-                       'status'  => "failed_general",
-                       'message' => WERNIS_API_REQUEST_DATA_MISSING
+                       'status'  => 'failed_general',
+                       'message' => getMessage('WERNIS_API_REQUEST_DATA_MISSING')
                );
        } // END - if
 
        // Add more request data
-       $requestData['api_id']  = getConfig(('wernis_api_id'));
+       $requestData['api_id']  = getConfig('wernis_api_id');
        $requestData['api_key'] = getConfig('wernis_api_md5');
 
        // Construct the request string
        $requestString = getConfig('wernis_api_url') . $scriptName;
 
        // Get the raw response from the lower function
-       $response = POST_URL($requestString, $requestData);
+       $response = sendPostRequest($requestString, $requestData);
 
        // Check the response header if all is fine
-       if (strpos($response[0], "200") === false) {
+       if (strpos($response[0], '200') === false) {
                // Something bad happend... :(
                return array(
-                       'status'  => "request_error",
-                       'message' => sprintf(WERNIS_API_REQUEST_ERROR, $response[0])
+                       'status'  => 'request_error',
+                       'message' => sprintf(getMessage('WERNIS_API_REQUEST_ERROR'), $response[0])
                );
        } // END - if
 
@@ -116,71 +116,71 @@ function WERNIS_SEND_REQUEST ($scriptName, $requestData =  array()) {
        $response = $response[(count($response) - 1)];
 
        // Prepare the returning result for higher functions
-       if (substr($response, 0, 1) == "&") {
+       if (substr($response, 0, 1) == '&') {
                // Remove the leading & (which can be used in Flash)
                $response = substr($response, 1);
        } // END - if
 
        // Bring back the response
-       $data = explode("=", $response);
+       $data = explode('=', $response);
 
        // Default return array (should not stay empty)
        $return = array();
 
        // We use only the first two entries (which shall be fine)
-       if ($data[0] === "error") {
+       if ($data[0] === 'error') {
                // The request has failed... :(
                switch ($data[1]) {
-                       case "404": // Invalid API ID
-                       case "AUTH": // Authorization has failed
+                       case '404': // Invalid API ID
+                       case 'AUTH': // Authorization has failed
                                $return = array(
-                                       'status'  => "auth_failed",
-                                       'message' => WERNIS_API_REQUEST_FAILED_AUTH
+                                       'status'  => 'auth_failed',
+                                       'message' => getMessage('WERNIS_API_REQUEST_FAILED_AUTH')
                                );
                                break;
 
-                       case "LOCKED": // User account is locked!
-                       case "PASS": // Bad passphrase entered
-                       case "USER": // Missing account or invalid password
+                       case 'LOCKED': // User account is locked!
+                       case 'PASS': // Bad passphrase entered
+                       case 'USER': // Missing account or invalid password
                                $return = array(
-                                       'status'  => "user_failed",
-                                       'message' => WERNIS_API_REQUEST_FAILED_USER
+                                       'status'  => 'user_failed',
+                                       'message' => getMessage('WERNIS_API_REQUEST_FAILED_USER')
                                );
                                break;
 
-                       case "OWN": // Transfer to own account
+                       case 'OWN': // Transfer to own account
                                $return = array(
-                                       'status'  => "own_failed",
-                                       'message' => WERNIS_API_REQUEST_FAILED_OWN
+                                       'status'  => 'own_failed',
+                                       'message' => getMessage('WERNIS_API_REQUEST_FAILED_OWN')
                                );
                                break;
 
-                       case "AMOUNT": // Amount is depleted
+                       case 'AMOUNT': // Amount is depleted
                                $return = array(
-                                       'status'  => "amount_failed",
-                                       'message' => WERNIS_API_REQUEST_FAILED_AMOUNT
+                                       'status'  => 'amount_failed',
+                                       'message' => getMessage('WERNIS_API_REQUEST_FAILED_AMOUNT')
                                );
                                break;
 
-                       case "AMOUNT-SEND": // API amount is depleted
+                       case 'AMOUNT-SEND': // API amount is depleted
                                $return = array(
-                                       'status'  => "api_amount_failed",
-                                       'message' => WERNIS_API_REQUEST_FAILED_API_AMOUNT
+                                       'status'  => 'api_amount_failed',
+                                       'message' => getMessage('WERNIS_API_REQUEST_FAILED_API_AMOUNT')
                                );
                                break;
 
                        default: // Unknown error (maybe new?)
                                DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown error %s from WDS66 API received.", $data[1]));
                                $return = array(
-                                       'status'  => "request_failed",
-                                       'message' => sprintf(WERNIS_API_REQUEST_FAILED, $data[1])
+                                       'status'  => 'request_failed',
+                                       'message' => sprintf(getMessage('WERNIS_API_REQUEST_FAILED'), $data[1])
                                );
                                break;
                }
        } else {
                // All fine here
                $return = array(
-                       'status'   => "OK",
+                       'status'   => 'OK',
                        'response' => $response
                );
        }
@@ -195,9 +195,9 @@ function WERNIS_TEST_API () {
        $result = false;
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST("balance.php");
+       $return = WERNIS_SEND_REQUEST('balance.php');
 
-       if ($return['status'] == "OK") {
+       if ($return['status'] == 'OK') {
                // All fine!
                $result = true;
        } else {
@@ -226,12 +226,12 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
        $result = false;
 
        // Prepare the purpose
-       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(WERNIS_API_PURPOSE_WITHDRAW, getUserId()))."\";";
+       $eval = "\$purpose = \"".COMPILE_CODE(sprintf(getMessage('WERNIS_API_PURPOSE_WITHDRAW'), getUserId()))."\";";
        eval($eval);
 
        // Prepare the request data
        $requestData = array(
-               'sub_request'   => "receive",
+               'sub_request'   => 'receive',
                't_uid'                 => bigintval($wdsId),
                't_md5'                 => $userMd5,
                'r_uid'                 => getConfig('wernis_refid'),
@@ -240,9 +240,9 @@ function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
        );
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST("book.php", $requestData);
+       $return = WERNIS_SEND_REQUEST('book.php', $requestData);
 
-       if ($return['status'] == "OK") {
+       if ($return['status'] == 'OK') {
                // All fine!
                $result = true;
 
@@ -272,7 +272,7 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
 
        // Prepare the request data
        $requestData = array(
-               'sub_request'   => "send",
+               'sub_request'   => 'send',
                't_uid'                 => getConfig('wernis_refid'),
                't_md5'                 => getConfig('wernis_pass_md5'),
                'r_uid'                 => bigintval($wdsId),
@@ -281,9 +281,9 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
        );
 
        // Return the result from the lower functions
-       $return = WERNIS_SEND_REQUEST("book.php", $requestData);
+       $return = WERNIS_SEND_REQUEST('book.php', $requestData);
 
-       if ($return['status'] == "OK") {
+       if ($return['status'] == 'OK') {
                // All fine!
                $result = true;
 
@@ -304,18 +304,18 @@ function WERNIS_EXECUTE_PAYOUT ($wdsId, $amount) {
 // Translate the status IN/OUT
 function WERNIS_TRANSFER_STATUS ($status) {
        // Default status
-       $return = sprintf(WERNIS_STATUS_UNKNWOWN, $status);
+       $return = sprintf(getMessage('WERNIS_STATUS_UNKNWOWN'), $status);
        switch ($status) {
-               case "IN": // Withdraw
-                       $return = WERNIS_STATUS_WITHDRAW;
+               case 'IN': // Withdraw
+                       $return = getMessage('WERNIS_STATUS_WITHDRAW');
                        break;
 
-               case "OUT": // Payout
-                       $return = WERNIS_STATUS_PAYOUT;
+               case 'OUT': // Payout
+                       $return = getMessage('WERNIS_STATUS_PAYOUT');
                        break;
 
-               case "FAILED": // Payout
-                       $return = WERNIS_STATUS_FAILED;
+               case 'FAILED': // Payout
+                       $return = getMessage('WERNIS_STATUS_FAILED');
                        break;
        }
 
@@ -324,7 +324,7 @@ function WERNIS_TRANSFER_STATUS ($status) {
 }
 
 // Log the transfer
-function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = "", $status = "") {
+function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = '', $status = '') {
        // Register this wernis movement
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_wernis` (`userid`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type`,`wernis_api_message`,`wernis_api_status`) VALUES (%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
                array(getUserId(), bigintval($wdsId), bigintval($amount), $type, $message, $status), __FUNCTION__, __LINE__);
@@ -383,19 +383,19 @@ function WERNIS_ADD_FEES_TO_ARRAY (&$array) {
        // Is the array an array? ;-)
        if (!is_array($array)) {
                // Log error and return
-               DEBUG_LOG(__FUNCTION__, __LINE__, " Type ".gettype($array)." != array.");
+               DEBUG_LOG(__FUNCTION__, __LINE__, ' Type '.gettype($array).'!=array.');
                return;
        } // END - if
 
        // Add both factors
-       $array['payout_factor']        = TRANSLATE_COMMA(getConfig('wernis_payout_factor'));
-       $array['withdraw_factor']      = TRANSLATE_COMMA(getConfig('wernis_withdraw_factor'));
+       $array['payout_factor']        = translateComma(getConfig('wernis_payout_factor'));
+       $array['withdraw_factor']      = translateComma(getConfig('wernis_withdraw_factor'));
 
        // Add all fees
-       $array['payout_fee_percent']   = TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent'));
-       $array['withdraw_fee_percent'] = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent'));
-       $array['payout_fee_fix']       = TRANSLATE_COMMA(getConfig('wernis_payout_fee_fix'));
-       $array['withdraw_fee_fix']     = TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_fix'));
+       $array['payout_fee_percent']   = translateComma(getConfig('wernis_payout_fee_percent'));
+       $array['withdraw_fee_percent'] = translateComma(getConfig('wernis_withdraw_fee_percent'));
+       $array['payout_fee_fix']       = translateComma(getConfig('wernis_payout_fee_fix'));
+       $array['withdraw_fee_fix']     = translateComma(getConfig('wernis_withdraw_fee_fix'));
 }
 
 //
index 09f057640498342a7889c7524d32aafd98fdabc4..25f3dd9dbb0ffe9bd1b80679e9109aaaf10ee7cf 100644 (file)
@@ -98,12 +98,12 @@ function YOOMEDIA_QUERY_API ($script, $countQuery = true) {
                );
 
                // Run the query
-               $response = GET_URL($requestString);
+               $response = sendGetRequest($requestString);
 
                // Shall we count the query as used?
                if ($countQuery) {
                        // Then update the config!
-                       UPDATE_CONFIG("yoomedia_requests_remain", 1, "-");
+                       updateConfiguration('yoomedia_requests_remain', 1, '-');
                } // END - if
        } // END - if
 
@@ -155,7 +155,7 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) {
        $cnt = 0; $entry = 0;
        foreach ($dataArray as $line) {
                // Add the line
-               $result[$entry][YOOMEDIA_TRANSLATE_INDEX($type, $cnt)] = $line;
+               $result[$entry][yoomediaTranslateIndex($type, $cnt)] = $line;
 
                // End of data of first entry reached?
                if ($cnt == 6) {
@@ -196,10 +196,10 @@ function YOOMEDIA_PREPARE_MAIL_DELIVERY ($data) {
        $data['sid'] = getConfig('yoomedia_sid');
 
        // Add total receivers
-       $data['all'] = TRANSLATE_COMMA(GET_TOTAL_RECEIVERS());
+       $data['all'] = translateComma(getTotalReceivers());
 
        // Add categories
-       $data['categories'] = ADD_CATEGORY_OPTIONS('normal');
+       $data['categories'] = generateCategoryOptionsList('normal');
 
        // Load template
        LOAD_TEMPLATE("admin_send_yoomedia", false, $data);
@@ -234,7 +234,7 @@ function YOOMEDIA_SEND_BONUS_MAIL ($data, $mode) {
        YOOMEDIA_RELOAD_LOCK($data, $mode);
 
        // Call the lower function
-       ADD_NEW_BONUS_MAIL($data, $mode);
+       addNewBonusMail($data, $mode);
 }
 
 // Lockdown given id
@@ -261,7 +261,7 @@ function YOOMEDIA_UNLIST_MAIL ($data, $mode) {
 }
 
 // "Translates" the index number into an assosiative value
-function YOOMEDIA_TRANSLATE_INDEX ($type, $index) {
+function yoomediaTranslateIndex ($type, $index) {
        // Default is the index
        $return = $index;
 
@@ -279,7 +279,7 @@ function YOOMEDIA_TRANSLATE_INDEX ($type, $index) {
 }
 
 // "Translate" error code
-function YOOMEDIA_TRANSLATE_ERROR ($errorCode) {
+function yoomediaTranslateError ($errorCode) {
        // Default is "failed"
        $return = "failed";
 
@@ -313,7 +313,7 @@ function YOOMEDIA_CHECK_RELOAD ($id, $reload, $type) {
                // Are we ready to sent again?
                if (((time() - $time) >= ($reload * 60*60)) && ($time > 0)) {
                        // Remove entry
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_yoomedia_reload` WHERE `id`=%s LIMIT 1",
                                array($id), __FUNCTION__, __LINE__);
                } else {
                        // Dont' sent again this mail
index ff07bba6dbaaf97aa4cdf1b0a74cca97efa43c7b..ffe91d926e7260100206d77dcb46eda109338222 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
 
 // Init & set the INC_POOL
 INIT_INC_POOL();
-SET_INC_POOL(GET_DIR_AS_ARRAY('inc/loader/', 'load_cache-'));
+SET_INC_POOL(getArrayFromDirectory('inc/loader/', 'load_cache-'));
 
 // Run the filter
 runFilterChain('load_includes');
index 18ff9c64dffbf3e9fddebf5d52e122eed84fcda4..f6ba3df7f3388d4bfdcb7e4b2484aa6afa233ca0 100644 (file)
@@ -188,7 +188,7 @@ if ($GLOBALS['cache_mode'] == 'load') {
        INIT_FILTER_SYSTEM();
 
        // Load more cache files (like admins)
-       LOAD_INC_ONCE('inc/load_cache.php');
+       loadIncludeOnce('inc/load_cache.php');
 
        // Remove array
        unset($EXT_POOL);
@@ -196,18 +196,18 @@ if ($GLOBALS['cache_mode'] == 'load') {
        // If current user is not admin load only activated extensions. But load
        // them all if we are going to init the cache files. The admin shall use
        // every available extension for testing purposes.
-       if ((!IS_ADMIN()) && ($GLOBALS['cache_mode'] != 'init')) $add = " WHERE ext_active='Y'";
+       if ((!IS_ADMIN()) && ($GLOBALS['cache_mode'] != 'init')) $add = " WHERE `ext_active`='Y'";
 
        if (GET_EXT_VERSION('sql_patches') >= '0.0.6') {
                // Query with CSS file from DB
-               $res_ext_crt = SQL_QUERY('SELECT id AS ext_id, ext_name, ext_has_css AS ext_css, ext_active, ext_version
-FROM `{!_MYSQL_PREFIX!}_extensions`' . $add . '
-ORDER BY ext_name', __FILE__, __LINE__);
+               $res_ext_crt = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_has_css AS ext_css, ext_active, ext_version
+FROM `{!_MYSQL_PREFIX!}_extensions`" . $add . "
+ORDER BY ext_name", __FILE__, __LINE__);
        } else {
                // Old obsolete query string
-               $res_ext_crt = SQL_QUERY('SELECT id AS ext_id, ext_name, ext_name, ext_active, ext_version
-FROM `{!_MYSQL_PREFIX!}_extensions`' . $add . '
-ORDER BY ext_name', __FILE__, __LINE__);
+               $res_ext_crt = SQL_QUERY("SELECT id AS ext_id, ext_name, ext_name, ext_active, ext_version
+FROM `{!_MYSQL_PREFIX!}_extensions`" . $add . "
+ORDER BY ext_name", __FILE__, __LINE__);
        }
 }
 
@@ -228,7 +228,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && (
                $FQFN = sprintf("%sinc/extensions/ext-%s.php", constant('PATH'), $content['ext_name']);
 
                // Does the extension file exists?
-               if (FILE_READABLE($FQFN)) {
+               if (isFileReadable($FQFN)) {
                        // By default no extension is always active, except sql_patches
                        EXT_SET_ALWAYS_ACTIVE('N');
 
@@ -247,10 +247,10 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && (
                        // CSS file handling:
                        if ((!isset($content['ext_css'])) || ($content['ext_css'] == 'Y')) {
                                // Create FQFN for the CSS file
-                               $FQFN = sprintf("%stheme/%s/css/%s.css", constant('PATH'), GET_CURR_THEME(), $content['ext_name']);
+                               $FQFN = sprintf("%stheme/%s/css/%s.css", constant('PATH'), getCurrentTheme(), $content['ext_name']);
 
                                // Is the file there?
-                               if (FILE_READABLE($FQFN)) {
+                               if (isFileReadable($FQFN)) {
                                        // CSS file for extension was found (use only relative path for now!)
                                        EXT_ADD_CSS_FILE($content['ext_name'] . '.css');
                                        $content['ext_css'] = 'Y';
@@ -268,7 +268,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && (
                                // Remember this value for later usage
                                $GLOBALS['cache_array']['active_extensions'][$content['ext_name']] = EXT_GET_ALWAYS_ACTIVE();
                        }
-               } elseif (!FILE_READABLE($FQFN)) {
+               } elseif (!isFileReadable($FQFN)) {
                        // Deleted extension file so we mark it for removal from DB
                        $DEL[] = $content['ext_name'];
                }
@@ -282,7 +282,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && (
                $GLOBALS['cache_instance']->finalize();
 
                // Load more cache files (like admins)
-               LOAD_INC_ONCE('inc/load_cache.php');
+               loadIncludeOnce('inc/load_cache.php');
        } // END - if
 
        // Free memory
@@ -300,7 +300,7 @@ if (!empty($DEL[0])) {
        // Remove extensions from two tables: extension registry and tasks table
        foreach ($DEL as $del_ext) {
                // First remove entry from extensions table
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                        array($del_ext), __FILE__, __LINE__);
 
                // Remove (maybe?) found tasks (main task and possible updates
index f9e9ec11003ed9b3ed4680f3e29465ac9bf913ba..564429cc83e41db2898f666718068b35a596d63a 100644 (file)
@@ -51,7 +51,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('revision', true))) {
        $GLOBALS['cache_instance']->init('revision');
 
        // add the new RevInfos in and saves it to the cache
-       $GLOBALS['cache_instance']->addRow(getAkt_vers());
+       $GLOBALS['cache_instance']->addRow(getArrayFromActualVersion());
 
        // Close the cache
        $GLOBALS['cache_instance']->finalize();
index 59f16516a34c1d27e48ea365422ecf47fd9257dd..fee209debf188c05173fa2b883eaf4579acba22c 100644 (file)
@@ -48,7 +48,7 @@ if (!defined('__SECURITY')) {
 if ($GLOBALS['output_mode'] == 1) return;
 
 // Create timemark from saved month
-$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time()));
 $sql = ''; $mode = '';
 
 // Shall I sent activation or deactivation mail?
@@ -89,18 +89,18 @@ if (!empty($sql)) {
        $sql .= ") AND `status`='CONFIRMED' ORDER BY last_online ASC";
 
        // Prepare data for the template
-       define('__BEG_MIN_POINTS' , TRANSLATE_COMMA(getConfig('beg_points')));
-       define('__BEG_MAX_POINTS' , TRANSLATE_COMMA(getConfig('beg_points_max')));
+       define('__BEG_MIN_POINTS' , translateComma(getConfig('beg_points')));
+       define('__BEG_MAX_POINTS' , translateComma(getConfig('beg_points_max')));
        define('__BEG_MAX_WINNERS', round(getConfig('beg_ranks')));
        if (getConfig('beg_ip_timeout') == 0)
        {
                // No IP locking setuped!
-               define('__BEG_IP_LOCKER', BEG_NO_LIMITATION);
+               define('__BEG_IP_LOCKER', getMessage('BEG_NO_LIMITATION'));
        }
         else
        {
                // Create timemark
-               define('__BEG_IP_LOCKER', CREATE_FANCY_TIME(getConfig('beg_ip_timeout')));
+               define('__BEG_IP_LOCKER', createFancyTime(getConfig('beg_ip_timeout')));
        }
 
        // Check for accounts to be notified
@@ -132,7 +132,7 @@ LIMIT 1",
                        } else {
                                // Send normal notification mail to the members
                                $message = LOAD_EMAIL_TEMPLATE('beg_' . $mode . '_notify', array(), $content['userid']);
-                               SEND_EMAIL($content['email'], $subject, $message);
+                               sendEmail($content['email'], $subject, $message);
                        }
                } // END - while
 
@@ -145,7 +145,7 @@ LIMIT 1",
                        $URL = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
-                       ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
+                       addBonusMailToQueue($subject, $message, $RECEIVER, getConfig('beg_notify_bonus'), getConfig('beg_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
                } // END - if
        } // END - if
 
index 81a49e97a389673ab38672a291fe60e1ee6c9bd1..bb5b53496ffea036f066bdda263fb2385878ee23 100644 (file)
@@ -48,43 +48,43 @@ if (!defined('__SECURITY')) {
 if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 
 // Get current day (01 to 31), month (01 to 12) and year (4-digits year)
-$DAY   = date("d", time());
-$MONTH = date("m", time());
-$YEAR  = date('Y', time());
+$day   = date('d', time());
+$month = date('m', time());
+$year  = date('Y', time());
 
 // Shall I include only active members?
-$add = "%s"; $VALUE = '';
+$add = "%s"; $value = '';
 if ((getConfig('birthday_active')) && (EXT_IS_ACTIVE('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
-       $add = " AND last_online >= (UNIX_TIMESTAP() - %s)";
-       $VALUE = getConfig('ap_inactive_since');
+       $add = " AND `last_online` >= (UNIX_TIMESTAP() - %s)";
+       $value = getConfig('ap_inactive_since');
 }
 
 // Only confirmed members shall receive birthday mails...
 $result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
 FROM `{!_MYSQL_PREFIX!}_user_data`
 WHERE `status`='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(getConfig('one_day') * 364).")".$add."
-ORDER BY userid",
array($DAY, $MONTH, $VALUE), __FILE__, __LINE__);
+ORDER BY `userid` ASC",
      array($day, $month, $value), __FILE__, __LINE__);
 
 if (SQL_NUMROWS($result_birthday) > 0) {
        // Start sending out birthday mails
        while ($content = SQL_FETCHARRAY($result_birthday)) {
                // Calculate own timestamp for birthday and today
-               $BD  = $content['birth_year'] + 12 * $MONTH + 365 * $DAY;
-               $NOW = $YEAR  + 12 * $MONTH + 365 * $DAY;
+               $bd  = $content['birth_year'] + 12 * $month + 365 * $day;
+               $now = $year  + 12 * $month + 365 * $day;
 
                // Simply subtract both values and you got the age... :)
-               $AGE = $NOW - $BD;
+               $age = $now - $bd;
 
                if (getConfig('birthday_points') > 0) {
                        // Add more entries to the array
-                       $content['age']    = $AGE;
-                       $content['points'] = TRANSLATE_COMMA(getConfig('birthday_points'));
+                       $content['age']    = $age;
+                       $content['points'] = translateComma(getConfig('birthday_points'));
                        $content['check']  = '';
 
                        // @TODO 4 is hard-coded here, should we move it out in config?
                        for ($idx = 0; $idx < 4; $idx++) {
-                               $content['check'] .= generateRandomCodde("8", mt_rand(0, "$MONTH$DAY"), $content['userid'], ($AGE*($idx+1)));
+                               $content['check'] .= generateRandomCodde("8", mt_rand(0, $month.$day), $content['userid'], ($age * ($idx + 1)));
                        }
 
                        // Insert row into database
@@ -95,11 +95,11 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                        $msg = LOAD_EMAIL_TEMPLATE("member_birthday_confirm", $content, bigintval($content['userid']));
                } else {
                        // Load default email template and fill in the age
-                       $msg = LOAD_EMAIL_TEMPLATE("member_birthday", $AGE, $content['userid']);
+                       $msg = LOAD_EMAIL_TEMPLATE("member_birthday", $age, $content['userid']);
                }
 
                // Send email
-               SEND_EMAIL($content['email'], getMessage('HAPPY_BIRTHDAY'), $msg);
+               sendEmail($content['email'], getMessage('HAPPY_BIRTHDAY'), $msg);
 
                // Remember him that he has received a birthday mail
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET birthday_sent=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
index baddc4ad7a4340aeab1a56cb22151d1455bc7fa0..b6b4d8102a47e1f37ab3509448cbde310bbdbc64 100644 (file)
@@ -48,7 +48,7 @@ if (!defined('__SECURITY')) {
 if ($GLOBALS['output_mode'] == 1) return;
 
 // Create timemark from saved month
-$mark = mktime(0, 0, 0, getConfig('last_month'), date("d", time()), date('Y', time()));
+$mark = mktime(0, 0, 0, getConfig('last_month'), date('d', time()), date('Y', time()));
 $sql = ''; $mode = '';
 
 // Shall I sent activation or deactivation mail?
@@ -111,7 +111,7 @@ LIMIT 1",
                        } else {
                                // Send normal notification mail to the members
                                $message = LOAD_EMAIL_TEMPLATE('bonus_' . $mode . '_notify', array(), $content['userid']);
-                               SEND_EMAIL($content['email'], $subject, $message);
+                               sendEmail($content['email'], $subject, $message);
                        }
                } // END - while
 
@@ -124,7 +124,7 @@ LIMIT 1",
                        $URL = 'modules.php?module=index&amp;what=login';
 
                        // Insert mail
-                       ADD_BONUS_MAIL_TO_QUEUE($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
+                       addBonusMailToQueue($subject, $message, $RECEIVER, getConfig('bonus_notify_points'), getConfig('bonus_notify_wait'), $URL, 0, 'normal', SQL_NUMROWS($result_main));
                } // END - if
        } // END - if
 
index f92332230e8a55c3b6dfee8ee3604326db46d28c..3a3472bcc1e9686b908203ad2e99065bf132e1bc 100644 (file)
@@ -43,22 +43,22 @@ if (!defined('__SECURITY')) {
 }
 
 // Load include file
-LOAD_INC_ONCE("inc/modules/admin/admin-inc.php");
+loadIncludeOnce('inc/modules/admin/admin-inc.php');
 
 // Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
-FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
+fixDeletedCookies(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
 
 // Init return value
-$ret = "init";
+$ret = 'init';
 
 // Is no admin registered?
 if (!isAdminRegistered()) {
        // Admin is not registered so we have to inform the user
        if ((IS_FORM_SENT()) && ((!REQUEST_ISSET_POST(('login'))) || (!REQUEST_ISSET_POST(('pass'))) || (strlen(REQUEST_POST('pass')) < 4))) {
-               REQUEST_SET_POST('ok', "***");
+               REQUEST_SET_POST('ok', '***');
        }
 
-       if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != "***")) {
+       if ((IS_FORM_SENT()) && (REQUEST_POST('ok') != '***')) {
                // Hash the password with the old function because we are here in install mode
                $hashedPass = md5(REQUEST_POST('pass'));
 
@@ -69,11 +69,11 @@ if (!isAdminRegistered()) {
                $ret = REGISTER_ADMIN(REQUEST_POST('login'), $hashedPass, constant('WEBMASTER'));
                switch ($ret)
                {
-               case "done":
+               case 'done':
                        $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
                        if ($done === true) {
                                // Registering is done
-                               LOAD_URL('modules.php?module=admin&amp;register=done');
+                               redirectToUrl('modules.php?module=admin&amp;register=done');
                        } else {
                                $ret = getMessage('ADMIN_CANNOT_COMPLETE');
                        }
@@ -101,7 +101,7 @@ if (!isAdminRegistered()) {
                                changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
                                // Load URL for login
-                               LOAD_URL('modules.php?module=admin');
+                               redirectToUrl('modules.php?module=admin');
                        } // END - if
                        break;
                }
@@ -193,11 +193,11 @@ if (!isAdminRegistered()) {
                // Output reset password form
                LOAD_TEMPLATE('admin_send_reset_link');
        }
-} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((get_session('admin_last') + bigintval(get_session('admin_to')) * 3600 * 24) < time())) {
+} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((getSession('admin_last') + bigintval(getSession('admin_to')) * 3600 * 24) < time())) {
        // At leat one administrator account was created
        if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) {
                // Timeout for last login, we have to logout first!
-               LOAD_URL('modules.php?module=admin&amp;logout=1');
+               redirectToUrl('modules.php?module=admin&amp;logout=1');
        } // END - if
 
        if (REQUEST_ISSET_GET(('register'))) {
@@ -223,7 +223,7 @@ if (!isAdminRegistered()) {
 
                        // Rewrite overview module
                        if ($GLOBALS['what'] == 'overview') {
-                               $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                               $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']);
                        } // END - if
 
                        // Add data to URL
@@ -232,7 +232,7 @@ if (!isAdminRegistered()) {
                         elseif (REQUEST_ISSET_GET('area')) $URL .= 'area='.REQUEST_GET('area');
 
                        // Load URL
-                       LOAD_URL($URL);
+                       redirectToUrl($URL);
                        break;
 
                case '404': // Administrator login not found
@@ -346,7 +346,7 @@ if (!isAdminRegistered()) {
        }
 } else {
        // Maybe an Admin want's to login?
-       $ret = CHECK_ADMIN_COOKIES(get_session('admin_login'), get_session('admin_md5'));
+       $ret = CHECK_ADMIN_COOKIES(getSession('admin_login'), getSession('admin_md5'));
        switch ($ret)
        {
        case 'done':
@@ -357,7 +357,7 @@ if (!isAdminRegistered()) {
                if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', 'OLD');
 
                // Check for version and switch between old menu system and new intelligent menu system
-               if ((ADMIN_CHECK_MENU_MODE() == 'NEW') && (INCLUDE_READABLE('inc/modules/admin/lasys-inc.php'))) {
+               if ((ADMIN_CHECK_MENU_MODE() == 'NEW') && (isIncludeReadable('inc/modules/admin/lasys-inc.php'))) {
                        // Default area is the entrance, of course
                        $area = 'entrance';
 
@@ -365,7 +365,7 @@ if (!isAdminRegistered()) {
                        if (REQUEST_ISSET_GET('area')) $area = REQUEST_GET('area');
 
                        // Load logical-area menu-system file
-                       LOAD_INC_ONCE('inc/modules/admin/lasys-inc.php');
+                       loadIncludeOnce('inc/modules/admin/lasys-inc.php');
 
                        // Create new-style menu system will logical areas
                        ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']);
index 19f675d53eea9733e0d3ce67a3991995bd0407e7..1200c49dc93c997ef609a4239ca3b931caf981f3 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC)) { 
+if (isIncludeReadable($INC)) { 
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
index cdf1168b5ec42980b77f31c0e0d6d456d4d5af21..56ae370c462314e57aeb9ea323ca06fd619418d2 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index c62a1cea4684e2fce1ee4196f9f0cb592bf4d72d..0a5ddf70fe2c9262adba2809f407817c32f4a778 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 21bb02c6683f657f468e5b8272018a2de592a92a..4c08cfac0b1e5e2b3cef02f5706440800965c146 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index e0fa47b05f3376e837402366c1b9998b4e9b3d9d..327dddc125a96e5e0031c2bcbae550f42643e6c5 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        // "what file" not found
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
index 5bc2f8a800ac39c9cb0f8064f9f38ec09a3279c6..8db1b0de02b076dc76d2cc11f1e8faac0598c6e8 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 84d68d9e068fd8408bcc9758fb1c83d26f5d34af..891af6a815ccf47a37b68547aa64db7ffb0faa71 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 38642aab5f4102b4ca850905830f01ba441d7bd1..7fdcf95297f7680e0fe366f122d0349711478447 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) { 
+if (isIncludeReadable($INC)) { 
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 6a640501a6d46f9d732a6cf79dcc30bf95f1498a..b8a2b0b428f9c64e162d1949ad3a89f8f75226cf 100644 (file)
@@ -47,10 +47,10 @@ ADD_DESCR('admin', __FILE__);
 
 if (REQUEST_ISSET_POST(('no'))) {
        // Do not logout now
-       LOAD_URL('admin.php');
+       redirectToUrl('admin.php');
 } elseif ((REQUEST_ISSET_POST(('yes'))) && ($GLOBALS['action'] == 'logout')) {
        // Redirect to logout link
-       LOAD_URL('modules.php?module=admin&amp;logout=1');
+       redirectToUrl('modules.php?module=admin&amp;logout=1');
 }
 
 // Load logout form template
index 0efbec2c2ed0a59aab8e3823439053fe53a2e4b5..292f283744ed398a7a1cc1b2cd3a913c776fbdf9 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 51a3da02484aea5065ce23d374d5e7b9fc50dbf4..311dd77aa4f958890fd5d681135907ab55280851 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 141cecb83dde16a4c0bf99139f8b1b15e4224aff..1de455a49a355a47539965bb87c3b3d3c76989b0 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 949a1f0310126535e722e04b82d698ca0cbb6219..605c6a41f0354c243ede1c5c70aa617d17775b1f 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index c11f368839478f933f240a07179cbd31f5bdc60c..73340586a1099fa783bbb32668816e6c4b4251ae 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 1316794dddd661fd88fc00d448508b389ee34dad..f97366a69bd10940e610e768e9791da667536abe 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 15b46df260bc2781317b7f1830b9214197f2528c..b77fae24280a6148f03e250ab3c49022fcb25f33 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index d164e50d4e7c338df118ce78be7160da4b40b156..e5a8165bca535d9ab77a6446ed6a3e6400d9dc83 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 891d31048273e616fede3dba52927c8f6f140ef2..2f9d38f0f998a65008c2fdb942054c90f4381834 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 68314e02092c06bd83ebfdd511296dd26d20020c..c05bb77f7b999ca6cd70f0f477d5e70b47a85acf 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 360c5b8a4ec5774419511b74c3f7c7823b8ad706..bd662bc6e925808c74ffbe3af330521d78b4dffe 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index d37f462518464b91ac73a8447a636d316dc3be19..5e4a8ea3e4be330ae869a893a53ed148157af921 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 1b9c69a78456a62895d62909559fece15e7b0f38..721e5edd9ab2c52b8b91d09acb6f7d0444aa829a 100644 (file)
@@ -50,9 +50,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 262af31025801977a03e915a39c25fbd67317c7f..48e2d96df841e4fe87363eec8112ef9090974002 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 7943de4b0c403fca2b929ed327f6be30da2d3b68..64375b4434d273fa27548db384c1057134758787 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 2f2846bda4febdb7b35865828fb14f16dc5eb6d9..86b97c7dc6c1493dfb4b9939fe5a742aee041843 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 51d5056589121fa60e4d3ead93bb40adedb3a89e..94308609b3b86736c83de059bdde03be4e0df53e 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the admin action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_ACTION_404'), $GLOBALS['what']);
 }
index 3f4ea64a52a3f01433638d0ccb451fcf78e52b2a..889820cea98191d968cd0bc8454ba78a4517a131 100644 (file)
@@ -48,7 +48,7 @@ function REGISTER_ADMIN ($user, $md5, $email) {
        $ret = "already";
 
        // Lookup the admin
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
                array($user), __FUNCTION__, __LINE__);
 
        // Is the entry there?
@@ -56,7 +56,7 @@ function REGISTER_ADMIN ($user, $md5, $email) {
                // Ok, let's create the admin login
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins` (login, password, email) VALUES ('%s', '%s', '%s')",
                        array($user, $md5, $email), __FUNCTION__, __LINE__);
-               $ret = "done";
+               $ret = 'done';
        } // END - if
 
        // Free memory
@@ -95,7 +95,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                $add = runFilterChain('sql_admin_extra_data');
 
                // Get password from DB
-               $result = SQL_QUERY_ESC("SELECT password".$add." FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT password".$add." FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array($aid), __FUNCTION__, __LINE__);
 
                // Entry found?
@@ -111,14 +111,14 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                SQL_FREERESULT($result);
        }
 
-       //* DEBUG: */ echo "*".$data['password']."/".md5($password)."/".$ret."<br />";
+       //* DEBUG: */ echo "*".$data['password'].'/'.md5($password).'/'.$ret."<br />";
        if ((isset($data['password'])) && (strlen($data['password']) == 32) && ($data['password'] == md5($password))) {
                // Generate new hash
                $data['password'] = generateHash($password);
 
                // Is the sql_patches not installed, than we cannot have a valid hashed password here!
-               if (($ret == 'pass') && ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == ""))) $ret = "done";
-       } elseif ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == "")) {
+               if (($ret == 'pass') && ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == ''))) $ret = 'done';
+       } elseif ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == '')) {
                // Old hashing way
                return $ret;
        } elseif (!isset($data['password'])) {
@@ -140,15 +140,15 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                // Remmeber login failures if available
                if (GET_EXT_VERSION('admins') >= '0.7.2') {
                        // Store it in session
-                       set_session('mxchange_admin_failures', $data['login_failures']);
-                       set_session('mxchange_admin_last_fail', $data['last_failure']);
+                       setSession('mxchange_admin_failures', $data['login_failures']);
+                       setSession('mxchange_admin_last_fail', $data['last_failure']);
 
                        // Update password and reset login failures
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s',login_failures=0,last_failure='0000-00-00 00:00:00' WHERE `id`=%s LIMIT 1",
                                array($data['password'], $aid), __FUNCTION__, __LINE__);
                } else {
                        // Update password
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET password='%s' WHERE `id`=%s LIMIT 1",
                                array($data['password'], $aid), __FUNCTION__, __LINE__);
                }
 
@@ -161,12 +161,12 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
                // Password matches so login here
                if (LOGIN_ADMIN($admin_login, $data['password'])) {
                        // All done now
-                       $ret = "done";
+                       $ret = 'done';
                } // END - if
        } elseif ((empty($salt)) && ($ret == 'pass')) {
                // Something bad went wrong
                $ret = "failed";
-       } elseif ($ret == "done") {
+       } elseif ($ret == 'done') {
                // Try to login here if we have the old hashing way (sql_patches not installed?)
                if (!LOGIN_ADMIN($admin_login, $data['password'])) {
                        // Something went wrong
@@ -177,7 +177,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
        // Count login failure if admins extension version is 0.7.0+
        if (($ret == 'pass') && (GET_EXT_VERSION('admins') >= '0.7.0')) {
                // Update counter
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=login_failures+1,last_failure=NOW() WHERE `id`=%s LIMIT 1",
                        array($aid), __FUNCTION__, __LINE__);
 
                // Rebuild cache
@@ -192,7 +192,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) {
 // Try to login the admin by setting some session/cookie variables
 function LOGIN_ADMIN ($adminLogin, $passHash) {
        // Reset failure counter on matching admins version
-       if ((GET_EXT_VERSION('admins') >= '0.7.0') && ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == ""))) {
+       if ((GET_EXT_VERSION('admins') >= '0.7.0') && ((EXT_VERSION_IS_OLDER('sql_patches', '0.3.6')) || (GET_EXT_VERSION('sql_patches') == ''))) {
                // Reset counter on out-dated sql_patches version
                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins` SET login_failures=0,last_failure='0000-00-00 00:00:00' WHERE login='%s' LIMIT 1",
                        array($adminLogin), __FUNCTION__, __LINE__);
@@ -204,13 +204,13 @@ function LOGIN_ADMIN ($adminLogin, $passHash) {
        // Now set all session variables and return the result
        return (
                (
-                       set_session('admin_md5', generatePassString($passHash))
+                       setSession('admin_md5', generatePassString($passHash))
                ) && (
-                       set_session('admin_login', $adminLogin)
+                       setSession('admin_login', $adminLogin)
                ) && (
-                       set_session('admin_last', time())
+                       setSession('admin_last', time())
                ) && (
-                       set_session('admin_to', bigintval(REQUEST_POST('timeout')))
+                       setSession('admin_to', bigintval(REQUEST_POST('timeout')))
                )
        );
 }
@@ -229,7 +229,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
        // Check if password matches
        if (($ret == 'pass') && ((generatePassString($pass) == $password) || ($pass == $password) || ((strlen($pass) == 32) && (md5($password) == $pass)))) {
                // Passwords matches!
-               $ret = "done";
+               $ret = 'done';
        }
 
        // Return result
@@ -239,7 +239,7 @@ function CHECK_ADMIN_COOKIES ($admin_login, $password) {
 //
 function ADMIN_DO_ACTION ($wht) {
        global $DATA;
-       //* DEBUG: */ echo __LINE__."*".$wht."/".$GLOBALS['module']."/".$GLOBALS['action']."/".$GLOBALS['what']."*<br />\n";
+       //* DEBUG: */ echo __LINE__."*".$wht.'/'.$GLOBALS['module'].'/'.$GLOBALS['action'].'/'.$GLOBALS['what']."*<br />\n";
 
        // Remove any spaces from variable
        if (empty($wht)) {
@@ -251,11 +251,11 @@ function ADMIN_DO_ACTION ($wht) {
        }
 
        // Get action value
-       $act = GET_ACTION($GLOBALS['module'], $wht);
+       $act = getModeAction($GLOBALS['module'], $wht);
 
        // Define admin login name and ID number
-       define('__ADMIN_LOGIN', get_session('admin_login'));
-       define('__ADMIN_ID'   , GET_CURRENT_ADMIN_ID());
+       define('__ADMIN_LOGIN', getSession('admin_login'));
+       define('__ADMIN_ID'   , getCurrentAdminId());
 
        // Preload templates
        if (EXT_IS_ACTIVE('admins')) {
@@ -270,15 +270,15 @@ function ADMIN_DO_ACTION ($wht) {
        LOAD_TEMPLATE("admin_main_header");
 
        // Check if action/what pair is valid
-       $result_action = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu`
+       $result_action = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu`
 WHERE `action`='%s' AND ((`what`='%s' AND what != 'overview') OR ((`what`='' OR `what` IS NULL) AND '%s'='overview'))
 LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result_action) == 1) {
                // Is valid but does the inlcude file exists?
                $INC = sprintf("inc/modules/admin/action-%s.php", $act);
-               if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION('admin', $act, $wht)) && ($GLOBALS['acl_allow'] === true)) {
+               if ((isIncludeReadable($INC)) && (isMenuActionValid('admin', $act, $wht)) && ($GLOBALS['acl_allow'] === true)) {
                        // Ok, we finally load the admin action module
-                       LOAD_INC($INC);
+                       loadInclude($INC);
                } elseif ($GLOBALS['acl_allow'] === false) {
                        // Access denied
                        LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED'));
@@ -290,8 +290,8 @@ LIMIT 1", array($act, $wht, $wht), __FUNCTION__, __LINE__);
                }
        } else {
                // Invalid action/what pair found!
-               LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $act."/".$wht));
-               addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_INVALID'), $act."/".$wht);
+               LOAD_TEMPLATE("admin_menu_failed", false, sprintf(getMessage('ADMIN_ACTION_INVALID'), $act.'/'.$wht));
+               addFatalMessage(__FUNCTION__, __LINE__, getMessage('ADMIN_ACTION_INVALID'), $act.'/'.$wht);
        }
 
        // Free memory
@@ -314,7 +314,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
        // Is there a cache instance?
        if ((isCacheInstanceValid()) && (getConfig('cache_admin_menu') == 'Y')) {
                // Create cache name
-               $cacheName = "admin_".$act."_".$wht."_".GET_LANGUAGE()."_".strtolower(get_session('admin_login'));
+               $cacheName = "admin_".$act."_".$wht."_".getLanguage()."_".strtolower(getSession('admin_login'));
 
                // Is that cache there?
                if ($GLOBALS['cache_instance']->loadCacheFile($cacheName)) {
@@ -343,7 +343,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
                        if ((EXT_IS_ACTIVE('admins')) && (GET_EXT_VERSION('admins') > '0.2.0')) {
-                               $ACL = ADMINS_CHECK_ACL($menu, '');
+                               $ACL = adminsCheckAdminAcl($menu, '');
                        } else {
                                // ACL is "allow"... hmmm
                                $ACL = true;
@@ -389,17 +389,19 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
                                        $OUT .= "<ul class=\"admin_menu_sub\">\n";
                                        // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                                        while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
-                                               // Filename
-                                               $INC = sprintf("inc/modules/admin/what-%s.php", $wht_sub);
+                                               // Check for access level
                                                if ((EXT_IS_ACTIVE('admins')) && (GET_EXT_VERSION('admins') > '0.2.0')) {
-                                                       $ACL = ADMINS_CHECK_ACL("", $wht_sub);
+                                                       $ACL = adminsCheckAdminAcl('', $wht_sub);
                                                } else {
                                                        // ACL is "allow"... hmmm
                                                        $ACL = true;
                                                }
 
+                                               // Filename
+                                               $INC = sprintf("inc/modules/admin/what-%s.php", $wht_sub);
+
                                                // Is the file readable?
-                                               $readable = INCLUDE_READABLE($INC);
+                                               $readable = isIncludeReadable($INC);
 
                                                // Access allowed?
                                                if ($ACL === true) {
@@ -477,9 +479,9 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) {
 }
 
 // Create member selection box
-function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $none=false, $field='userid') {
+function ADD_MEMBER_SELECTION_BOX ($def='0', $add_all=false, $return=false, $none=false, $field='userid') {
        // Output selection form with all confirmed user accounts listed
-       $result = SQL_QUERY("SELECT userid, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` ORDER BY userid", __FUNCTION__, __LINE__);
+       $result = SQL_QUERY("SELECT userid, surname, family FROM `{!_MYSQL_PREFIX!}_user_data` ORDER BY `userid` ASC", __FUNCTION__, __LINE__);
 
        // Default output
        $OUT = '';
@@ -503,7 +505,7 @@ function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $non
                define('_MEMBER_SELECTION', $OUT);
 
                // Display selection box
-               define('__LANG_VALUE', GET_LANGUAGE());
+               define('__LANG_VALUE', getLanguage());
 
                // Load template
                LOAD_TEMPLATE("admin_member_selection_box", false, $GLOBALS['what']);
@@ -514,7 +516,7 @@ function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $non
 }
 
 // Create a menu selection box for given menu system
-function ADMIN_MENU_SELECTION ($mode, $default="", $defid="") {
+function ADMIN_MENU_SELECTION ($mode, $default = '', $defid = '') {
        $wht = "`what` != ''";
        if ($mode == "action") $wht = "(`what`='' OR `what` IS NULL) AND action !='login'";
        $result = SQL_QUERY_ESC("SELECT %s, title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY `sort`",
@@ -522,7 +524,7 @@ function ADMIN_MENU_SELECTION ($mode, $default="", $defid="") {
        if (SQL_NUMROWS($result) > 0) {
                // Load menu as selection
                $OUT = "<select name=\"".$mode."_menu";
-               if ((!empty($defid)) || ($defid == "0")) $OUT .= "[".$defid."]";
+               if ((!empty($defid)) || ($defid == '0')) $OUT .= "[".$defid."]";
                $OUT .= "\" size=\"1\" class=\"admin_select\">
        <option value=\"\">{--SELECT_NONE--}</option>\n";
                // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query
@@ -564,7 +566,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
                // Process only formular field but not submit buttons ;)
                if ($id != "ok") {
                        // Do not save the ok value
-                       CONVERT_SELECTIONS_TO_TIMESTAMP($POST, $DATA, $id, $skip);
+                       convertSelectionsToTimestamp($POST, $DATA, $id, $skip);
 
                        // Shall we process this ID? It muss not be empty, of course
                        if ((!$skip) && (!empty($id))) {
@@ -574,12 +576,12 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
                                // Translate the value? (comma to dot!)
                                if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
                                        // Then do it here... :)
-                                       $val = REVERT_COMMA($val);
+                                       $val = convertCommaToDot($val);
                                } // END - if
 
                                // Shall we add numbers or strings?
                                $test = (float)$val;
-                               if ("".$val."" == "".$test."") {
+                               if ("".$val."" == ''.$test."") {
                                        // Add numbers
                                        $DATA[] = sprintf("`%s`=%s", $id, $test);
                                } else {
@@ -615,22 +617,22 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
                );
        } else {
                // Add Line (does only work with auto_increment!
-               $KEYs = array(); $VALUEs = array();
+               $KEYs = array(); $values = array();
                foreach ($DATA as $entry) {
                        // Split up
-                       $line = explode("=", $entry);
-                       $KEYs[] = $line[0]; $VALUEs[] = $line[1];
+                       $line = explode('=', $entry);
+                       $KEYs[] = $line[0]; $values[] = $line[1];
                } // END - foreach
 
                // Add both in one line
                $KEYs = implode(", ", $KEYs);
-               $VALUEs = implode(", ", $VALUEs);
+               $values = implode(", ", $values);
 
                // Generate SQL string
                $sql = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)",
                        $tableName,
                        $KEYs,
-                       $VALUEs
+                       $values
                );
        }
 
@@ -648,9 +650,9 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
 }
 
 // Generate a selection box
-function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
+function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default = '') {
        // Open the requested menu directory
-       $menuArray = GET_DIR_AS_ARRAY(sprintf("inc/modules/%s/", $menu), '', false, false);
+       $menuArray = getArrayFromDirectory(sprintf("inc/modules/%s/", $menu), '', false, false);
 
        // Init the selection box
        $OUT = "<select name=\"".$name."\" class=\"admin_select\" size=\"1\">
@@ -659,12 +661,12 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
        // Walk through all files
        foreach ($menuArray as $file) {
                // Is this a PHP script?
-               if (($file != ".") && ($file != "..") && ($file != "lost+found") && (strpos($file, "".$type."-") > -1) && (strpos($file, ".php") > 0)) {
+               if ((!isDirectory($file)) && (strpos($file, "".$type.'-') > -1) && (strpos($file, ".php") > 0)) {
                        // Then test if the file is readable
                        $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
 
                        // Is the file there?
-                       if (FILE_READABLE($test)) {
+                       if (isFileReadable($test)) {
                                // Extract the value for what=xxx
                                $part = substr($file, (strlen($type) + 1));
                                $part = substr($part, 0, -4);
@@ -687,13 +689,13 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
 }
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
-function ADMIN_USER_PROFILE_LINK ($uid, $title="", $wht="list_user") {
-       if (($title == "") && ($title != "0")) {
+function generateUserProfileLink ($uid, $title = '', $wht="list_user") {
+       if (($title == '') && ($title != '0')) {
                // Set userid as title
                $title = $uid;
        } // END - if
 
-       if (($title == "0") && ($wht == "list_refs")) {
+       if (($title == '0') && ($wht == "list_refs")) {
                // Return title again
                return $title;
        } // END - if
@@ -710,7 +712,7 @@ function ADMIN_CHECK_MENU_MODE () {
        $ADMIN = $mode;
 
        // Get admin id
-       $aid = GET_CURRENT_ADMIN_ID();
+       $aid = getCurrentAdminId();
 
        // Check individual settings of current admin
        if (isset($GLOBALS['cache_array']['admins']['la_mode'][$aid])) {
@@ -719,7 +721,7 @@ function ADMIN_CHECK_MENU_MODE () {
                incrementConfigEntry('cache_hits');
        } elseif (GET_EXT_VERSION('admins') >= '0.6.7') {
                // Load from database when version of 'admins' is enough
-               $result = SQL_QUERY_ESC("SELECT la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT la_mode FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array($aid), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load data
@@ -739,7 +741,7 @@ function ADMIN_CHECK_MENU_MODE () {
 
 // Change activation status
 function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
-       $cnt = 0; $newStatus = "Y";
+       $cnt = 0; $newStatus = 'Y';
        if ((is_array($IDs)) && (count($IDs) > 0)) {
                // "Walk" all through and count them
                foreach ($IDs as $id => $selected) {
@@ -758,7 +760,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
                                        list($currStatus) = SQL_FETCHROW($result);
 
                                        // And switch it N<->Y
-                                       if ($currStatus == 'Y') $newStatus = "N"; else $newStatus = "Y";
+                                       if ($currStatus == 'Y') $newStatus = 'N'; else $newStatus = 'Y';
 
                                        // Change this status
                                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s` SET %s='%s' WHERE %s=%s LIMIT 1",
@@ -782,7 +784,7 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
 }
 
 // Send mails for del/edit/lock build modes
-function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") {
+function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart = '') {
        // Default subject is the subject part
        $subject = $subjectPart;
 
@@ -805,7 +807,7 @@ function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="")
                }
 
                // Send email out
-               SEND_EMAIL(REQUEST_POST('uid_raw', $id), $subjectLine, $mail);
+               sendEmail(REQUEST_POST('uid_raw', $id), $subjectLine, $mail);
        } // END - if
 
        // Generate subject
@@ -813,9 +815,9 @@ function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="")
 
        // Send admin notification out
        if (!empty($subjectPart)) {
-               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".strtolower($subjectPart)."_".$table, $content, REQUEST_POST('uid_raw', $id));
+               sendAdminNotification($subjectLine, "admin_".$mode."_".strtolower($subjectPart)."_".$table, $content, REQUEST_POST('uid_raw', $id));
        } else {
-               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".$table, $content, REQUEST_POST('uid_raw', $id));
+               sendAdminNotification($subjectLine, "admin_".$mode."_".$table, $content, REQUEST_POST('uid_raw', $id));
        }
 }
 
@@ -848,7 +850,7 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions,
                                } // END - if
 
                                // Handle the call in external function
-                               $content[$key] = HANDLE_EXTRA_VALUES($filterFunctions[$idx], $value, $extraValues[$idx]);
+                               $content[$key] = handleExtraValues($filterFunctions[$idx], $value, $extraValues[$idx]);
                        } // END - foreach
 
                        // Add color switching
@@ -987,7 +989,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                                        SQL_FREERESULT($result);
 
                                        // Send "build mails" out
-                                       ADMIN_SEND_BUILD_MAILS("del", $table, $content, $id);
+                                       ADMIN_SEND_BUILD_MAILS('del', $table, $content, $id);
                                } // END - if
 
                                // Add id number
@@ -1007,7 +1009,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                        }
                } else {
                        // List for deletion confirmation
-                       ADMIN_BUILD_LIST("del", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+                       ADMIN_BUILD_LIST('del', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
                }
        } // END - if
 }
@@ -1043,7 +1045,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                                // Send data through the filter function if found
                                                if ((isset($filterFunctions[$key])) && (isset($extraValues[$key]))) {
                                                        // Filter function set!
-                                                       $entries[$id] = HANDLE_EXTRA_VALUES($filterFunctions[$key], $entries[$id], $extraValues[$key]);
+                                                       $entries[$id] = handleExtraValues($filterFunctions[$key], $entries[$id], $extraValues[$key]);
                                                } // END - if
 
                                                // Then add this value
@@ -1064,7 +1066,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                } // END - foreach
 
                                // Finish SQL command
-                               $sql = substr($sql, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
+                               $sql = substr($sql, 0, -1) . " WHERE `".$idColumn."`=".bigintval($id)." LIMIT 1";
 
                                // Run this query
                                SQL_QUERY($sql, __FUNCTION__, __LINE__);
@@ -1073,7 +1075,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                $affected += SQL_AFFECTEDROWS();
 
                                // Load all data from that id
-                               $result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT * FROM `{!_MYSQL_PREFIX!}_%s` WHERE `%s`=%s LIMIT 1",
                                        array($table, $idColumn, $id), __FUNCTION__, __LINE__);
 
                                // Fetch the data
@@ -1084,7 +1086,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                SQL_FREERESULT($result);
 
                                // Send "build mails" out
-                               ADMIN_SEND_BUILD_MAILS("edit", $table, $content, $id);
+                               ADMIN_SEND_BUILD_MAILS('edit', $table, $content, $id);
                        } // END - foreach
 
                        // Was this fine?
@@ -1097,7 +1099,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                        }
                } else {
                        // List for editing
-                       ADMIN_BUILD_LIST("edit", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+                       ADMIN_BUILD_LIST('edit', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
                }
        } // END - if
 }
@@ -1138,10 +1140,10 @@ function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
        mergeConfig($settingsArray);
 
        // Now get the test URL
-       $content = GET_URL("check-updates3.php");
+       $content = sendGetRequest('check-updates3.php');
 
        // Is the first line with "200 OK"?
-       $valid = eregi("200 OK", $content[0]);
+       $valid = (strpos($content[0], '200 OK') !== false);
 
        // Return result
        return $valid;
@@ -1172,7 +1174,7 @@ function ADMIN_SEND_PASSWORD_RESET_LINK ($email) {
        SQL_FREERESULT($result);
 
        // Generate hash for reset link
-       $content['hash'] = generateHash(URL.":".$content['id'].":".$content['login'].":".$content['password'], substr($content['password'], 10));
+       $content['hash'] = generateHash(URL.':'.$content['id'].':'.$content['login'].':'.$content['password'], substr($content['password'], 10));
 
        // Remove some data
        unset($content['id']);
@@ -1182,7 +1184,7 @@ function ADMIN_SEND_PASSWORD_RESET_LINK ($email) {
        $mailText = LOAD_EMAIL_TEMPLATE("admin_reset_password", $content);
 
        // Send it out
-       SEND_EMAIL($email, getMessage('ADMIN_RESET_PASS_LINK_SUBJ'), $mailText);
+       sendEmail($email, getMessage('ADMIN_RESET_PASS_LINK_SUBJ'), $mailText);
 
        // Prepare output
        return getMessage('ADMIN_RESET_LINK_SENT');
@@ -1206,7 +1208,7 @@ function ADMIN_VALIDATE_RESET_LINK_HASH_LOGIN ($hash, $login) {
                $content = SQL_FETCHARRAY($result);
 
                // Generate hash again
-               $hashFromData = generateHash(URL.":".$content['id'].":".$login.":".$content['password'], substr($content['password'], 10));
+               $hashFromData = generateHash(URL.':'.$content['id'].':'.$login.':'.$content['password'], substr($content['password'], 10));
 
                // Does both match?
                $valid = ($hash == $hashFromData);
@@ -1247,13 +1249,13 @@ function ADMIN_RESET_PASSWORD ($login, $password) {
 // Solves a task by given id number
 function ADMIN_SOLVE_TASK ($id) {
        // Update the task data
-       ADMIN_UPDATE_TASK_DATA($id, "status", "SOLVED");
+       ADMIN_UPDATE_TASK_DATA($id, 'status', "SOLVED");
 }
 
 // Marks a given task as deleted
 function ADMIN_DELETE_TASK ($id) {
        // Update the task data
-       ADMIN_UPDATE_TASK_DATA($id, "status", "DELETED");
+       ADMIN_UPDATE_TASK_DATA($id, 'status', "DELETED");
 }
 
 // Function to update task data
@@ -1269,7 +1271,7 @@ function ADMIN_UPDATE_TASK_DATA ($id, $row, $data) {
        } // END - if
 
        // Update the task
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET %s='%s' WHERE `id`=%s LIMIT 1",
                array($row, $data, bigintval($id)), __FUNCTION__, __LINE__);
 }
 
index 4501489c6c8edab780e2fea6f19c5b8bb2b47841..504e74052384f2a9a5267fb69e2807d361abe568 100644 (file)
@@ -44,15 +44,15 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 
 function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
        // First check for solved and not assigned tasks and assign them to current admin
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'",
-               array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `assigned_admin`=%s WHERE assigned_admin < 1 AND status != 'NEW'",
+               array(getCurrentAdminId()), __FILE__, __LINE__);
 
        // We currently don't want to install an extension so let's find out if we need...
        $EXT_LOAD_MODE = 'register';
        $jobsDone = true;
 
        // Open the extension directory
-       $extensionList = GET_DIR_AS_ARRAY("inc/extensions/", "ext-", false, false);
+       $extensionList = getArrayFromDirectory("inc/extensions/", "ext-", false, false);
        foreach ($extensionList as $file) {
                // Is this file an extension?
                if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
@@ -74,7 +74,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
                                // We maybe want to install an extension so let's test-drive it...
                                if (LOAD_EXTENSION($ext_name, $EXT_LOAD_MODE)) {
                                        // Create a task for newly installed extension
-                                       CREATE_NEW_EXTENSION_TASK(GET_CURRENT_ADMIN_ID(), $ext_subj, $ext_name);
+                                       CREATE_NEW_EXTENSION_TASK(getCurrentAdminId(), $ext_subj, $ext_name);
                                } // END - if
                        } else {
                                // Test-drive extension in update mode
@@ -99,11 +99,11 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
        } // END - foreach
 
        // At last - but not least - check for own and new unassigned tasks...
-       $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
+       $result_tasks = SQL_QUERY_ESC("SELECT `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created`
 FROM `{!_MYSQL_PREFIX!}_task_system`
-WHERE assigned_admin='%s' OR (assigned_admin='0' AND `status`='NEW')
-ORDER BY userid DESC, task_type DESC, subject, task_created DESC",
-               array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+WHERE `assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW')
+ORDER BY `userid` DESC, `task_type` DESC, `subject` ASC, `task_created` DESC",
+               array(getCurrentAdminId()), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result_tasks) > 0) {
                // New jobs found!
@@ -123,23 +123,27 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                // Assign / do tasks
                $OUT = ''; $SW = 2;
                foreach ($POST['task'] as $id => $sel) {
-                       $result_task = SQL_QUERY_ESC("SELECT id, userid, task_type, subject, text, task_created, status, assigned_admin FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND (assigned_admin='%s' OR (assigned_admin='0' AND `status`='NEW')) LIMIT 1",
-                               array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+                       $result_task = SQL_QUERY_ESC("SELECT `id`, `userid`, `task_type`, `subject`, `text`, `task_created`, `status`, `assigned_admin`
+FROM `{!_MYSQL_PREFIX!}_task_system`
+WHERE `id`=%s AND (`assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW'))
+LIMIT 1",
+                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result_task) == 1) {
                                // Task is valid...
                                list($tid, $uid, $type, $subj, $text, $created, $status, $aid) = SQL_FETCHROW($result_task);
                                SQL_FREERESULT($result_task);
 
-                               if ($aid == "0") {
+                               if ($aid == '0') {
                                        // Assgin current admin to unassgigned task
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin='%s' WHERE id=%s LIMIT 1",
-                                               array(GET_CURRENT_ADMIN_ID(), bigintval($tid)), __FILE__, __LINE__);
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `assigned_admin`=%s WHERE `id`=%s LIMIT 1",
+                                               array(getCurrentAdminId(), bigintval($tid)), __FILE__, __LINE__);
                                } // END - if
 
                                $add = '';
-                               if ($type == "SUPPORT_MEMBER") {
-                                       $mode = substr($text, 0, strpos($text, ":"));
-                                       $text = substr($text, strpos($text, ":") + 1);
+                               // @TODO Rewrite this to a filter
+                               if ($type == 'SUPPORT_MEMBER') {
+                                       $mode = substr($text, 0, strpos($text, ':'));
+                                       $text = substr($text, strpos($text, ':') + 1);
                                        $add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>".$mode."</strong></li>";
                                } // END - if
 
@@ -149,7 +153,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                        if (SQL_NUMROWS($result_user) == 1) {
                                                list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
                                                SQL_FREERESULT($result_user);
-                                               $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".ADMIN_USER_PROFILE_LINK($uid)." (<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$sname." ".$fname."</a>)</strong></li>";
+                                               $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($uid)." (<a href=\"".generateMemberEmailLink($email, "user_data")."\">".translateGender($gender)." ".$sname." ".$fname."</a>)</strong></li>";
                                        } // END - if
                                } // END - if
 
@@ -157,7 +161,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                $text = decodeEntities($text);
 
                                // Compile and insert text from task into table template
-                               $text = LOAD_TEMPLATE("admin_extensions_text", true, $text);
+                               $text = LOAD_TEMPLATE('admin_extensions_text', true, $text);
 
                                // Initialize variables (no title for SQL commands by default)
                                $ext_name = '';
@@ -165,8 +169,8 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
 
                                // Shall I list SQL commands assigned to an extension installation or update task?
                                if (((GET_EXT_VERSION('sql_patches') != '') && (getConfig('verbose_sql') == 'Y')) || (!EXT_IS_ACTIVE('sql_patches'))) {
-                                       $ext_name = substr($subj, 1, strpos($subj, ":") - 1);
-                                       if ($type == "EXTENSION") {
+                                       $ext_name = substr($subj, 1, strpos($subj, ':') - 1);
+                                       if ($type == 'EXTENSION') {
                                                // Load SQL commands for registering
                                                REGISTER_EXTENSION($ext_name, $id, true);
 
@@ -175,13 +179,13 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
 
                                                // Set title
                                                $title = getMessage('ADMIN_SQLS_EXECUTED_ON_REGISTER');
-                                       } elseif ($type == "EXTENSION_UPDATE") {
+                                       } elseif ($type == 'EXTENSION_UPDATE') {
                                                // Prepare extension name and version
                                                $ext_name = substr($ext_name, 7);
-                                               $ext_name = substr($ext_name, 0, strpos($ext_name, "-"));
-                                               $test = "[UPDATE-".$ext_name."-";
+                                               $ext_name = substr($ext_name, 0, strpos($ext_name, '-'));
+                                               $test = '[UPDATE-'.$ext_name.'-';
                                                $ext_ver = substr($subj, strlen($test));
-                                               $ext_ver = substr($ext_ver, 0, strpos($ext_ver, ":"));
+                                               $ext_ver = substr($ext_ver, 0, strpos($ext_ver, ':'));
 
                                                // Load SQLs from file
                                                EXTENSION_UPDATE($ext_name, $ext_ver, true);
@@ -215,26 +219,26 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                        'subj'      => $subj,
                                        'add'       => $add,
                                        'text'      => $text,
-                                       'created'   => MAKE_DATETIME($created, "1"),
+                                       'created'   => generateDateTime($created, '1'),
                                        'extension' => $ext_name
                                );
 
                                // Load template
-                               $OUT .= LOAD_TEMPLATE("admin_overview_row", true, $content);
+                               $OUT .= LOAD_TEMPLATE('admin_overview_row', true, $content);
 
                                // Which task do we actually have here?
                                // @TODO Rewrite this to something with include files
                                switch ($type)
                                {
-                               case "EXTENSION": // Install new extensions
-                                       $ext_name = substr($subj, 1, strpos($subj, ":") - 1);
-                                       $result_lines = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_extensions` WHERE ext_name='%s' LIMIT 1",
+                               case 'EXTENSION': // Install new extensions
+                                       $ext_name = substr($subj, 1, strpos($subj, ':') - 1);
+                                       $result_lines = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `ext_name`='%s' LIMIT 1",
                                                array($ext_name), __FILE__, __LINE__);
                                        $lines = SQL_NUMROWS($result_lines);
                                        SQL_FREERESULT($result_lines);
-                                       if ($lines == "0") {
+                                       if ($lines == '0') {
                                                // New extension found
-                                               $OUT .= LOAD_TEMPLATE("admin_ext_reg_form", true, array(
+                                               $OUT .= LOAD_TEMPLATE('admin_ext_reg_form', true, array(
                                                        'id'       => bigintval($id),
                                                        'ext_name' => $ext_name
                                                ));
@@ -243,25 +247,25 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                                $OUT .= "<div class=\"admin_failed\">{--ADMIN_EXT_ALREADY_REGISTERED--}</div>\n";
 
                                                // Close task but not already closes or deleted or update tasks
-                                               if (($status != "CLOSED") && ($status != "DELETED") && ($type != "EXTENSION_UPDATE")) {
+                                               if (($status != 'CLOSED') && ($status != 'DELETED') && ($type != 'EXTENSION_UPDATE')) {
                                                        // Solve the task
                                                        runFilterChain('solve_task', $tid);
                                                } // END - if
                                        }
                                        break;
 
-                               case "EXTENSION_UPDATE": // Extension update
+                               case 'EXTENSION_UPDATE': // Extension update
                                        // Extension updates are installed automatically
                                        $OUT .= "<div class=\"admin_failed medium\">{--ADMIN_EXTENSION_UPDATED--}</div>\n";
 
                                        // Close task
-                                       if (($status != "CLOSED") && ($status != "DELETED")) {
+                                       if (($status != 'CLOSED') && ($status != 'DELETED')) {
                                                // Solve the task
                                                runFilterChain('solve_task', $tid);
                                        } // END - if
                                        break;
 
-                               case "SUPPORT_MEMBER": // Assign on member's support request
+                               case 'SUPPORT_MEMBER': // Assign on member's support request
                                        // @TODO This may also be rewritten to include files
                                        switch ($mode)
                                        {
@@ -272,10 +276,10 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                        }
                                        break;
 
-                               case "PAYOUT_REQUEST": // Payout requests
+                               case 'PAYOUT_REQUEST': // Payout requests
                                        if (EXT_IS_ACTIVE('payout')) {
                                                // Extension is installed so let him send a notification to the user
-                                               $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE userid=%s AND payout_timestamp=%s LIMIT 1",
+                                               $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE userid=%s AND payout_timestamp=%s LIMIT 1",
                                                        array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
                                                list($pid) = SQL_FETCHROW($result_pay);
                                                SQL_FREERESULT($result_pay);
@@ -286,10 +290,10 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                                                'pid' => $pid,
                                                                'tid' => $tid,
                                                        );
-                                                       $OUT .= LOAD_TEMPLATE("admin_payout_overview_form", true, $content);
+                                                       $OUT .= LOAD_TEMPLATE('admin_payout_overview_form', true, $content);
                                                } else {
                                                        // Problem obtaining payout ID
-                                                       $OUT .= "<div class=\"admin_failed medium\">".PAYOUT_OBTAIN_ID_FAILED."</div>\n";
+                                                       $OUT .= "<div class=\"admin_failed medium\">{--PAYOUT_OBTAIN_ID_FAILED--}</div>\n";
                                                }
                                        } else {
                                                // Extension is not installed
@@ -297,10 +301,10 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                        }
                                        break;
 
-                               case "WERNIS_REQUEST": // Wernis requests
+                               case 'WERNIS_REQUEST': // Wernis requests
                                        if (EXT_IS_ACTIVE('wernis')) {
                                                // Extension is installed so let him send a notification to the user
-                                               $result_pay = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE userid=%s AND wernis_timestamp=%s LIMIT 1",
+                                               $result_pay = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE userid=%s AND wernis_timestamp=%s LIMIT 1",
                                                        array(bigintval($uid), bigintval($created)), __FILE__, __LINE__);
                                                list($pid) = SQL_FETCHROW($result_pay);
                                                SQL_FREERESULT($result_pay);
@@ -311,7 +315,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                                                'pid' => $pid,
                                                                'tid' => $tid,
                                                        );
-                                                       $OUT .= LOAD_TEMPLATE("admin_wernis_overview_form", true, $content);
+                                                       $OUT .= LOAD_TEMPLATE('admin_wernis_overview_form', true, $content);
                                                } else {
                                                        // Problem obtaining wernis ID
                                                        $OUT .= "<div class=\"admin_failed medium\">{--WERNIS_OBTAIN_ID_FAILED--}</div>\n";
@@ -322,11 +326,11 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                        }
                                        break;
 
-                               case "HOLIDAY_REQUEST": // Holiday requests
-                                       $OUT .= LOAD_TEMPLATE("admin_task_holiday", true, $uid);
+                               case 'HOLIDAY_REQUEST': // Holiday requests
+                                       $OUT .= LOAD_TEMPLATE('admin_task_holiday', true, $uid);
                                        break;
 
-                               case "NL_UNSUBSCRIBE": // Newsletter unsubscriptions
+                               case 'NL_UNSUBSCRIBE': // Newsletter unsubscriptions
                                        $result = SQL_QUERY_ESC("SELECT nl_timespan FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
                                                array(bigintval($uid)), __FILE__, __LINE__);
                                        list($span) = SQL_FETCHROW($result);
@@ -338,7 +342,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                                        'uid' => $uid,
                                                        'id'  => $tid
                                                );
-                                               $OUT .= LOAD_TEMPLATE("admin_newsletter_tsk", true, $content);
+                                               $OUT .= LOAD_TEMPLATE('admin_newsletter_tsk', true, $content);
                                        } else {
                                                // Already unsubscribed
                                                $OUT .= "<div class=\"admin_failed medium\">".ADMIN_NL_UNSUBSCRIBE_ALREADY."</div>\n";
@@ -359,27 +363,27 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                define('__TASK_ROWS', $OUT);
 
                // Load final template
-               LOAD_TEMPLATE("admin_overview_list");
+               LOAD_TEMPLATE('admin_overview_list');
        } else {
-               if ((isset($POST['task'])) && ((count($POST['task']) > 0) || ($POST['task'][0] == "1"))) {
+               if ((isset($POST['task'])) && ((count($POST['task']) > 0) || ($POST['task'][0] == '1'))) {
                        // Only unassign / delete tasks when there are selected tasks posted
                        if (!empty($POST['unassign'])) {
                                // Unassign from tasks
                                foreach ($POST['task'] as $id => $sel) {
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1",
-                                               array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
+                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } elseif (isset($POST['del'])) {
                                // Delete tasks
                                foreach ($POST['task'] as $id => $sel) {
-                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s AND assigned_admin IN (%s,0) LIMIT 1",
-                                               array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s AND assigned_admin IN (%s,0) LIMIT 1",
+                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        }
 
                        // Update query
-                       $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!_MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s OR (assigned_admin=0 AND `status`='NEW') ORDER BY task_created DESC",
-                               array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+                       $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW') ORDER BY task_created DESC",
+                               array(getCurrentAdminId()), __FILE__, __LINE__);
                } // END - if
 
                // There are uncompleted jobs!
@@ -389,14 +393,14 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                        $content['infos'] = '---';
 
                        // Generate assign link
-                       $content['assigned_admin'] = GENERATE_AID_LINK($content['assigned_admin']);
+                       $content['assigned_admin'] = generateAdminLink($content['assigned_admin']);
 
                        // Generate infos
                        switch ($content['task_type'])
                        {
-                       case "EXTENSION":
-                       case "EXTENSION_UPDATE":
-                               $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ":") - 1);
+                       case 'EXTENSION':
+                       case 'EXTENSION_UPDATE':
+                               $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ':') - 1);
                                break;
                        }
 
@@ -405,7 +409,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
 
                        if ($content['userid'] > 0) {
                                // Member found otherwise it's a system task
-                               $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']);
+                               $content['userid'] = generateUserProfileLink($content['userid']);
                        } else {
                                $content['userid'] = "<em>{--ADMIN_IS_SYSTEM_TASK--}</em>";
                        }
@@ -417,11 +421,11 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                                'admin'   => $content['assigned_admin'],
                                'uid'     => $content['userid'],
                                'type'    => $content['task_type_msg'],
-                               'created' => MAKE_DATETIME($content['task_created'], "2")
+                               'created' => generateDateTime($content['task_created'], "2")
                        ));
 
                        // Do we have extension task?
-                       if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) {
+                       if (($content['task_type'] == 'EXTENSION') && (GET_EXT_VERSION($content['infos']) == '')) {
                                // Load extension row template
                                $OUT .= LOAD_TEMPLATE("admin_overview_list_ext_rows", true, $content);
                        } else {
index 5eb9a3d1b1380be408b525409143ad372b97e55f..b8ddd1adcb231e1e2ff8be0cceedfc06f28ad21b 100644 (file)
@@ -55,7 +55,7 @@ if (REQUEST_GET('uid') == "all") {
                define('__POINTS_VALUE', REQUEST_POST('points'));
 
                // Select all users
-               $result_main = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY userid",
+               $result_main = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC",
                        __FILE__, __LINE__);
 
                // Process all entries
@@ -66,7 +66,7 @@ if (REQUEST_GET('uid') == "all") {
                        $GLOBALS['ref_level'] = -1;
 
                        // Ok, add points and send an email to him...
-                       ADD_POINTS_REFSYSTEM("admin_all", $content['userid'], bigintval(REQUEST_POST('points')), false, "0", false, "direct");
+                       ADD_POINTS_REFSYSTEM_DIRECT('admin_all', $content['userid'], bigintval(REQUEST_POST('points')));
 
                        // Prepare content
                        $content['text']   = SQL_ESCAPE(REQUEST_POST('reason'));
@@ -74,7 +74,7 @@ if (REQUEST_GET('uid') == "all") {
 
                        // Load email template and send email away
                        $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval($content['userid']));
-                       SEND_EMAIL(bigintval($content['userid']), getMessage('ADMIN_ADD_SUBJ'), $msg);
+                       sendEmail(bigintval($content['userid']), getMessage('ADMIN_ADD_SUBJ'), $msg);
                } // END - while
 
                // Free memory
@@ -102,7 +102,7 @@ if (REQUEST_GET('uid') == "all") {
                        unset($GLOBALS['ref_level']);
 
                        // Ok, add points and send an email to him...
-                       ADD_POINTS_REFSYSTEM("admin_single", bigintval(REQUEST_GET('uid')), bigintval(REQUEST_POST('points')), false, "0", false, "direct");
+                       ADD_POINTS_REFSYSTEM_DIRECT('admin_single', bigintval(REQUEST_GET('uid')), bigintval(REQUEST_POST('points')));
 
                        // Prepare content
                        $content = array(
@@ -113,12 +113,12 @@ if (REQUEST_GET('uid') == "all") {
                        // Message laden
                        $msg = LOAD_EMAIL_TEMPLATE("add-points", $content, bigintval(REQUEST_GET('uid')));
 
-                       SEND_EMAIL(bigintval(REQUEST_GET('uid')), getMessage('ADMIN_ADD_SUBJ'), $msg);
+                       sendEmail(bigintval(REQUEST_GET('uid')), getMessage('ADMIN_ADD_SUBJ'), $msg);
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED'));
                } else {
                        // Opps, missing form here
                        // @TODO Rewrite these both constants
-                       define('__USER_VALUE', "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</a>");
+                       define('__USER_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$sname." ".$fname."</a>");
                        define('__UID'       , bigintval(REQUEST_GET('uid')));
                        LOAD_TEMPLATE("admin_add_points");
                }
@@ -128,7 +128,7 @@ if (REQUEST_GET('uid') == "all") {
        }
 } else {
        // Output selection form with all confirmed user accounts listed
-       ADD_MEMBER_SELECTION_BOX("0", true);
+       ADD_MEMBER_SELECTION_BOX('0', true);
 }
 
 //
index 2e18ce09b537a79492ee8f0b945cc653ffd2bdeb..7ee5f72fbec4c619c5b92eb0c36710043b180c78 100644 (file)
@@ -59,7 +59,7 @@ if (IS_FORM_SENT()) {
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_rallye_data` (admin_id, title, descr, template, start_time, end_time, auto_add_new_user, is_active, send_notify)
 VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
  array(
-       GET_CURRENT_ADMIN_ID(),
+       getCurrentAdminId(),
        REQUEST_POST('title'),
        REQUEST_POST('descr'),
        REQUEST_POST('template'),
@@ -71,14 +71,14 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 ), __FILE__, __LINE__);
 
                // Load ID
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE start_time='%s' AND end_time='%s' AND `title`='%s' LIMIT 1",
                 array($START, $END, REQUEST_POST('title')), __FILE__, __LINE__);
                list($id) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
                if (!empty($id)) {
                        // Reload to prices...
-                       LOAD_URL('modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye='.$id);
+                       redirectToUrl('modules.php?module=admin&amp;what=config_rallye_prices&amp;rallye='.$id);
                } else {
                        // Problem detected...
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_PROBLEM_CREATE'));
@@ -93,9 +93,9 @@ VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s')",
 }
 
 // Prepare some constants for the template
-define('_AUTO_ADD_OPTIONS', ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
-define('_ACTIVE_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('N','Y'), array(NO , YES)));
-define('_NOTIFY_OPTIONS'  , ADD_OPTION_LINES('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_AUTO_ADD_OPTIONS', generateOptionList('/ARRAY/', array('Y','N'), array(YES, NO )));
+define('_ACTIVE_OPTIONS'  , generateOptionList('/ARRAY/', array('N','Y'), array(NO , YES)));
+define('_NOTIFY_OPTIONS'  , generateOptionList('/ARRAY/', array('Y','N'), array(YES, NO )));
 
 // Starting day
 define('_START_SEC'  , ADD_SELECTION('sec'  , '0'              , 'start'));
index 5521355644dc166c6c1222c9a577c4dd76d4b63a..7a432fa319c164d6ddb9596daf400aa1299b922a 100644 (file)
@@ -51,7 +51,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('url')))) {
        $DATA = array(); $id = "reload_ye"; $skip = false;
 
        // Convert the "reload selections"
-       CONVERT_SELECTIONS_TO_TIMESTAMP(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
+       convertSelectionsToTimestamp(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
 
        // Then add this URL
        if (SURFBAR_ADMIN_ADD_URL(REQUEST_POST('url'), REQUEST_POST('limit'), REQUEST_POST('reload'))) {
@@ -65,7 +65,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('url')))) {
 
 // Prepare content for template
 $content = array(
-       'reload' => CREATE_TIME_SELECTIONS(0, "reload", "WDhms")
+       'reload' => createTimeSelections(0, "reload", "WDhms")
 );
 
 // Load template
index ce8ca70042340d0c968934be4f224ee5755cadcf..bc85b8a7912f90834ee57b064db8e4663552a9bd 100644 (file)
@@ -179,7 +179,7 @@ if (!IS_FORM_SENT())
                                bigintval(REQUEST_POST('sort')),
                        ), __FILE__, __LINE__
                );
-               CACHE_PURGE_ADMIN_MENU(0, REQUEST_POST('menu'), REQUEST_POST('name'));
+               cachePurgeAdminMenu(0, REQUEST_POST('menu'), REQUEST_POST('name'));
        } else {
                // Add main menu
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (action, title, descr, sort) VALUES ('%s','%s','%s','%s')",
@@ -190,7 +190,7 @@ if (!IS_FORM_SENT())
                                bigintval(REQUEST_POST('sort')),
                        ), __FILE__, __LINE__
                );
-               CACHE_PURGE_ADMIN_MENU(0, REQUEST_POST('name'));
+               cachePurgeAdminMenu(0, REQUEST_POST('name'));
        }
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
 } else {
index 577c13c802fb4371348b06c2e5ae28743def24b3..2528ba750ce9e579a50b56928cc1158253512bf3 100644 (file)
@@ -55,7 +55,7 @@ if (REQUEST_ISSET_GET('sub'))
 
 // Get count of (maybe) selected menu points
 $chk = 0;
-if (REQUEST_ISSET_POST('sel')) $chk = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $chk = countPostSelection();
 
 // List all menu points and make them editable
 if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
@@ -155,7 +155,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
        // An action is done...
        switch (REQUEST_POST('ok'))
        {
-       case "edit": // Edit menu
+       case 'edit': // Edit menu
                foreach (REQUEST_POST('sel') as $sel => $menu) {
                        // Secure ID
                        $sel = bigintval($sel);
@@ -177,17 +177,17 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                }
 
                // Purge admin menu cache
-               CACHE_PURGE_ADMIN_MENU(0, REQUEST_POST('sel_action', $sel), REQUEST_POST('sel_what', $sel));
+               cachePurgeAdminMenu(0, REQUEST_POST('sel_action', $sel), REQUEST_POST('sel_what', $sel));
 
                // Load template
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
                break;
 
-       case "del": // Delete menu
+       case 'del': // Delete menu
                foreach (REQUEST_POST('sel') as $sel => $menu) {
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
-                       CACHE_PURGE_ADMIN_MENU(0, '', '', $AND);
+                       cachePurgeAdminMenu(0, '', '', $AND);
                } // END - foreach
 
                // Load template
@@ -205,21 +205,21 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                // Get IDs
                if (REQUEST_ISSET_GET(('w'))) {
                        // Sub menus selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
                                array(REQUEST_GET('act'), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
                                array(REQUEST_GET('act'), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                } else {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
                                array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
                                array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -231,7 +231,7 @@ WHERE ".$AND." AND id=%s LIMIT 1",
                                array(bigintval(REQUEST_GET('tid')), bigintval($fid)), __FILE__, __LINE__);
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
                                array(bigintval(REQUEST_GET('fid')), bigintval($tid)), __FILE__, __LINE__);
-                       CACHE_PURGE_ADMIN_MENU(0, '', '', $AND);
+                       cachePurgeAdminMenu(0, '', '', $AND);
                }
        }
 
index 4339a81c380da94cc03b5b21c62e6965b010ea21..139bbaf5bec28e43ff5150753c484c95f3911e6e 100644 (file)
@@ -50,7 +50,7 @@ $FORM = true;
 
 if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('login'))) && (REQUEST_ISSET_POST(('email'))) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
        // Add admin when not added already
-       if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == "done") {
+       if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == 'done') {
                // Do not ouput any form!
                $FORM = false;
 
index d2dd289f8064cc12dcd31fda3a3e3a75ee7bb20e..5b99c28e67b9d0c217608f0fb17a0364ace404f6 100644 (file)
@@ -49,15 +49,15 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET('admin'))) {
        // Send mail or message
        if ((EXT_IS_ACTIVE("msg")) && (REQUEST_POST('type') == "msg")) {
                // Add message
-               $msg = LOAD_EMAIL_TEMPLATE("admins_msg_contct_admin", REQUEST_POST('text'), "0");
+               $msg = LOAD_EMAIL_TEMPLATE("admins_msg_contct_admin", REQUEST_POST('text'), '0');
                SEND_ADMIN_MESSAGE(REQUEST_GET('admin'), ADMINS_MSG_FROM_ADMIN, $msg);
        } else {
                // Load admin's email address
-               $email = GET_ADMIN_EMAIL(bigintval(REQUEST_GET('admin')));
+               $email = getAdminEmail(bigintval(REQUEST_GET('admin')));
 
                // Load email template and send the mail to the admin
-               $msg = LOAD_EMAIL_TEMPLATE("admins_mail_contct_admin", REQUEST_POST('text'), "0");
-               SEND_EMAIL($email, ADMINS_MSG_FROM_ADMIN, $msg);
+               $msg = LOAD_EMAIL_TEMPLATE("admins_mail_contct_admin", REQUEST_POST('text'), '0');
+               sendEmail($email, getMessage('ADMINS_MSG_FROM_ADMIN'), $msg);
        }
 
        // Mail / message dropped
index ddb2fe08ca39873e0b340c75a23adf74a62fed8b..f57381ce44d6235499280270d97fc95440f2a25f 100644 (file)
@@ -56,25 +56,25 @@ if (REQUEST_ISSET_GET('admin')) {
        // Set required fields
        REQUEST_SET_POST('edit', "1");
        REQUEST_SET_POST(array('sel', $aid), "1");
-}
+} // END - if
 
-if ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
        // Edit account(s)
-       ADMINS_EDIT_ADMIN_ACCOUNTS(REQUEST_POST_ARRAY());
+       adminsEditAdminAccount(REQUEST_POST_ARRAY());
 } elseif ((REQUEST_ISSET_POST('change')) && (count(REQUEST_POST('login')) > 0)) {
        // Change admin accounts
-       ADMINS_CHANGE_ADMIN_ACCOUNT(REQUEST_POST_ARRAY());
-} elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+       adminsChangeAdminAccount(REQUEST_POST_ARRAY());
+} elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) {
        // Show admin accounts for deletetion
-       ADMINS_DELETE_ADMIN_ACCOUNTS(REQUEST_POST_ARRAY());
+       adminsDeleteAdminAccount(REQUEST_POST_ARRAY());
 } else {
-       if ((REQUEST_ISSET_POST('remove')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+       if ((REQUEST_ISSET_POST('remove')) && (countPostSelection() > 0)) {
                // Remove accounts now
-               ADMINS_REMOVE_ADMIN_ACCOUNTS(REQUEST_POST_ARRAY());
-       }
+               adminsRemoveAdminAccount(REQUEST_POST_ARRAY());
+       } // END - if
 
        // List all admin accounts
-       ADMINS_LIST_ADMIN_ACCOUNTS();
+       adminsListAdminAccounts();
 }
 
 //
index 0f67efc615dfdd5a45a5b398e3581958fab399bc..7d9bbc2c929bec3e09e7eec96f560495037bd164 100644 (file)
@@ -47,10 +47,10 @@ ADD_DESCR('admin', __FILE__);
 
 if (REQUEST_ISSET_POST('edit')) {
        // Check if entires are checked
-       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+       $SEL = countPostSelection();
        if ($SEL > 0) {
                // Add option for events
-               $GLOBALS['cache_array']['admins'] = ADD_OPTION_LINES('admins', "id", "login", '', 'email');
+               $GLOBALS['cache_array']['admins'] = generateOptionList('admins', "id", "login", '', 'email');
                $SW = 2; $rowNameS = '';
                foreach (REQUEST_POST('sel') as $template => $sel) {
                        // First of all load data from DB
@@ -61,14 +61,14 @@ if (REQUEST_ISSET_POST('edit')) {
                                // @TODO Can this be rewritten???
                                $OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
 <option value=\"0\"";
-                               if ($content['admin_id'] == "0") $OUT .= ' selected="selected"';
+                               if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
                                $OUT .=">{--ADMINS_ALL_ADMINS--}</option>\n";
                                if (EXT_IS_ACTIVE('events')) {
                                        $OUT .= "<option value=\"-1\"";
                                        if ($content['admin_id'] == "-1") $OUT .= ' selected="selected"';
                                        $OUT .= ">{--ADMINS_TO_USER_EVENTS--}</option>\n";
                                }
-                               $OUT .= ADD_OPTION_LINES('admins', "id", "login", $content['admin_id'], 'email');
+                               $OUT .= generateOptionList('admins', "id", "login", $content['admin_id'], 'email');
                                $OUT .= "</select>\n<br />\n";
                                $aid2 = $content['admin_id']; $id2 = $content['id'];
                        }
@@ -128,7 +128,7 @@ ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
                                $content['admin_id'] = bigintval($content['admin_id']);
 
                                // Update entry
-                               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_mails` SET admin_id=%s WHERE id=%s ORDER BY `id` LIMIT 1",
+                               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_mails` SET admin_id=%s WHERE `id`=%s ORDER BY `id` LIMIT 1",
                                        array($content['admin_id'], $id), __FILE__, __LINE__, false));
 
                                if (($content['admin_id'] < 1) && (REQUEST_ISSET_POST('template', $id))) {
@@ -159,7 +159,7 @@ ORDER BY m.admin_id, m.mail_template", __FILE__, __LINE__);
                                'sw'   => $SW,
                                'id'   => $data['id'],
                                'tpl'  => $data['mail_template'],
-                               'alnk' => GENERATE_AID_LINK($data['admin_id'])
+                               'alnk' => generateAdminLink($data['admin_id'])
                        );
 
                        // Load row template
index fa39e2a5d53c83de35c962777618a0d14789aec3..474288056b56e532603f9d53ab0bce6b3dc8a489 100644 (file)
@@ -49,10 +49,10 @@ ADD_DESCR('admin', __FILE__);
 $totalHits = (getConfig('db_hits') + getConfig('cache_hits'));
 
 // Prepare data for the template
-define('__DB_HITS'   , TRANSLATE_COMMA(getConfig('db_hits')));
-define('__CACHE_HITS', TRANSLATE_COMMA(getConfig('cache_hits')));
-define('__TOTAL_HITS', TRANSLATE_COMMA($totalHits));
-define('__CACHE_PERC', TRANSLATE_COMMA((getConfig('cache_hits') / $totalHits * 100)));
+define('__DB_HITS'   , translateComma(getConfig('db_hits')));
+define('__CACHE_HITS', translateComma(getConfig('cache_hits')));
+define('__TOTAL_HITS', translateComma($totalHits));
+define('__CACHE_PERC', translateComma((getConfig('cache_hits') / $totalHits * 100)));
 
 // Load template
 LOAD_TEMPLATE("admin_cache_stats");
index 0319bfef1fb49073decfeef3023bb398818f3048..ec1cb4abe73db0b94ff057d6e470f3c79f1653e4 100644 (file)
@@ -56,20 +56,20 @@ if (SQL_NUMROWS($result) > 0) {
        $OUT = ''; $SW = 2;
        while ($content = SQL_FETCHARRAY($result)) {
                // Add link to refid
-               if ($content['refid'] > 0) $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']);
+               if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
 
                // Prepare array for the row template
                // @TODO Rewritings: sname->surname,fname->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template
                $content = array(
                        'sw'     => $SW,
-                       'gender' => TRANSLATE_GENDER($content['gender']),
+                       'gender' => translateGender($content['gender']),
                        'sname'  => $content['surname'],
                        'fname'  => $content['family'],
-                       'email'  => "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".$content['email']."</a>",
+                       'email'  => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
                        'ip'     => $content['REMOTE_ADDR'],
                        'ref'    => $content['refid'],
                        'hash'   => $content['user_hash'],
-                       'link'   => ADMIN_USER_PROFILE_LINK($content['userid']),
+                       'link'   => generateUserProfileLink($content['userid']),
                );
 
                // Load row template and switch color
index 6b203e594fdcee3fdee497e553bd778e26e36a08..24b9126b76f63ab4ce7dea31ec16cca845e09da4 100644 (file)
@@ -46,14 +46,14 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 $SEL = 0;
-if (REQUEST_ISSET_POST('sel')) $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 
 if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
        // Edit ACLs
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('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",
+               $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                list($aid, $act, $wht, $mode) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -62,10 +62,10 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                $content = array(
                        'sw'               => $SW,
                        'id'               => $id,
-                       'admins_selection' => ADD_OPTION_LINES('admins', "id", "login", $aid, "default_acl"),
+                       'admins_selection' => generateOptionList('admins', "id", "login", $aid, "default_acl"),
                        'action_selection' => ADMIN_MENU_SELECTION("action", $act, $id),
                        'what_selection'   => ADMIN_MENU_SELECTION("what", $wht, $id),
-                       'mode_options'     => ADD_OPTION_LINES(
+                       'mode_options'     => generateOptionList(
                                "/ARRAY/",
                                array("allow", "deny"),
                                array(constant('ADMINS_ALLOW_MODE'), constant('ADMINS_DENY_MODE')),
@@ -88,7 +88,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                $id = bigintval($id);
 
                // Update entries
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_acls` SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admins_acls` SET admin_id=%s, action_menu='%s', what_menu='%s', access_mode='%s' WHERE `id`=%s LIMIT 1",
                        array(
                                REQUEST_POST('admin', $id),
                                REQUEST_POST('action_menu', $id),
@@ -103,7 +103,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // Purge menu cache
-               CACHE_PURGE_ADMIN_MENU(REQUEST_POST('admin', $id));
+               cachePurgeAdminMenu(REQUEST_POST('admin', $id));
        }
 
        // Entries changed
@@ -113,7 +113,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('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",
+               $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                list($admin, $act, $wht, $mode) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -126,7 +126,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                $mode = constant('ADMINS_'.strtoupper($mode).'_MODE');
 
                // Generate link
-               $admin = GENERATE_AID_LINK($admin);
+               $admin = generateAdminLink($admin);
 
                // Prepare data for the row template
                $content = array(
@@ -149,7 +149,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
 } elseif ((REQUEST_ISSET_POST('remove')) && ($SEL > 0)) {
        // Remove entries
        foreach (REQUEST_POST('sel') as $id => $selected) {
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)),__FILE__, __LINE__);
        }
 
@@ -158,20 +158,20 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                // @TODO This causes the whole (!) menu cache being rebuild
-               CACHE_PURGE_ADMIN_MENU();
+               cachePurgeAdminMenu();
        }
 
        // Entries deleted
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED'));
 } elseif (REQUEST_ISSET_POST(('add'))) {
        // Check if everything is fine...
-       $mode = GET_ADMIN_DEFAULT_ACL(bigintval(REQUEST_POST('admin_id')));
+       $mode = getAdminDefaultAcl(bigintval(REQUEST_POST('admin_id')));
 
        // Default ACL is false
        $ACL = false;
        if (REQUEST_ISSET_POST(('what_menu'))) {
                // Check parent ACL
-               $ACL = ADMINS_CHECK_ACL(GET_ACTION('admin', REQUEST_POST('what_menu')), '');
+               $ACL = adminsCheckAdminAcl(getModeAction('admin', REQUEST_POST('what_menu')), '');
        }
 
        if ($mode != REQUEST_POST('mode') || ($ACL)) {
@@ -179,8 +179,8 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) {
                $BOTH = ((REQUEST_ISSET_POST(('action_menu'))) && (REQUEST_ISSET_POST(('what_menu'))));
                if (((REQUEST_ISSET_POST(('action_menu'))) || (REQUEST_ISSET_POST(('what_menu')))) && (!$BOTH)) {
                        // Main or sub menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
-                        array(bigintval(REQUEST_POST('admin_id')), REQUEST_POST('action_menu'), REQUEST_POST('what_menu')), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
+                               array(bigintval(REQUEST_POST('admin_id')), REQUEST_POST('action_menu'), REQUEST_POST('what_menu')), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 0) {
                                // Finally add the new ACL
                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_admins_acls` (admin_id, action_menu, what_menu, access_mode)
@@ -198,7 +198,7 @@ VALUES ('%s','%s','%s','%s')",
                                        if ($GLOBALS['cache_instance']->loadCacheFile("admins_acls")) $GLOBALS['cache_instance']->destroyCacheFile();
 
                                        // Purge cache
-                                       CACHE_PURGE_ADMIN_MENU(REQUEST_POST('admin_id'), REQUEST_POST('action_menu'), REQUEST_POST('what_menu'));
+                                       cachePurgeAdminMenu(REQUEST_POST('admin_id'), REQUEST_POST('action_menu'), REQUEST_POST('what_menu'));
                                } // END - if
                        } else {
                                // ACL does already exist!
@@ -236,7 +236,7 @@ VALUES ('%s','%s','%s','%s')",
                        $content = array(
                                'sw'     => $SW,
                                'id'     => $content['id'],
-                               'admin'  => GENERATE_AID_LINK($content['admin_id']),
+                               'admin'  => generateAdminLink($content['admin_id']),
                                'action' => $content['action_menu'],
                                'what'   => $content['what_menu'],
                                'mode'   => $content['access_mode'],
@@ -256,11 +256,11 @@ VALUES ('%s','%s','%s','%s')",
        }
 
        // Prepare some constants for the template
-       define('_ADMINS_SELECTION', ADD_OPTION_LINES('admins', "id", "login", '', "default_acl"));
+       define('_ADMINS_SELECTION', generateOptionList('admins', "id", "login", '', "default_acl"));
        define('_ACTION_SELECTION', ADMIN_MENU_SELECTION("action"));
        define('_WHAT_SELECTION'  , ADMIN_MENU_SELECTION("what"));
        define('_MODE_OPTIONS'    ,
-               ADD_OPTION_LINES(
+               generateOptionList(
                        "/ARRAY/",
                        array("allow", "deny"),
                        array(
index aff79ba14ed3f6fc4910d82de5c9661e9a435450..e980c5747f1f7883b1f10d1f1544edf06fdfc08c 100644 (file)
@@ -62,14 +62,14 @@ if (IS_FORM_SENT()) {
        define('__AP_NOTIFY_DEL_MAILS'     , ADD_SELECTION('yn', getConfig('ap_dm_notify')   , "ap_dm_notify"));
 
        // Output time selection boxes
-       define('__AP_IN_SINCE'      , CREATE_TIME_SELECTIONS(getConfig('ap_inactive_since'), "ap_inactive_since"  , "MWDh"));
-       define('__AP_IN_TIME'       , CREATE_TIME_SELECTIONS(getConfig('ap_in_time')       , "ap_inactive_time"   , "MWDh"));
-       define('__AP_UN_TIME'       , CREATE_TIME_SELECTIONS(getConfig('ap_un_time')       , "ap_unconfirmed_time", "MWDh"));
-       define('__AP_TASK_TIME'     , CREATE_TIME_SELECTIONS(getConfig('ap_tasks_time')    , "ap_tasks_time"      , "MWDh"));
-       define('__AP_DEL_MAILS_TIME', CREATE_TIME_SELECTIONS(getConfig('ap_dm_timeout')    , "ap_dm_timeout"      , "MWDh"));
+       define('__AP_IN_SINCE'      , createTimeSelections(getConfig('ap_inactive_since'), "ap_inactive_since"  , "MWDh"));
+       define('__AP_IN_TIME'       , createTimeSelections(getConfig('ap_in_time')       , "ap_inactive_time"   , "MWDh"));
+       define('__AP_UN_TIME'       , createTimeSelections(getConfig('ap_un_time')       , "ap_unconfirmed_time", "MWDh"));
+       define('__AP_TASK_TIME'     , createTimeSelections(getConfig('ap_tasks_time')    , "ap_tasks_time"      , "MWDh"));
+       define('__AP_DEL_MAILS_TIME', createTimeSelections(getConfig('ap_dm_timeout')    , "ap_dm_timeout"      , "MWDh"));
 
        // Mail confirmation links
-       define('_CFG_AUTO_PURGE', CREATE_TIME_SELECTIONS(getConfig('auto_purge'), "auto_purge", "MWD"));
+       define('_CFG_AUTO_PURGE', createTimeSelections(getConfig('auto_purge'), "auto_purge", "MWD"));
        if (getConfig('auto_purge_active') != 'Y') {
                define('_CFG_AP_ACTIVE_N', ' chkecked="checked"');
                define('_CFG_AP_ACTIVE_Y', '');
index 70d591f6e9c67e10b52d9a2000baca17a6641d3e..7200379faf5d1bb5a074009d800818abc47685fd 100644 (file)
@@ -47,9 +47,9 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Translate german decimal commas to computer decimal dots
-       REQUEST_SET_POST('beg_points'      , REVERT_COMMA(REQUEST_POST('beg_points')      ));
-       REQUEST_SET_POST('beg_points_max'  , REVERT_COMMA(REQUEST_POST('beg_points_max')  ));
-       REQUEST_SET_POST('beg_notify_bonus', REVERT_COMMA(REQUEST_POST('beg_notify_bonus')));
+       REQUEST_SET_POST('beg_points'      , convertCommaToDot(REQUEST_POST('beg_points')      ));
+       REQUEST_SET_POST('beg_points_max'  , convertCommaToDot(REQUEST_POST('beg_points_max')  ));
+       REQUEST_SET_POST('beg_notify_bonus', convertCommaToDot(REQUEST_POST('beg_notify_bonus')));
 
        // Save settings
        ADMIN_SAVE_SETTINGS_POST();
@@ -60,13 +60,13 @@ if (IS_FORM_SENT()) {
        setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
 } else {
        // Prepare constants for the template
-       define('__BEG_POINTS'           , TRANSLATE_COMMA(getConfig('beg_points')      , false));
-       define('__BEG_POINTS_MAX'       , TRANSLATE_COMMA(getConfig('beg_points_max')  , false));
-       define('__BEG_NOTIFY_BONUS'     , TRANSLATE_COMMA(getConfig('beg_notify_bonus'), false));
-       define('__BEG_TIMEOUT'          , CREATE_TIME_SELECTIONS(getConfig('beg_timeout')    , "beg_timeout"    , "Dhm"));
-       define('__BEG_UID_TIMEOUT'      , CREATE_TIME_SELECTIONS(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
-       define('__BEG_REMOTE_IP_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
-       define('__WAIT_SELECTION'       , CREATE_TIME_SELECTIONS(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
+       define('__BEG_POINTS'           , translateComma(getConfig('beg_points')      , false));
+       define('__BEG_POINTS_MAX'       , translateComma(getConfig('beg_points_max')  , false));
+       define('__BEG_NOTIFY_BONUS'     , translateComma(getConfig('beg_notify_bonus'), false));
+       define('__BEG_TIMEOUT'          , createTimeSelections(getConfig('beg_timeout')    , "beg_timeout"    , "Dhm"));
+       define('__BEG_UID_TIMEOUT'      , createTimeSelections(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
+       define('__BEG_REMOTE_IP_TIMEOUT', createTimeSelections(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
+       define('__WAIT_SELECTION'       , createTimeSelections(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
        define('__BEG_RANKS'            , getConfig('beg_ranks'));
 
        // Activate / Deactivate beg rallye (Y/N)
index 0a97e29a00966ebda2008f5b63d95f9734f97cf6..1f2ff3bac7eb7b7054c71794042aafbb3c97a3ce 100644 (file)
@@ -47,17 +47,17 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Replace german decimal commas to computer decimal dots
-       REQUEST_POST('login_bonus')         = REVERT_COMMA(REQUEST_POST('login_bonus')        );
-       REQUEST_POST('turbo_bonus')         = REVERT_COMMA(REQUEST_POST('turbo_bonus')        );
-       REQUEST_POST('bonus_ref')           = REVERT_COMMA(REQUEST_POST('bonus_ref')          );
-       REQUEST_POST('bonus_order')         = REVERT_COMMA(REQUEST_POST('bonus_order')        );
-       REQUEST_SET_POST('bonus_notify_points', REVERT_COMMA(REQUEST_POST('bonus_notify_points')));
+       REQUEST_POST('login_bonus')         = convertCommaToDot(REQUEST_POST('login_bonus')        );
+       REQUEST_POST('turbo_bonus')         = convertCommaToDot(REQUEST_POST('turbo_bonus')        );
+       REQUEST_POST('bonus_ref')           = convertCommaToDot(REQUEST_POST('bonus_ref')          );
+       REQUEST_POST('bonus_order')         = convertCommaToDot(REQUEST_POST('bonus_order')        );
+       REQUEST_SET_POST('bonus_notify_points', convertCommaToDot(REQUEST_POST('bonus_notify_points')));
 
        // Generate string for saving ranks
        REQUEST_SET_POST('turbo_rates', '');
        $RATES = array();
        foreach (REQUEST_POST('rate') as $rate) {
-               $rate = trim(REVERT_COMMA($rate));
+               $rate = trim(convertCommaToDot($rate));
                if (!empty($rate)) $RATES[] = $rate;
        }
        REQUEST_SET_POST('turbo_rates', trim(implode(';', $RATES)));
@@ -75,12 +75,12 @@ if (IS_FORM_SENT()) {
        setConfigEntry('bonus_di_notify', REQUEST_POST('bonus_di_notify'));
 } else {
        // Prepare contants for the template
-       define('__LOGIN_VALUE' , TRANSLATE_COMMA(getConfig('login_bonus')        , false));
-       define('__TURBO_VALUE' , TRANSLATE_COMMA(getConfig('turbo_bonus')        , false));
-       define('__ORDER_VALUE' , TRANSLATE_COMMA(getConfig('bonus_order')        , false));
-       define('__REF_VALUE'   , TRANSLATE_COMMA(getConfig('bonus_ref')          , false));
-       define('__STATS_VALUE' , TRANSLATE_COMMA(getConfig('bonus_stats')        , false));
-       define('__NOTIFY_VALUE', TRANSLATE_COMMA(getConfig('bonus_notify_points'), false));
+       define('__LOGIN_VALUE' , translateComma(getConfig('login_bonus')        , false));
+       define('__TURBO_VALUE' , translateComma(getConfig('turbo_bonus')        , false));
+       define('__ORDER_VALUE' , translateComma(getConfig('bonus_order')        , false));
+       define('__REF_VALUE'   , translateComma(getConfig('bonus_ref')          , false));
+       define('__STATS_VALUE' , translateComma(getConfig('bonus_stats')        , false));
+       define('__NOTIFY_VALUE', translateComma(getConfig('bonus_notify_points'), false));
        define('__TRANKS_VALUE', getConfig('bonus_ranks'));
        define('__TLINES_VALUE', getConfig('bonus_lines'));
 
@@ -92,7 +92,7 @@ if (IS_FORM_SENT()) {
        $RANKS = explode(';', getConfig('turbo_rates'));
 
        // Automatically calculate bonus points for ranks 2 and 3 when not set
-       if (getConfig('turbo_rates') == "") $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
+       if (getConfig('turbo_rates') == '') $RANKS = array(round(getConfig('turbo_bonus') / 2), round(getConfig('turbo_bonus') / 4));
 
        // Generate list
        $OUT = "<ol start=\"2\">\n";
@@ -115,9 +115,9 @@ if (IS_FORM_SENT()) {
        $OUT .= "</ol>\n";
        define('__TRATES_LIST', $OUT);
 
-       define('__LOGIN_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('login_timeout')    , "login_timeout"    , "WDh"));
-       define('__BONUS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('bonus_timeout')    , "bonus_timeout"    , "WDh"));
-       define('__WAIT_SELECTION'         , CREATE_TIME_SELECTIONS(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
+       define('__LOGIN_TIMEOUT_SELECTION', createTimeSelections(getConfig('login_timeout')    , "login_timeout"    , "WDh"));
+       define('__BONUS_TIMEOUT_SELECTION', createTimeSelections(getConfig('bonus_timeout')    , "bonus_timeout"    , "WDh"));
+       define('__WAIT_SELECTION'         , createTimeSelections(getConfig('bonus_notify_wait'), "bonus_notify_wait", "ms" ));
 
        // Activate / Deactivate bonus active rallye (Y/N)
        switch (getConfig('bonus_active'))
index 53c70e73829777a8595142cdc0fb3882a57b47a4..d271c05deb616273771a967f8acfba0f4e29792e 100644 (file)
@@ -47,12 +47,12 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Cache path has been not changed by default so don't test it again
-       REQUEST_SET_POST('cache_tested', "N");
+       REQUEST_SET_POST('cache_tested', 'N');
 
        // Check if path has been changed
        if (REQUEST_POST('cache_path') != getConfig('cache_path')) {
                // Okay, cache path has been altered so we have to test it again!
-               REQUEST_SET_POST('cache_tested', "Y");
+               REQUEST_SET_POST('cache_tested', 'Y');
        }
 
        if ((REQUEST_POST('cache_admins') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('admins'))) {
index a000ebfd519c6fa5422fe38734d332b5f9df96e4..7d8f4a3b8abf72d30a5dc5bcb5c2f355e0f604f7 100644 (file)
@@ -51,7 +51,7 @@ $CATS = '';
 
 if (REQUEST_ISSET_POST(('add'))) {
        // Add a new category
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_cats` WHERE cat='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_cats` WHERE cat='%s' LIMIT 1",
                array(REQUEST_POST('catname')), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Category does not exists, we simply add it...
@@ -68,7 +68,7 @@ if (REQUEST_ISSET_POST(('add'))) {
 
        // Display message
        LOAD_TEMPLATE('admin_settings_saved', false, $content);
-} elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('id'))) && (is_array(REQUEST_POST('id')))) {
+} elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST('id')) && (is_array(REQUEST_POST('id')))) {
        // Change or delete categories...
        $TEXT = '';
        foreach (REQUEST_POST('id') as $id => $cat) {
@@ -79,8 +79,8 @@ if (REQUEST_ISSET_POST(('add'))) {
                if (!empty($cat)) {
                        switch (REQUEST_GET('do'))
                        {
-                       case "edit": // Change categories
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_cats` SET cat='%s', `visible`='%s', sort=%s WHERE id=%s LIMIT 1",
+                       case 'edit': // Change categories
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_cats` SET cat='%s', `visible`='%s', sort=%s WHERE `id`=%s LIMIT 1",
                                        array(
                                                $cat,
                                                REQUEST_POST('vis', $id),
@@ -90,8 +90,8 @@ if (REQUEST_ISSET_POST(('add'))) {
                                $TEXT = CATEGORIES_SAVED;
                                break;
 
-                       case "del": // Delete categories
-                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1",
+                       case 'del': // Delete categories
+                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_cats` WHERE `id`=%s LIMIT 1",
                                        array($id), __FILE__, __LINE__);
                                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s",
                                        array($id), __FILE__, __LINE__);
@@ -108,12 +108,12 @@ if (REQUEST_ISSET_POST(('add'))) {
                // Display message
                LOAD_TEMPLATE('admin_settings_saved', false, $TEXT);
        }
-} elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) {
        // Delete categories
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('sel') as $id => $value) {
                // Load data of category
-               $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                list($cat) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -133,13 +133,13 @@ if (REQUEST_ISSET_POST(('add'))) {
 
        // Load main template
        LOAD_TEMPLATE("admin_del_cats");
-} elseif ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
        // Edit categories
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('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",
+               $result = SQL_QUERY_ESC("SELECT cat, visible, sort FROM `{!_MYSQL_PREFIX!}_cats` WHERE `id`=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                list($cat, $vis, $sort) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -175,7 +175,7 @@ if (REQUEST_ISSET_POST(('add'))) {
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare data for the row template
                        $content['sw']  = $SW;
-                       $content['vis'] = TRANSLATE_YESNO($content['visible']);
+                       $content['vis'] = translateYesNo($content['visible']);
 
                        // Put cat descriptions into variable for the selection box
                        if (strlen($content['cat']) > 20) $content['cat'] = substr($content['cat'], 0, 17)."...";
index 1accd8bc923b815a4800babc00ee4d03bedbedfc..303d52a515a535c345c9a1837dc29866ed746b7a 100644 (file)
@@ -47,26 +47,26 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Replace commata with decimal dot
-       REQUEST_SET_POST('doubler_charge', REVERT_COMMA((REQUEST_POST('doubler_charge') / 100)));
-       REQUEST_SET_POST('doubler_ref'   , REVERT_COMMA((REQUEST_POST('doubler_ref') / 100)));
-       REQUEST_SET_POST('doubler_min'   , REVERT_COMMA(REQUEST_POST('doubler_min')));
-       REQUEST_SET_POST('doubler_max'   , REVERT_COMMA(REQUEST_POST('doubler_max')));
-       REQUEST_SET_POST('doubler_left'  , REVERT_COMMA(REQUEST_POST('doubler_left')));
+       REQUEST_SET_POST('doubler_charge', convertCommaToDot((REQUEST_POST('doubler_charge') / 100)));
+       REQUEST_SET_POST('doubler_ref'   , convertCommaToDot((REQUEST_POST('doubler_ref') / 100)));
+       REQUEST_SET_POST('doubler_min'   , convertCommaToDot(REQUEST_POST('doubler_min')));
+       REQUEST_SET_POST('doubler_max'   , convertCommaToDot(REQUEST_POST('doubler_max')));
+       REQUEST_SET_POST('doubler_left'  , convertCommaToDot(REQUEST_POST('doubler_left')));
 
        // Save settings
        ADMIN_SAVE_SETTINGS_POST();
 } else {
        // Prepare data for the template
        // - Charge rate
-       define('__DOUBLER_CHARGE', TRANSLATE_COMMA((getConfig('doubler_charge') * 100), false));
+       define('__DOUBLER_CHARGE', translateComma((getConfig('doubler_charge') * 100), false));
        // - Referal rate
-       define('__DOUBLER_REFERRAL', TRANSLATE_COMMA((getConfig('doubler_ref') * 100), false));
+       define('__DOUBLER_REFERRAL', translateComma((getConfig('doubler_ref') * 100), false));
        // - Minimum points to double
-       define('__DOUBLER_MINIMUM', TRANSLATE_COMMA(getConfig('doubler_min'), false));
+       define('__DOUBLER_MINIMUM', translateComma(getConfig('doubler_min'), false));
        // - Maximum points to double
-       define('__DOUBLER_MAXIMUM', TRANSLATE_COMMA(getConfig('doubler_max'), false));
+       define('__DOUBLER_MAXIMUM', translateComma(getConfig('doubler_max'), false));
        // - Points left on users account after doubling
-       define('__DOUBLER_LEFT', TRANSLATE_COMMA(getConfig('doubler_left'), false));
+       define('__DOUBLER_LEFT', translateComma(getConfig('doubler_left'), false));
        // - Max payouts to check per click/reset
        define('__DOUBLER_MAX_SENT', getConfig('doubler_max_sent'));
        // - Group sending
@@ -132,12 +132,12 @@ if (IS_FORM_SENT()) {
        define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('doubler_uid'), false, true, true, "doubler_uid"));
 
        // Number of rows to display (option lines!!!)
-       define('__DOUBLER_DISPLAY_NEW', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
-       define('__DOUBLER_DISPLAY_PAY', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
-       define('__DOUBLER_DISPLAY_OLD', ADD_OPTION_LINES("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
+       define('__DOUBLER_DISPLAY_NEW', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_new')));
+       define('__DOUBLER_DISPLAY_PAY', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_pay')));
+       define('__DOUBLER_DISPLAY_OLD', generateOptionList("/ARRAY/", array(5,10,20,30,40,50,100), array(5,10,20,30,40,50,100), getConfig('doubler_display_old')));
 
        // Timeout selection box or input box?
-       define('__DOUBLER_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('doubler_timeout')  , "doubler_timeout"  , "WDh"));
+       define('__DOUBLER_TIMEOUT', createTimeSelections(getConfig('doubler_timeout')  , "doubler_timeout"  , "WDh"));
 
        // Load template
        LOAD_TEMPLATE("admin_config_doubler");
index 41dd5d180592447d4be21e2a224d5c5e3b87ee65..975ee4c6d8eb54fc6e23cacd191c2e848d2d577c 100644 (file)
@@ -50,7 +50,7 @@ if (!REQUEST_ISSET_POST(('max'))) REQUEST_UNSET_POST(('add_max'));
 
 if (REQUEST_ISSET_POST(('add_max'))) {
        // Save all settings
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE value='%s' LIMIT 1",
         array(bigintval(REQUEST_POST('max'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Add this value (including comment)
@@ -76,8 +76,8 @@ if (REQUEST_ISSET_POST(('add_max'))) {
 
                switch (REQUEST_GET('do'))
                {
-               case "edit": // Change entries
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_max_receive` SET value='%s', comment='%s' WHERE id=%s LIMIT 1",
+               case 'edit': // Change entries
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_max_receive` SET value='%s', comment='%s' WHERE `id`=%s LIMIT 1",
                                array(
                                        bigintval(REQUEST_POST('val', $id)),
                                        REQUEST_POST('comm', $id),
@@ -86,8 +86,8 @@ if (REQUEST_ISSET_POST(('add_max'))) {
                        $TEXT = MRECEIVE_SAVED;
                        break;
 
-               case "del":
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1",
+               case 'del':
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE `id`=%s LIMIT 1",
                                array($id), __FILE__, __LINE__);
                        $TEXT = MRECEIVE_DELETED;
                        break;
@@ -98,13 +98,13 @@ if (REQUEST_ISSET_POST(('add_max'))) {
                // Display message
                LOAD_TEMPLATE('admin_settings_saved', false, $TEXT);
        }
-} elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) {
        // Delete entries
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('sel') as $id => $value)
        {
                // Load data
-               $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE `id`=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                list($value, $comment) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -125,12 +125,12 @@ if (REQUEST_ISSET_POST(('add_max'))) {
 
        // Load main template
        LOAD_TEMPLATE("admin_config_email_del");
-} elseif ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
        // Edit entries
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('sel') as $id => $value) {
                // Load data
-               $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT value, comment FROM `{!_MYSQL_PREFIX!}_max_receive` WHERE `id`=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                list($value, $comment) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
index 5841be23d7afeae147e9cae72fd68052a3ec9390..cde0b8234a7fdd395dc4e01c51b1a347fec3a31d 100644 (file)
@@ -54,7 +54,7 @@ if (IS_FORM_SENT())
 {
        // Prepare constants for the template
        define('__MAX_VALUE', getConfig('holiday_max'));
-       define('__LOCKED'   , CREATE_TIME_SELECTIONS(getConfig('holiday_lock')  , "holiday_lock"  , "WDh"));
+       define('__LOCKED'   , createTimeSelections(getConfig('holiday_lock')  , "holiday_lock"  , "WDh"));
 
        switch (getConfig('holiday_mode')) {
        case "RESET":
index df9f65ae4acba36708e14e192e64cf3b850d13eb..a9119193b72dddb01c53f27725fd7dc9b8821fb3 100644 (file)
@@ -61,7 +61,7 @@ case "settings": // Settings related to the index page
                $content = array_fill(-1, 60, '');
                $content[getConfig('index_delay')] = ' selected="selected"';
 
-               define('__INDEX_COOKIE_SELECTION', CREATE_TIME_SELECTIONS(getConfig('index_cookie'), "index_cookie", "YMWD"));
+               define('__INDEX_COOKIE_SELECTION', createTimeSelections(getConfig('index_cookie'), "index_cookie", "YMWD"));
                LOAD_TEMPLATE("admin_config_home_settings", false, $content);
        }
        break;
@@ -69,7 +69,7 @@ case "settings": // Settings related to the index page
 case "target": // Set which what-file will be placed in home-page (only modules.php?module=index)
        if (REQUEST_ISSET_GET(('home'))) {
                // Set new home
-               UPDATE_CONFIG("index_home", REQUEST_GET(('home')));
+               updateConfiguration('index_home', REQUEST_GET(('home')));
        } // END - if
 
        // Load all what menu points
index 8e69442d412a5db9fa7eda91cad43df3ef313560..7d7a403aaa9585742b285d0878ae64c350f3d843 100644 (file)
@@ -63,7 +63,7 @@ if (IS_FORM_SENT()) {
 
        // Convert some data
        REQUEST_SET_POST('mt_stage', bigintval(REQUEST_POST('mt_stage')));
-       if (REQUEST_POST('mt_stage') <= GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true)) {
+       if (REQUEST_POST('mt_stage') <= GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true)) {
                // Not enougth!
                REQUEST_UNSET_POST('ok');
        }
@@ -76,12 +76,12 @@ if (IS_FORM_SENT()) {
        // Start of this exchange
        if (getConfig('mt_start') > 0) {
                // Only show start
-               define('__MT_START', "<strong>".MAKE_DATETIME(getConfig('mt_start'), "3")."</strong>");
+               define('__MT_START', "<strong>".generateDateTime(getConfig('mt_start'), "3")."</strong>");
        } else {
                // Make start editable
                define('__MT_START',
-                       ADD_SELECTION("day"  , date("d", time())).
-                       ADD_SELECTION("month", date("m", time())).
+                       ADD_SELECTION("day"  , date('d', time())).
+                       ADD_SELECTION("month", date('m', time())).
                        ADD_SELECTION("year",  -1)
                );
        }
index bf26f1d6f93b74ee3f992178fb752172348462b5..c5233e570ce467032e86ef69f132e3fc85f72adc 100644 (file)
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
 $SEL = 0;
 if (REQUEST_ISSET_POST('edit')) {
        // Check if at least one module is selected
-       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+       $SEL = countPostSelection();
        if ($SEL > 0) {
                // Output header
                $OUT = ''; $SW = 2;
@@ -56,7 +56,7 @@ if (REQUEST_ISSET_POST('edit')) {
                // Edit selected modules
                foreach (REQUEST_POST('sel') as $id => $sel) {
                        // Load module data
-                       $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT module, title, locked, hidden, admin_only, mem_only FROM `{!_MYSQL_PREFIX!}_mod_reg` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                        list($mod, $title, $locked, $hidden, $admin, $mem) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -98,7 +98,7 @@ if (REQUEST_ISSET_POST('edit')) {
                $id = bigintval($id);
 
                // Update module
-               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `title`='%s', `locked`='%s', `hidden`='%s', `admin_only`='%s', `mem_only`='%s' WHERE id=%s LIMIT 1",
+               ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `title`='%s', `locked`='%s', `hidden`='%s', `admin_only`='%s', `mem_only`='%s' WHERE `id`=%s LIMIT 1",
                        array(
                                REQUEST_POST('title', $id),
                                REQUEST_POST('locked', $id),
@@ -142,10 +142,10 @@ ORDER BY module', __FILE__, __LINE__);
                        'id'     => $content['id'],
                        'mod'    => $content['module'],
                        'title'  => $content['title'],
-                       'locked' => TRANSLATE_YESNO($content['locked']),
-                       'hidden' => TRANSLATE_YESNO($content['hidden']),
-                       'admin'  => TRANSLATE_YESNO($content['admin_only']),
-                       'mem'    => TRANSLATE_YESNO($content['mem_only']),
+                       'locked' => translateYesNo($content['locked']),
+                       'hidden' => translateYesNo($content['hidden']),
+                       'admin'  => translateYesNo($content['admin_only']),
+                       'mem'    => translateYesNo($content['mem_only']),
                );
 
                // Load row template
index 52996aae33ee108a06f3b5785a9ab484feeaf347..54d47057d4c1103fa2c670c4aef311781f817537 100644 (file)
@@ -47,12 +47,12 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Save data
-       REQUEST_SET_POST('nl_charge', REVERT_COMMA(REQUEST_POST('nl_charge')));
+       REQUEST_SET_POST('nl_charge', convertCommaToDot(REQUEST_POST('nl_charge')));
 
        ADMIN_SAVE_SETTINGS_POST();
 } else {
        // Prepare contants for the template
-       define('__CHARGE_VALUE'  , TRANSLATE_COMMA(getConfig('nl_charge'), false));
+       define('__CHARGE_VALUE'  , translateComma(getConfig('nl_charge'), false));
 
        // Prepare constants and load template
        LOAD_TEMPLATE("admin_config_newsletter", false);
index 30b3c530c4948cee04912f29a746643207115c32..584f71f5214c7ddccdf916e827f8e1d0fa3bf6a8 100644 (file)
@@ -93,19 +93,19 @@ if (IS_FORM_SENT()) {
        }
 
        switch (getConfig('repay_deleted_mails')) {
-               case "REPAY":
+               case 'REPAY':
                        define('_CFG_REPAY_POINTS_REPAY'  , ' selected="selected"');
                        define('_CFG_REPAY_POINTS_JACKPOT', '');
                        define('_CFG_REPAY_POINTS_SHRED'  , '');
                        break;
 
-               case "JACKPOT":
+               case 'JACKPOT':
                        define('_CFG_REPAY_POINTS_REPAY'  , '');
                        define('_CFG_REPAY_POINTS_JACKPOT', ' selected="selected"');
                        define('_CFG_REPAY_POINTS_SHRED'  , '');
                        break;
 
-               case "SHRED":
+               case 'SHRED':
                        define('_CFG_REPAY_POINTS_REPAY'  , '');
                        define('_CFG_REPAY_POINTS_JACKPOT', '');
                        define('_CFG_REPAY_POINTS_SHRED'  , ' selected="selected"');
index 8fc0b37a1c420aab3d250ac44657e53e935bd4e0..71971c0521d5b6f890c2bc96f885584e46182bb3 100644 (file)
@@ -52,11 +52,11 @@ ADD_DESCR('admin', __FILE__);
 // Stop saving data if one input field is !isset
 if (IS_FORM_SENT()) {
        // Calculate stamps and set calculated stamps
-       REQUEST_POST('online_timeout')        = CREATE_TIMESTAMP_FROM_SELECTIONS('ip_timeout'           , REQUEST_POST_ARRAY());
-       REQUEST_POST('url_tlock')             = CREATE_TIMESTAMP_FROM_SELECTIONS('url_tlock'            , REQUEST_POST_ARRAY());
-       REQUEST_POST('profile_lock')          = CREATE_TIMESTAMP_FROM_SELECTIONS('profile_lock'         , REQUEST_POST_ARRAY());
-       REQUEST_POST('profile_update')        = CREATE_TIMESTAMP_FROM_SELECTIONS('profile_update'       , REQUEST_POST_ARRAY());
-       REQUEST_SET_POST('resend_profile_update', CREATE_TIMESTAMP_FROM_SELECTIONS('resend_profile_update', REQUEST_POST_ARRAY()));
+       REQUEST_POST('online_timeout')        = createTimestampFromSelections('ip_timeout'           , REQUEST_POST_ARRAY());
+       REQUEST_POST('url_tlock')             = createTimestampFromSelections('url_tlock'            , REQUEST_POST_ARRAY());
+       REQUEST_POST('profile_lock')          = createTimestampFromSelections('profile_lock'         , REQUEST_POST_ARRAY());
+       REQUEST_POST('profile_update')        = createTimestampFromSelections('profile_update'       , REQUEST_POST_ARRAY());
+       REQUEST_SET_POST('resend_profile_update', createTimestampFromSelections('resend_profile_update', REQUEST_POST_ARRAY()));
 
        // Online-Timeout shall be > 0 or your database will crow and crow and crow...
        if (!REQUEST_ISSET_POST(('online_timeout')))        { REQUEST_UNSET_POST('ok'); }
@@ -85,11 +85,11 @@ if (IS_FORM_SENT()) {
        define('_CFG_MIN_AGE'    , getConfig('min_age'));
 
        // Time selection boxes
-       define('_CFG_ONLINE_TIMEOUT', CREATE_TIME_SELECTIONS(getConfig('online_timeout'), 'ip_timeout'           , 'ms'));
-       define('_CFG_URL_TLOCK'     , CREATE_TIME_SELECTIONS(getConfig('url_tlock')     , 'url_tlock'            , 'WDh'));
-       define('_CFG_PROFILE_LOCK'  , CREATE_TIME_SELECTIONS(getConfig('profile_lock')  , 'profile_lock'         , 'WDh'));
-       define('_CFG_PROFILE_UPDATE', CREATE_TIME_SELECTIONS(getConfig('profile_update'), 'profile_update'       , 'YM'));
-       define('_CFG_PROF_REUPDATE' , CREATE_TIME_SELECTIONS(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD'));
+       define('_CFG_ONLINE_TIMEOUT', createTimeSelections(getConfig('online_timeout'), 'ip_timeout'           , 'ms'));
+       define('_CFG_URL_TLOCK'     , createTimeSelections(getConfig('url_tlock')     , 'url_tlock'            , 'WDh'));
+       define('_CFG_PROFILE_LOCK'  , createTimeSelections(getConfig('profile_lock')  , 'profile_lock'         , 'WDh'));
+       define('_CFG_PROFILE_UPDATE', createTimeSelections(getConfig('profile_update'), 'profile_update'       , 'YM'));
+       define('_CFG_PROF_REUPDATE' , createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD'));
 
        if (getConfig('order_multi_page') != 'Y') {
                define('_CFG_ORDER_MULTI_N', ' chkecked="checked"');
index 79b6f1c6cc796a5c7209c6d541a0a35845269bf6..94ecd2f11d40e6f4eb021b4ce2054b122a1a80dd 100644 (file)
@@ -45,11 +45,12 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (REQUEST_ISSET_POST(('rate'))) REQUEST_SET_POST('rate', REVERT_COMMA(REQUEST_POST('rate')));
+
+if (REQUEST_ISSET_POST(('rate'))) REQUEST_SET_POST('rate', convertCommaToDot(REQUEST_POST('rate')));
 
 if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('title'))) && (REQUEST_POST('rate') > 0)) {
        // Add new payout type
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE type='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE type='%s' LIMIT 1",
                array(REQUEST_POST('title')), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Add now
@@ -79,10 +80,10 @@ VALUES ('%s', %d, %d,'%s','%s','%s','%s','%s','%s','%s')",
 }
 
 // Payout requests by your members
-$result_mem = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
+$result_mem = SQL_QUERY("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
 
 $display = true;
-if ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+if ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
        // Edit payout types
        if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == "ok")) {
                // Init SQLs
@@ -101,11 +102,11 @@ type='%s',
 rate=%s,
 min_points=%s,
 allow_url='%s'
-WHERE id='".$id."' LIMIT 1",
+WHERE `id`='".$id."' LIMIT 1",
  array(
        REQUEST_POST('title', $id),
-       REVERT_COMMA(REQUEST_POST('rate', $id)),
-       REVERT_COMMA(REQUEST_POST('mpoi' , $id)),
+       convertCommaToDot(REQUEST_POST('rate', $id)),
+       convertCommaToDot(REQUEST_POST('mpoi' , $id)),
        REQUEST_POST('allow', $id),
 ),__FILE__, __LINE__, false));
                        }
@@ -121,7 +122,7 @@ WHERE id='".$id."' LIMIT 1",
                $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('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",
+                       $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                        list($title, $rate, $mpoi, $allow) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -131,8 +132,8 @@ WHERE id='".$id."' LIMIT 1",
                                'sw'    => $SW,
                                'id'    => $id,
                                'title' => COMPILE_CODE($title),
-                               'rate'  => TRANSLATE_COMMA($rate),
-                               'mpoi'  => TRANSLATE_COMMA($mpoi),
+                               'rate'  => translateComma($rate),
+                               'mpoi'  => translateComma($mpoi),
                                'allow' => ADD_SELECTION('yn', $allow, "allow[".$id."]"),
                        );
 
@@ -147,7 +148,7 @@ WHERE id='".$id."' LIMIT 1",
                // Load main template
                LOAD_TEMPLATE("admin_config_payouts_edit");
        }
-} elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) {
        // Delete payout types
        if ((REQUEST_ISSET_GET('ok')) && (REQUEST_GET('ok') == "ok")) {
                // Init SQLs
@@ -155,7 +156,7 @@ WHERE id='".$id."' LIMIT 1",
 
                // Delete entries
                foreach (REQUEST_POST('sel') as $id => $sel) {
-                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1",
+                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__, false));
                } // END - foreach
 
@@ -172,7 +173,7 @@ WHERE id='".$id."' LIMIT 1",
                        $id = bigintval($id);
 
                        // Load data
-                       $result = SQL_QUERY_ESC("SELECT type, rate, min_points FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT type, rate, min_points FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
                                array($id), __FILE__, __LINE__);
                        list($title, $rate, $mpoi) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -182,8 +183,8 @@ WHERE id='".$id."' LIMIT 1",
                                'sw'    => $SW,
                                'id'    => $id,
                                'title' => COMPILE_CODE($title),
-                               'rate'  => TRANSLATE_COMMA($rate),
-                               'mpoi'  => TRANSLATE_COMMA($mpoi),
+                               'rate'  => translateComma($rate),
+                               'mpoi'  => translateComma($mpoi),
                        );
 
                        // Load row template and switch color
@@ -215,8 +216,8 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
                        'id'    => $content['id'],
                        'from'  => COMPILE_CODE($content['from_account']),
                        'type'  => COMPILE_CODE($content['type']),
-                       'rate'  => TRANSLATE_COMMA($content['rate']),
-                       'mpoi'  => TRANSLATE_COMMA($content['min_points']),
+                       'rate'  => translateComma($content['rate']),
+                       'mpoi'  => translateComma($content['min_points']),
                );
 
                // Load row template and switch color
index a13f1cdd2036cf63b9cfeb4922ce462657830152..874f8c79b9f610f946695a21b94e14d9fc4a6c17 100644 (file)
@@ -87,24 +87,24 @@ if (IS_FORM_SENT()) {
                        ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')");
                        break;
 
-               case "edit": // Change entries
+               case 'edit': // Change entries
                        foreach (REQUEST_POST('lvl') as $id => $value) {
                                // Secure ID
                                $id = bigintval($id);
 
                                // Revert german commata
-                               REQUEST_SET_POST(array('perc', $id), REVERT_COMMA(REQUEST_POST('perc', $id)));
+                               REQUEST_SET_POST(array('perc', $id), convertCommaToDot(REQUEST_POST('perc', $id)));
 
                                // Update entry
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE `id`=%s LIMIT 1",
                                        array(bigintval($value), REQUEST_POST('perc', $id), $id), __FILE__, __LINE__);
                        }
                        $message = getMessage('REF_DEPTHS_SAVED');
                        break;
 
-               case "del":
+               case 'del':
                        foreach (REQUEST_POST('id') as $id => $value) {
-                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                        }
                        $message = getMessage('REF_DEPTHS_DELETED');
@@ -143,7 +143,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
 
        if ((IS_SQLS_VALID()) && (IS_SQLS_VALID())) {
                if (strpos($GLOBALS['sqls'][0], "INSERT") > -1) {
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
                                array(bigintval(REQUEST_POST('lvl'))), __FILE__, __LINE__);
                        SQL_FREERESULT($result);
                } // END - if
@@ -188,8 +188,15 @@ WHERE mails_confirmed < %s", $REF, $REF));
 
        // One-time referal bonus add-mode
        switch (getConfig('reg_points_mode')) {
-               case "ref"   : define('__MODE_REF', ' chkecked="checked"'); define('__MODE_DIRECT', '');         break;
-               case "direct": define('__MODE_REF', '');         define('__MODE_DIRECT', ' chkecked="checked"'); break;
+               case 'ref'   :
+                       define('__MODE_REF', ' chkecked="checked"');
+                       define('__MODE_DIRECT', '');
+                       break;
+
+               case 'direct':
+                       define('__MODE_REF', '');
+                       define('__MODE_DIRECT', ' chkecked="checked"');
+                       break;
        }
 
        // Referal payout value
@@ -199,11 +206,11 @@ WHERE mails_confirmed < %s", $REF, $REF));
        LOAD_TEMPLATE("admin_config_point_settings");
 } elseif (REQUEST_GET('sub') == "ref") {
        // 12                  3     32    2                  3     32    2               3            4     43    21
-       if ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+       if ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST('sel')) && (countPostSelection() > 0)) {
                // Delete entries
                $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
-                       $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                        list($lvl, $perc) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -213,7 +220,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                                'sw'  => $SW,
                                'id'  => $id,
                                'lvl' => $lvl,
-                               'per' => TRANSLATE_COMMA($perc),
+                               'per' => translateComma($perc),
                        );
 
                        // Load row template and switch color
@@ -224,11 +231,11 @@ WHERE mails_confirmed < %s", $REF, $REF));
 
                // Load main template
                LOAD_TEMPLATE("admin_points_del");
-       } elseif ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+       } elseif ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('sel')) && (countPostSelection() > 0)) {
                // Edit entries
                $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
-                       $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE `id`=%s LIMIT 1",
                         array(bigintval($id)), __FILE__, __LINE__);
                        list($lvl, $perc) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
@@ -238,7 +245,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                                'sw'  => $SW,
                                'id'  => $id,
                                'lvl' => $lvl,
-                               'per' => TRANSLATE_COMMA($perc),
+                               'per' => translateComma($perc),
                        );
 
                        // Load row template and switch color
@@ -264,7 +271,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                                        'sw'  => $SW,
                                        'id'  => $content['id'],
                                        'lvl' => $content['level'],
-                                       'per' => TRANSLATE_COMMA($content['percents']),
+                                       'per' => translateComma($content['percents']),
                                );
 
                                // Load row template and switch color
index 87b725d80d1f2ea238f42982714ce6cbe040a947..09915021bdea7fac8b168a17cb9827cbaaef906e 100644 (file)
@@ -50,7 +50,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
        if (REQUEST_ISSET_POST(('add'))) {
                if ((REQUEST_ISSET_POST(('level'))) && ((REQUEST_ISSET_POST(('points'))) || (REQUEST_ISSET_POST(('info'))))) {
                        // Submitted data is valid, but maybe we already have this price level?
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s AND price_level='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s AND price_level='%s' LIMIT 1",
                                array(bigintval(REQUEST_GET('rallye')), bigintval(REQUEST_POST('level'))), __FILE__, __LINE__);
 
                        if (SQL_NUMROWS($result) == 0) {
@@ -74,11 +74,11 @@ VALUES ('%s','%s','%s','%s')",
                }
        } elseif (REQUEST_ISSET_POST('remove')) {
                // Check if at last one line is selected
-               $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+               $SEL = countPostSelection();
                if ($SEL > 0) {
                        // Delete selected entries
                        foreach (REQUEST_POST('sel') as $id => $sel) {
-                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                        }
 
@@ -94,7 +94,7 @@ VALUES ('%s','%s','%s','%s')",
                        $id = bigintval($id);
 
                        // Update entry
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_prices` SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_rallye_prices` SET rallye_id=%s, price_level='%s', points='%s', info='%s' WHERE `id`=%s LIMIT 1",
                                array(
                                        REQUEST_POST('rallye_id', $id),
                                        bigintval($level),
@@ -110,13 +110,13 @@ VALUES ('%s','%s','%s','%s')",
 
        if (REQUEST_ISSET_POST('edit')) {
                // Check if at last one line is selected
-               $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+               $SEL = countPostSelection();
                if ($SEL > 0) {
                        // Make selected editable
                        $OUT = ''; $SW = 2;
                        foreach (REQUEST_POST('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",
+                               $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                                list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
@@ -125,7 +125,7 @@ VALUES ('%s','%s','%s','%s')",
                                $content = array(
                                        'sw'      => $SW,
                                        'id'      => $id,
-                                       'rallyes' => ADD_OPTION_LINES("rallye_data", "id", "title", $rallye),
+                                       'rallyes' => generateOptionList("rallye_data", "id", "title", $rallye),
                                        'level'   => $level,
                                        'points'  => $points,
                                        'infos'   => $infos,
@@ -149,13 +149,13 @@ VALUES ('%s','%s','%s','%s')",
                }
        } elseif (REQUEST_ISSET_POST('del')) {
                // Check if at last one line is selected
-               $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+               $SEL = countPostSelection();
                if ($SEL > 0) {
                        // List all prices
                        $OUT = ''; $SW = 2;
                        foreach (REQUEST_POST('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",
+                               $result = SQL_QUERY_ESC("SELECT rallye_id, price_level, points, info FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                                list($rallye, $level, $points, $infos) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
@@ -252,10 +252,10 @@ WHERE d.admin_id=a.id ORDER BY start_time DESC", __FILE__, __LINE__);
                                'select'     => $select,
                                'title'      => $content['title'],
                                'aid'        => $content['admin_id'],
-                               'email_link' => CREATE_EMAIL_LINK($content['admin_id']),
+                               'email_link' => generateMemberEmailLink($content['admin_id']),
                                'alogin'     => $content['login'],
-                               'start'      => MAKE_DATETIME($content['start_time'], "3"),
-                               'end'        => MAKE_DATETIME($content['end_time'], "3"),
+                               'start'      => generateDateTime($content['start_time'], "3"),
+                               'end'        => generateDateTime($content['end_time'], "3"),
                        );
 
                        // Load row template and switch color
index 859a94eb73410004b6c9aa2b0bbde53660f3a224..1c92b3ba2a0820bc228c801840ea7926d347cf1a 100644 (file)
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
 // Do we want to save changes?
 if (IS_FORM_SENT()) {
        foreach (REQUEST_POST('sel') as $id => $value) {
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_must_register` SET field_required='%s' WHERE id=%s AND field_required != '%s' LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_must_register` SET field_required='%s' WHERE `id`=%s AND field_required != '%s' LIMIT 1",
                        array($value, bigintval($id), $value),__FILE__, __LINE__);
        }
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('REGISTER_ADMIN_CHANGES_SAVED'));
index b28e8fa5f95e564552d2a27e0dfc153b7e0ca202..e5650dc474b3e6a61ff3571103fd7076045405c9 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // Calculate timestamp from selections...
-       REQUEST_SET_POST('ip_timeout', CREATE_TIMESTAMP_FROM_SELECTIONS("ip_timeout", REQUEST_POST_ARRAY()));
+       REQUEST_SET_POST('ip_timeout', createTimestampFromSelections('ip_timeout', REQUEST_POST_ARRAY()));
        REQUEST_SET_POST('least_cats', round(REQUEST_POST('least_cats')));
 
        // Save settings
@@ -50,14 +50,14 @@ if (IS_FORM_SENT()) {
 } else {
        // Remember stuff in constants
        define('LEAST_CATS_VALUE'   , round(getConfig('least_cats')));
-       define('__CFG_SHOW_REFID'   , ADD_SELECTION('yn', getConfig('display_refid')   , "display_refid"));
-       define('__TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('ip_timeout')   , "ip_timeout", "Dhm"));
-       define('__CFG_DBL_EMAIL'    , ADD_SELECTION('yn', getConfig('check_double_email')       , "check_double_email"));
-       define('__CFG_DBL_PASS'     , ADD_SELECTION('yn', getConfig('check_double_pass')        , "check_double_pass"));
-       define('__CFG_CAT_DEFAULT'  , ADD_SELECTION('yn', getConfig('register_default'), "register_default"));
+       define('__CFG_SHOW_REFID'   , ADD_SELECTION('yn', getConfig('display_refid')     , 'display_refid'));
+       define('__TIMEOUT_SELECTION', createTimeSelections(getConfig('ip_timeout')     , 'ip_timeout', 'Dhm'));
+       define('__CFG_DBL_EMAIL'    , ADD_SELECTION('yn', getConfig('check_double_email'), 'check_double_email'));
+       define('__CFG_DBL_PASS'     , ADD_SELECTION('yn', getConfig('check_double_pass') , 'check_double_pass'));
+       define('__CFG_CAT_DEFAULT'  , ADD_SELECTION('yn', getConfig('register_default')  , 'register_default'));
 
        // Load normal template
-       LOAD_TEMPLATE("admin_config_register2");
+       LOAD_TEMPLATE('admin_config_register2');
 }
 
 //
index d06af5e61232bca2cd3cfef5e4f584556b2930b5..111e06c2eed9d06502d7dd130688ac1e093b70c0 100644 (file)
@@ -57,7 +57,7 @@ if (IS_FORM_SENT()) {
        }
 
        // Implode array to string and remove posted mod array
-       REQUEST_SET_POST('rewrite_skip', implode(":", $MODs));
+       REQUEST_SET_POST('rewrite_skip', implode(':', $MODs));
        REQUEST_UNSET_POST('mod');
 
        // Save settings
index cfcc3c8b0481af858905ad78d26def292a9f9388..b6d4f6425c44cefd102796d7cf5a99c938804064 100644 (file)
@@ -46,15 +46,15 @@ ADD_DESCR('admin', __FILE__);
 
 if (IS_FORM_SENT()) {
        // If salt length is empty or null then we shall generate new passwords
-       if (!REQUEST_ISSET_POST(('salt_length')) || (REQUEST_POST('salt_length') == "0")) {
+       if (!REQUEST_ISSET_POST(('salt_length')) || (REQUEST_POST('salt_length') == '0')) {
                // Generate new passwords for all!
-               LOAD_INC('inc/gen_sql_patches.php');
+               loadInclude('inc/gen_sql_patches.php');
 
                // Forget the wrong number!
                REQUEST_UNSET_POST(('salt_length'));
 
                // Redirect to logout link
-               LOAD_URL('modules.php?module=admin&logout=1');
+               redirectToUrl('modules.php?module=admin&logout=1');
        } // END - if
 
        // Save settings
index ac629fb3f57694d4ae1953393f1c28cf69e3cf20..ee4f738d1dfe04e500e082dc897068d4cb0eec16 100644 (file)
@@ -48,32 +48,32 @@ ADD_DESCR('admin', __FILE__);
 // Was the form submitted?
 if (IS_FORM_SENT()) {
        // Replace german decimal comma with computer decimal dot
-       if (REQUEST_ISSET_POST(('surfbar_static_reward')))   REQUEST_SET_POST('surfbar_static_reward'  , REVERT_COMMA(REQUEST_POST('surfbar_static_reward')));
-       if (REQUEST_ISSET_POST(('surfbar_static_costs')))    REQUEST_SET_POST('surfbar_static_costs'   , REVERT_COMMA(REQUEST_POST('surfbar_static_costs')));
-       if (REQUEST_ISSET_POST(('surfbar_dynamic_percent'))) REQUEST_SET_POST('surfbar_dynamic_percent', REVERT_COMMA(REQUEST_POST('surfbar_dynamic_percent')));
+       if (REQUEST_ISSET_POST(('surfbar_static_reward')))   REQUEST_SET_POST('surfbar_static_reward'  , convertCommaToDot(REQUEST_POST('surfbar_static_reward')));
+       if (REQUEST_ISSET_POST(('surfbar_static_costs')))    REQUEST_SET_POST('surfbar_static_costs'   , convertCommaToDot(REQUEST_POST('surfbar_static_costs')));
+       if (REQUEST_ISSET_POST(('surfbar_dynamic_percent'))) REQUEST_SET_POST('surfbar_dynamic_percent', convertCommaToDot(REQUEST_POST('surfbar_dynamic_percent')));
 
        // Save settings
        ADMIN_SAVE_SETTINGS_POST();
 } else {
        // Prepare content
        $content = array(
-               'surfbar_static_reward'   => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
-               'surfbar_static_costs'    => TRANSLATE_COMMA(getConfig('surfbar_static_costs')),
-               'surfbar_static_time'     => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_time')   , "surfbar_static_time"   , "ms" , "left"),
-               'surfbar_static_lock'     => CREATE_TIME_SELECTIONS(getConfig('surfbar_static_lock')   , "surfbar_static_lock"   , "hm" , "left"),
-               'surfbar_restart_time'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_restart_time')  , "surfbar_restart_time"  , "ms" , "left"),
-               'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
+               'surfbar_static_reward'   => translateComma(getConfig('surfbar_static_reward')),
+               'surfbar_static_costs'    => translateComma(getConfig('surfbar_static_costs')),
+               'surfbar_static_time'     => createTimeSelections(getConfig('surfbar_static_time')   , 'surfbar_static_time'   , 'ms' , 'left'),
+               'surfbar_static_lock'     => createTimeSelections(getConfig('surfbar_static_lock')   , 'surfbar_static_lock'   , 'hm' , 'left'),
+               'surfbar_restart_time'    => createTimeSelections(getConfig('surfbar_restart_time')  , 'surfbar_restart_time'  , 'ms' , 'left'),
+               'surfbar_dynamic_percent' => translateComma(getConfig('surfbar_dynamic_percent')),
                'surfbar_max_order'       => getConfig('surfbar_max_order'),
-               'surfbar_stats_reload'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_stats_reload')  , "surfbar_stats_reload"  , "ms" , "left"),
-               'surfbar_purge_deleted'   => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_deleted') , "surfbar_purge_deleted" , "WDh", "left"),
-               'surfbar_purge_migrated'  => CREATE_TIME_SELECTIONS(getConfig('surfbar_purge_migrated'), "surfbar_purge_migrated", "WDh", "left"),
+               'surfbar_stats_reload'    => createTimeSelections(getConfig('surfbar_stats_reload')  , 'surfbar_stats_reload'  , 'ms' , 'left'),
+               'surfbar_purge_deleted'   => createTimeSelections(getConfig('surfbar_purge_deleted') , 'surfbar_purge_deleted' , 'WDh', 'left'),
+               'surfbar_purge_migrated'  => createTimeSelections(getConfig('surfbar_purge_migrated'), 'surfbar_purge_migrated', 'WDh', 'left'),
                'surfbar_pause_url'       => getConfig('surfbar_pause_url'),
                'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'),
-               'surfbar_low_interval'    => CREATE_TIME_SELECTIONS(getConfig('surfbar_low_interval')  , "surfbar_low_interval"  , "WDh", "left"),
+               'surfbar_low_interval'    => createTimeSelections(getConfig('surfbar_low_interval')  , 'surfbar_low_interval'  , 'WDh', 'left'),
        );
 
        // Prepare payment model for template
-       if (getConfig('surfbar_pay_model') == "STATIC") {
+       if (getConfig('surfbar_pay_model') == 'STATIC') {
                // Static model
                define('__CONFIG_SURFBAR_PAY_MODEL_STATIC' , ' chkecked="checked"');
                define('__CONFIG_SURFBAR_PAY_MODEL_DYNAMIC', '');
@@ -128,7 +128,7 @@ if (IS_FORM_SENT()) {
        }
 
        // Pause URL mode
-       if (getConfig('surfbar_pause_mode') == "INTERNAL") {
+       if (getConfig('surfbar_pause_mode') == 'INTERNAL') {
                // Internal pause page
                define('__CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', ' chkecked="checked"');
                define('__CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', '');
@@ -139,7 +139,7 @@ if (IS_FORM_SENT()) {
        }
 
        // Notification mode
-       if (getConfig('surfbar_notification_mode') == "INSTANT") {
+       if (getConfig('surfbar_notification_mode') == 'INSTANT') {
                // Instant notification
                define('__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', ' selected="selected"');
                define('__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET'  , '');
@@ -150,7 +150,7 @@ if (IS_FORM_SENT()) {
        }
 
        // Load template
-       LOAD_TEMPLATE("admin_config_surfbar", false, $content);
+       LOAD_TEMPLATE('admin_config_surfbar', false, $content);
 }
 
 //
index 26216dda532f0fc1f840cd576c8aae2b16e1d799..08969d6d12f2bc4056d17e23c35eff6a6a1776c4 100644 (file)
@@ -69,8 +69,8 @@ switch (getConfig('ap_transfer')) {
 }
 
 // Time selection box
-define('__TRANS_AGE_SELECTION'    , CREATE_TIME_SELECTIONS(getConfig('transfer_age'), "transfer_age", "MWDh"));
-define('__TRANS_TIMEOUT_SELECTION', CREATE_TIME_SELECTIONS(getConfig('transfer_timeout'), "transfer_timeout", "MWDh"));
+define('__TRANS_AGE_SELECTION'    , createTimeSelections(getConfig('transfer_age'), "transfer_age", "MWDh"));
+define('__TRANS_TIMEOUT_SELECTION', createTimeSelections(getConfig('transfer_timeout'), "transfer_timeout", "MWDh"));
 
 // Load template
 LOAD_TEMPLATE("admin_config_transfer");
index f174499163d70f0290ccabca5cb6f3a5a91261bc..ccd6fbfbc5960633418c3b3911374f64851c3e6c 100644 (file)
@@ -53,7 +53,7 @@ if (IS_FORM_SENT()) {
        if (WERNIS_TEST_API()) {
                // Revert german commata
                foreach (array('payout_factor', 'withdraw_factor', 'payout_fee_percent', 'withdraw_fee_percent') as $revert) {
-                       REQUEST_SET_POST('wernis_'.$revert, REVERT_COMMA(REQUEST_POST('wernis_'.$revert)));
+                       REQUEST_SET_POST('wernis_'.$revert, convertCommaToDot(REQUEST_POST('wernis_'.$revert)));
                } // END - if
 
                // Hash the password and remove clear-text
@@ -75,10 +75,10 @@ if (IS_FORM_SENT()) {
                'api_md5'              => getConfig('wernis_api_md5'),
                'api_url'              => getConfig('wernis_api_url'),
                'refid'                => getConfig(('wernis_refid')),
-               'payout_factor'        => TRANSLATE_COMMA(getConfig('wernis_payout_factor')),
-               'withdraw_factor'      => TRANSLATE_COMMA(getConfig('wernis_withdraw_factor')),
-               'payout_fee_percent'   => TRANSLATE_COMMA(getConfig('wernis_payout_fee_percent')),
-               'withdraw_fee_percent' => TRANSLATE_COMMA(getConfig('wernis_withdraw_fee_percent')),
+               'payout_factor'        => translateComma(getConfig('wernis_payout_factor')),
+               'withdraw_factor'      => translateComma(getConfig('wernis_withdraw_factor')),
+               'payout_fee_percent'   => translateComma(getConfig('wernis_payout_fee_percent')),
+               'withdraw_fee_percent' => translateComma(getConfig('wernis_withdraw_fee_percent')),
                'payout_fee_fix'       => getConfig(('wernis_payout_fee_fix')),
                'withdraw_fee_fix'     => getConfig(('wernis_withdraw_fee_fix'))
        );
index ab5b4dc8bced2d112dcf85490f675408b1345d10..b5a3fedd71c5ff454768cc46bf6b145d265dada7 100644 (file)
@@ -48,7 +48,7 @@ $cnt = 0;
 
 if (REQUEST_ISSET_GET(('mid'))) {
        // Load email data
-       $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT id, sender, subject, url, timestamp, payment_id FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
 
        // Delete mail only once
@@ -58,14 +58,14 @@ if (REQUEST_ISSET_GET(('mid'))) {
                SQL_FREERESULT($result);
 
                // Get points we shall pay back per mail
-               $price = GET_PAY_POINTS($payId, "price");
+               $price = getPaymentPoints($payId, 'price');
 
                // Prepare data for the template
                define('__ID'     , $id);
-               define('__SENDER' , ADMIN_USER_PROFILE_LINK($sender));
+               define('__SENDER' , generateUserProfileLink($sender));
                define('__SUBJECT', $subject);
                define('__URL'    , DEREFERER($url));
-               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+               define('__ORDERED', generateDateTime($timestamp, '0'));
 
                // Load template
                LOAD_TEMPLATE("admin_del_email_normal");
@@ -75,7 +75,7 @@ if (REQUEST_ISSET_GET(('mid'))) {
 
                // Load email template and send the email away
                $msg_user = LOAD_EMAIL_TEMPLATE("order-deleted", array(), $sender);
-               SEND_EMAIL($sender, getMessage('MEMBER_ORDER_DELETED'), $msg_user);
+               sendEmail($sender, getMessage('MEMBER_ORDER_DELETED'), $msg_user);
 
                // Fetch right stats_id from pool
                $result_pool = SQL_QUERY_ESC("SELECT s.id FROM `{!_MYSQL_PREFIX!}_user_stats` AS s
@@ -91,35 +91,35 @@ WHERE s.pool_id=%s LIMIT 1",
                        $links = GET_TOTAL_DATA($stats_id, "user_links", 'userid', "stats_id", true);
 
                        // Reset sent mails for recipient(s)
-                       REDUCED_RECIPIENT_RECEIVED_MAILS("stats_id", REQUEST_GET('mid'), $links);
+                       reduceRecipientReceivedMails("stats_id", REQUEST_GET('mid'), $links);
 
                        // Calc total points and pay them back
                        $totalPoints = $links * $price;
 
                        // Shall we pay the points back to the user?
-                       if (getConfig('repay_deleted_mails') != "SHRED") {
-                               //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
+                       if (getConfig('repay_deleted_mails') != 'SHRED') {
+                               //* DEBUG: */ echo $stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />\n";
                                if ($totalPoints > 0) {
                                        // Shall we payback to user or jackpot?
-                                       if (getConfig('repay_deleted_mails') == "JACKPOT") {
+                                       if (getConfig('repay_deleted_mails') == 'JACKPOT') {
                                                // Set jackpot
                                                $sender = 0;
                                        } // END - if
 
                                        // Pay back points
                                        //* DEBUG: */ echo "PAYBACK:".$sender."<br />\n";
-                                       ADD_POINTS_REFSYSTEM("mail_deleted", $sender, $totalPoints, true, "0", false,"direct");
+                                       ADD_POINTS_REFSYSTEM('mail_deleted', $sender, $totalPoints, true, '0', false,'direct');
 
                                        // Output message
-                                       if (getConfig('repay_deleted_mails') == "REPAY") {
+                                       if (getConfig('repay_deleted_mails') == 'REPAY') {
                                                // Repayed
                                                LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_POINTS_REPAYED'),
-                                                       TRANSLATE_COMMA($totalPoints)
+                                                       translateComma($totalPoints)
                                                ));
                                        } else {
                                                // To jackpot
                                                LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_POINTS_TO_JACKPOT'),
-                                                       TRANSLATE_COMMA($totalPoints)
+                                                       translateComma($totalPoints)
                                                ));
                                        }
                                } else {
@@ -144,7 +144,7 @@ WHERE s.pool_id=%s LIMIT 1",
                SQL_FREERESULT($result_pool);
 
                // Delete mail from queue
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                        array(bigintval(REQUEST_GET('mid'))), __FILE__, __LINE__);
                $cnt += SQL_AFFECTEDROWS();
 
@@ -163,7 +163,7 @@ WHERE s.pool_id=%s LIMIT 1",
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_USER_STATS_REMOVED'));
 } elseif ((REQUEST_ISSET_GET(('bid'))) && (EXT_IS_ACTIVE('bonus'))) {
        // Load data from bonus mail
-       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s",
+       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
                array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
 
        // Delete mail only once
@@ -172,13 +172,13 @@ WHERE s.pool_id=%s LIMIT 1",
                list ($id, $subject, $url, $timestamp, $sent) = SQL_FETCHROW($result);
 
                // Reset sent mails for recipient(s)
-               REDUCED_RECIPIENT_RECEIVED_MAILS('bonus_id', REQUEST_GET('bid'), $sent);
+               reduceRecipientReceivedMails('bonus_id', REQUEST_GET('bid'), $sent);
 
                // Init counter for deleted mails
                $cnt = 0;
 
                // Delete bonus mail entirely from database
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                        array(bigintval(REQUEST_GET('bid'))), __FILE__, __LINE__);
                $cnt += SQL_AFFECTEDROWS();
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
@@ -189,7 +189,7 @@ WHERE s.pool_id=%s LIMIT 1",
                define('__ID'     , $id);
                define('__SUBJECT', $subject);
                define('__URL'    , DEREFERER($url));
-               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+               define('__ORDERED', generateDateTime($timestamp, '0'));
                define('__CNT'    , $cnt);
 
                // Load template
@@ -203,7 +203,7 @@ WHERE s.pool_id=%s LIMIT 1",
        SQL_FREERESULT($result);
 } elseif ((REQUEST_ISSET_GET(('nid'))) && (GET_EXT_VERSION('bonus') >= '0.8.7')) {
        // Load data from bonus mail
-       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s",
+       $result = SQL_QUERY_ESC("SELECT id, subject, url, timestamp FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s",
                array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
 
        // Delete mail only once
@@ -216,7 +216,7 @@ WHERE s.pool_id=%s LIMIT 1",
                $cnt = 0;
 
                // Delete bonus mail entirely from database
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                        array(bigintval(REQUEST_GET('nid'))), __FILE__, __LINE__);
                $cnt += SQL_AFFECTEDROWS();
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s",
@@ -227,7 +227,7 @@ WHERE s.pool_id=%s LIMIT 1",
                define('__ID'     , $id);
                define('__SUBJECT', $subject);
                define('__URL'    , DEREFERER($url));
-               define('__ORDERED', MAKE_DATETIME($timestamp, "0"));
+               define('__ORDERED', generateDateTime($timestamp, '0'));
                define('__CNT'    , $cnt);
 
                // Load template
index e28913976a9583a79912f5edae4a10cc43f71e77..c1f8af8e7649d2a3a75a6496de0df9803deb6f78 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__);
 
 // Check for selected holidays
 $SUM = 0;
-if (REQUEST_ISSET_POST('sel')) $SUM = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $SUM = countPostSelection();
 
 // Shall I delete selected holidays???
 if ($SUM > 0)
@@ -59,7 +59,7 @@ if ($SUM > 0)
                // Get the userid
                $result = SQL_QUERY_ESC("SELECT userid, holiday_start, holiday_end
 FROM `{!_MYSQL_PREFIX!}_user_holidays`
-WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1)
                {
                        // Load data and free memory
@@ -73,17 +73,17 @@ WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__);
 
                        // Remove holiday
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_holidays`
-WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
 
                        // Prepare loaded data for the
                        $content = array(
-                               'start' => MAKE_DATETIME($start, "3"),
-                               'end'   => MAKE_DATETIME($end  , "3")
+                               'start' => generateDateTime($start, "3"),
+                               'end'   => generateDateTime($end  , "3")
                        );
 
                        // Send email to user
                        $msg = LOAD_EMAIL_TEMPLATE("member_holiday_removed", $content, $uid);
-                       SEND_EMAIL($uid, getMessage('HOLIDAY_ADMIN_REMOVED_SUBJ'), $msg);
+                       sendEmail($uid, getMessage('HOLIDAY_ADMIN_REMOVED_SUBJ'), $msg);
                        $cnt++;
                }
        }
@@ -106,7 +106,7 @@ WHERE userid=%s LIMIT 1", array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE
 
                // Send email to user
                $msg = LOAD_EMAIL_TEMPLATE("member_holiday_removed", $content, REQUEST_GET('uid'));
-               SEND_EMAIL(REQUEST_GET('uid'), getMessage('HOLIDAY_ADMIN_REMOVED_SUBJ'), $msg);
+               sendEmail(REQUEST_GET('uid'), getMessage('HOLIDAY_ADMIN_REMOVED_SUBJ'), $msg);
 
                // Set message
                $message = getMessage('HOLIDAY_ADMIN_SINGLE_DELETED');
index f12da4ae2b13e0e81a0632edca532d6f6ab8310e..06b6242446faa0fc5fc50166f1375af8ea66cbf0 100644 (file)
@@ -45,9 +45,9 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (REQUEST_ISSET_GET(('id'))) {
+if (REQUEST_ISSET_GET('id')) {
        // Check for selected sponsor
-       $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT email, gender, surname, family FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
                array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Remove sponsor
@@ -59,16 +59,16 @@ if (REQUEST_ISSET_GET(('id'))) {
                        SQL_FREERESULT($result);
 
                        define('__EMAIL'  , $email);
-                       define('__GENDER'  , TRANSLATE_GENDER($gender));
+                       define('__GENDER'  , translateGender($gender));
                        define('__SURNAME', $surname);
                        define('__FAMILY' , $family);
 
                        // Prepare message and send it away
                        $msg = LOAD_EMAIL_TEMPLATE("del_sponsor", REQUEST_POST('reason'), bigintval(REQUEST_GET('id')));
-                       SEND_EMAIL($email, getMessage('ADMIN_SPONSOR_DEL_SUBJECT'), $msg);
+                       sendEmail($email, getMessage('ADMIN_SPONSOR_DEL_SUBJECT'), $msg);
 
                        // Remove account
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
                                array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
 
                        // Remove orders
@@ -79,7 +79,7 @@ if (REQUEST_ISSET_GET(('id'))) {
                        LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_SPONSOR_DELETED'), bigintval(REQUEST_GET('id'))));
                } elseif (REQUEST_ISSET_POST(('no'))) {
                        // Do not delete him...
-                       LOAD_URL('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
+                       redirectToUrl('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
                } else {
                        // Load data
                        list ($email, $gender, $sname, $fname) = SQL_FETCHROW($result);
@@ -88,7 +88,7 @@ if (REQUEST_ISSET_GET(('id'))) {
                        define('__EMAIL' , $email);
                        define('__SNAME' , $sname);
                        define('__FNAME' , $fname);
-                       define('__GENDER', TRANSLATE_GENDER($gender));
+                       define('__GENDER', translateGender($gender));
                        define('__UID'   , bigintval(REQUEST_GET('id')));
 
                        // Display form
index 15b0265d8f8162edb14925db4004e3ef5cfd9044..9cc0a1b92ca57fe1c7eb5bf9cff9c971cc7fa9fa 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__);
 
 if (REQUEST_ISSET_POST('del')) {
        // Delete entries from tables
-       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+       $SEL = countPostSelection();
        if ($SEL > 0) {
                // Init SQLs
                INIT_SQLS();
@@ -77,11 +77,11 @@ if (SQL_NUMROWS($result) > 0) {
                $content = array(
                        'sw'       => $SW,
                        'idx'      => $content['trans_id'],
-                       'stamp'    => MAKE_DATETIME($content['time_trans'], "3"),
-                       'uid_from' => ADMIN_USER_PROFILE_LINK($content['userid']),
-                       'uid_to'   => ADMIN_USER_PROFILE_LINK($content['to_uid']),
+                       'stamp'    => generateDateTime($content['time_trans'], "3"),
+                       'uid_from' => generateUserProfileLink($content['userid']),
+                       'uid_to'   => generateUserProfileLink($content['to_uid']),
                        'reason'   => $content['reason'],
-                       'points'   => TRANSLATE_COMMA($content['points']),
+                       'points'   => translateComma($content['points']),
                );
 
                // Load row template
index 6275cc15b0a9b8579c1e02702fc5bbf3b8667d28..bc5cde104ab3d454a733fc4342c94d31191f8fb0 100644 (file)
@@ -55,7 +55,7 @@ if ((IS_FORM_SENT()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('re
                SQL_FREERESULT($result_user);
 
                // Delete user account
-               DELETE_USER_ACCOUNT(REQUEST_GET('uid'), REQUEST_POST('reason'));
+               deleteUserAccount(REQUEST_GET('uid'), REQUEST_POST('reason'));
 
                // Output message
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_DEL_COMPLETED'));
@@ -65,7 +65,7 @@ if ((IS_FORM_SENT()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('re
        }
 } elseif (REQUEST_ISSET_POST(('no'))) {
        // Do not delete him...
-       LOAD_URL(ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid')));
+       redirectToUrl(ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid')));
 } elseif (!REQUEST_ISSET_GET('uid')) {
        // Output selection form with all confirmed user accounts listed
        ADD_MEMBER_SELECTION_BOX();
@@ -80,7 +80,7 @@ if ((IS_FORM_SENT()) || ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST(('re
 
                // Prepare content
                $content = array(
-                       'email'   => CREATE_EMAIL_LINK($email, "user_data"),
+                       'email'   => generateMemberEmailLink($email, "user_data"),
                        'surname' => $sname,
                        'family'  => $fname,
                        'header'  => sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), REQUEST_GET('uid')),
index 1ce7fa94a68fadda7d85e131a1837b33249e7dcd..3ac617bee570beab991fef8cfe8b7b1755410868 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if ((IS_FORM_SENT()) && (!REQUEST_ISSET_POST(('id')))) {
+if ((IS_FORM_SENT()) && (!REQUEST_ISSET_POST('id'))) {
        REQUEST_UNSET_POST('ok');
 }
 
@@ -53,7 +53,7 @@ $result = SQL_QUERY("SELECT id, sender, subject, payment_id, cat_id FROM `{!_MYS
 if (SQL_NUMROWS($result) > 0) {
        if (IS_FORM_SENT()) {
                // Make mail editable...
-               $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT subject, text, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                 array(bigintval(REQUEST_POST('id'))), __FILE__, __LINE__);
                list($subj, $text, $url) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -71,7 +71,7 @@ if (SQL_NUMROWS($result) > 0) {
 subject='%s',
 text='%s',
 url='%s'
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
  array(
        REQUEST_POST('subj'),
        REQUEST_POST('text'),
@@ -97,9 +97,9 @@ WHERE id=%s LIMIT 1",
                                'sw'   => $SW,
                                'id'   => $content['id'],
                                'subj' => $content['subject'],
-                               'uid'  => ADMIN_USER_PROFILE_LINK($content['sender']),
-                               'pay'  => GET_PAYMENT($content['payment_id']),
-                               'cat'  => GET_CATEGORY($content['cat_id']),
+                               'uid'  => generateUserProfileLink($content['sender']),
+                               'pay'  => getPaymentTitlePrice($content['payment_id']),
+                               'cat'  => getCategory($content['cat_id']),
                        );
 
                        // Load row template and switch colors
index f0cde3f762975400f64b840868975bb3b53c6170..747d4728a58412ea065d18dca6cf4059eae61488 100644 (file)
@@ -45,9 +45,9 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
+if ((REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('mode')))) {
        // Check for selected sponsor
-       $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, receive_warnings, warning_interval FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
         array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Load sponsor details
@@ -97,7 +97,7 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
                define('__URL'        , $DATA['url']);
                //  Warning because low points
                define('__REC_WARNING', ADD_SELECTION('yn', $DATA['receive_warnings'], "receive_warning"));
-               define('__INTERVAL'   , CREATE_TIME_SELECTIONS($DATA['warning_interval'], "warning_interval", "MWDh"));
+               define('__INTERVAL'   , createTimeSelections($DATA['warning_interval'], "warning_interval", "MWDh"));
 
                // Init variables here
                $TPL = sprintf("admin_edit_sponsor_%s", REQUEST_GET(('mode')));
@@ -111,19 +111,19 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
                        case "add_points": // Add points
                                if (strval(REQUEST_POST('points')) > 0) {
                                        // Replace german decimal comma with computer's decimal dot
-                                       $POINTS = strval(REVERT_COMMA(REQUEST_POST('points')));
+                                       $POINTS = strval(convertCommaToDot(REQUEST_POST('points')));
 
                                        // Add points to account
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_amount=points_amount+%s WHERE `id`='%s' LIMIT 1",
                                                array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
 
                                        // Remember points /reason for the template
-                                       define('__POINTS' , TRANSLATE_COMMA($POINTS));
+                                       define('__POINTS' , translateComma($POINTS));
                                        define('__REASON' , REQUEST_POST('reason'));
 
                                        // Send email
                                        $msg = LOAD_EMAIL_TEMPLATE("sponsor_add_points", REQUEST_POST('reason'), true);
-                                       SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_ADD_POINTS_SUBJ, $msg);
+                                       sendEmail(__EMAIL, ADMIN_SPONSOR_ADD_POINTS_SUBJ, $msg);
                                        $message = ADMIN_SPONSOR_POINTS_ADDED;
                                } else {
                                        // No points entered to add!
@@ -134,19 +134,19 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
                        case "sub_points": // Subtract points
                                if (strval(REQUEST_POST('points')) > 0) {
                                        // Replace german decimal comma with computer's decimal dot
-                                       $POINTS = strval(REVERT_COMMA(REQUEST_POST('points')));
+                                       $POINTS = strval(convertCommaToDot(REQUEST_POST('points')));
 
                                        // Add points to account
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_used=points_used+%s WHERE id='%s' LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET points_used=points_used+%s WHERE `id`='%s' LIMIT 1",
                                                array($POINTS, bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
 
                                        // Remember points /reason for the template
-                                       define('__POINTS' , TRANSLATE_COMMA($POINTS));
+                                       define('__POINTS' , translateComma($POINTS));
                                        define('__REASON' , REQUEST_POST('reason'));
 
                                        // Send email
                                        $msg = LOAD_EMAIL_TEMPLATE("sponsor_sub_points", REQUEST_POST('reason'), true);
-                                       SEND_EMAIL(__EMAIL, ADMIN_SPONSOR_SUB_POINTS_SUBJ, $msg);
+                                       sendEmail(__EMAIL, ADMIN_SPONSOR_SUB_POINTS_SUBJ, $msg);
                                        $message = ADMIN_SPONSOR_POINTS_SUBTRACTED;
                                } else {
                                        // No points entered to add!
@@ -154,7 +154,7 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
                                }
                                break;
 
-                       case "edit": // Edit sponsor account
+                       case 'edit': // Edit sponsor account
                                $PASS = true;
                                if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) || ((!REQUEST_ISSET_POST(('pass1'))) && (!REQUEST_ISSET_POST(('pass1'))))) {
                                        // Remove passwords
@@ -165,20 +165,20 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
 
                                // Convert time selection
                                $DATA = array(); $id = "warning_interval_ye"; $skip = false;
-                               CONVERT_SELECTIONS_TO_TIMESTAMP(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
+                               convertSelectionsToTimestamp(REQUEST_POST_ARRAY(), $DATA, $id, $skip);
 
                                // Save the sponsor
                                SPONSOR_HANDLE_SPONSOR(REQUEST_POST_ARRAY());
 
                                // Convert some data for the email template
-                               REQUEST_POST('gender'          , TRANSLATE_GENDER(REQUEST_POST('gender')));
-                               REQUEST_POST('warning_interval', CREATE_FANCY_TIME(REQUEST_POST('warning_interval')));
+                               REQUEST_POST('gender'          , translateGender(REQUEST_POST('gender')));
+                               REQUEST_POST('warning_interval', createFancyTime(REQUEST_POST('warning_interval')));
 
                                if (!$PASS) REQUEST_SET_POST('pass1', getMessage('SPONSOR_PASS_UNCHANGED'));
 
                                // Load email template and send the mail away
                                $msg = LOAD_EMAIL_TEMPLATE("admin_sponsor_edit", REQUEST_POST_ARRAY(), false);
-                               SEND_EMAIL(REQUEST_POST('email'), getMessage('ADMIN_SPONSOR_EDIT_SUBJECT'), $msg);
+                               sendEmail(REQUEST_POST('email'), getMessage('ADMIN_SPONSOR_EDIT_SUBJECT'), $msg);
                                break;
 
                        default: // Unknown mode
@@ -191,7 +191,7 @@ if ((REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('mode')))) {
                                // Output message
                                LOAD_TEMPLATE('admin_settings_saved', false, $message);
                        } // END - if
-               } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", constant('PATH'), GET_LANGUAGE(), $TPL))) {
+               } elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", constant('PATH'), getLanguage(), $TPL))) {
                        // Create mailto link
                        define('__SPONSOR_VALUE', "<a href=\"mailto:{!__EMAIL!}\">{!__SURNAME!} {!__FAMILY!}</a>");
 
index 57e51bd49763b572422db031ecfebc7fd0a4dc51..961edaec7e49d140959019b1dde541685115ec58 100644 (file)
@@ -101,19 +101,19 @@ if (SQL_NUMROWS($result) > 0) {
                // Prepare data for the row template
                $content = array(
                        'sw'          => $SW,
-                       'u_link'      => ADMIN_USER_PROFILE_LINK($pool[1]),
+                       'u_link'      => generateUserProfileLink($pool[1]),
                        'subj'        => COMPILE_CODE($pool[2]),
                        'text'        => COMPILE_CODE($pool[3]),
-                       'pay'         => GET_PAYMENT($pool[5]),
-                       'cat'         => GET_CATEGORY($pool[10]),
+                       'pay'         => getPaymentTitlePrice($pool[5]),
+                       'cat'         => getCategory($pool[10]),
                        'sent'        => $sent,
                        'ruids'       => str_replace(';', ", ", $pool[4]),
                        'unconfirmed' => $unconfirmed,
-                       'type'        => TRANSLATE_POOL_TYPE($pool[6]),
+                       'type'        => translatePoolType($pool[6]),
                        'tsend'       => $pool[9],
                        'frametester' => FRAMETESTER($pool[8]),
                        'url'         => COMPILE_CODE($pool[8]),
-                       'stamp'       => MAKE_DATETIME($pool[7], "0"),
+                       'stamp'       => generateDateTime($pool[7], '0'),
                        'mid'         => $pool[0],
                );
 
index 88c24a0096b11b9801ce64a81300cd16eb8e30ad..8b1a87da3ac879b3230baca3c43988f69943f2b8 100644 (file)
@@ -70,7 +70,7 @@ if (REQUEST_ISSET_GET(('mid'))) {
        //              0     1       2       3       4           5          6          7       8        9          10
        $sql = "SELECT id, sender, subject, text, receivers, payment_id, data_type, timestamp, url, target_send, cat_id
         FROM `{!_MYSQL_PREFIX!}_pool`
-        WHERE id='".bigintval(REQUEST_GET('mid'))."'
+        WHERE `id`='".bigintval(REQUEST_GET('mid'))."'
         LIMIT 1";
        $WHO = MAIL_ID.": ".REQUEST_GET('mid');
 } elseif (REQUEST_ISSET_GET('uid')) {
@@ -161,16 +161,16 @@ if (SQL_NUMROWS($result_list) > 0) {
 
                // Prepare content
                $content = $pool;
-               $content['sender_link'] = ADMIN_USER_PROFILE_LINK($pool['sender']);
+               $content['sender_link'] = generateUserProfileLink($pool['sender']);
                $content['subject']     = COMPILE_CODE($pool['subject']);
                $content['text']        = COMPILE_CODE($pool['text']);
-               $content['payment']     = GET_PAYMENT($pool['payment_id']);
-               $content['category']    = GET_CATEGORY($pool['cat_id']);
+               $content['payment']     = getPaymentTitlePrice($pool['payment_id']);
+               $content['category']    = getCategory($pool['cat_id']);
                $content['receivers']   = str_replace(';', ", ", $pool['receivers']);
-               $content['type']        = TRANSLATE_POOL_TYPE($pool['data_type']);
+               $content['type']        = translatePoolType($pool['data_type']);
                $content['frametester'] = FRAMETESTER($pool['url']);
                $content['url']         = COMPILE_CODE($pool['url']);
-               $content['timestamp']   = MAKE_DATETIME($pool['timestamp'], "0");
+               $content['timestamp']   = generateDateTime($pool['timestamp'], '0');
 
                // Load row template
                $OUT .= LOAD_TEMPLATE("admin_list_emails_row", true, $content);
@@ -217,12 +217,12 @@ if ((EXT_IS_ACTIVE('bonus')) && ($WHO == _ALL)) {
 
                        // Prepare content
                        $content = $bonus;
-                       $content['time']        = CREATE_FANCY_TIME($content['time']);
-                       $content['category']    = GET_CATEGORY($content['cat_id']);
+                       $content['time']        = createFancyTime($content['time']);
+                       $content['category']    = getCategory($content['cat_id']);
                        $content['receivers']   = str_replace(';', ", ", $content['receivers']);
-                       $content['type']        = TRANSLATE_POOL_TYPE($content['data_type']);
+                       $content['type']        = translatePoolType($content['data_type']);
                        $content['frametester'] = FRAMETESTER($content['url']);
-                       $content['timestamp']   = MAKE_DATETIME($content['timestamp'], "0");
+                       $content['timestamp']   = generateDateTime($content['timestamp'], '0');
 
                        // Load row template
                        $OUT .= LOAD_TEMPLATE("admin_list_bonus_emails_row", true, $content);
index dfa59dcfafb71b78b24b8d7d48a3e447f4cfaf00..f72bc83dcbe05c04e86ef4c7618add1fdd91a001 100644 (file)
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
 // Normally we want the overview of all registered extensions
 $do = "overview";
 $SEL = 0;
-if (REQUEST_ISSET_POST('sel')) $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 
 if (REQUEST_ISSET_GET(('reg_ext'))) {
        // We are about to register a new extension
@@ -62,9 +62,9 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
                        // Keep this extension active!
                } else {
                        // De/activate extension
-                       $ACT = "N"; $EXT_LOAD_MODE = 'deactivate';
-                       if ($active == 'N') { $ACT = "Y"; $EXT_LOAD_MODE = 'activate'; }
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='".$ACT."' WHERE id=%s AND ext_active='%s' LIMIT 1",
+                       $ACT = 'N'; $EXT_LOAD_MODE = 'deactivate';
+                       if ($active == 'N') { $ACT = 'Y'; $EXT_LOAD_MODE = 'activate'; }
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='".$ACT."' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1",
                                array(bigintval($ext_id), $active), __FILE__, __LINE__);
 
                        // Run embeded SQL commands
@@ -91,11 +91,11 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
                                // Update extension's record
                                if (GET_EXT_VERSION('sql_patches') >= '0.0.6') {
                                        // Update also CSS column when extensions sql_patches is newer or exact v0.0.6
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='%s', ext_active='%s' WHERE id=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_has_css='%s', `ext_active`='%s' WHERE `id`=%s LIMIT 1",
                                                array(REQUEST_POST('css', $ext_id), $active, $ext_id), __FILE__, __LINE__);
                                } else {
                                        // When extension is older than v0.0.6 there is no column for the CSS information
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET ext_active='%s' WHERE id=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1",
                                                array($active, $ext_id), __FILE__, __LINE__);
                                }
 
@@ -120,12 +120,12 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
                        if (($sel == 'Y') || ($sel == 'N')) {
                                // Load required data
                                if (GET_EXT_VERSION('sql_patches') >= '0.0.6') {
-                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_has_css, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_has_css, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `id`=%s LIMIT 1",
                                         array(bigintval($ext_id)), __FILE__, __LINE__);
                                        list($name, $css, $active) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
                                } else {
-                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE id=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT ext_name, ext_active FROM `{!_MYSQL_PREFIX!}_extensions` WHERE `id`=%s LIMIT 1",
                                         array(bigintval($ext_id)), __FILE__, __LINE__);
                                        list($name, $active) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
@@ -156,7 +156,7 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
 
                // Load template
                LOAD_TEMPLATE("admin_extensions_edit");
-               $do = "edit";
+               $do = 'edit';
        }
 } elseif ((REQUEST_ISSET_POST('delete')) && ($SEL > 0) && (!IS_DEMO())) {
        // List extensions and when verbose is enabled SQL statements which will be executed
@@ -225,7 +225,7 @@ if (REQUEST_ISSET_GET(('reg_ext'))) {
 // Shall we display active/inactive extensions?
 $where = '';
 if (REQUEST_ISSET_GET(('active'))) {
-       $where = sprintf("WHERE ext_active = '%s'", SQL_ESCAPE(strip_tags(REQUEST_GET('active'))));
+       $where = sprintf("WHERE `ext_active`='%s'", SQL_ESCAPE(strip_tags(REQUEST_GET('active'))));
 } // END - if
 
 // Case selection
@@ -252,14 +252,14 @@ ORDER BY ext_name", __FILE__, __LINE__);
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare CSS selection output
                        $cssSelection = '---';
-                       if (GET_EXT_VERSION('sql_patches') >= '0.0.6') $cssSelection = TRANSLATE_YESNO($content['ext_css']);
+                       if (GET_EXT_VERSION('sql_patches') >= '0.0.6') $cssSelection = translateYesNo($content['ext_css']);
 
                        // Prepare data for the row template
                        $content = array(
                                'sw'      => $SW,
                                'id'      => $content['ext_id'],
                                'name'    => $content['ext_name'],
-                               'active'  => TRANSLATE_YESNO($content['ext_active']),
+                               'active'  => translateYesNo($content['ext_active']),
                                'act_val' => $content['ext_active'],
                                'css'     => $cssSelection,
                                'ver'     => $content['ext_version'],
@@ -285,8 +285,8 @@ ORDER BY ext_name", __FILE__, __LINE__);
        break;
 
 case 'register': // Register new extension
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE assigned_admin=%s AND task_type='EXTENSION' LIMIT 1",
-               array(GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `assigned_admin`=%s AND `task_type`='EXTENSION' LIMIT 1",
+               array(getCurrentAdminId()), __FILE__, __LINE__);
        $task_found = SQL_NUMROWS($result);
 
        // Free result
@@ -295,7 +295,7 @@ case 'register': // Register new extension
        // Is the ID number valid and the task was found?
        if (($ext_id > 0) && ($task_found == 1)) {
                // ID is valid so begin with registration, we first want to it's real name from task management (subject column)
-               $result = SQL_QUERY_ESC("SELECT subject FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT subject FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s LIMIT 1",
                        array(bigintval($ext_id)), __FILE__, __LINE__);
                list($subj) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -304,7 +304,7 @@ case 'register': // Register new extension
                $cache_update = 0;
                if (!empty($subj)) {
                        // Extract extension's name from subject...
-                       $ext_name = trim(substr($subj, 1, strpos($subj, ":") - 1));
+                       $ext_name = trim(substr($subj, 1, strpos($subj, ':') - 1));
 
                        // Test the extension for deprecation
                        LOAD_EXTENSION($ext_name, 'test');
index 27b0447d6fc8bdea54a962eba1bc1528d0ede80f..64ee46891adf94a714adc01c078e9187c66a55b0 100644 (file)
@@ -55,7 +55,7 @@ if (REQUEST_ISSET_GET('sub')) {
 
 // Get count of (maybe) selected menu points
 $chk = 0;
-if (REQUEST_ISSET_POST('sel')) $chk = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $chk = countPostSelection();
 
 // List all menu points and make them editable
 if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
@@ -146,7 +146,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
        // An action is done...
        switch (REQUEST_POST('ok'))
        {
-       case "edit": // Edit menu
+       case 'edit': // Edit menu
                foreach (REQUEST_POST('sel') as $sel => $menu) {
                        // Secure selector
                        $sel = bigintval($sel);
@@ -158,7 +158,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
                break;
 
-       case "del": // Delete menu
+       case 'del': // Delete menu
                foreach (REQUEST_POST('sel') as $sel => $menu) {
                        // Delete enty
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
@@ -167,7 +167,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
                break;
 
-       case "status": // Change access levels
+       case 'status': // Change access levels
                foreach (REQUEST_POST('sel') as $sel => $menu) {
                        // Secure selector
                        $sel = bigintval($sel);
@@ -238,21 +238,21 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO()))
                // Get IDs
                if (REQUEST_ISSET_GET(('w'))) {
                        // Sub menus selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
                         array(REQUEST_GET('act'), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
                         array(REQUEST_GET('act'), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                } else {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
                         array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
                         array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
index 5e1dce2fd94e545db63ec6720ff7e7f3a1cb8b8c..dd93f3ba035637b9bfd4d80235f76b2604ac7af8 100644 (file)
@@ -78,14 +78,14 @@ if (SQL_NUMROWS($result) > 0) {
                // @TODO Rewritings: sname->surname,fname->family in templates
                $content = array(
                        'sw'       => $SW,
-                       'uid'      => ADMIN_USER_PROFILE_LINK($content['userid']),
-                       'gender'   => TRANSLATE_GENDER($content['gender']),
+                       'uid'      => generateUserProfileLink($content['userid']),
+                       'gender'   => translateGender($content['gender']),
                        'sname'    => $content['surname'],
                        'fname'    => $content['family'],
-                       'email'    => "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".$content['email']."</a>",
-                       'joined'   => MAKE_DATETIME($content['joined'], "2"),
-                       'last'     => MAKE_DATETIME($content['last_online'], "2"),
-                       'notified' => MAKE_DATETIME($content['ap_notified'], "2"),
+                       'email'    => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>",
+                       'joined'   => generateDateTime($content['joined'], "2"),
+                       'last'     => generateDateTime($content['last_online'], "2"),
+                       'notified' => generateDateTime($content['ap_notified'], "2"),
                );
 
                // Load row template
index 595409c3b4d0abe3b8100d48828e322dadf41e4f..ebfaa3dab7a3b93fc27d51f0760862a24dd07d26 100644 (file)
@@ -47,31 +47,31 @@ ADD_DESCR('admin', __FILE__);
 
 // Check if there is enougth selected
 $show = true;
-if ((REQUEST_ISSET_POST(('id'))) && (is_array(REQUEST_POST('id'))) && (count(REQUEST_POST('id')) > 0)) {
+if ((REQUEST_ISSET_POST('id')) && (is_array(REQUEST_POST('id'))) && (count(REQUEST_POST('id')) > 0)) {
        // Okay, which button was pressed?
        if (REQUEST_ISSET_POST('change')) {
                // Change permissions
-               ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), "bank_packages", "package_active");
+               ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), 'bank_packages', 'package_active');
        } elseif (REQUEST_ISSET_POST('edit')) {
                // Delete entries (with confirmation)
                ADMIN_EDIT_ENTRIES_CONFIRM(
                        REQUEST_POST('id'),
-                       "bank_packages",
-                       array("id", "title", "description", "account_fee", "free_transfers", "transfer_fee", "output_system_mode", "package_active", "free_months_no_fee", "interest_plus", "interest_minus", "first_payment", "free_account_income", "free_account_stuff", "tan_lock"),
-                       array("bigintval", '', '', "TRANSLATE_COMMA", "bigintval", "TRANSLATE_COMMA", '', '', "bigintval", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", "TRANSLATE_COMMA", '', "bigintval"),
-                       array("", '', '', '', '', '', '', '', '', '', '', '', '', '', '')
+                       'bank_packages',
+                       array('id', 'title', 'description', 'account_fee', 'free_transfers', 'transfer_fee', 'output_system_mode', 'package_active', 'free_months_no_fee', 'interest_plus', 'interest_minus', 'first_payment', 'free_account_income', 'free_account_stuff', 'tan_lock'),
+                       array('bigintval', '', '', 'translateComma', 'bigintval', 'translateComma', '', '', 'bigintval', 'translateComma', 'translateComma', 'translateComma', 'translateComma', '', 'bigintval'),
+                       array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
                );
                $show = false;
        } elseif (REQUEST_ISSET_POST(('do_edit'))) {
                // Delete entries (with confirmation)
-               ADMIN_EDIT_ENTRIES_CONFIRM(REQUEST_POST('id'), "bank_packages", array(), array(), array(), true);
+               ADMIN_EDIT_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array(), array(), array(), true);
        } elseif (REQUEST_ISSET_POST('delete')) {
                // Delete entries (with confirmation)
-               ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), "bank_packages", array("id", "title", "description", "account_fee"), array("bigintval", '', '', "TRANSLATE_COMMA"), array("", '', '', ''));
+               ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array('id', 'title', 'description', 'account_fee'), array('bigintval', '', '', 'translateComma'), array('', '', '', ''));
                $show = false;
        } elseif (REQUEST_ISSET_POST('remove')) {
                // Delete entries (with confirmation)
-               ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), "bank_packages", array(), array(), array(), true);
+               ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), 'bank_packages', array(), array(), array(), true);
        }
 } // END - if
 
@@ -89,14 +89,14 @@ if (SQL_NUMROWS($result) > 0) {
        $OUT = ''; $SW = 2;
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate" some data
-               $content['active'] = TRANSLATE_YESNO($content['active']);
-               $content['fee']    = TRANSLATE_COMMA($content['fee']);
-               $content['plus']   = TRANSLATE_COMMA($content['plus']);
-               $content['minus']  = TRANSLATE_COMMA($content['minus']);
+               $content['active'] = translateYesNo($content['active']);
+               $content['fee']    = translateComma($content['fee']);
+               $content['plus']   = translateComma($content['plus']);
+               $content['minus']  = translateComma($content['minus']);
                $content['sw']     = $SW;
 
                // Load row template
-               $OUT .= LOAD_TEMPLATE("admin_list_bank_package_row", true, $content);
+               $OUT .= LOAD_TEMPLATE('admin_list_bank_package_row', true, $content);
                $SW = 3 - $SW;
        } // END - while
 
@@ -104,7 +104,7 @@ if (SQL_NUMROWS($result) > 0) {
        define('__BANK_PACKAGE_ROWS', $OUT);
 
        // Load main template
-       LOAD_TEMPLATE("admin_list_bank_package");
+       LOAD_TEMPLATE('admin_list_bank_package');
 } else {
        // No packages found!
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BANK_NO_PACKAGES_FOUND'));
index b68ff1d3061835b162728fa508e4cc7e24d7fa20..3bb5aba71f942586923c3e552d17eecd63b77fee 100644 (file)
@@ -48,9 +48,9 @@ if (getConfig('beg_rallye') == 'Y') {
        // Shall I withdraw now?
        if (REQUEST_ISSET_POST(('withdraw'))) {
                // Okay, let's prepare...
-               $curr = date("m", time()) - 1;
-               if (strlen($curr) == 1) $curr = "0".$curr;
-               UPDATE_CONFIG("last_month", $curr);
+               $curr = date('m', time()) - 1;
+               if (strlen($curr) == 1) $curr = '0'.$curr;
+               updateConfiguration('last_month', $curr);
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BEG_WITHDRAW_PREPARED'));
        } // END - if
 
@@ -58,7 +58,7 @@ if (getConfig('beg_rallye') == 'Y') {
        $lastOnline = "%s"; $ONLINE = '';
        if (EXT_IS_ACTIVE('autopurge')) {
                // Use last online timestamp to keep inactive members away from here
-               $lastOnline   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+               $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
                $ONLINE = getConfig('ap_inactive_since');
        } // END - if
 
@@ -86,12 +86,12 @@ ORDER BY beg_points DESC, last_online DESC, userid",
                        // @TODO to shorten this block. Please also do so with uid->userid
                        $content = array(
                                'uid'    => $content['userid'],
-                               'email'  => CREATE_EMAIL_LINK($content['email'], "user_data"),
-                               'gender' => TRANSLATE_GENDER($content['gender']),
+                               'email'  => generateMemberEmailLink($content['email'], "user_data"),
+                               'gender' => translateGender($content['gender']),
                                'sname'  => $content['surname'],
                                'fname'  => $content['family'],
-                               'turbo'  => TRANSLATE_COMMA($content['beg_points']),
-                               'last'   => MAKE_DATETIME($content['last_online'], "2"),
+                               'turbo'  => translateComma($content['beg_points']),
+                               'last'   => generateDateTime($content['last_online'], "2"),
                                'sw'     => $SW,
                                'win1'   => $WIN1,
                                'win2'   => $WIN2,
@@ -103,10 +103,10 @@ ORDER BY beg_points DESC, last_online DESC, userid",
                        $SW = 3 - $SW; $cnt++; $total += $content['beg_points'];
                }
                define('__BEG_ROWS', $OUT);
-               define('__TOTAL', TRANSLATE_COMMA($total));
+               define('__TOTAL', translateComma($total));
 
                // Check if we need to display form or not with manuel withdraw
-               if (getConfig('last_month') == date("m", time())) {
+               if (getConfig('last_month') == date('m', time())) {
                        // Load form
                        define('__BEG_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_beg_form", true));
                } else {
@@ -116,7 +116,7 @@ ORDER BY beg_points DESC, last_online DESC, userid",
 
                // Prepare constant for timemark
                if (EXT_IS_ACTIVE('autopurge')) {
-                       define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2"));
+                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
                } else {
                        define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
                }
index fbc0a6024784074c8bcd6a14024a619b4b11e65c..1a225c96f34836ffe89e8cc740750b81f907ea70 100644 (file)
@@ -49,11 +49,11 @@ if (getConfig('bonus_active') == 'Y') {
        // Shall I withdraw now?
        if (REQUEST_ISSET_POST(('withdraw'))) {
                // Okay, let's prepare...
-               $curr = date("m", time()) - 1;
-               if (strlen($curr) == 1) $curr = "0".$curr;
-               UPDATE_CONFIG("last_month", $curr);
+               $curr = date('m', time()) - 1;
+               if (strlen($curr) == 1) $curr = '0'.$curr;
+               updateConfiguration('last_month', $curr);
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_BONUS_WITHDRAW_PREPARED'));
-       }
+       } // END - if
 
        if (GET_EXT_VERSION('bonus') >= '0.6.9') {
                // Add more bonus points here
@@ -73,7 +73,7 @@ if (getConfig('bonus_active') == 'Y') {
        $lastOnline = "%s"; $ONLINE = '';
        if (EXT_IS_ACTIVE('autopurge')) {
                // Use last online timestamp to keep inactive members away from here
-               $lastOnline   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+               $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
                $ONLINE = getConfig('ap_inactive_since');
        }
 
@@ -100,11 +100,11 @@ ORDER BY points DESC, last_online DESC, userid",
                        }
 
                        // Prepare content
-                       $content['uid']    = ADMIN_USER_PROFILE_LINK($content['uid']);
-                       $content['email']  = CREATE_EMAIL_LINK($content['email'], "user_data");
-                       $content['gender'] = TRANSLATE_GENDER($content['gender']);
-                       $content['points'] = TRANSLATE_COMMA($content['points']);
-                       $content['last']   = MAKE_DATETIME($content['last'], "2");
+                       $content['uid']    = generateUserProfileLink($content['uid']);
+                       $content['email']  = generateMemberEmailLink($content['email'], "user_data");
+                       $content['gender'] = translateGender($content['gender']);
+                       $content['points'] = translateComma($content['points']);
+                       $content['last']   = generateDateTime($content['last'], "2");
                        $content['sw']     = $SW;
                        $content['win1']   = $WIN1;
                        $content['win2']   = $WIN2;
@@ -115,10 +115,10 @@ ORDER BY points DESC, last_online DESC, userid",
                        $SW = 3 - $SW; $cnt++;
                }
                define('__BONUS_ROWS', $OUT);
-               define('__TOTAL', TRANSLATE_COMMA($total));
+               define('__TOTAL', translateComma($total));
 
                // Check if we need to display form or not with manuel withdraw
-               if (getConfig('last_month') == date("m", time())) {
+               if (getConfig('last_month') == date('m', time())) {
                        // Load form
                        define('__BONUS_WITHDRAW_FORM', LOAD_TEMPLATE("admin_list_bonus_form", true));
                } else {
@@ -128,7 +128,7 @@ ORDER BY points DESC, last_online DESC, userid",
 
                // Prepare constant for timemark
                if (EXT_IS_ACTIVE('autopurge')) {
-                       define('__AUTOPURGE_TIMEOUT', MAKE_DATETIME(time() - getConfig('ap_inactive_since'), "2"));
+                       define('__AUTOPURGE_TIMEOUT', generateDateTime(time() - getConfig('ap_inactive_since'), "2"));
                } else {
                        define('__AUTOPURGE_TIMEOUT', sprintf(getMessage('EXTENSION_PROBLEM_NOT_INSTALLED'), 'autopurge'));
                }
index 633cfaf9dcfb0da613ebe17fc8cc625b46ba06b6..804b2c92e4a64b0c5cb5a02501b7172dce5ec456 100644 (file)
@@ -58,8 +58,8 @@ if (REQUEST_ISSET_GET('uid')) {
                // Prepare constants
                define('__CATS_BASE'   , "<a href=\"{!URL!}/modules.php?module=admin&amp;uid=");
                define('__UID'         , bigintval(REQUEST_GET('uid')));
-               define('__MEMBER_LINKS', MEMBER_ACTION_LINKS(constant('__UID')));
-               define('__EMAIL'       , "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$sname." ".$fname."</a>");
+               define('__MEMBER_LINKS', generateMemberAdminActionLinks(constant('__UID')));
+               define('__EMAIL'       , "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$sname." ".$fname."</a>");
 
                // Ok, list categories of this user
                $result_cats = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__);
@@ -69,7 +69,7 @@ if (REQUEST_ISSET_GET('uid')) {
                        $cnt = 1; $OUT = ''; $SW = 2;
                        while ($content = SQL_FETCHARRAY($result_cats)) {
                                // Check user's selection
-                               $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
+                               $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
                                        array(bigintval(REQUEST_GET('uid')), bigintval($content['id'])), __FILE__, __LINE__);
 
                                // Set selection
index 5739f8d512d5d53ffedb05a38ffaf11ae9bd1dd9..e3f0ab16e972711fffb6042abacf817063f3ddc7 100644 (file)
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
 // Add new code?
 if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ISSET_POST(('descr')))) {
        // Check if country code does already exist
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_countries` WHERE code='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_countries` WHERE code='%s' LIMIT 1",
         array(strtoupper(REQUEST_POST('code'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Save entry
@@ -71,7 +71,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
 
        // Display message
        LOAD_TEMPLATE('admin_settings_saved', false, $message);
-} elseif ((REQUEST_ISSET_POST('change')) && (REQUEST_ISSET_POST(('id')))) {
+} elseif ((REQUEST_ISSET_POST('change')) && (REQUEST_ISSET_POST('id'))) {
        // Change all status
        ADMIN_CHANGE_ACTIVATION_STATUS(REQUEST_POST('id'), "countries", "is_active");
 
@@ -80,7 +80,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                'url'   => 'modules.php?module=admin&amp;what=list_country',
                'title' => getMessage('ADMIN_COUNTRY_ACTIVATION_NEXT_LINK')
        ));
-} elseif (((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('delete'))) && (REQUEST_ISSET_POST(('id')))) {
+} elseif (((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('delete'))) && (REQUEST_ISSET_POST('id'))) {
        if (count(REQUEST_POST('id')) > 0) {
                if (REQUEST_ISSET_POST('edit')) {
                        // Edit template
@@ -104,7 +104,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('id') as $id => $status) {
                        // Load data from DB
-                       $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE id=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT code, descr FROM `{!_MYSQL_PREFIX!}_countries` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Load data
@@ -121,10 +121,10 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
 
                                if ($post == 'modify') {
                                        // Generate default selection in edit-mode
-                                       $content['status'] = ADD_OPTION_LINES('/ARRAY/', array('Y', 'N'), array(getMessage('YES'), getMessage('NO')), $status);
+                                       $content['status'] = generateOptionList('/ARRAY/', array('Y', 'N'), array(getMessage('YES'), getMessage('NO')), $status);
                                } else {
                                        // Only display status when in delete-mode
-                                       $content['status'] = TRANSLATE_YESNO($status);
+                                       $content['status'] = translateYesNo($status);
                                }
 
                                // Insert row template and switch color
@@ -145,7 +145,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
 } else {
        // Shall we modify / remove entries now?
        $message = ''; INIT_SQLS();
-       if ((REQUEST_ISSET_POST(('modify'))) && (REQUEST_ISSET_POST(('id')))) {
+       if ((REQUEST_ISSET_POST(('modify'))) && (REQUEST_ISSET_POST('id'))) {
                // Modify
                foreach (REQUEST_POST('id') as $id => $sel) {
                        ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_countries` SET `code`='".REQUEST_POST('code', $id)."', `descr`='".REQUEST_POST('descr', $id)."', `is_active`='".REQUEST_POST('is_active', $id)."' WHERE `id`='".$id."' LIMIT 1");
@@ -153,7 +153,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
 
                // Create message
                $message = getMessage('ADMIN_COUNTRIES_MODIFIED');
-       } elseif ((REQUEST_ISSET_POST('remove')) && (REQUEST_ISSET_POST(('id')))) {
+       } elseif ((REQUEST_ISSET_POST('remove')) && (REQUEST_ISSET_POST('id'))) {
                // Remove
                $IDs = implode(',', array_keys(REQUEST_POST('id')));
                ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_countries` WHERE `id` IN (".$IDs.") LIMIT ".count(REQUEST_POST('id'))."");
@@ -183,7 +183,7 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_
                                'id'     => $content['id'],
                                'code'   => $content['code'],
                                'name'   => $content['descr'],
-                               'active' => TRANSLATE_YESNO($content['is_active']),
+                               'active' => translateYesNo($content['is_active']),
                                'sw'     => $SW,
                                'status' => $content['is_active'],
                        );
index 02f3fa76c2af8643f6e360b56e34cf86e0eaa449..d64026ba2800fe9fae2dcf60c149ed3803adb029 100644 (file)
@@ -68,10 +68,10 @@ case "overview": // General overview page
        list($cnt) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if ((empty($cnt)) || ($cnt == "0"))
+       if ((empty($cnt)) || ($cnt == '0'))
        {
                // Nothing payed out so far
-               define('__DOUBLER_ALREADY_DIRECT_LINK', "0");
+               define('__DOUBLER_ALREADY_DIRECT_LINK', '0');
        }
         else
        {
@@ -83,10 +83,10 @@ case "overview": // General overview page
        list($cnt) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if ((empty($cnt)) || ($cnt == "0"))
+       if ((empty($cnt)) || ($cnt == '0'))
        {
                // Nothing payed out so far
-               define('__DOUBLER_ALREADY_REF_LINK', "0");
+               define('__DOUBLER_ALREADY_REF_LINK', '0');
        }
         else
        {
@@ -101,10 +101,10 @@ case "overview": // General overview page
        list($cnt) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if ((empty($cnt)) || ($cnt == "0"))
+       if ((empty($cnt)) || ($cnt == '0'))
        {
                // Nothing payed out so far
-               define('__DOUBLER_WAITING_DIRECT_LINK', "0");
+               define('__DOUBLER_WAITING_DIRECT_LINK', '0');
        }
         else
        {
@@ -116,10 +116,10 @@ case "overview": // General overview page
        list($cnt) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if ((empty($cnt)) || ($cnt == "0"))
+       if ((empty($cnt)) || ($cnt == '0'))
        {
                // Nothing payed out so far
-               define('__DOUBLER_WAITING_REF_LINK', "0");
+               define('__DOUBLER_WAITING_REF_LINK', '0');
        }
         else
        {
index ce20c453c49c03073990d4f32e98b04fbff6f574..9a0a4a1f09c6e75a989ea496a5607a14883ace2a 100644 (file)
@@ -63,12 +63,12 @@ if (SQL_NUMROWS($result) > 0) {
                $content = array(
                        'sw'       => $SW,
                        'id'       => $content['id'],
-                       'uid'      => ADMIN_USER_PROFILE_LINK($content['userid']),
-                       'start'    => MAKE_DATETIME($content['holiday_start'], "3"),
-                       'end'      => MAKE_DATETIME($content['holiday_end'], "3"),
+                       'uid'      => generateUserProfileLink($content['userid']),
+                       'start'    => generateDateTime($content['holiday_start'], "3"),
+                       'end'      => generateDateTime($content['holiday_end'], "3"),
                        'comments' => wordwrap($content['comments'], 15),
-                       'status'   => TRANSLATE_STATUS($content['status']),
-                       'last'     => MAKE_DATETIME($content['last_online'], "3"),
+                       'status'   => translateUserStatus($content['status']),
+                       'last'     => generateDateTime($content['last_online'], "3"),
                );
 
                // Load row template and switch color
index 3c3adcb14bd30b7a853c72f1c169870f4b5dfb5d..0f31e43bd914ea48c7f0e917809f0a0a4814a5bf 100644 (file)
@@ -84,7 +84,7 @@ if (REQUEST_ISSET_GET('uid')) {
 
                                // Prepare mail and send it away
                                $msg = LOAD_EMAIL_TEMPLATE("admin-del_links", $nums, bigintval(REQUEST_GET('uid')));
-                               SEND_EMAIL($email, getMessage('ADMIN_DEL_LINK_SUBJ'), $msg);
+                               sendEmail($email, getMessage('ADMIN_DEL_LINK_SUBJ'), $msg);
 
                                // Display message
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_LINKS_DELETED'));
@@ -105,14 +105,14 @@ if (REQUEST_ISSET_GET('uid')) {
                                        switch ($type)
                                        {
                                        case "NORMAL":
-                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp_ordered, cat_id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `id`=%s LIMIT 1",
                                                        array(bigintval($id)), __FILE__, __LINE__);
                                                $type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
                                                $LINK = "<a href=\"{!URL!}/mailid.php?uid=".REQUEST_GET('uid')."&amp;mailid=".$id."\" target=\"_blank\">".$id."</a>";
                                                break;
 
                                        case "BONUS":
-                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                                               $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                                        array(bigintval($id2)), __FILE__, __LINE__);
                                                $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
                                                $LINK = "<a href=\"{!URL!}/mailid.php?uid=".REQUEST_GET('uid')."&amp;bonusid=".$id2."\" target=\"_blank\">".$id2."</a>";
@@ -135,8 +135,8 @@ if (REQUEST_ISSET_GET('uid')) {
                                                        'sw'    => $SW,
                                                        'link'  => $LINK,
                                                        'subj'  => $subject,
-                                                       'stamp' => MAKE_DATETIME($timestamp, "0"),
-                                                       'cat'   => GET_CATEGORY($cat),
+                                                       'stamp' => generateDateTime($timestamp, '0'),
+                                                       'cat'   => getCategory($cat),
                                                );
 
                                                // Load row template
@@ -160,7 +160,7 @@ if (REQUEST_ISSET_GET('uid')) {
                                // Remember list in constant for the template
                                define('__SNAME_VALUE', $sname);
                                define('__FNAME_VALUE', $fname);
-                               define('__EMAIL_VALUE', "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</a>");
+                               define('__EMAIL_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".$email."</a>");
                                define('__EMAIL_LIST' , $OUT);
                                define('__NUMS_VALUE' , $nums);
                                define('__UID'        , bigintval(REQUEST_GET('uid')));
index 70b82b1dc7870b952dccebf2aea280f7156f61cd..7b2f85209cf82c8b4e68dbfbc35c23fc03451aab 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if ((REQUEST_ISSET_POST('uid')) && (REQUEST_ISSET_POST(('id')))) {
+if ((REQUEST_ISSET_POST('uid')) && (REQUEST_ISSET_POST('id'))) {
        // Update database...
        // First user's account
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_until=(UNIX_TIMESTAMP() + nl_timespan), nl_receive='N', nl_timespan=0 WHERE userid=%s LIMIT 1",
@@ -56,7 +56,7 @@ if ((REQUEST_ISSET_POST('uid')) && (REQUEST_ISSET_POST(('id')))) {
 
        // Send mail to user
        $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_done", true, bigintval(REQUEST_POST('uid')));
-       SEND_EMAIL(bigintval(REQUEST_POST('uid')), NL_MEMBER_DONE_SUBJECT, $msg);
+       sendEmail(bigintval(REQUEST_POST('uid')), getMessage('NL_MEMBER_DONE_SUBJECT'), $msg);
 
        // Output message to admin
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_NL_MEMBER_DONE'));
index e718db2cc8ed2585086f44d88f469d161c6fc909..bc34e3156c7b51506000241154ab7a8831c08243 100644 (file)
@@ -96,12 +96,12 @@ if ((EXT_IS_ACTIVE('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2)
 
                        // Prepare content
                        $content = $bonus;
-                       $content['time']        = CREATE_FANCY_TIME($content['time']);
-                       $content['category']    = GET_CATEGORY($content['cat_id']);
+                       $content['time']        = createFancyTime($content['time']);
+                       $content['category']    = getCategory($content['cat_id']);
                        $content['receivers']   = str_replace(';', ", ", $content['receivers']);
-                       $content['type']        = TRANSLATE_POOL_TYPE($content['data_type']);
+                       $content['type']        = translatePoolType($content['data_type']);
                        $content['frametester'] = FRAMETESTER($content['url']);
-                       $content['timestamp']   = MAKE_DATETIME($content['timestamp'], "0");
+                       $content['timestamp']   = generateDateTime($content['timestamp'], '0');
 
                        // Load row template
                        $OUT .= LOAD_TEMPLATE("admin_list_notify_emails_row", true, $content);
index 90b60ed755b574599659f18647a74bdd58bcefba..1215c5fa6db72bf5d14844fdf265cabcc480dbfe 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__);
 
 if (REQUEST_ISSET_GET(('pid'))) {
        // First let's get the member's ID
-       $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT userid, target_account, payout_total, payout_timestamp, password FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `id`=%s LIMIT 1",
                array(REQUEST_GET('pid')), __FILE__, __LINE__);
        list($uid, $tuid, $points, $tstamp, $tpass) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
@@ -55,12 +55,12 @@ if (REQUEST_ISSET_GET(('pid'))) {
        // Obtain some data
        if (!REQUEST_ISSET_GET(('task')) && (!empty($uid)) && ($uid > 0)) {
                // Get task ID from database
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_task_system` WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_task_system` WHERE userid=%s AND `task_type`='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
                        array(bigintval($uid)), __FILE__, __LINE__);
                list($task) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
                if (empty($task)) $task = 0;
-       } elseif ((empty($uid)) || ($uid == "0")) {
+       } elseif ((empty($uid)) || ($uid == '0')) {
                // Cannot obtain member ID!
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERID'));
        } else {
@@ -76,20 +76,20 @@ if (REQUEST_ISSET_GET(('pid'))) {
                SQL_FREERESULT($result);
 
                // Konstante bauen
-               define('PAYOUT_USERDATA_VALUE', "<a href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".TRANSLATE_GENDER($gender)." ".$surname." ".$family."</a>");
+               define('PAYOUT_USERDATA_VALUE', "<a href=\"".generateMemberEmailLink($email, "user_data")."\">".translateGender($gender)." ".$surname." ".$family."</a>");
 
                if ((REQUEST_GET('do') == "accept") && (!empty($email))) {
                        // Ok, now we can output the form or execute accepting
                        if (IS_FORM_SENT()) {
                                // Obtain payout type and other data
-                               $result = SQL_QUERY_ESC("SELECT payout_id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT payout_id FROM `{!_MYSQL_PREFIX!}_user_payouts` WHERE `id`=%s LIMIT 1",
                                 array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
                                list($ptype) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
 
                                if (!empty($ptype)) {
                                        // Obtain data from payout type
-                                       $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT from_account, from_pass, engine_url, engine_ret_ok, engine_ret_failed, pass_enc, allow_url FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
                                         array(bigintval($ptype)), __FILE__, __LINE__);
                                        list($fuid, $fpass, $eurl, $eok, $failed, $eenc, $allow) = SQL_FETCHROW($result);
                                        SQL_FREERESULT($result);
@@ -118,7 +118,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                                                eval($eval);
 
                                                // Execute transfer
-                                               $ret = GET_URL($URL);
+                                               $ret = sendGetRequest($URL);
                                        } else {
                                                // No URL to run
                                                $ret[0] = $eok;
@@ -131,7 +131,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                                                }
 
                                                // Clear payout request
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='ACCEPTED' WHERE id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='ACCEPTED' WHERE `id`=%s LIMIT 1",
                                                        array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
 
                                                // Send out mail
@@ -147,7 +147,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                                                }
 
                                                // Finally send mail
-                                               SEND_EMAIL($email, PAYOUT_ACCEPTED_SUBJECT, $msg);
+                                               sendEmail($email, getMessage('PAYOUT_ACCEPTED_SUBJECT'), $msg);
                                        } else {
                                                // Something goes wrong... :-(
                                                $content = implode("<br />", $ret);
@@ -176,7 +176,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                                }
 
                                // Clear payout request
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='REJECTED' WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_payouts` SET `status`='REJECTED' WHERE `id`=%s LIMIT 1",
                                        array(bigintval(REQUEST_GET('pid'))), __FILE__, __LINE__);
 
                                // Send out mail
@@ -186,7 +186,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_REJECTED_NOTIFIED'));
 
                                // Finally send mail
-                               SEND_EMAIL($email, getMessage('PAYOUT_REJECTED_SUBJECT'), $msg);
+                               sendEmail($email, getMessage('PAYOUT_REJECTED_SUBJECT'), $msg);
                        } else {
                                // Prepare content
                                $content = array(
@@ -201,7 +201,7 @@ if (REQUEST_ISSET_GET(('pid'))) {
                        // Cannot load user data
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_USERDATA'));
                }
-       } elseif ((empty($task)) || ($task == "0")) {
+       } elseif ((empty($task)) || ($task == '0')) {
                // Failed loading task ID
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_FAILED_OBTAIN_TASK_ID'));
        }
@@ -254,11 +254,11 @@ ORDER BY p.payout_timestamp DESC", __FILE__, __LINE__);
                        // Remember data in array for the template
                        $content = array(
                                'sw'      => $SW,
-                               'ulink'   => ADMIN_USER_PROFILE_LINK($content['userid']),
-                               'ptype'   => TRANSLATE_COMMA($content['payout_total'])." ".COMPILE_CODE($content['type']),
+                               'ulink'   => generateUserProfileLink($content['userid']),
+                               'ptype'   => translateComma($content['payout_total'])." ".COMPILE_CODE($content['type']),
                                'account' => $content['target_account'],
                                'bank'    => $content['target_bank'],
-                               'tstamp'  => MAKE_DATETIME($content['payout_timestamp'], "2"),
+                               'tstamp'  => generateDateTime($content['payout_timestamp'], "2"),
                                'status'  => $content['status'],
                        );
 
index 9b1c364f0cfb2293fc070895f6a7a58cd63c0dd1..cbb86b063c0da46c43f734fc246c610055195bbf 100644 (file)
@@ -56,9 +56,9 @@ if (SQL_NUMROWS($result) > 0) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Translate some data and add color
                $content['sw']                                  = $SW;
-               $content['link']                                = ADMIN_USER_PROFILE_LINK($content['userid']);
-               $content['primera_amount']              = TRANSLATE_COMMA($content['primera_amount']);
-               $content['primera_timestamp']   = MAKE_DATETIME($content['primera_timestamp'], "2");
+               $content['link']                                = generateUserProfileLink($content['userid']);
+               $content['primera_amount']              = translateComma($content['primera_amount']);
+               $content['primera_timestamp']   = generateDateTime($content['primera_timestamp'], "2");
                $content['raw_type']                    = strtolower($content['primera_type']);
                $content['primera_type']                = PRIMERA_TRANSFER_STATUS($content['primera_type']);
 
index 4ac5ba448b0e5a80d5189f24b0f61cfd12b49d88..8f9e81d5fd3b3277160818b87d0ea30732b4d0f5 100644 (file)
@@ -58,11 +58,11 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                switch (REQUEST_GET('activate'))
                {
                case "1": // Activate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE id=%s AND is_active='N' LIMIT 1");
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='Y' WHERE `id`=%s AND is_active='N' LIMIT 1");
                        break;
 
-               case "0": // Deactivate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE id=%s AND is_active='Y' LIMIT 1");
+               case '0': // Deactivate
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET is_active='N' WHERE `id`=%s AND is_active='Y' LIMIT 1");
                        break;
                }
        } elseif (REQUEST_ISSET_GET(('notify'))) {
@@ -70,11 +70,11 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                switch (REQUEST_GET('notify'))
                {
                case "1": // Activate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE id=%s AND send_notify='N' LIMIT 1");
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='Y' WHERE `id`=%s AND send_notify='N' LIMIT 1");
                        break;
 
-               case "0": // Deactivate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE id=%s AND send_notify='Y' LIMIT 1");
+               case '0': // Deactivate
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET send_notify='N' WHERE `id`=%s AND send_notify='Y' LIMIT 1");
                        break;
                }
        } elseif (REQUEST_ISSET_GET(('auto'))) {
@@ -82,11 +82,11 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                switch (REQUEST_GET('auto'))
                {
                case "1": // Activate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE id=%s AND auto_add_new_user='N' LIMIT 1");
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='Y' WHERE `id`=%s AND auto_add_new_user='N' LIMIT 1");
                        break;
 
-               case "0": // Deactivate
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE id=%s AND auto_add_new_user='Y' LIMIT 1");
+               case '0': // Deactivate
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_rallye_data` SET auto_add_new_user='N' WHERE `id`=%s AND auto_add_new_user='Y' LIMIT 1");
                        break;
                }
        }
@@ -95,7 +95,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
        runFilterChain('run_sqls');
 } elseif (REQUEST_ISSET_POST('remove')) {
        // Delete rallyes
-       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+       $SEL = countPostSelection();
        if ($SEL > 0) {
                // Init SQLs
                INIT_SQLS();
@@ -103,7 +103,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
                // Delete selected rallyes and all it's data
                foreach (REQUEST_POST('sel') as $id => $selected) {
                        // Remove selected rallye entirely...
-                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE id=%s LIMIT 1",
+                       ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_data` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__, false));
                        ADD_SQL(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s",
                                array(bigintval($id)), __FILE__, __LINE__, false));
@@ -122,7 +122,7 @@ if (REQUEST_ISSET_GET(('rallye'))) {
        }
 } elseif (REQUEST_ISSET_POST('change')) {
        // Change rallye
-       $SEL = SELECTION_COUNT(REQUEST_POST('title'));
+       $SEL = countSelection(REQUEST_POST('title'));
        if ($SEL > 0) {
                // Init SQLs
                INIT_SQLS();
@@ -145,7 +145,7 @@ start_time='%s',
 end_time='%s',
 min_users='%s',
 min_prices='%s'
-WHERE id='".$id."' LIMIT 1",
+WHERE `id`='".$id."' LIMIT 1",
                                array(
                                        $title,
                                        REQUEST_POST('descr', $id),
@@ -168,7 +168,7 @@ WHERE id='".$id."' LIMIT 1",
 
 if (REQUEST_ISSET_POST('edit')) {
        // Check for selections
-       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+       $SEL = countPostSelection();
        if ($SEL > 0) {
                // Make all selected and deactivated rallyes editable
                $OUT = ''; $SW = 2;
@@ -186,28 +186,28 @@ LIMIT 1",
                        SQL_FREERESULT($result);
 
                        // Starting day
-                       $content['s_sec']   = ADD_SELECTION("sec"  , date("s", $content['start_time']), "start", $id);
-                       $content['s_min']   = ADD_SELECTION("min"  , date("i", $content['start_time']), "start", $id);
-                       $content['s_hour']  = ADD_SELECTION("hour" , date("G", $content['start_time']), "start", $id);
-                       $content['s_day']   = ADD_SELECTION("day"  , date("d", $content['start_time']), "start", $id);
-                       $content['s_month'] = ADD_SELECTION("month", date("m", $content['start_time']), "start", $id);
-                       $content['s_year']  = ADD_SELECTION("year" , date('Y', $content['start_time']), "start", $id);
+                       $content['s_sec']   = ADD_SELECTION('sec'  , date('s', $content['start_time']), 'start', $id);
+                       $content['s_min']   = ADD_SELECTION('min'  , date('i', $content['start_time']), 'start', $id);
+                       $content['s_hour']  = ADD_SELECTION('hour' , date('G', $content['start_time']), 'start', $id);
+                       $content['s_day']   = ADD_SELECTION('day'  , date('d', $content['start_time']), 'start', $id);
+                       $content['s_month'] = ADD_SELECTION('month', date('m', $content['start_time']), 'start', $id);
+                       $content['s_year']  = ADD_SELECTION('year' , date('Y', $content['start_time']), 'start', $id);
 
                        // Ending day
-                       $content['e_sec']   = ADD_SELECTION("sec"  , date("s", $content['end_time'])  , "end"  , $id);
-                       $content['e_min']   = ADD_SELECTION("min"  , date("i", $content['end_time'])  , "end"  , $id);
-                       $content['e_hour']  = ADD_SELECTION("hour" , date("G", $content['end_time'])  , "end"  , $id);
-                       $content['e_day']   = ADD_SELECTION("day"  , date("d", $content['end_time'])  , "end"  , $id);
-                       $content['e_month'] = ADD_SELECTION("month", date("m", $content['end_time'])  , "end"  , $id);
-                       $content['e_year']  = ADD_SELECTION("year" , date('Y', $content['end_time'])  , "end"  , $id);
+                       $content['e_sec']   = ADD_SELECTION('sec'  , date('s', $content['end_time'])  , 'end'  , $id);
+                       $content['e_min']   = ADD_SELECTION('min'  , date('i', $content['end_time'])  , 'end'  , $id);
+                       $content['e_hour']  = ADD_SELECTION('hour' , date('G', $content['end_time'])  , 'end'  , $id);
+                       $content['e_day']   = ADD_SELECTION('day'  , date('d', $content['end_time'])  , 'end'  , $id);
+                       $content['e_month'] = ADD_SELECTION('month', date('m', $content['end_time'])  , 'end'  , $id);
+                       $content['e_year']  = ADD_SELECTION('year' , date('Y', $content['end_time'])  , 'end'  , $id);
 
                        // Remember other values
-                       $content['templ']      = RALLYE_TEMPLATE_SELECTION("templ[".$id."]", $content['template']);
+                       $content['templ']      = RALLYE_TEMPLATE_SELECTION('templ['.$id.']', $content['template']);
                        $content['sw']         = $SW;
                        $content['id']         = $id;
 
                        // Output row
-                       $OUT .= LOAD_TEMPLATE("admin_edit_rallyes_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE('admin_edit_rallyes_row', true, $content);
 
                        // Color switching
                        $SW = 3 - $SW;
@@ -217,14 +217,14 @@ LIMIT 1",
                define('__RALLYE_ROWS', $OUT);
 
                // Load final template
-               LOAD_TEMPLATE("admin_edit_rallyes");
+               LOAD_TEMPLATE('admin_edit_rallyes');
        } else {
                // Nothing selected to edit
-               LOAD_TEMPLATE('admin_settings_saved', false, LOAD_TEMPLATE("admin_list_rallye_noselect", true));
+               LOAD_TEMPLATE('admin_settings_saved', false, LOAD_TEMPLATE('admin_list_rallye_noselect', true));
        }
-} elseif ((REQUEST_GET('sub') == "users") && (REQUEST_GET('rallye') > 0)) {
+} elseif ((REQUEST_GET('sub') == 'users') && (REQUEST_GET('rallye') > 0)) {
        // List users and their refs before start and current
-       $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY userid",
+       $result = SQL_QUERY_ESC("SELECT userid, refs, curr_points FROM `{!_MYSQL_PREFIX!}_rallye_users` WHERE rallye_id=%s ORDER BY `userid` ASC",
                array(bigintval(REQUEST_GET('rallye'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                $OUT = ''; $SW = 2;
@@ -242,9 +242,9 @@ LIMIT 1",
                        if (($content['curr_points'] > 0) && ($cnt > 0)) { $bl = "<strong>"; $br = "</strong>"; }
                        if (($content['refs'] > 0) || ($cnt > 0)) {
                                // Insert link to referal list
-                               //* DEBUG: */ echo "-".$content['userid']."/".$cnt."/".$content['refs']."-<br />";
-                               $cnt = ADMIN_USER_PROFILE_LINK($content['userid'], $cnt, "list_refs");
-                               $content['refs'] = ADMIN_USER_PROFILE_LINK($content['userid'], $content['refs'], "list_refs");
+                               //* DEBUG: */ echo '-'.$content['userid'].'/'.$cnt.'/'.$content['refs']."-<br />";
+                               $cnt = generateUserProfileLink($content['userid'], $cnt, "list_refs");
+                               $content['refs'] = generateUserProfileLink($content['userid'], $content['refs'], "list_refs");
                        } // END - if
 
                        // Get user points
@@ -260,11 +260,11 @@ LIMIT 1",
                                'bold_r'  => $br ,
                                'old'     => $content['refs'],
                                'cnt'     => $cnt,
-                               'opoints' => TRANSLATE_COMMA($points - $content['curr_points']),
+                               'opoints' => translateComma($points - $content['curr_points']),
                        );
 
                        // Load row template and switch color
-                       $OUT .= LOAD_TEMPLATE("admin_list_rallye_usr_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE('admin_list_rallye_usr_row', true, $content);
                        $SW = 3 - $SW;
                } // END - while
 
@@ -273,7 +273,7 @@ LIMIT 1",
                define('__RALLYE_USER_ROWS', $OUT);
 
                // Load template
-               LOAD_TEMPLATE("admin_list_rallye_usr");
+               LOAD_TEMPLATE('admin_list_rallye_usr');
        } else {
                // No entries found?
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_ADMIN_USERS_404'));
@@ -289,7 +289,7 @@ ORDER BY start_time DESC",
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Load admin login
-                       $content['alogin'] = GET_ADMIN_LOGIN($content['admin_id']);
+                       $content['alogin'] = getAdminLogin($content['admin_id']);
 
                        // Count joined userids
                        $joined = GET_TOTAL_DATA($content['id'], "rallye_users", "id", "rallye_id", true);
@@ -301,7 +301,7 @@ ORDER BY start_time DESC",
                        } // END - if
 
                        // Alter some variables
-                       if (empty($content['alogin']))   $content['alogin']    = "???";
+                       if (empty($content['alogin']))   $content['alogin']    = '???';
                        if (empty($content['template'])) $content['template']  = '---';
                        if (empty($content['descr']))    $content['descr']     = '---';
 
@@ -310,20 +310,20 @@ ORDER BY start_time DESC",
                        $content = array(
                                'select'     => "<input type=\"checkbox\" name=\"sel[".$content['id']."]\" class=\"admin_normal\" value=\"1\" />",
                                'aid'        => $content['admin_id'],
-                               'email_link' => CREATE_EMAIL_LINK($content['admin_id']),
+                               'email_link' => generateMemberEmailLink($content['admin_id']),
                                'alogin'     => $content['alogin'],
                                'id'         => $content['id'],
                                'sw'         => $SW,
                                'title'      => $content['title'],
                                'template'   => $content['template'],
                                'joined'     => $joined,
-                               'start_date' => MAKE_DATETIME($content['start_time'], "2"),
-                               'end_date'   => MAKE_DATETIME($content['end_time']  , "2"),
-                               'active_lnk' => TRANSLATE_YESNO($content['is_active']),
-                               'notify_lnk' => TRANSLATE_YESNO($content['send_notify']),
-                               'auto_lnk'   => TRANSLATE_YESNO($content['auto_add_new_user']),
-                               'notified'   => TRANSLATE_YESNO($content['notified']),
-                               'prices_cnt' => TRANSLATE_COMMA(GET_TOTAL_DATA($content['id'], "rallye_prices", "id", "rallye_id", true)),
+                               'start_date' => generateDateTime($content['start_time'], '2'),
+                               'end_date'   => generateDateTime($content['end_time']  , '2'),
+                               'active_lnk' => translateYesNo($content['is_active']),
+                               'notify_lnk' => translateYesNo($content['send_notify']),
+                               'auto_lnk'   => translateYesNo($content['auto_add_new_user']),
+                               'notified'   => translateYesNo($content['notified']),
+                               'prices_cnt' => translateComma(GET_TOTAL_DATA($content['id'], 'rallye_prices', 'id', 'rallye_id', true)),
                                'descr'      => COMPILE_CODE($content['descr']),
                                'min_users'  => $content['min_users'],
                                'min_prices' => $content['min_prices'],
@@ -341,7 +341,7 @@ ORDER BY start_time DESC",
 
                        case 'N':
                                $content['active_title'] = getMessage('RALLYE_ACTIVATE_NOW');
-                               $content['active'] = "1";
+                               $content['active'] = '1';
                                break;
                        }
 
@@ -355,7 +355,7 @@ ORDER BY start_time DESC",
 
                        case 'N':
                                $content['notify_title'] = getMessage('RALLYE_START_NOTIFY_NOW');
-                               $content['notify'] = "1";
+                               $content['notify'] = '1';
                                break;
                        }
 
@@ -369,12 +369,12 @@ ORDER BY start_time DESC",
 
                        case 'N':
                                $content['auto_title'] = getMessage('RALLYE_START_AUTO_ADD_NOW');
-                               $content['auto'] = "1";
+                               $content['auto'] = '1';
                                break;
                        }
 
                        // Output row
-                       $OUT .= LOAD_TEMPLATE("admin_list_rallyes_row", true, $content);
+                       $OUT .= LOAD_TEMPLATE('admin_list_rallyes_row', true, $content);
                        $SW = 3 - $SW;
                }
 
@@ -383,7 +383,7 @@ ORDER BY start_time DESC",
                define('__RALLYE_ROWS', $OUT);
 
                // Load template
-               LOAD_TEMPLATE("admin_list_rallyes");
+               LOAD_TEMPLATE('admin_list_rallyes');
        } else {
                // No rallyes setup so far
                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('RALLYE_NO_RALLYES_SETUP'));
index 596cd56b2cb0efee8ca830ab34b11572e7fe3169..77912df4965568d679556de2e5329a3cfaa7d7c3 100644 (file)
@@ -67,7 +67,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                        // Loads surname, family's name and the email address
                        $result     = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s",
                                array($uid), __FILE__, __LINE__);
-                       $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid",
+                       $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY `userid` ASC",
                                array($uid), __FILE__, __LINE__);
                        $menge      = SQL_RESULT($result    , 0, 0);
                        $menge_lck  = SQL_RESULT($result_lck, 0, 0);
@@ -81,7 +81,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                array($uid), __FILE__, __LINE__);
 
                        // Output info message
-                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), ADMIN_USER_PROFILE_LINK(REQUEST_GET('uid')), $menge, $menge_lck));
+                       LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink(REQUEST_GET('uid')), $menge, $menge_lck));
                }
 
                // Are there some levels (VERY BAD IF NONE!)
@@ -97,14 +97,14 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                        // Load all refs of this user
                                        $result_refs = SQL_QUERY_ESC("SELECT refid FROM `{!_MYSQL_PREFIX!}_user_refs` WHERE userid=%s AND level='%s' ORDER BY refid ASC",
                                                array($uid, $levels['level']), __FILE__, __LINE__);
-                                       //* DEBUG: */ echo $uid."/".$levels['level']."/".SQL_NUMROWS($result_refs)."<br />\n";
+                                       //* DEBUG: */ echo $uid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."<br />\n";
 
                                        // Do we have levels?
                                        if (SQL_NUMROWS($result_refs) > 0) {
                                                // Loads surname, family's name and the email address
                                                $result     = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s",
                                                        array($uid), __FILE__, __LINE__);
-                                               $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY userid",
+                                               $result_lck = SQL_QUERY_ESC("SELECT COUNT(*) FROM `{!_MYSQL_PREFIX!}_user_data` WHERE refid=%s AND status != 'CONFIRMED' ORDER BY `userid` ASC",
                                                        array($uid), __FILE__, __LINE__);
                                                $menge      = SQL_RESULT($result    , 0, 0);
                                                $menge_lck  = SQL_RESULT($result_lck, 0, 0);
@@ -114,7 +114,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                                SQL_FREERESULT($result_lck);
 
                                                // Output info message
-                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), ADMIN_USER_PROFILE_LINK($uid), $menge, $menge_lck);
+                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($uid), $menge, $menge_lck);
 
                                                // Init variables
                                                $OUT_REFS = ''; $SW = 2;
@@ -143,18 +143,18 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                                                // Prepare data for the template
                                                                $content = array(
                                                                        'sw'         => $SW,
-                                                                       'u_link'     => ADMIN_USER_PROFILE_LINK($data['userid']),
-                                                                       'gender'     => TRANSLATE_GENDER($data['gender']),
-                                                                       'refs_link'  => "0",
+                                                                       'u_link'     => generateUserProfileLink($data['userid']),
+                                                                       'gender'     => translateGender($data['gender']),
+                                                                       'refs_link'  => '0',
                                                                        'surname'    => $data['surname'],
                                                                        'family'     => $data['family'],
-                                                                       'email'      => "[<a href=\"".CREATE_EMAIL_LINK($data['email'], "user_data")."\">".$data['email']."</a>]",
-                                                                       'status'     => TRANSLATE_STATUS($data['status']),
-                                                                       'registered' => MAKE_DATETIME($data['joined'], "3"),
+                                                                       'email'      => "[<a href=\"".generateMemberEmailLink($data['email'], "user_data")."\">".$data['email']."</a>]",
+                                                                       'status'     => translateUserStatus($data['status']),
+                                                                       'registered' => generateDateTime($data['joined'], "3"),
                                                                );
 
                                                                // Check if referal count is larger 0 and update link
-                                                               if ($refs_cnt > 0) $content['refs_link'] = ADMIN_USER_PROFILE_LINK($data['userid'], $refs_cnt, "list_refs");
+                                                               if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink($data['userid'], $refs_cnt, "list_refs");
 
                                                                // Load template for level one
                                                                $OUT_REFS .= LOAD_TEMPLATE("admin_list_refs_row", true, $content);
@@ -174,7 +174,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                                } // END - while
                                        } else {
                                                // Output info message
-                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), ADMIN_USER_PROFILE_LINK($uid), "0", "0");
+                                               $levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($uid), '0', '0');
 
                                                // No refs found
                                                $levels['rows'] = LOAD_TEMPLATE("admin_list_refs_norefs", true, array('uid' => $uid));
@@ -195,18 +195,18 @@ ORDER BY level ASC", __FILE__, __LINE__);
                                        // Prepare data for the template
                                        $content = array(
                                                'sw'         => $SW,
-                                               'u_link'     => ADMIN_USER_PROFILE_LINK($levels['userid']),
-                                               'gender'     => TRANSLATE_GENDER($levels['gender']),
-                                               'refs_link'  => "0",
+                                               'u_link'     => generateUserProfileLink($levels['userid']),
+                                               'gender'     => translateGender($levels['gender']),
+                                               'refs_link'  => '0',
                                                'surname'    => $levels['surname'],
                                                'family'     => $levels['family'],
-                                               'email'      => "[<a href=\"".CREATE_EMAIL_LINK($levels['email'], "user_data")."\">".$levels['email']."</a>]",
-                                               'status'     => TRANSLATE_STATUS($levels['status']),
-                                               'registered' => MAKE_DATETIME($levels['joined'], "3"),
+                                               'email'      => "[<a href=\"".generateMemberEmailLink($levels['email'], "user_data")."\">".$levels['email']."</a>]",
+                                               'status'     => translateUserStatus($levels['status']),
+                                               'registered' => generateDateTime($levels['joined'], "3"),
                                        );
 
                                        // Check if referal count is larger 0 and update link
-                                       if ($refs_cnt > 0) $content['refs_link'] = ADMIN_USER_PROFILE_LINK($levels['userid'], $refs_cnt, "list_refs");
+                                       if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink($levels['userid'], $refs_cnt, "list_refs");
 
                                        // Load template for level one
                                        $OUT .= LOAD_TEMPLATE("admin_list_refs_row", true, $content);
@@ -219,7 +219,7 @@ ORDER BY level ASC", __FILE__, __LINE__);
                        // Prepare content
                        $content = array(
                                'rows' => $OUT,
-                               'uid'  => ADMIN_USER_PROFILE_LINK(REQUEST_GET('uid'))
+                               'uid'  => generateUserProfileLink(REQUEST_GET('uid'))
                        );
 
                        // Load main template
index 9bbaf602b7ffa6693de1830376226124c0748ecc..af15d3b2dbcecb40fc065e625844e35770b7da5d 100644 (file)
@@ -45,11 +45,11 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (REQUEST_ISSET_GET(('id'))) {
+if (REQUEST_ISSET_GET('id')) {
        // Show detailed informations to a sponsor
        $result = SQL_QUERY_ESC("SELECT company, position, gender, surname, family, street_nr1, street_nr2, zip, city, country, phone, fax, cell, email, url, tax_ident, status, sponsor_created, last_online, last_change, receive_warnings, points_amount, points_used, remote_addr, warning_interval, refid, ref_count
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' LIMIT 1",
+WHERE `id`='%s' LIMIT 1",
  array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
@@ -78,7 +78,7 @@ WHERE id='%s' LIMIT 1",
                define('__SPONSOR_POSITION'   , $DATA['position']);
                define('__SPONSOR_TAX_IDENT'  , $DATA['tax_ident']);
                //  Personal data
-               define('__SPONSOR_GENDER'      , TRANSLATE_GENDER($DATA['gender']));
+               define('__SPONSOR_GENDER'      , translateGender($DATA['gender']));
                define('__SPONSOR_SURNAME'    , $DATA['surname']);
                define('__SPONSOR_FAMILY'     , $DATA['family']);
                define('__SPONSOR_STREET1'    , $DATA['street_nr1']);
@@ -94,19 +94,19 @@ WHERE id='%s' LIMIT 1",
                define('__SPONSOR_EMAIL_VALUE', $DATA['email']);
                define('__SPONSOR_URL'        , DEREFERER($DATA['url']));
                //  Timestamps
-               define('__SPONSOR_CREATED'    , MAKE_DATETIME($DATA['sponsor_created'], "2"));
-               define('__SPONSOR_LAST_ONLINE', MAKE_DATETIME($DATA['last_online'], "2"));
-               define('__SPONSOR_LAST_CHANGE', MAKE_DATETIME($DATA['last_change'], "2"));
+               define('__SPONSOR_CREATED'    , generateDateTime($DATA['sponsor_created'], "2"));
+               define('__SPONSOR_LAST_ONLINE', generateDateTime($DATA['last_online'], "2"));
+               define('__SPONSOR_LAST_CHANGE', generateDateTime($DATA['last_change'], "2"));
                //  Sponsor points
-               define('__SPONSOR_AMOUNT'     , TRANSLATE_COMMA($DATA['points_amount']));
-               define('__SPONSOR_USED'       , TRANSLATE_COMMA($DATA['points_used']));
+               define('__SPONSOR_AMOUNT'     , translateComma($DATA['points_amount']));
+               define('__SPONSOR_USED'       , translateComma($DATA['points_used']));
                //  Warning because low points
-               define('__SPONSOR_REC_WARNING', TRANSLATE_YESNO($DATA['receive_warnings']));
-               define('__SPONSOR_INTERVAL'   , CREATE_FANCY_TIME($DATA['warning_interval']));
+               define('__SPONSOR_REC_WARNING', translateYesNo($DATA['receive_warnings']));
+               define('__SPONSOR_INTERVAL'   , createFancyTime($DATA['warning_interval']));
                //  Orders total
                define('__SPONSOR_ORDERS'     , $orders);
                //  Other data
-               define('__SPONSOR_STATUS'     , SPONSOR_TRANSLATE_STATUS($DATA['status']));
+               define('__SPONSOR_STATUS'     , sponsorTranslateUserStatus($DATA['status']));
                define('__SPONSOR_REFID'      , $DATA['refid']);
                define('__SPONSOR_REMOTE_ADR' , $DATA['remote_addr']);
                define('__SPONSOR_REFS'       , $DATA['ref_count']);
@@ -119,7 +119,7 @@ WHERE id='%s' LIMIT 1",
        }
 } elseif (REQUEST_ISSET_GET(('rid'))) {
        // Search for sponsor
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
         array(bigintval(REQUEST_GET('rid'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Free memory
@@ -156,14 +156,14 @@ FROM `{!_MYSQL_PREFIX!}_sponsor_data` ORDER BY `id`", __FILE__, __LINE__);
                        $content = array(
                                'id'      => $content['id'],
                                'sw'      => $SW,
-                               'gender'  => TRANSLATE_GENDER($content['gender']),
+                               'gender'  => translateGender($content['gender']),
                                'sname'   => $content['surname'],
                                'fname'   => $content['family'],
                                'email'   => "mailto:".$content['email'],
-                               'status'  => SPONSOR_TRANSLATE_STATUS($content['status']),
-                               'created' => MAKE_DATETIME($content['sponsor_created'], "2"),
-                               'last'    => MAKE_DATETIME($content['last_online'], "2"),
-                               'points'  => TRANSLATE_COMMA($content['points_amount'] - $content['points_used']),
+                               'status'  => sponsorTranslateUserStatus($content['status']),
+                               'created' => generateDateTime($content['sponsor_created'], "2"),
+                               'last'    => generateDateTime($content['last_online'], "2"),
+                               'points'  => translateComma($content['points_amount'] - $content['points_used']),
                                'ip'      => $content['remote_addr'],
                        );
 
index ce0dcf9ca401d822b19c80bf377a455c306fa250..77ed5f9b3153a30c8ab423b6e25fc0b42ebbe38c 100644 (file)
@@ -59,7 +59,7 @@ if (REQUEST_ISSET_POST(('add'))) {
 
 } elseif ((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('del')) || (REQUEST_ISSET_POST('change')) || (REQUEST_ISSET_POST('remove'))) {
        // Check if at least one entry was selected
-       if (!REQUEST_ISSET_POST(('id'))) {
+       if (!REQUEST_ISSET_POST('id')) {
                // Nothing selected for editing / deleting???
                REQUEST_UNSET_POST('edit');
                REQUEST_UNSET_POST('del');
@@ -73,7 +73,7 @@ if (REQUEST_ISSET_POST(('add'))) {
 
                        // Save entry
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_paytypes`
-SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id='%s' LIMIT 1",
+SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE `id`='%s' LIMIT 1",
                                array(
                                        REQUEST_POST('name', $id),
                                        REQUEST_POST('rate', $id),
@@ -89,7 +89,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id
                // Remove entries here...
                foreach (REQUEST_POST('id') as $id => $sel) {
                        // Remove entry
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE id='%s' LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                }
 
@@ -105,14 +105,14 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE id
 
 if (REQUEST_ISSET_POST(('add'))) {
        // Check if entry with same name does exists
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1",
                array(REQUEST_POST('pay_name')), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // No entry found so add this line
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_sponsor_paytypes` (pay_name, pay_rate, pay_min_count, pay_currency) VALUES ('%s','%s','%s','%s')",
                        array(
                                htmlspecialchars(REQUEST_POST('pay_name')),
-                               REVERT_COMMA(REQUEST_POST('pay_rate')),
+                               convertCommaToDot(REQUEST_POST('pay_rate')),
                                bigintval(REQUEST_POST('pay_min_count')),
                                htmlspecialchars(REQUEST_POST('pay_currency'))
                        ), __FILE__, __LINE__);
@@ -134,7 +134,7 @@ if (REQUEST_ISSET_POST(('add'))) {
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('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",
+               $result = SQL_QUERY_ESC("SELECT pay_name, pay_rate, pay_min_count, pay_currency FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE `id`='%s' LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Load data
@@ -146,7 +146,7 @@ if (REQUEST_ISSET_POST(('add'))) {
                                'id'   => bigintval($id),
                                'sw'   => bigintval($SW),
                                'name' => htmlspecialchars($name),
-                               'rate' => TRANSLATE_COMMA($rate),
+                               'rate' => translateComma($rate),
                                'min'  => bigintval($min),
                                'curr' => htmlspecialchars($curr)
                        );
@@ -195,7 +195,7 @@ if (REQUEST_ISSET_POST(('add'))) {
                                'sw'       => $SW,
                                'id'       => $content['id'],
                                'name'     => $content['pay_name'],
-                               'rate'     => TRANSLATE_COMMA($content['pay_rate']),
+                               'rate'     => translateComma($content['pay_rate']),
                                'min'      => $content['pay_min_count'],
                                'currency' => $content['pay_currency']
                        );
index 7e5b29ee9877c4ed79843e3d2460394f69b2c737..1052478aa77285008374bfcda64c23c788b1b13a 100644 (file)
@@ -45,9 +45,9 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-if (REQUEST_ISSET_GET(('id'))) {
+if (REQUEST_ISSET_GET('id')) {
        // Check for selected sponsor
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
         array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // ...
index 895ad0e1fd8b7c94c66b34a0359a46ef8d85be20..e134b7ecdb5a56b6162bf48c394440bf4aac103a 100644 (file)
@@ -49,7 +49,7 @@ ADD_DESCR('admin', __FILE__);
 $show = true;
 
 // Check for 'id' element
-if ((REQUEST_POST_COUNT() > 0) && ((!REQUEST_ISSET_POST(('id'))) || (!is_array(REQUEST_POST('id'))) || (count(REQUEST_POST('id')) == 0))) {
+if ((REQUEST_POST_COUNT() > 0) && ((!REQUEST_ISSET_POST('id')) || (!is_array(REQUEST_POST('id'))) || (count(REQUEST_POST('id')) == 0))) {
        // Not found so output message
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_SELECTIONS'));
 
@@ -62,17 +62,17 @@ if (REQUEST_ISSET_POST('edit')) {
        // Show entries for editing
        ADMIN_EDIT_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
-               array("id", 'userid', "url"),
-               array("bigintval", "ADD_MEMBER_SELECTION_BOX", ''),
-               array("", array(false, true, true), '')
+               'surfbar_urls',
+               array('id', 'userid', 'url'),
+               array('bigintval', 'ADD_MEMBER_SELECTION_BOX', ''),
+               array('', array(false, true, true), '')
        );
        $show = false;
 } elseif (REQUEST_ISSET_POST(('do_edit'))) {
        // Change data of entries
        ADMIN_EDIT_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
+               'surfbar_urls',
                array(),
                array(),
                array(),
@@ -82,55 +82,55 @@ if (REQUEST_ISSET_POST('edit')) {
        // Show entries for deletion
        ADMIN_DELETE_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
-               array("id", 'userid', "url", "registered"),
-               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", ''),
-               array("", '', '', '')
+               'surfbar_urls',
+               array('id', 'userid', 'url', 'registered'),
+               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', ''),
+               array('', '', '', '')
        );
        $show = false;
 } elseif (REQUEST_ISSET_POST(('do_delete'))) {
        // Remove entries from database
-       ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), "surfbar_urls", array(), array(), array(), true);
+       ADMIN_DELETE_ENTRIES_CONFIRM(REQUEST_POST('id'), 'surfbar_urls', array(), array(), array(), true);
 } elseif (REQUEST_ISSET_POST(('lock'))) {
        // Un-/lock selected URLs. This does not work for pending URLs
        ADMIN_LOCK_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
-               array("id", 'userid', "url", "registered", "status"),
-               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", '', "SURFBAR_TRANSLATE_STATUS"),
-               array("", '', '', '', '')
+               'surfbar_urls',
+               array('id', 'userid', 'url', 'registered', 'status'),
+               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'surfbarTranslateUserStatus'),
+               array('', '', '', '', '')
        );
        $show = false;
 } elseif (REQUEST_ISSET_POST(('do_lock'))) {
        // Un-/lock selected URLs. This does not work for pending URLs
        ADMIN_LOCK_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
+               'surfbar_urls',
                array(),
                array(),
                array(),
-               array("status" => array("ACTIVE" => "LOCKED", "LOCKED" => "ACTIVE")),
+               array('status' => array('ACTIVE' => 'LOCKED', 'LOCKED' => 'ACTIVE')),
                true
        );
 } elseif (REQUEST_ISSET_POST(('undelete'))) {
        // Undelete selected URLs. This does only work for deleted URLs... ;-)
        ADMIN_UNDELETE_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
-               array("id", 'userid', "url", "registered", "status"),
-               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", '', "SURFBAR_TRANSLATE_STATUS"),
-               array("", '', '', '', '')
+               'surfbar_urls',
+               array('id', 'userid', 'url', 'registered', 'status'),
+               array('bigintval', 'generateUserProfileLink', 'FRAMETESTER', '', 'surfbarTranslateUserStatus'),
+               array('', '', '', '', '')
        );
        $show = false;
 } elseif (REQUEST_ISSET_POST(('do_undelete'))) {
        // Undelete selected URLs. This does only work for deleted URLs... ;-)
        ADMIN_UNDELETE_ENTRIES_CONFIRM(
                REQUEST_POST('id'),
-               "surfbar_urls",
+               'surfbar_urls',
                array(),
                array(),
                array(),
-               array("status" => array("DELETED" => "ACTIVE")),
+               array('status' => array('DELETED' => 'ACTIVE')),
                true
        );
 }
@@ -150,23 +150,23 @@ if (SQL_NUMROWS($result) > 0) {
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate"/add content
                $content['sw']          = $SW;
-               $content['userid']      = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['userid']      = generateUserProfileLink($content['userid']);
                $content['url']         = FRAMETESTER($content['url']);
-               $content['views_total'] = TRANSLATE_COMMA($content['views_total']);
-               $content['status']      = SURFBAR_TRANSLATE_STATUS($content['status']);
-               $content['registered']  = MAKE_DATETIME($content['registered'], 2);
-               $content['last_locked'] = MAKE_DATETIME($content['last_locked'], 2);
+               $content['views_total'] = translateComma($content['views_total']);
+               $content['status']      = surfbarTranslateUserStatus($content['status']);
+               $content['registered']  = generateDateTime($content['registered'], 2);
+               $content['last_locked'] = generateDateTime($content['last_locked'], 2);
                if (empty($content['lock_reason'])) $content['lock_reason'] = '---';
 
                // Load row template
-               $OUT .= LOAD_TEMPLATE("admin_list_surfbar_urls_row", true, $content);
+               $OUT .= LOAD_TEMPLATE('admin_list_surfbar_urls_row', true, $content);
 
                // Switch color
                $SW = 3 - $SW;
        } // END - while
 
        // Load main template
-       LOAD_TEMPLATE("admin_list_surfbar_urls", false, $OUT);
+       LOAD_TEMPLATE('admin_list_surfbar_urls', false, $OUT);
 } else {
        // No URLs in surfbar
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_SURFBAR_NO_URLS_FOUND'));
index 8835316d6f52b0ab889ac7464e5b21c6dff3672c..3808ecf675e9b7e193bdc56fbbc176669abb6520 100644 (file)
@@ -54,19 +54,19 @@ if (!REQUEST_ISSET_GET(('type'))) REQUEST_SET_GET('type', "your");
 switch (REQUEST_GET('type'))
 {
 case "your": // List only your own open (new) tasks
-       $whereStatement = "assigned_admin='".GET_CURRENT_ADMIN_ID()."' AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'";
+       $whereStatement = "`assigned_admin`='".getCurrentAdminId()."' AND `status`='NEW' AND task_type != 'EXTENSION_UPDATE'";
        break;
 
 case "updates": // List only updates assigned to you
-       $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='NEW' AND task_type = 'EXTENSION_UPDATE'";
+       $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='NEW' AND task_type = 'EXTENSION_UPDATE'";
        break;
 
 case "solved": // List only solved tasks assigned to you
-       $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='SOLVED'";
+       $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='SOLVED'";
        break;
 
 case "unassigned": // List unassigned (but not deleted) tasks
-       $whereStatement = "assigned_admin='0' AND status != 'DELETED'";
+       $whereStatement = "`assigned_admin`=0 AND `status` != 'DELETED'";
        break;
 
 case "deleted": // List all deleted
@@ -74,7 +74,7 @@ case "deleted": // List all deleted
        break;
 
 case "closed": // List all closed
-       $whereStatement = "assigned_admin=".GET_CURRENT_ADMIN_ID()." AND `status`='CLOSED'";
+       $whereStatement = "`assigned_admin`=".getCurrentAdminId()." AND `status`='CLOSED'";
        break;
 
 default: // Unknown type
@@ -85,11 +85,11 @@ default: // Unknown type
 
 if (!empty($whereStatement)) {
        $SEL = 0;
-       if (REQUEST_ISSET_POST(('task'))) $SEL = SELECTION_COUNT(REQUEST_POST('task'));
+       if (REQUEST_ISSET_POST(('task'))) $SEL = countSelection(REQUEST_POST('task'));
 
        if ((REQUEST_ISSET_POST(('assign'))) && ($SEL > 0)) {
                // Assign / do tasks
-               LOAD_INC_ONCE("inc/modules/admin/overview-inc.php");
+               loadIncludeOnce("inc/modules/admin/overview-inc.php");
                if (empty($dmy)) $dmy = '';
                OUTPUT_SELECTED_TASKS(REQUEST_POST_ARRAY(), $dmy);
        } else {
@@ -103,15 +103,15 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                        if (REQUEST_ISSET_POST(('unassign'))) {
                                // Unassign from tasks
                                foreach (REQUEST_POST('task') as $id => $sel) {
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET assigned_admin=0 WHERE id=%s AND assigned_admin=%s LIMIT 1",
-                                               array(bigintval($id), GET_CURRENT_ADMIN_ID()), __FILE__, __LINE__);
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
+                                               array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                                }
                        } elseif (REQUEST_ISSET_POST('del')) {
                                // Delete tasks
                                foreach (REQUEST_POST('task') as $id => $sel) {
                                        if (REQUEST_GET('type') == "deleted") {
                                                // Delete task immediately
-                                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_task_system` WHERE `id`=%s LIMIT 1",
                                                        array(bigintval($id)),__FILE__, __LINE__);
                                        } else {
                                                // Mark task as to be deleted (purged by autppurge extension)
@@ -137,7 +137,7 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                        $content['infos'] = '---';
 
                        // Generate link
-                       $content['assigned_admin'] = GENERATE_AID_LINK($content['assigned_admin']);
+                       $content['assigned_admin'] = generateAdminLink($content['assigned_admin']);
 
                        // Get admin task
                        $content['task_type_msg'] = getMessage('ADMIN_TASK_IS_'.strtoupper($content['task_type']).'');
@@ -145,16 +145,16 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                        // Generate infos
                        switch ($content['task_type'])
                        {
-                       case "EXTENSION":
-                       case "EXTENSION_UPDATE":
-                               $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ":") - 1);
+                       case 'EXTENSION':
+                       case 'EXTENSION_UPDATE':
+                               $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ':') - 1);
                                break;
                        }
 
                        // Member assigned with task?
                        if ($content['userid'] > 0) {
                                // Member found otherwise it's a system task
-                               $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']);
+                               $content['userid'] = generateUserProfileLink($content['userid']);
                        } else {
                                // Is a system task!
                                $content['userid'] = "<em>{--ADMIN_IS_SYSTEM_TASK--}</em>";
@@ -167,11 +167,11 @@ ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __L
                                'admin'   => $content['assigned_admin'],
                                'uid'     => $content['userid'],
                                'type'    => $content['task_type_msg'],
-                               'created' => MAKE_DATETIME($content['task_created'], "2")
+                               'created' => generateDateTime($content['task_created'], "2")
                        ));
 
                        // Do we have an extension task?
-                       if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) {
+                       if (($content['task_type'] == 'EXTENSION') && (GET_EXT_VERSION($content['infos']) == '')) {
                                // Load extension row template
                                // @TODO Rewrite this to $OUT .= ..., true, ...
                                LOAD_TEMPLATE("admin_list_task_ext_rows", false, $content);
index a6aa3892216dde70699fe99e3ccd56d7d842df8a..24cff28bedb412b1ea65e45a6c3b65b4ea8981df 100644 (file)
@@ -57,11 +57,11 @@ if (SQL_NUMROWS($result) > 0)
                $content = array(
                        'sw'        => $SW,
                        'idx'       => $content['trans_id'],
-                       'stamp'     => MAKE_DATETIME($content['time_trans'], "3"),
-                       'from_link' => ADMIN_USER_PROFILE_LINK($content['userid']),
-                       'to_link'   => ADMIN_USER_PROFILE_LINK($content['to_uid']),
+                       'stamp'     => generateDateTime($content['time_trans'], "3"),
+                       'from_link' => generateUserProfileLink($content['userid']),
+                       'to_link'   => generateUserProfileLink($content['to_uid']),
                        'reason'    => wordwrap($content['reason'], 15),
-                       'points'    => TRANSLATE_COMMA($content['points']),
+                       'points'    => translateComma($content['points']),
                );
 
                // Load row template add points and switch color
@@ -87,7 +87,7 @@ if (SQL_NUMROWS($result) > 0)
 define('__TRANSFER_ROWS', $OUT);
 
 // Remeber total amount
-define('__TRANSFER_TOTAL_VALUE', TRANSLATE_COMMA($total));
+define('__TRANSFER_TOTAL_VALUE', translateComma($total));
 
 // Set title
 define('__TRANSFER_TITLE', getMessage('TRANSFER_LIST_ALL'));
index cc64e36d48208b2838b1cd0c46b5dee4ea14edff..da4767d126da84a912920583403dcc0375417081 100644 (file)
@@ -69,7 +69,7 @@ WHERE p.id='".REQUEST_GET('mid')."' LIMIT 1";
        define('__LIST_UNCON_TITLE', getMessage('LIST_UNCONFIRMED_BONUS_LINKS'));
 
        // SQL query for mail data (both ids are required for compatiblity to above normal mail
-       $sql = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id='".REQUEST_GET('bid')."' LIMIT 1";
+       $sql = "SELECT id, id, subject, text, url, timestamp, mails_sent FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`='".REQUEST_GET('bid')."' LIMIT 1";
 
        // Column, type and ID for member's mail
        $col = 'bonus_id'; $type = "BONUS"; $ID = REQUEST_GET('bid');
@@ -116,12 +116,12 @@ WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
                                // @TODO Rewritings: uid->userid
                                $content = array(
                                        'sw'     => $SW,
-                                       'u_link' => ADMIN_USER_PROFILE_LINK($content['userid']),
+                                       'u_link' => generateUserProfileLink($content['userid']),
                                        'uid'    => $content['userid'],
                                        'link'   => $LINK,
                                        'id'     => $ID,
-                                       'email'  => "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".TRANSLATE_GENDER($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
-                                       'status' => TRANSLATE_STATUS($content['status']),
+                                       'email'  => "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>",
+                                       'status' => translateUserStatus($content['status']),
                                );
 
                                // Load row template and switch colors
@@ -147,7 +147,7 @@ WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
                        'text'          => COMPILE_CODE($text),
                        'url'           => FRAMETESTER($url),
                        'unconfirmed'   => $unconfirmed,
-                       'stamp'         => MAKE_DATETIME($stamp, "2"),
+                       'stamp'         => generateDateTime($stamp, "2"),
                        'rows'          => $OUT
                );
 
@@ -155,9 +155,9 @@ WHERE l.%s='%s' ORDER BY l.userid LIMIT %s",
                LOAD_TEMPLATE("admin_list_unconfirmed", false, $content);
        } elseif (REQUEST_GET('mid') > 0) {
                // Data in pool or in user_stats not found, so let's find out where data is missing
-               $result1 = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+               $result1 = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                        array(bigintval($ID)), __FILE__, __LINE__);
-               $result2 = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
+               $result2 = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s LIMIT 1",
                        array(bigintval($ID)), __FILE__, __LINE__);
                if (SQL_NUMROWS($result1) == 1) {
                        // pool table
index dc3cc18f02b75490e36addab5969f6a0b84905dc..a13bbaf73243ebc10448c32ed1010025f6cff07f 100644 (file)
@@ -40,7 +40,7 @@
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
-} elseif ((!EXT_IS_ACTIVE('user')) || (GET_EXT_VERSION('user') == "")) {
+} elseif ((!EXT_IS_ACTIVE('user')) || (GET_EXT_VERSION('user') == '')) {
        // Missing extension!
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'user'));
        return;
@@ -52,7 +52,7 @@ ADD_DESCR('admin', __FILE__);
 // Init title with "all accounts"
 $listHeader = getMessage('ADMIN_ALL_ACCOUNTS');
 if (REQUEST_ISSET_GET(('status'))) {
-       // Set title according to the "status"
+       // Set title according to the 'status'
        $listHeader = getMessage(sprintf("ADMIN_LIST_STATUS_%s_ACCOUNTS", strtoupper(REQUEST_GET(('status')))));
 } elseif (REQUEST_ISSET_GET(('mode'))) {
        // Set title according to the "mode"
@@ -129,29 +129,29 @@ LIMIT 1",
                // Is this above zero?
                if ($stamp > 0) {
                        // Then use it
-                       define('_BIRTHDAY', MAKE_DATETIME($stamp, "3"));
+                       define('_BIRTHDAY', generateDateTime($stamp, "3"));
                } else {
                        // Zero or below so set zero!
-                       define('_BIRTHDAY', MAKE_DATETIME(0, "3"));
+                       define('_BIRTHDAY', generateDateTime(0, "3"));
                }
 
                // Prepare data for template
                define('_REFS' , $REFS);
                define('_CATS' , $CATS);
                define('_LINKS', $LINKS);
-               define('_ADMIN_LINKS', MEMBER_ACTION_LINKS($uid, $DATA['status']));
-               $DATA['gender']            = TRANSLATE_GENDER($DATA['gender']);
-               $DATA['email_link']        = CREATE_EMAIL_LINK($DATA['email'], "user_data");
-               $DATA['status']            = TRANSLATE_STATUS($DATA['status']);
-               $DATA['last_online']       = MAKE_DATETIME($DATA['last_online'], "0");
-               $DATA['used_points']       = TRANSLATE_COMMA($DATA['used_points']);
-               if ($DATA['emails_sent'] > 0) $DATA['emails_sent'] = $base."&amp;what=email_details&amp;uid=".$uid."\">".TRANSLATE_COMMA($DATA['emails_sent'])."</a>]";
-               $DATA['joined']            = MAKE_DATETIME($DATA['joined'], "0");
-               $DATA['last_update']       = MAKE_DATETIME($DATA['last_update'], "0");
-               $DATA['last_profile_sent'] = MAKE_DATETIME($DATA['last_profile_sent'], "0");
-               $DATA['total']             = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "points"));
-               $DATA['locked']            = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
-               $DATA['lock_timestamp']    = MAKE_DATETIME($DATA['lock_timestamp'], "2");
+               define('_ADMIN_LINKS', generateMemberAdminActionLinks($uid, $DATA['status']));
+               $DATA['gender']            = translateGender($DATA['gender']);
+               $DATA['email_link']        = generateMemberEmailLink($DATA['email'], "user_data");
+               $DATA['status']            = translateUserStatus($DATA['status']);
+               $DATA['last_online']       = generateDateTime($DATA['last_online'], '0');
+               $DATA['used_points']       = translateComma($DATA['used_points']);
+               if ($DATA['emails_sent'] > 0) $DATA['emails_sent'] = $base."&amp;what=email_details&amp;uid=".$uid."\">".translateComma($DATA['emails_sent'])."</a>]";
+               $DATA['joined']            = generateDateTime($DATA['joined'], '0');
+               $DATA['last_update']       = generateDateTime($DATA['last_update'], '0');
+               $DATA['last_profile_sent'] = generateDateTime($DATA['last_profile_sent'], '0');
+               $DATA['total']             = translateComma(GET_TOTAL_DATA($uid, "user_points", "points"));
+               $DATA['locked']            = translateComma(GET_TOTAL_DATA($uid, "user_points", "locked_points"));
+               $DATA['lock_timestamp']    = generateDateTime($DATA['lock_timestamp'], "2");
 
                // Is the lock reason not set?
                if (!isset($DATA['lock_reason'])) $DATA['lock_reason'] = '---';
@@ -169,18 +169,18 @@ LIMIT 1",
                // Is the user extension newer?
                if (GET_EXT_VERSION('user') >= '0.3.4') {
                        // Then "translate" the number
-                       $DATA['rand_confirmed'] = TRANSLATE_COMMA($DATA['rand_confirmed']);
+                       $DATA['rand_confirmed'] = translateComma($DATA['rand_confirmed']);
                } // END - if
 
                // Clickrate
                $DATA['click_rate'] = 0;
                if ($DATA['emails_received'] > 0) {
-                       $DATA['click_rate'] = TRANSLATE_COMMA($DATA['mails_confirmed'] / $DATA['emails_received'] * 100);
+                       $DATA['click_rate'] = translateComma($DATA['mails_confirmed'] / $DATA['emails_received'] * 100);
                } // END - if
 
                // "Translate" more data
-               $DATA['mails_confirmed'] = TRANSLATE_COMMA($DATA['mails_confirmed']);
-               $DATA['emails_received'] = TRANSLATE_COMMA($DATA['emails_received']);
+               $DATA['mails_confirmed'] = translateComma($DATA['mails_confirmed']);
+               $DATA['emails_received'] = translateComma($DATA['emails_received']);
 
                // Is the extension 'country' installed?
                if (EXT_IS_ACTIVE('country')) {
@@ -188,7 +188,7 @@ LIMIT 1",
                        $DATA['country'] = COUNTRY_GENERATE_INFO($DATA['country_code']);
                } elseif ($DATA['country'] == 0) {
                        // Zero ID???
-                       $DATA['country'] = "???";
+                       $DATA['country'] = '???';
                }
 
                // Load user-details template
@@ -295,14 +295,14 @@ LIMIT 1",
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Set refid link
-                       if ($content['refid'] > 0) $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']);
+                       if ($content['refid'] > 0) $content['refid'] = generateUserProfileLink($content['refid']);
 
                        // Get number of unconfirmed mails
                        $LINKS = GET_TOTAL_DATA($content['userid'], "user_links", "id", 'userid', true);
-                       if ($LINKS > 0) $LINKS = $base."&amp;what=list_links&amp;uid=".$content['userid']."\">".TRANSLATE_COMMA($LINKS)."</a>]";
+                       if ($LINKS > 0) $LINKS = $base."&amp;what=list_links&amp;uid=".$content['userid']."\">".translateComma($LINKS)."</a>]";
 
                        // Set link to sent mails if present
-                       if ($content['emails_sent'] > 0) $content['emails_sent'] = $base."&amp;what=email_details&amp;uid=".$content['userid']."\">".TRANSLATE_COMMA($content['emails_sent'])."</a>]";
+                       if ($content['emails_sent'] > 0) $content['emails_sent'] = $base."&amp;what=email_details&amp;uid=".$content['userid']."\">".translateComma($content['emails_sent'])."</a>]";
 
                        // Add nickname
                        if (empty($content['nickname']) || $content['nickname'] == $content['userid']) $content['nickname'] = '---';
@@ -318,17 +318,17 @@ LIMIT 1",
 
                        // Transfer data to array
                        $content['sw']     = $SW;
-                       $content['uid']    = ADMIN_USER_PROFILE_LINK($content['userid']);
-                       $content['gender'] = TRANSLATE_GENDER($content['gender']);
-                       $content['email']  = "[<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".$content['email']."</a>]";
+                       $content['uid']    = generateUserProfileLink($content['userid']);
+                       $content['gender'] = translateGender($content['gender']);
+                       $content['email']  = "[<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['email']."</a>]";
                        $content['addr']   = $content['REMOTE_ADDR'];
                        $content['links']  = $LINKS;
-                       $content['alinks'] = MEMBER_ACTION_LINKS($content['userid'], $content['status']);
-                       $content['points'] = TRANSLATE_COMMA($pointsTotal);
-                       $content['rate']   = TRANSLATE_COMMA($clickRate);
-                       $content['locked'] = TRANSLATE_COMMA(GET_TOTAL_DATA($content['userid'], "user_points", "locked_points"));
-                       $content['lock_timestamp'] = MAKE_DATETIME($content['lock_timestamp'], "2");
-                       $content['status'] = TRANSLATE_STATUS($content['status']);
+                       $content['alinks'] = generateMemberAdminActionLinks($content['userid'], $content['status']);
+                       $content['points'] = translateComma($pointsTotal);
+                       $content['rate']   = translateComma($clickRate);
+                       $content['locked'] = translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "locked_points"));
+                       $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], "2");
+                       $content['status'] = translateUserStatus($content['status']);
 
                        // Is the lock reason not set?
                        if (!isset($content['lock_reason'])) $content['lock_reason'] = '---';
@@ -338,9 +338,9 @@ LIMIT 1",
                        if (EXT_IS_ACTIVE('country')) {
                                // Then overwrite country information
                                $content['country'] = COUNTRY_GENERATE_INFO($content['country_code']);
-                       } elseif ($content['country'] == "") {
+                       } elseif ($content['country'] == '') {
                                // Zero ID???
-                               $content['country'] = "???";
+                               $content['country'] = '???';
                        }
 
                        // Load row template and switch colors
index 750d989585cc3f6cae6b1464946b1cf8e79c0bc0..24501b427bd5a1d7d0b9553ae9315a69d81bcd11 100644 (file)
@@ -56,9 +56,9 @@ if (SQL_NUMROWS($result) > 0) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Translate some data and add color
                $content['sw']                                  = $SW;
-               $content['link']                                = ADMIN_USER_PROFILE_LINK($content['userid']);
-               $content['wernis_amount']               = TRANSLATE_COMMA($content['wernis_amount']);
-               $content['wernis_timestamp']    = MAKE_DATETIME($content['wernis_timestamp'], "2");
+               $content['link']                                = generateUserProfileLink($content['userid']);
+               $content['wernis_amount']               = translateComma($content['wernis_amount']);
+               $content['wernis_timestamp']    = generateDateTime($content['wernis_timestamp'], "2");
                $content['raw_type']                    = strtolower($content['wernis_type']);
                $content['wernis_type']                 = WERNIS_TRANSFER_STATUS($content['wernis_type']);
 
index 7dfd145aa6b0e6470ec22bccc856496bf1035e6a..4ff7c5ac7994f9307fb6d9299e0d9ad23784655c 100644 (file)
@@ -91,7 +91,7 @@ if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id'])))
        $code = $code[0];
 
        // Output message
-       LOAD_TEMPLATE('admin_yoomedia_error', false, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(YOOMEDIA_TRANSLATE_ERROR($code))));
+       LOAD_TEMPLATE('admin_yoomedia_error', false, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(yoomediaTranslateError($code))));
        return false;
 }
 
@@ -99,8 +99,8 @@ if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id'])))
 $OUT = ''; $SW = 2;
 foreach ($result as $entry) {
        // Translate some data
-       $entry['pay']    = TRANSLATE_COMMA($entry['pay'], true, 5);
-       $entry['remain'] = TRANSLATE_COMMA($entry['remain']);
+       $entry['pay']    = translateComma($entry['pay'], true, 5);
+       $entry['remain'] = translateComma($entry['remain']);
        $entry['sw']     = $SW;
 
        // Check reload lock
@@ -123,7 +123,7 @@ foreach ($result as $entry) {
                        } // END - if
 
                        // Add reload lock
-                       $entry['already'] = sprintf(getMessage('ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN'), CREATE_FANCY_TIME($countdown));
+                       $entry['already'] = sprintf(getMessage('ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN'), createFancyTime($countdown));
                } else {
                        // Never resentable unless manual removal
                        $entry['already'] = getMessage('ADMIN_YOOMEDIA_TEXTMAIL_MANUALLY_LOCKED');
index e1daf83ea37fc365c6556a8987abac945a6525d7..e640e77360babcfe5794fcd493a305b0e17bc295 100644 (file)
@@ -46,25 +46,25 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 $message = '';
 
-if (REQUEST_ISSET_GET(('id'))) {
+if (REQUEST_ISSET_GET('id')) {
        // Check for selected sponsor
-       $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE id='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT gender, surname, family, email, status FROM `{!_MYSQL_PREFIX!}_sponsor_data` WHERE `id`='%s' LIMIT 1",
         array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Get sponsor's current status and let only confirmed and locked status pass
                list($gender, $sname, $fname, $email, $status) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
 
-               if (($status == "CONFIRMED") || ($status == "LOCKED")) {
+               if (($status == 'CONFIRMED') || ($status == "LOCKED")) {
                        // Transfer data to constants
-                       define('__GENDER'  , TRANSLATE_GENDER($gender));
+                       define('__GENDER'  , translateGender($gender));
                        define('__SURNAME', $sname);
                        define('__FAMILY' , $fname);
                        define('__ID'     , bigintval(REQUEST_GET('id')));
 
                        if (IS_FORM_SENT()) {
                                // Create messages
-                               if ($status == "CONFIRMED") {
+                               if ($status == 'CONFIRMED') {
                                        // Message when sponsor's account got lock
                                        define('__EMAIL_MSG', getMessage('SPONSOR_ACCOUNT_LOCKED'));
                                        $subject = getMessage('SPONSOR_SUBJECT_LOCKED');
@@ -73,21 +73,21 @@ if (REQUEST_ISSET_GET(('id'))) {
                                        // Message when sponsor's account got unlock
                                        define('__EMAIL_MSG', getMessage('SPONSOR_ACCOUNT_UNLOCKED'));
                                        $subject = getMessage('SPONSOR_SUBJECT_UNLOCKED');
-                                       $status = "CONFIRMED";
+                                       $status = 'CONFIRMED';
                                }
 
                                // Load email message
                                $msg = LOAD_EMAIL_TEMPLATE("lock_sponsor", REQUEST_POST('reason'), bigintval(REQUEST_GET('id')));
 
                                // And send it away
-                               SEND_EMAIL($email, $subject, $msg);
+                               sendEmail($email, $subject, $msg);
 
                                // Update sponsor's account
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='".$status."' WHERE id='%s' LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='".$status."' WHERE `id`='%s' LIMIT 1",
                                        array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
                        } elseif (REQUEST_ISSET_POST(('no'))) {
                                // No don't lock / unlock now!
-                               LOAD_URL('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
+                               redirectToUrl('modules.php?module=admin&amp;what=list_sponsor&amp;id='.bigintval(REQUEST_GET('id')));
                        } else {
                                // Create header and text messages
                                if ($status == 'CONFIRMED') {
index 7bc533df5e41f9ecb647854e73330f76ebf9450f..efde7fa314caf417311f89b62be43c878723d92a 100644 (file)
@@ -49,7 +49,7 @@ ADD_DESCR('admin', __FILE__);
 if (REQUEST_ISSET_GET('uid')) {
        // Load user's data
        $result_user = SQL_QUERY_ESC("SELECT status, gender, surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-        array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
+               array(bigintval(REQUEST_GET('uid'))), __FILE__, __LINE__);
        $ACT = false;
        if (SQL_NUMROWS($result_user) == 1) {
                // User found
@@ -77,7 +77,7 @@ if (REQUEST_ISSET_GET('uid')) {
                                $msg = LOAD_EMAIL_TEMPLATE("lock-user", array('text' => REQUEST_POST('reason')), bigintval(REQUEST_GET('uid')));
 
                                // Send away...
-                               SEND_EMAIL(bigintval(REQUEST_GET('uid')), ADMIN_LOCKED_SUBJ, $msg);
+                               sendEmail(bigintval(REQUEST_GET('uid')), ADMIN_LOCKED_SUBJ, $msg);
                        } // END - if
 
                        // Prepare message
@@ -101,7 +101,7 @@ if (REQUEST_ISSET_GET('uid')) {
                                $msg = LOAD_EMAIL_TEMPLATE("unlock-user", array('text' => REQUEST_POST('reason')), bigintval(REQUEST_GET('uid')));
 
                                // Send away...
-                               SEND_EMAIL(bigintval(REQUEST_GET('uid')), getMessage('ADMIN_UNLOCKED_SUBJ'), $msg);
+                               sendEmail(bigintval(REQUEST_GET('uid')), getMessage('ADMIN_UNLOCKED_SUBJ'), $msg);
                                if (EXT_IS_ACTIVE('rallye')) {
                                        RALLYE_AUTOADD_USER(REQUEST_GET('uid'));
                                } // END - if
@@ -113,7 +113,7 @@ if (REQUEST_ISSET_GET('uid')) {
                } elseif (REQUEST_ISSET_POST('del')) {
                        // Delete the account
                        $ACT = true;
-                       LOAD_INC_ONCE("inc/modules/admin/what-del_user.php");
+                       loadIncludeOnce("inc/modules/admin/what-del_user.php");
                } elseif (REQUEST_ISSET_POST(('no'))) {
                        // Do not lock him...
                        $URL = ADMIN_CREATE_USERID_LINK(REQUEST_GET('uid'));
@@ -131,7 +131,7 @@ if (REQUEST_ISSET_GET('uid')) {
 
                                // Transfer data to constants for the template
                                // @TODO Rewrite these all constants
-                               define('__EMAIL', CREATE_EMAIL_LINK($email, "user_data"));
+                               define('__EMAIL', generateMemberEmailLink($email, 'user_data'));
                                define('__SNAME', $sname);
                                define('__FNAME', $fname);
                                define('__UID'  , bigintval(REQUEST_GET('uid')));
@@ -139,27 +139,27 @@ if (REQUEST_ISSET_GET('uid')) {
                                // Realy want to lock?
                                switch ($status)
                                {
-                               case "CONFIRMED": // Yes, lock him down... ;-)
-                                       define('__OK_VALUE'    , "lock");
+                               case 'CONFIRMED': // Yes, lock him down... ;-)
+                                       define('__OK_VALUE'    , 'lock');
                                        define('__HEADER_VALUE', sprintf(getMessage('ADMIN_HEADER_LOCK_ACCOUNT'), constant('__UID')));
                                        define('__TEXT_VALUE'  , sprintf(getMessage('ADMIN_TEXT_LOCK_ACCOUNT'), constant('__UID')));
                                        break;
 
-                               case "LOCKED": // Unlock the user
-                                       define('__OK_VALUE'    , "unlock");
+                               case 'LOCKED': // Unlock the user
+                                       define('__OK_VALUE'    , 'unlock');
                                        define('__HEADER_VALUE', sprintf(getMessage('ADMIN_HEADER_UNLOCK_ACCOUNT'), constant('__UID')));
                                        define('__TEXT_VALUE'  , sprintf(getMessage('ADMIN_TEXT_UNLOCK_ACCOUNT'), constant('__UID')));
                                        break;
 
-                               case "UNCONFIRMED": // Unconfirmed accounts cannot be unlocked!
-                                       define('__OK_VALUE'    , "del");
+                               case 'UNCONFIRMED': // Unconfirmed accounts cannot be unlocked!
+                                       define('__OK_VALUE'    , 'del');
                                        define('__HEADER_VALUE', sprintf(getMessage('ADMIN_HEADER_DEL_ACCOUNT'), constant('__UID')));
                                        define('__TEXT_VALUE'  , sprintf(getMessage('ADMIN_TEXT_DEL_ACCOUNT'), constant('__UID')));
                                        break;
                                }
 
                                // Output form
-                               LOAD_TEMPLATE("admin_lock_user");
+                               LOAD_TEMPLATE('admin_lock_user');
                        } else {
                                // Account does not exists!
                                LOAD_TEMPLATE('admin_settings_saved', false, "<div class=\"admin_failed\">".sprintf(getMessage('ADMIN_MEMBER_404'), REQUEST_GET('uid'))."</div>");
@@ -169,7 +169,7 @@ if (REQUEST_ISSET_GET('uid')) {
                // Is an URL set?
                if (!empty($URL)) {
                        // Reload and die...
-                       LOAD_URL($URL);
+                       redirectToUrl($URL);
                } elseif ($ACT) {
                        // An action was performed...
                        if (!empty($message)) {
index b546fc0760c057adfe499b6624fd1b07472bed41..8d1c5823489e258f55fc0f599afc46811a071f24 100644 (file)
@@ -51,9 +51,9 @@ if (REQUEST_ISSET_GET(('access'))) {
        $target = sprintf("%slogs/%s", constant('PATH'), $access);
 
        // Is the file valid and readable?
-       if (FILE_READABLE($target)) {
+       if (isFileReadable($target)) {
                // Load it directly
-               $content = READ_FILE($target);
+               $content = readFromFile($target);
 
                // Save old content
                $OUTPUT = ob_get_contents();
@@ -89,11 +89,11 @@ if (REQUEST_ISSET_GET(('access'))) {
        }
 } else {
        // List access logfiles
-       $dir = constant('PATH') . getConfig('logs_base') . "/";
+       $dir = constant('PATH') . getConfig('logs_base') . '/';
        if (isDirectory($dir)) {
                // logs directory does exist
                OUTPUT_HTML("<ol>");
-               $handle = opendir($dir) or app_die(__FILE__, __LINE__, "Cannot open directory ".getConfig('logs_base')."!");
+               $handle = opendir($dir) or app_die(__FILE__, __LINE__, "Cannot open directory ".getConfig('logs_base').'!');
                while ($file = readdir($handle)) {
                        // We currenly only like files with "access" as prefix, should be more flexible!
                        if (substr($file, 0, 6) == "access") {
index 019cb57969c9253913f14a0bcd22035a9da939a3..9fc9045f46203358202f5e437ea169fe396b9592 100644 (file)
@@ -50,18 +50,18 @@ if (IS_FORM_SENT()) {
        switch (getConfig('maintenance'))
        {
        case 'Y':
-               $target_mode = "N";
+               $target_mode = 'N';
                $out = getMessage('ADMIN_MAINTENANCE_DEACTIVATED');
                break;
 
        case 'N':
-               $target_mode = "Y";
+               $target_mode = 'Y';
                $out = getMessage('ADMIN_MAINTENANCE_ACTIVATED');
                break;
        }
 
        // Update config
-       UPDATE_CONFIG('maintenance', $target_mode);
+       updateConfiguration('maintenance', $target_mode);
 
        // Load template
        LOAD_TEMPLATE('admin_settings_saved', false, $out);
index 77056716203556e5036a4db26091bbe14673d8c0..dcf88df56d36cc25421b7e3ad187e2d83dd78943 100644 (file)
@@ -55,7 +55,7 @@ if (REQUEST_ISSET_GET('sub')) {
 
 // Get count of (maybe) selected menu points
 $chk = 0;
-if (REQUEST_ISSET_POST('sel')) $chk = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $chk = countPostSelection();
 
 // List all menu points and make them editable
 if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
@@ -107,9 +107,8 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
                if ($confirm == 1) {
                        $cnt++;
                        $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
-                        array(bigintval($sel)), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1)
-                       {
+                               array(bigintval($sel)), __FILE__, __LINE__);
+                       if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                list($title) = SQL_FETCHROW($result);
                                SQL_FREERESULT($result);
@@ -119,9 +118,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
                                        'title' => $title
                                );
                                $OUT .= LOAD_TEMPLATE("admin_mmenu_delete_row", true, $content);
-                       }
-                        else
-                       {
+                       } else {
                                // Entry not found?
                                $content = array(
                                        'sw'  => $SW,
@@ -186,17 +183,17 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
                if (!empty($SUB)) $AND = "`action`='".$SUB."'";
                switch (REQUEST_POST('ok'))
                {
-               case "edit": // Edit menu
+               case 'edit': // Edit menu
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
                                array($menu, REQUEST_POST('sel_act', $sel), REQUEST_POST('sel_what', $sel), $sel), __FILE__, __LINE__);
                        break;
 
-               case "del": // Delete menu
+               case 'del': // Delete menu
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND id=%s LIMIT 1",
                                array($sel), __FILE__, __LINE__);
                        break;
 
-               case "status": // Change status of menus
+               case 'status': // Change status of menus
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
                                array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
                        break;
@@ -214,21 +211,21 @@ if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
                // Get IDs
                if (REQUEST_ISSET_GET(('w'))) {
                        // Sub menus selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
-                        array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                               array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
-                        array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
+                               array(bigintval(REQUEST_GET('act')), bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                        SQL_FREERESULT($result);
                } else {
                        // Main menu selected
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
-                        array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                               array(bigintval(REQUEST_GET('tid'))), __FILE__, __LINE__);
                        list($tid) = SQL_FETCHROW($result);
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
-                        array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `sort`='%s' LIMIT 1",
+                               array(bigintval(REQUEST_GET('fid'))), __FILE__, __LINE__);
                        list($fid) = SQL_FETCHROW($result);
                }
 
index 46a4a8c87b6b098183769e2c03260c83afd208d3..424f7acce5d06ad72ed5994688b819830a5af56c 100644 (file)
@@ -79,8 +79,8 @@ foreach ($DATA['tables'] as $row_array)
                'tpl' => $row_array[0],
                'rep' => $REP,
                'opt' => $OPT,
-               'sum' => TRANSLATE_COMMA($row_array[3]),
-               'sav' => TRANSLATE_COMMA($row_array[4]),
+               'sum' => translateComma($row_array[3]),
+               'sav' => translateComma($row_array[4]),
        );
 
        // Load row template and switch color
@@ -91,11 +91,11 @@ define('__ROWS', $OUT);
 
 // Prepare data for the template
 define('__TOTAL_TABS'     , $DATA['total_tabs']);
-define('__TOTAL_SIZE'     , TRANSLATE_COMMA($DATA['total_size']));
+define('__TOTAL_SIZE'     , translateComma($DATA['total_size']));
 define('__TOTAL_CALLS'    , $DATA['total_rows']);
-define('__TOTAL_OPTIMIZED', TRANSLATE_COMMA($DATA['total_opti']));
+define('__TOTAL_OPTIMIZED', translateComma($DATA['total_opti']));
 define('__NOW_OPTIMIZED'  , $gain_tabs);
-define('__NOW_SAVED'      , TRANSLATE_COMMA($DATA['total_gain']));
+define('__NOW_SAVED'      , translateComma($DATA['total_gain']));
 
 // Load main template
 LOAD_TEMPLATE("admin_optimize");
index 7f947a212c6f27e1c60ba0087aebddce634baca5..677277428947dcfe1aa53906c45f7002fd08470f 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // In Opera browsers the menu is being displayed double: ADD_DESCR('admin', __FILE__);
 
 // Otherwise load include file 'overview-inc' (old standard overview page)
-LOAD_INC_ONCE("inc/modules/admin/overview-inc.php");
+loadIncludeOnce('inc/modules/admin/overview-inc.php');
 
 $jobsDone = true;
 $taskExt = false; // Default is that 'task' is not installed
index a6c05990a720d276486ca83ec1a7cf86659756cb..eed43ee98fb2a8008a27b7c107c03900d49a0152 100644 (file)
@@ -53,7 +53,7 @@ if (IS_FORM_SENT()) {
        switch (REQUEST_GET('do')) {
        case 'add':
                ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_payments` (time, payment, mail_title, price) VALUES ('".REQUEST_POST('t_wait')."','".REQUEST_POST('payment')."','".REQUEST_POST('title')."','".REQUEST_POST('price')."')");
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_payments` WHERE time='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_payments` WHERE time='%s' LIMIT 1",
                        array(REQUEST_POST('t_wait')), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Re-init the array here
@@ -64,15 +64,15 @@ if (IS_FORM_SENT()) {
                }
                break;
 
-       case "edit":
+       case 'edit':
                foreach (REQUEST_POST('time') as $id => $value) {
-                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_payments` SET time='".$value."', payment='".REQUEST_POST('pay', $id)."', price='".REQUEST_POST('price', $id)."', mail_title='".REQUEST_POST('title', $id)."' WHERE id='".$id."' LIMIT 1");
+                       ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_payments` SET time='".$value."', payment='".REQUEST_POST('pay', $id)."', price='".REQUEST_POST('price', $id)."', mail_title='".REQUEST_POST('title', $id)."' WHERE `id`='".$id."' LIMIT 1");
                }
                break;
 
-       case "del":
+       case 'del':
                foreach (REQUEST_POST('id') as $id => $value) {
-                       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payments` WHERE id='".$id."' LIMIT 1");
+                       ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_payments` WHERE `id`='".$id."' LIMIT 1");
                }
                break;
        }
@@ -89,11 +89,11 @@ if (IS_FORM_SENT()) {
 
        // Output template
        LOAD_TEMPLATE('admin_settings_saved', false, $content);
-} elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('del')) && (countPostSelection() > 0)) {
        // Delete entries here
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('sel') as $id => $value) {
-               $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT time, mail_title FROM `{!_MYSQL_PREFIX!}_payments` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                list($time, $title) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -114,11 +114,11 @@ if (IS_FORM_SENT()) {
 
        // Load main template
        LOAD_TEMPLATE("admin_del_payments");
-} elseif ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
+} elseif ((REQUEST_ISSET_POST('edit')) && (countPostSelection() > 0)) {
        // Edit entries
        $OUT = ''; $SW = 2;
        foreach (REQUEST_POST('sel') as $id => $value) {
-               $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT time, payment, mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE `id`=%s LIMIT 1",
                 array(bigintval($id)), __FILE__, __LINE__);
                list($time, $pay, $title, $price) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -157,8 +157,8 @@ if (IS_FORM_SENT()) {
                                'id'    => $content['id'],
                                'time'  => $content['time'],
                                'title' => $content['mail_title'],
-                               'pay'   => TRANSLATE_COMMA($content['payment']),
-                               'price' => TRANSLATE_COMMA($content['price'])
+                               'pay'   => translateComma($content['payment']),
+                               'price' => translateComma($content['price'])
                        );
 
                        // Load row template and switch colors
index 1cbddf6dcb55bcbe4fa9e54a439059e1357e0929..bab476d6c1acb7dc2cc4f5353ac012cdea9ee5cc 100644 (file)
@@ -54,7 +54,7 @@ if ((!REQUEST_ISSET_POST(('url'))) || (!REQUEST_ISSET_POST(('alternate')))) {
 }
 
 // Check selection count
-if (REQUEST_ISSET_POST('sel')) $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 
 if (IS_FORM_SENT()) {
        // Fix older calls from add-new-banner-form
@@ -64,7 +64,7 @@ if (IS_FORM_SENT()) {
        {
        case 'add':
                // Check if banner is already added
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE url='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE url='%s' LIMIT 1",
                        array(REQUEST_POST('url')), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 0) {
                        // Add banner
@@ -77,13 +77,13 @@ VALUES ('%s','%s','%s')",
                }
                break;
 
-       case "edit": // Update banner
+       case 'edit': // Update banner
                foreach (REQUEST_POST('sel') as $id => $sel) {
                        // Secure ID
                        $id = bigintval($id);
 
                        // Update entry
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET url='%s', alternate='%s', `visible`='%s' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET url='%s', alternate='%s', `visible`='%s' WHERE `id`=%s LIMIT 1",
                                array(
                                        REQUEST_POST('url', $id),
                                        REQUEST_POST('alternate', $id),
@@ -105,7 +105,7 @@ VALUES ('%s','%s','%s')",
        $SW = ''; $OUT = '';
        foreach (REQUEST_POST('sel') as $id => $sel) {
                // Load data
-               $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT url, alternate, visible FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                list($url, $alt, $vis) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
@@ -133,7 +133,7 @@ VALUES ('%s','%s','%s')",
        if (($SEL > 0) && (REQUEST_ISSET_POST('del'))) {
                // Delete banner
                foreach (REQUEST_POST('sel') as $id => $sel) {
-                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
                }
        }
@@ -152,7 +152,7 @@ VALUES ('%s','%s','%s')",
                                'id'  => $content['id'],
                                'url' => $content['url'],
                                'alt' => $content['alternate'],
-                               'vis' => TRANSLATE_YESNO($content['visible']),
+                               'vis' => translateYesNo($content['visible']),
                                'cnt' => $content['counter'],
                                'clx' => $content['clicks']
                        );
index 3137d7f2da06929517bf6947b0eaddac367e3418..86c4f765b83517366883ba805fe8eb4ca942410f 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__);
 
 $ACTIONS = array();
 
-// First fix all main menus (what="")...
+// First fix all main menus (what = '')...
 $result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while ($content = SQL_FETCHARRAY($result_fix)) {
@@ -55,7 +55,7 @@ while ($content = SQL_FETCHARRAY($result_fix)) {
        $ACTIONS[] = $content['action'];
 
        // Fix weight
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
                array($cnt, $content['id']), __FILE__, __LINE__);
        $REP += SQL_AFFECTEDROWS();
 
@@ -68,12 +68,12 @@ SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `sort`='999' WHERE `action`
 
 // Now sort every each menu
 foreach ($ACTIONS as $act) {
-       $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
+       $result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                array($act), __FILE__, __LINE__);
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
                        array($cnt, $content['id']), __FILE__, __LINE__);
                $REP += SQL_AFFECTEDROWS();
 
@@ -83,7 +83,7 @@ foreach ($ACTIONS as $act) {
 }
 
 // @TODO This causes the whole (!) menu cache being rebuilded
-CACHE_PURGE_ADMIN_MENU();
+cachePurgeAdminMenu();
 
 // Repair finished
 if ($REP > 0) {
index cc5769e40b35f0fadb7559ffadcd2c8a20504f6a..bdc599ce7643e3d2e034c28a9b6220464567a977 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR('admin', __FILE__);
 
-$result = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` ORDER BY userid", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` ORDER BY `userid` ASC", __FILE__, __LINE__);
 if (SQL_NUMROWS($result) > 0) {
        // Check if found userid is also found in user_data table
        $REMOVED = 0; // Nothing is removed for now... ;-)
index 453f084d6d7ceef00cde61c7814741f855762d35..1b468759c51364d3e02812dbe361d9b457aab669 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 $ACTIONS = array();
-// First fix all main menus (what="")...
+// First fix all main menus (what = '')...
 $result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while ($content = SQL_FETCHARRAY($result_fix)) {
@@ -54,7 +54,7 @@ while ($content = SQL_FETCHARRAY($result_fix)) {
        $ACTIONS[] = $content['action'];
 
        // Fix weight
-       $result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='".$cnt."' WHERE id='".$content['id']."' LIMIT 1", __FILE__, __LINE__);
+       $result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='".$cnt."' WHERE `id`='".$content['id']."' LIMIT 1", __FILE__, __LINE__);
        $REP += SQL_AFFECTEDROWS();
 
        // Count one up
@@ -65,12 +65,12 @@ $result_sort = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort='999' W
 
 // Now sort every each menu
 foreach ($ACTIONS as $act) {
-       $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
+       $result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                array($act), __FILE__, __LINE__);
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort=%s WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_guest_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
                        array($cnt, $content['id']), __FILE__, __LINE__);
                $REP += SQL_AFFECTEDROWS();
 
index 135fa713c659104a059fa37e0df2aefefeea42a8..c489100b49417fb0a77feca29fc8026b5dcf7a19 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__);
 
 $ACTIONS = array();
 
-// First fix all main menus (what="")...
+// First fix all main menus (what = '')...
 $result_fix = SQL_QUERY("SELECT id, action FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND action != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
 $cnt = 0; $REP = 0;
 while ($content = SQL_FETCHARRAY($result_fix)) {
@@ -55,7 +55,7 @@ while ($content = SQL_FETCHARRAY($result_fix)) {
        $ACTIONS[] = $content['action'];
 
        // Fix weight
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
                array($cnt, $content['id']), __FILE__, __LINE__);
        $REP += SQL_AFFECTEDROWS();
 
@@ -68,12 +68,12 @@ SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort='999' WHERE `action`=
 
 // Now sort every each menu
 foreach ($ACTIONS as $act) {
-       $result_fix = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
+       $result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                array($act), __FILE__, __LINE__);
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
                        array($cnt, $content['id']), __FILE__, __LINE__);
                $REP += SQL_AFFECTEDROWS();
 
index 45a8659627a1f621a7c9d2b4c43fdfc84d7cb0d4..ed6591d16c9fc5d6b12f55500c2cb2942739085f 100644 (file)
@@ -53,13 +53,13 @@ if (!REQUEST_ISSET_GET('mode')) REQUEST_SET_GET('mode', "select");
 
 if (IS_FORM_SENT()) {
        // Deliver bonus mail
-       ADD_NEW_BONUS_MAIL(REQUEST_POST_ARRAY(), REQUEST_GET('mode'));
+       addNewBonusMail(REQUEST_POST_ARRAY(), REQUEST_GET('mode'));
 } else {
        // Get all available users
-       define('__ALL_VALUE', TRANSLATE_COMMA(GET_TOTAL_RECEIVERS(REQUEST_GET('mode'))));
+       define('__ALL_VALUE', translateComma(getTotalReceivers(REQUEST_GET('mode'))));
 
        // Prepare option lines
-       define('__OPTION_LINES', ADD_CATEGORY_OPTIONS(REQUEST_GET('mode')));
+       define('__OPTION_LINES', generateCategoryOptionsList(REQUEST_GET('mode')));
 
        // Store send mode
        define('__MODE', REQUEST_GET(('mode')));
index fde5d8c4ca804d7cb7d70a5ff531ca332f1dbf5e..c93be0786546fb401926ca8e3bc6f12385b672c1 100644 (file)
@@ -84,7 +84,7 @@ ORDER BY userid ASC", __FILE__, __LINE__);
 } else {
        // Copy data into constants for the template and load it
        // @TODO Rewrite this constant
-       define('_DATESTAMP', MAKE_DATETIME(time(), "3"));
+       define('_DATESTAMP', generateDateTime(time(), "3"));
        if (EXT_IS_ACTIVE('html_mail')) {
                // Load template with HTML mode
                LOAD_TEMPLATE("admin_newsletter");
index cab446b0723e528ef4290521878df86ba0d3cfb5..57123d9487eaae15debe4d27b1ae65af8ba10784 100644 (file)
@@ -55,7 +55,7 @@ if (REQUEST_GET('uid') == "all") {
 
        // Is the form sent?
        if ((IS_FORM_SENT()) && (REQUEST_POST('points') > 0)) {
-               $result_main = SQL_QUERY("SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY userid",
+               $result_main = SQL_QUERY("SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC",
                        __FILE__, __LINE__);
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Ok, add points to used points and send an email to him...
@@ -67,7 +67,7 @@ if (REQUEST_GET('uid') == "all") {
 
                        // Load message and send it away
                        $msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval($content['userid']));
-                       SEND_EMAIL($content['email'], getMessage('ADMIN_SUB_SUBJ'), $msg);
+                       sendEmail($content['email'], getMessage('ADMIN_SUB_SUBJ'), $msg);
                } // END - while
 
                // Free memory
@@ -97,13 +97,13 @@ if (REQUEST_GET('uid') == "all") {
 
                        // Load email and send it away
                        $msg = LOAD_EMAIL_TEMPLATE("sub-points", $content, bigintval(REQUEST_GET('uid')));
-                       SEND_EMAIL($content['email'], getMessage('ADMIN_SUB_SUBJ'), $msg);
+                       sendEmail($content['email'], getMessage('ADMIN_SUB_SUBJ'), $msg);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_SUBTRACTED'));
                } else {
                        // @TODO Rewrite these constants
-                       define('__USER_VALUE', "<a href=\"".CREATE_EMAIL_LINK($content['email'], "user_data")."\">".$content['surname']." ".$content['family']."</a>");
+                       define('__USER_VALUE', "<a href=\"".generateMemberEmailLink($content['email'], "user_data")."\">".$content['surname']." ".$content['family']."</a>");
                        define('__UID', bigintval(REQUEST_GET('uid')));
 
                        // Load form
@@ -118,7 +118,7 @@ if (REQUEST_GET('uid') == "all") {
        SQL_FREERESULT($result);
 } else {
        // Output selection form with all confirmed user accounts listed
-       ADD_MEMBER_SELECTION_BOX("0", true);
+       ADD_MEMBER_SELECTION_BOX('0', true);
 }
 
 //
index daf8f50e9c900e01315e57005017ec398348d3b9..6637b61c9bbf52598479111542cabee57f435be1 100644 (file)
@@ -63,9 +63,9 @@ ORDER BY `userid` ASC",
                        $visits += $content['total_visits'];
 
                        // "Translate" some data
-                       $content['userid']       = ADMIN_USER_PROFILE_LINK($content['userid']);
-                       $content['total_visits'] = TRANSLATE_COMMA($content['total_visits']);
-                       $content['last_online']  = MAKE_DATETIME($content['last_online'], "2");
+                       $content['userid']       = generateUserProfileLink($content['userid']);
+                       $content['total_visits'] = translateComma($content['total_visits']);
+                       $content['last_online']  = generateDateTime($content['last_online'], "2");
                        $content['sw']           = $SW;
 
                        // Load row template
@@ -104,9 +104,9 @@ ORDER BY `userid` ASC", __FILE__, __LINE__);
                        $visits += $content['total_visits'];
 
                        // "Translate" some data
-                       $content['userid']       = ADMIN_USER_PROFILE_LINK($content['userid']);
-                       $content['visited_urls'] = TRANSLATE_COMMA($content['visited_urls']);
-                       $content['total_visits'] = TRANSLATE_COMMA($content['total_visits']);
+                       $content['userid']       = generateUserProfileLink($content['userid']);
+                       $content['visited_urls'] = translateComma($content['visited_urls']);
+                       $content['total_visits'] = translateComma($content['total_visits']);
                        $content['sw']           = $SW;
 
                        // Load row template
index eaaed34d57739f7f0a8e0e09abb77662d5e54876..77067577374922c8153524ce1bfcf4d9960d0f28 100644 (file)
@@ -50,7 +50,7 @@ $mode = "overview";
 $SEL = 0;
 
 // Get response from our server
-$response = GET_URL("check-themes.php");
+$response = sendGetRequest('check-themes.php');
 
 // Are theme_check found?
 if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
@@ -79,7 +79,7 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
                        $cver = THEME_GET_VERSION($name);
 
                        // Is the theme already installed or not?
-                       if (($ver != $cver) && ($cver != "?") && ($cver != "!")) {
+                       if (($ver != $cver) && ($cver != '?') && ($cver != '!')) {
                                // No, it isn't. So let's add this one!
                                $THEMES['fname'][]  = $name;
                                $THEMES['fsize'][]  = $response[$idx + 1];
@@ -95,7 +95,7 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
                                // Trim every data line
                                foreach ($LANG_DUMMY as $k => $v) {
                                        $v = trim($v);
-                                       if (substr($v, 3) == "") $v = '---';
+                                       if (substr($v, 3) == '') $v = '---';
                                        $LANG_DUMMY[$k] = $v;
                                        if ($v == "xx:xx") break;
                                        $LANG[] = $v;
@@ -103,7 +103,7 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
 
                                // If language is found stop searching on matching line
                                foreach($LANG as $search) {
-                                       if (substr($search, 0, 3) == (GET_LANGUAGE().":")) { $INFO = substr($search, 3); break; }
+                                       if (substr($search, 0, 3) == (getLanguage().':')) { $INFO = substr($search, 3); break; }
                                } // END - foreach
 
                                // Add informations to array
@@ -127,8 +127,8 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
                        $OUT .= "<tr>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".($idx + 1).".</td>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\"><a href=\"".$LINK."\">".$name."</a></td>
-  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".MAKE_DATETIME($THEMES['fctime'][$idx], "2")."</td>
-  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".TRANSLATE_COMMA(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</td>
+  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".generateDateTime($THEMES['fctime'][$idx], "2")."</td>
+  <td align=\"center\" class=\"switch_sw".$SW." bottom2 right2\">".translateComma(round($THEMES['fsize'][$idx] / 1.024) / 1000)." ".KBYTES."</td>
   <td align=\"center\" class=\"switch_sw".$SW." bottom2\">".$THEMES['ver'][$idx]." (".$THEMES['cver'][$idx].")</td>
 </tr>
 <tr>
@@ -141,7 +141,7 @@ if (($response[count($response) - 1] == "[EOF]") && ($response[0] != "[EOF]")) {
                        $SW = 3 - $SW;
                }
                define('__THEMES_ROWS', $OUT);
-               define('__TKBYTES_VALUE', TRANSLATE_COMMA(round($TSIZE / 1.024) / 1000));
+               define('__TKBYTES_VALUE', translateComma(round($TSIZE / 1.024) / 1000));
                define('__TTHEME_VALUE', count($THEMES['fname']));
 
                // Load template
index febd0bdbc4b4da2a2389b6ac61d9876805ba851b..57c5ffe1a1c77b25102802a65c2b95083ceaca11 100644 (file)
@@ -50,7 +50,7 @@ ADD_DESCR('admin', __FILE__);
 
 // Check for selected themes
 $SEL = 0;
-if (REQUEST_ISSET_POST('sel')) $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+if (REQUEST_ISSET_POST('sel')) $SEL = countPostSelection();
 if ($SEL > 0) {
        $OUT = '';
        foreach (REQUEST_POST('sel') as $id => $sel) {
@@ -59,14 +59,14 @@ if ($SEL > 0) {
                if (REQUEST_ISSET_POST(('status'))) {
                        // Change status
                        if (REQUEST_POST('active', $id) == 'Y') {
-                               $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE id='".$id."' LIMIT 1";
+                               $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='N' WHERE `id`='".$id."' LIMIT 1";
                        } else {
-                               $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE id='".$id."' LIMIT 1";
+                               $sql = "UPDATE `{!_MYSQL_PREFIX!}_themes` SET theme_active='Y' WHERE `id`='".$id."' LIMIT 1";
                        }
                        $OUT = getMessage('ADMIN_THEMES_UPDATED');
                } elseif (REQUEST_ISSET_POST('del')) {
                        // Delete themes
-                       $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_themes` WHERE id='".$id."' LIMIT 1";
+                       $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_themes` WHERE `id`='".$id."' LIMIT 1";
                        $OUT = getMessage('ADMIN_THEMES_DELETED');
                }
 
@@ -87,7 +87,7 @@ if ($SEL > 0) {
        $POST['default_theme'] = REQUEST_GET(('default_theme'));
 
        // Set session
-       set_session('mxchange_theme', $POST['default_theme']);
+       setSession('mxchange_theme', $POST['default_theme']);
 
        // Set it in config and current theme as well
        $GLOBALS['curr_theme'] = $POST['default_theme'];
@@ -109,11 +109,11 @@ if (SQL_NUMROWS($result) > 0) {
                $INC = sprintf("theme/%s/theme.php", $content['theme_path']);
 
                // Load theme in test mode
-               LOAD_INC($INC);
+               loadInclude($INC);
 
                // Is the loaded theme name != current theme name?
                $LINK = $content['theme_path'];
-               if ($content['theme_path'] != GET_CURR_THEME()) $LINK = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=theme_edit&amp;default_theme=".$content['theme_path']."\" title=\"{--ADMIN_SET_AS_NEW_THEME--}\">".$content['theme_path']."</a>";
+               if ($content['theme_path'] != getCurrentTheme()) $LINK = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=theme_edit&amp;default_theme=".$content['theme_path']."\" title=\"{--ADMIN_SET_AS_NEW_THEME--}\">".$content['theme_path']."</a>";
 
                // Prepare data for the row template
                $content = array(
@@ -122,8 +122,8 @@ if (SQL_NUMROWS($result) > 0) {
                        'active'    => $content['theme_active'],
                        'link'      => $LINK,
                        'name'      => $content['theme_name'],
-                       'is_act'    => TRANSLATE_YESNO($content['theme_active']),
-                       'email'     => "<a href=\"mailto:".$GLOBALS['theme_data']['email']."?Subject=[Theme:] ".$GLOBALS['theme_data']['name']." (".$content['theme_path'].")"."\">".$GLOBALS['theme_data']['author']."</a>",
+                       'is_act'    => translateYesNo($content['theme_active']),
+                       'email'     => "<a href=\"mailto:".$GLOBALS['theme_data']['email']."?Subject=[Theme:] ".$GLOBALS['theme_data']['name']." (".$content['theme_path'].")'.'\">".$GLOBALS['theme_data']['author']."</a>",
                        'url_link'  => DEREFERER($GLOBALS['theme_data']['url']),
                        'url_title' => $GLOBALS['theme_data']['url'],
                        'ver'       => $content['theme_ver'],
index 727974ba3345b2d05001f4bc4127d54c610c259a..72caa77374bcb5c7c01645e8339f2c85f6cf40f5 100644 (file)
@@ -54,12 +54,12 @@ $GLOBALS['theme_mode'] = 'test';
 // Import selected theme if not present
 if (REQUEST_ISSET_POST('theme')) {
        // Check if theme is there
-       if (!THEME_CHECK_EXIST(REQUEST_POST('theme'))) {
+       if (!ifThemeExists(REQUEST_POST('theme'))) {
                // Import theme
                $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE(REQUEST_POST('theme')));
-               if (INCLUDE_READABLE($INC)) {
+               if (isIncludeReadable($INC)) {
                        // Load the theme header file
-                       LOAD_INC($INC);
+                       loadInclude($INC);
 
                        // Register it ith the exchange
                        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`,`theme_active`,`theme_ver`,`theme_name`)
@@ -101,9 +101,9 @@ while ($dir = readdir($handle)) {
        $INC = sprintf("theme/%s/theme.php", $dir);
 
        // Test it...
-       if (($dir != ".") && ($dir != "..") && (INCLUDE_READABLE($INC))) {
+       if ((!isDirectory($dir)) && (isIncludeReadable($INC))) {
                // Found a valid directory so let's load it's theme.php file
-               LOAD_INC($INC);
+               loadInclude($INC);
 
                // Add found theme to array
                $THEMES['theme_unix'][]   = $dir;
@@ -128,7 +128,7 @@ foreach ($THEMES['theme_unix'] as $key => $unix) {
        $FOUND = "<div class=\"admin_note\">{--ADMIN_THEME_ALREADY_INSTALLED--}</div>";
 
        // Check if current theme is already imported or not
-       if (!THEME_CHECK_EXIST($unix)) {
+       if (!ifThemeExists($unix)) {
                // Theme not installed
                $FOUND = LOAD_TEMPLATE("admin_theme_import_form", true, $unix);
        } // END - if
index 6d26db812cfefc04a2b7a5d512797b2b2793e51b..20687f46a648aab96097cca5fb99abebe77b9406 100644 (file)
@@ -61,7 +61,7 @@ if ((SQL_NUMROWS($result_main) > 0) || (REQUEST_ISSET_POST(('lock')))) {
                // Are there checked boxes?
                if (count(REQUEST_POST('sel')) > 0) {
                        // Count now... We use an own function for now
-                       $SEL = SELECTION_COUNT(REQUEST_POST('sel'));
+                       $SEL = countPostSelection();
                } // END - if
        } // END - if
 
@@ -109,19 +109,19 @@ LIMIT 1",
                                        $msg_user = LOAD_EMAIL_TEMPLATE("order-accept", array(), $DATA['sender']);
 
                                        // Send email
-                                       SEND_EMAIL($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user);
+                                       sendEmail($DATA['sender'], MEMBER_ORDER_ACCEPTED, $msg_user);
 
                                        // Unlock selected email
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW' WHERE id=%s AND data_type='ADMIN' LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW' WHERE `id`=%s AND data_type='ADMIN' LIMIT 1",
                                                array($id), __FILE__, __LINE__);
                                } // END - if
                        } // END - foreach
 
                        // Set message
-                       $message = ADMIN_MAILS_ACTIVATED;
+                       $message = getMessage('ADMIN_MAILS_ACTIVATED');
                } else {
                        // Nothing checked!
-                       $message = ADMIN_MAILS_NOTHING_CHECKED;
+                       $message = getMessage('ADMIN_MAILS_NOTHING_CHECKED');
                }
 
                // Mails unlocked for mail delivery
@@ -135,7 +135,7 @@ LIMIT 1",
                                $id = bigintval($id);
 
                                // Load URL and subject from pool
-                               $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT url, subject, sender FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                                        array($id), __FILE__, __LINE__);
 
                                // Load data
@@ -146,13 +146,13 @@ LIMIT 1",
 
                                // Load email template and send it away
                                $msg_user = LOAD_EMAIL_TEMPLATE("order-reject", array(), $DATA['sender']);
-                               SEND_EMAIL($DATA['sender'], MEMBER_ORDER_REJECTED, $msg_user);
+                               sendEmail($DATA['sender'], getMessage('MEMBER_ORDER_REJECTED'), $msg_user);
 
                                // If you do not enter an URL to redirect to, your URL will be set!
                                if ((!REQUEST_ISSET_POST(('redirect'))) || (REQUEST_POST('redirect') == "http://")) REQUEST_SET_POST('redirect', constant('URL'));
 
                                // Redirect URL
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET url='%s', data_type='NEW' WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET url='%s', data_type='NEW' WHERE `id`=%s LIMIT 1",
                                        array(REQUEST_POST('redirect'), $id),__FILE__, __LINE__);
 
                                // Prepare data for the row template
@@ -204,15 +204,15 @@ LIMIT 1",
                                'sw'        => $SW,
                                'id'        => $content['id'],
                                'sender'    => $content['sender'],
-                               'u_link'    => ADMIN_USER_PROFILE_LINK($content['sender']),
+                               'u_link'    => generateUserProfileLink($content['sender']),
                                'subj'      => COMPILE_CODE($content['subject']),
                                'tester'    => FRAMETESTER($content['url']),
                                'url'       => $content['url'],
-                               'cat_title' => str_replace("\"", "&quot;", GET_CATEGORY($content['category'])),
+                               'cat_title' => str_replace("\"", "&quot;", getCategory($content['category'])),
                                'cat_link'  => $content['category'],
-                               'pay_title' => str_replace("\"", "&quot;", GET_PAYMENT($content['payment'], true)),
+                               'pay_title' => str_replace("\"", "&quot;", getPaymentTitlePrice($content['payment'], true)),
                                'pay_link'  => $content['payment'],
-                               'ordered'   => MAKE_DATETIME($content['timestamp'], "2"),
+                               'ordered'   => generateDateTime($content['timestamp'], "2"),
                                'tsend'     => $content['target_send'],
                        );
 
index e0ee294b52e034d9887e6b9b895182eb536bde7a..e6e6866993d369deba3747d1cba97e46ceca321d 100644 (file)
@@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__);
 // Check if admin has submitted form
 if (IS_FORM_SENT()) {
        // Does he have selected at least one sponsor?
-       if (SELECTION_COUNT(REQUEST_POST('id')) > 0) {
+       if (countSelection(REQUEST_POST('id')) > 0) {
                // At least one entry selected
                foreach (REQUEST_POST('id') as $id => $selected) {
                        // Secure ID number and init $content
@@ -84,16 +84,16 @@ ORDER BY sp.pay_name",
 
                                                // Set default email
                                                $content['email'] = getMessage('SPONSOR_NO_ADMIN');
-                                               if ($content['aid'] > "0") {
+                                               if ($content['aid'] > '0') {
                                                        // Load admin's email address for contact
-                                                       $content['email'] = GET_ADMIN_EMAIL($content['aid']);
+                                                       $content['email'] = getAdminEmail($content['aid']);
                                                } // END - if
 
                                                // Transfer data to array
                                                $data = array(
                                                        'aid'   => $content['email'],
                                                        'order' => ($content['pay_count'] * $content['pay_rate'])." ".$content['pay_currency'],
-                                                       'stamp' => MAKE_DATETIME($content['pay_ordered'], "2"),
+                                                       'stamp' => generateDateTime($content['pay_ordered'], "2"),
                                                        'pname' => $content['pay_name'],
                                                );
        
@@ -114,7 +114,7 @@ ORDER BY sp.pay_name",
 
                        // Unlock sponsor account
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='CONFIRMED'
-WHERE id='%s' AND `status`='PENDING' LIMIT 1",
+WHERE `id`='%s' AND `status`='PENDING' LIMIT 1",
                                array($content['id']), __FILE__, __LINE__);
 
                        // Update, if applyable, referal count and points
@@ -122,7 +122,7 @@ WHERE id='%s' AND `status`='PENDING' LIMIT 1",
                                // Update referal account
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data`
 SET points_amount=points_amount+%s, ref_count=ref_count+1
-WHERE id='%s' LIMIT 1",
+WHERE `id`='%s' LIMIT 1",
                                        array(getConfig('sponsor_ref_points'), bigintval($content['refid'])), __FILE__, __LINE__);
 
                                // Whas that update fine?
@@ -131,20 +131,20 @@ WHERE id='%s' LIMIT 1",
                                        $result = SQL_QUERY_ESC("SELECT id, gender, surname, family, email,
 (points_amount - points_used) AS points, receive_warnings, ref_count AS refs
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' LIMIT 1",
+WHERE `id`='%s' LIMIT 1",
                                                array(bigintval($content['refid'])), __FILE__, __LINE__);
                                        $REFERRAL = SQL_FETCHARRAY($result);
 
                                        // Send warnings out?
                                        if ($REFERRAL['receive_warnings'] == 'Y') {
                                                // Translate some data
-                                               $REFERRAL['points']     = TRANSLATE_COMMA($REFERRAL['points']);
-                                               $REFERRAL['ref_points'] = TRANSLATE_COMMA(getConfig('sponsor_ref_points'));
-                                               $REFERRAL['gender']     = TRANSLATE_GENDER($REFERRAL['gender']);
+                                               $REFERRAL['points']     = translateComma($REFERRAL['points']);
+                                               $REFERRAL['ref_points'] = translateComma(getConfig('sponsor_ref_points'));
+                                               $REFERRAL['gender']     = translateGender($REFERRAL['gender']);
 
                                                // Send notification to referal
                                                $REF_MSG = LOAD_EMAIL_TEMPLATE("sponsor_ref_notify", $REFERRAL);
-                                               SEND_EMAIL($REFERRAL['email'], getMessage('SPONSOR_REF_NOTIFY_SUBJ'), $REF_MSG);
+                                               sendEmail($REFERRAL['email'], getMessage('SPONSOR_REF_NOTIFY_SUBJ'), $REF_MSG);
                                        }
 
                                        // Free memory
@@ -153,13 +153,13 @@ WHERE id='%s' LIMIT 1",
                        }
 
                        // Transfer data to array
-                       $content['gender']   = TRANSLATE_GENDER($content['gender']);
+                       $content['gender']   = translateGender($content['gender']);
                        $content['sponsor']  = $content['id'];
-                       $content['points']   = TRANSLATE_COMMA($content['points_amount']);
+                       $content['points']   = translateComma($content['points_amount']);
 
                        // So let's send the email away
                        $msg = LOAD_EMAIL_TEMPLATE("sponsor_unlocked", $content);
-                       SEND_EMAIL($content['email'], getMessage('SPONSOR_UNLOCKED_SUBJ'), $msg);
+                       sendEmail($content['email'], getMessage('SPONSOR_UNLOCKED_SUBJ'), $msg);
                }
        } else {
                // Nothing selected
@@ -189,12 +189,12 @@ if (SQL_NUMROWS($result) > 0) {
                $content = array(
                        'sw'      => $SW,
                        'id'      => $content['id'],
-                       'gender'   => TRANSLATE_GENDER($content['gender']),
+                       'gender'   => translateGender($content['gender']),
                        'surname' => $content['surname'],
                        'family'  => $content['family'],
                        'email'   => "mailto:".$content['email'],
                        'remote'  => $content['remote_addr'],
-                       'created' => MAKE_DATETIME($content['sponsor_created'], "2"),
+                       'created' => generateDateTime($content['sponsor_created'], "2"),
                );
 
                // Load row template and switch colors
index 8f198b596d07facd54747ab4ddf6d1bd908eb266..56ac755543919ff0e02a9580a21cd5b9dec2da9c 100644 (file)
@@ -79,9 +79,9 @@ if (SQL_NUMROWS($result) > 0) {
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate"/add content
                $content['sw']          = $SW;
-               $content['userid']      = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['userid']      = generateUserProfileLink($content['userid']);
                $content['framekiller'] = FRAMETESTER($content['url']);
-               $content['registered']  = MAKE_DATETIME($content['registered'], 2);
+               $content['registered']  = generateDateTime($content['registered'], 2);
 
                // Load row template
                $OUT .= LOAD_TEMPLATE("admin_unlock_surfbar_urls_row", true, $content);
index d64c1175bf4d2560becd2b0fbf69b96f2be9acff..411634ab67777e8721ad5a1922176c4c4f4d3aeb 100644 (file)
@@ -46,14 +46,14 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 // Init array
-$ONLINE['code'] = "???";
+$ONLINE['code'] = '???';
 
 // Get response from our server in an array
-$response = GET_URL("check-updates3.php");
+$response = sendGetRequest('check-updates3.php');
 
 if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($response[3])) {
        // Error!
-       $response = array("", '', '');
+       $response = array('', '', '');
 } else {
        // Analyse header for response code
        if (eregi("200 OK", $response[0])) {
@@ -104,8 +104,8 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($
                                        $PATCHES['fname'][] = str_replace("\n", '', $response[$idx * 5 + 2]);
                                        $PATCHES['fsize'][] = str_replace("\n", '', $response[$idx * 5 + 3]);
                                        $PATCHES['ctime'][] = str_replace("\n", '', $response[$idx * 5 + 4]);
-                                       switch (GET_LANGUAGE()) {
-                                               case "de": $PATCHES['descr'][] = str_replace("\n", '', $response[$idx * 5 + 5]); break; // Load german description
+                                       switch (getLanguage()) {
+                                               case 'de': $PATCHES['descr'][] = str_replace("\n", '', $response[$idx * 5 + 5]); break; // Load german description
                                                default  : $PATCHES['descr'][] = str_replace("\n", '', $response[$idx * 5 + 6]); break; // Load english description as default
                                        }
 
@@ -132,7 +132,7 @@ if (empty($ONLINE['version'])) {
 } elseif (($ONLINE['version'] != constant('FULL_VERSION')) || ($ONLINE['revision'] != constant('CURR_SVN_REVISION'))) {
        // New full-version available (all previous released patches are included in this version!)
        define('__ONLINE_VERSION', $ONLINE['version']);
-       define('__ONLINE_CHANGE' , MAKE_DATETIME($ONLINE['changed'], "2"));
+       define('__ONLINE_CHANGE' , generateDateTime($ONLINE['changed'], "2"));
        define('__ONLINE_REVISION', $ONLINE['revision']);
 
        // Load template
index c9785a6d924bb914a4ca8f759b6ff6b7b787fe8c..7041ee31bfb6e4c234f7de3238c0027643c991ae 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 ADD_DESCR('admin', __FILE__);
 
 // Base directory (should be moved to database)
-$usage = getConfig('usage_base')."/";
+$usage = getConfig('usage_base').'/';
 
 if (REQUEST_ISSET_GET(('image'))) {
        if (REQUEST_GET('type') == 'usage') {
@@ -64,7 +64,7 @@ if (REQUEST_ISSET_GET(('image'))) {
                );
        }
 
-       if (FILE_READABLE($FQFN)) {
+       if (isFileReadable($FQFN)) {
                $image = imagecreatefrompng($FQFN);
                header("Content-type: image/png");
                imagepng($image);
@@ -84,9 +84,9 @@ if (REQUEST_ISSET_GET(('image'))) {
        );
 }
 
-if ((!empty($FQFN)) && (FILE_READABLE($FQFN))) {
+if ((!empty($FQFN)) && (isFileReadable($FQFN))) {
        // @TODO This code is double, see LOAD_TEMPLATE and LOAD_EMAIL_TEMPLATE in functions.php
-       $tmpl_file = READ_FILE($FQFN);
+       $tmpl_file = readFromFile($FQFN);
        $tmpl_file = SQL_ESCAPE($tmpl_file);
        $tmpl_file = "\$content=\"".$tmpl_file."\";";
        eval($tmpl_file);
index 18ac32db93cf70ff320f048a9cbc5970f3887fac..1fd14be6b8844120c1e41612f9a0523f9ed849b3 100644 (file)
@@ -66,7 +66,7 @@ if ((REQUEST_ISSET_GET('uid')) && (bigintval(REQUEST_GET('uid')) > 0)) {
 
                        // Send contact form out
                        $msg = LOAD_EMAIL_TEMPLATE("member_contct", $content);
-                       SEND_EMAIL($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $msg);
+                       sendEmail($content['email'], getMessage('ADMIN_CONTACT_USER_SUBJECT'), $msg);
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_USER_CONTACTED'));
                } else {
                        // Load contact form template
@@ -74,7 +74,7 @@ if ((REQUEST_ISSET_GET('uid')) && (bigintval(REQUEST_GET('uid')) > 0)) {
                }
        } else {
                // Not found?
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(USER_ACCOUNT_404, bigintval(REQUEST_GET('uid'))));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('USER_ACCOUNT_404'), bigintval(REQUEST_GET('uid'))));
        }
 
        // Free result
index ffb7f8618cd3041d0c6067ce7ecc8657d601a659..b73b91080718a5a165f69218fc074bdb6ca57438 100644 (file)
@@ -50,19 +50,19 @@ if (EXT_IS_ACTIVE('online')) {
        // Count guests, members and admins
        // @TODO Rewrite these constants
        // @TODO Add a filter for sponsor
-       define('_GUESTS_ONLINE' , GET_TOTAL_DATA("N", 'online', "id", "is_admin", true, " AND is_member='N'"));
-       define('_ADMINS_ONLINE' , GET_TOTAL_DATA("N", 'online', "id", "is_admin", true, " AND is_member='Y'"));
-       define('_MEMBERS_ONLINE', GET_TOTAL_DATA("N", 'online', "id", "is_admin", true));
+       define('_GUESTS_ONLINE' , GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'"));
+       define('_ADMINS_ONLINE' , GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'"));
+       define('_MEMBERS_ONLINE', GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true));
 
        // Load template
-       LOAD_TEMPLATE("admin_mini_online");
+       LOAD_TEMPLATE('admin_mini_online');
 
        // Check for online users
        $result = SQL_QUERY("SELECT id, ip, userid, refid, module, action, what, is_member, is_admin, timestamp FROM `{!_MYSQL_PREFIX!}_online` ORDER by timestamp DESC",
                __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Load header template
-               LOAD_TEMPLATE("admin_online_header");
+               LOAD_TEMPLATE('admin_online_header');
 
                // List all online users
                $SW = 2;
@@ -79,13 +79,13 @@ if (EXT_IS_ACTIVE('online')) {
                                $content['userid'] = getMessage('_IS_GUEST');
                        } elseif ($content['userid'] > 0) {
                                // Add profile link to userid
-                               $content['userid'] = ADMIN_USER_PROFILE_LINK($content['userid']);
+                               $content['userid'] = generateUserProfileLink($content['userid']);
                        } // END - if
 
                        // Is the refid set?
                        if ($content['refid'] > 0) {
                                // Add profile link to referer id
-                               $content['refid'] = ADMIN_USER_PROFILE_LINK($content['refid']);
+                               $content['refid'] = generateUserProfileLink($content['refid']);
                        } // END - if
 
                        OUTPUT_HTML("<tr>
@@ -96,7 +96,7 @@ if (EXT_IS_ACTIVE('online')) {
   <td align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$content['module']."</td>
   <td align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom right\">".$content['action']."</td>
   <td align=\"center\" width=\"5%\" class=\"switch_sw".$SW." bottom right\">".$content['what']."</td>
-  <td align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".MAKE_DATETIME($content['timestamp'], "2")."</td>
+  <td align=\"center\" width=\"10%\" class=\"switch_sw".$SW." bottom\">".generateDateTime($content['timestamp'], '2')."</td>
 </tr>");
                        $SW = 3 - $SW;
                } // END - while
@@ -105,10 +105,10 @@ if (EXT_IS_ACTIVE('online')) {
                SQL_FREERESULT($result);
 
                // @TODO Rewrite this constant
-               define('__FANCY_ONLINE_TIMEOUT', CREATE_FANCY_TIME(getConfig('online_timeout')));
+               define('__FANCY_ONLINE_TIMEOUT', createFancyTime(getConfig('online_timeout')));
 
                // Load footer template
-               LOAD_TEMPLATE("admin_online_footer");
+               LOAD_TEMPLATE('admin_online_footer');
        } // END - if
 } else {
        // Online statistics deactivated!
index 33e652776f3221006443bb84d0a6c8214427bccb..64e2f26ce1dfa1ace676eb59ba84bd33fdcd2fe4 100644 (file)
@@ -65,7 +65,7 @@ if (isUserIdSet() && (isSessionVariableSet('u_hash'))) {
        SQL_FREERESULT($result);
 
        // Change to new theme
-       set_session('mxchange_theme', $data['curr_theme']);
+       setSession('mxchange_theme', $data['curr_theme']);
 
        // Remmeber login failures if available
        if (GET_EXT_VERSION('sql_patches') >= '0.6.1') {
@@ -77,8 +77,8 @@ LIMIT 1",
                        array(getUserId()), __FILE__, __LINE__);
 
                // Store it in session
-               set_session('mxchange_member_failures', $data['login_failures']);
-               set_session('mxchange_member_last_fail', $data['last_failure']);
+               setSession('mxchange_member_failures', $data['login_failures']);
+               setSession('mxchange_member_last_fail', $data['last_failure']);
        } // END - if
 
        // Bonus is not given by default ;-)
@@ -100,7 +100,7 @@ LIMIT 1",
        if (($bonus) && (REQUEST_GET('mode') == 'bonus') && (EXT_IS_ACTIVE('bonus'))) {
                // Output message with added points
                $message .= "<div class=\"tiny\">
-  ".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), TRANSLATE_COMMA(getConfig('login_bonus')))."
+  ".sprintf(getMessage('BONUS_LOGIN_BONUS_ADDED'), translateComma(getConfig('login_bonus')))."
 </div>";
        } elseif (EXT_IS_ACTIVE('bonus')) {
                // No login bonus added!
index 58eec2b957a894baa0dfb5dc1c84b51620db053f..80e829565226a8a54125e90a22836e87a747a304 100644 (file)
@@ -48,7 +48,7 @@ if (REQUEST_ISSET_GET(('order'))) {
        // Order number placed, is he also logged in?
        if (IS_MEMBER()) {
                // Ok, test passed... :)
-               $result = SQL_QUERY_ESC("SELECT subject, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT subject, url FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
                        array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
 
                // Finally is the entry valid?
@@ -63,14 +63,14 @@ if (REQUEST_ISSET_GET(('order'))) {
                        $mode = 'member';
                } else {
                        // Matching line not found!
-                       LOAD_URL('modules.php?module=index&amp;what=login');
+                       redirectToUrl('modules.php?module=index&amp;what=login');
                }
 
                // Free memory
                SQL_FREERESULT($result);
        } else {
                // He is no longer logged in
-               LOAD_URL('modules.php?module=index&amp;what=login');
+               redirectToUrl('modules.php?module=index&amp;what=login');
        }
 }
 
@@ -120,7 +120,7 @@ if ((REQUEST_ISSET_POST(('url'))) || (REQUEST_ISSET_GET(('url'))) || (REQUEST_IS
        }
 } else {
        // Go away...
-       LOAD_URL('modules.php?module=login');
+       redirectToUrl('modules.php?module=login');
 }
 //
 ?>
index 4d9e68bf8e83d2c6e5d1ea0b3b956b117cea095c..f1aeadc24b28b275822cbdefd0ea328b1e49d4f3 100644 (file)
@@ -53,9 +53,9 @@ ADD_DESCR('guest', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/guest/what-%s.php", $GLOBALS['what']);
-if (FILE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the guest action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } elseif ($IS_VALID) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
 } else {
index 59df1863bbc9f03b59db6684fdb345c1edfbd28a..a28716c64442b51c38ae6700241a257bf14c8d1e 100644 (file)
@@ -47,9 +47,9 @@ if (!defined('__SECURITY')) {
 
 // Only when one admin link is clicked...
 $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the guest action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
 }
index bb1a284f36b5cbe444470ebd2c8c72a20aeda4af..a555c07e79914463f22311a1839ec9a716f178ca 100644 (file)
@@ -50,9 +50,9 @@ ADD_DESCR('guest', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the guest action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
 }
index e683c49ec5228364f45c1d8d4e3b413a89e1ce05..feed98a8b3c90ea76705b6cb2c7bc14b695a4e20 100644 (file)
@@ -50,9 +50,9 @@ ADD_DESCR('guest', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the guest action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
 }
index 55001d10d7a9e5d4d1c67b74cd8dad44c44c23bb..d3844e778e2ec00d2180b8843e6af81534db0984 100644 (file)
@@ -46,23 +46,23 @@ if (!defined('__SECURITY')) {
 }
 
 // Total visitors online
-$total = GET_TOTAL_DATA("", 'online', "id", 'userid', true);
+$total = GET_TOTAL_DATA('', 'online', 'id', 'userid', true);
 
 if (getConfig('mad_count') < $total) {
        // Update counter
-       UPDATE_CONFIG(array("mad_timestamp", "mad_count"), array(time(), $total));
+       updateConfiguration(array('mad_timestamp', 'mad_count'), array(time(), $total));
 } // END - if
 
 // Prepare content
 $content = array(
-       'guests'  => TRANSLATE_COMMA(GET_TOTAL_DATA("N", 'online', "id", "is_admin", true, " AND is_member='N'")),
-       'members' => TRANSLATE_COMMA(GET_TOTAL_DATA("N", 'online', "id", "is_admin", true, " AND is_member='Y'")),
-       'admins'  => TRANSLATE_COMMA(GET_TOTAL_DATA("Y", 'online', "id", "is_admin", true)),
-       'total'   => TRANSLATE_COMMA($total)
+       'guests'  => translateComma(GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'")),
+       'members' => translateComma(GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'")),
+       'admins'  => translateComma(GET_TOTAL_DATA('Y', 'online', 'id', 'is_admin', true)),
+       'total'   => translateComma($total)
 );
 
 // Output table
-LOAD_TEMPLATE("online_now", false, $content);
+LOAD_TEMPLATE('online_now', false, $content);
 
 // Add more links in this block
 runFilterChain('online_extra_links');
index a0b1fcae651a2fd34af9755014384df2b8b6845b..1277bd1cb3244722e09439382c1c5ddedbca6a5c 100644 (file)
@@ -52,9 +52,9 @@ ADD_DESCR('guest', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the guest action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, getMessage('GUEST_404_ACTION'), $GLOBALS['what']);
 }
index 151fb63ddd38b338b4cf79b3e8acf066485e0b0c..3cf394a871be5247e3170596abe2c494114e6418 100644 (file)
@@ -55,10 +55,10 @@ if ($num_themes > 1) {
        // If more than 1 is installed output selection box
        $act = '';
        if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
-       $OUT = THEME_SELECTION_BOX('index', $act, $GLOBALS['what'], $result_themes);
+       $OUT = generateThemeSelectionBox('index', $act, $GLOBALS['what'], $result_themes);
 } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
        // If there's only one just print it's name
-       define('__THEME_NAME', GET_CURR_THEME_NAME());
+       define('__THEME_NAME', getCurrentThemeName());
        $OUT = LOAD_TEMPLATE("theme_one", true);
 } elseif (IS_ADMIN()) {
        // If there is no theme installed and there's an admin notify him!
index c089956b340f16316147442e69f0f64616cae9b1..53f144ba4a4b79705ca9dd5f45fb6bf5c2fada85 100644 (file)
@@ -74,8 +74,8 @@ if (SQL_NUMROWS($result) > 0) {
                        'sw'     => $SW,
                        'uid'    => $uid,
                        'nick'   => $nick2,
-                       'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, 'user_points', 'points') - GET_TOTAL_DATA($uid, 'user_data', 'used_points')),
-                       'last'   => MAKE_DATETIME($last, '2'),
+                       'points' => translateComma(GET_TOTAL_DATA($uid, 'user_points', 'points') - GET_TOTAL_DATA($uid, 'user_data', 'used_points')),
+                       'last'   => generateDateTime($last, '2'),
                );
 
                // Load template
index 125a7531464e5a1611e97c755d0e8bdf034a31e7..36861d107735a7e37478784339267e3d53a110e0 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // A simple redirect...
-LOAD_URL('modules.php?module=admin');
+redirectToUrl('modules.php?module=admin');
 
 //
 ?>
index e8849838721e1a0755959e73f7b7ca7cb78fcba1..1ce4e5e2f845e8628ed44522e89d2ba5e06d11ae 100644 (file)
@@ -49,8 +49,8 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 // Prepare constants
-define('__BEG_POINTS'    , TRANSLATE_COMMA(getConfig('beg_points')));
-define('__BEG_POINTS_MAX', TRANSLATE_COMMA(getConfig('beg_points_max')));
+define('__BEG_POINTS'    , translateComma(getConfig('beg_points')));
+define('__BEG_POINTS_MAX', translateComma(getConfig('beg_points_max')));
 if ($GLOBALS['refid'] > 0) {
        // Take referal ID from URL/Cookie
        define('__BEG_UID'       , $GLOBALS['refid']);
@@ -60,8 +60,8 @@ if ($GLOBALS['refid'] > 0) {
 }
 
 // Selection boxes are now the default
-define('__BEG_TIMEOUT'    , CREATE_FANCY_TIME(getConfig('beg_timeout')));
-define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
+define('__BEG_TIMEOUT'    , createFancyTime(getConfig('beg_timeout')));
+define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_uid_timeout')));
 
 // Load final template
 LOAD_TEMPLATE("guest_".substr(basename(__FILE__), 5, -4));
index 08f907bf8e996aa20b7e5e9602e7c6784ae12114..aa8d40d7d7d0e182c90b95d2d120e7ec9692eca7 100644 (file)
@@ -63,7 +63,7 @@ if (REQUEST_ISSET_GET(('hash'))) {
                        $msg = LOAD_EMAIL_TEMPLATE("confirm-member", array('points' => getConfig('points_register')), bigintval($uid));
 
                        // And send him right away the confirmation mail
-                       SEND_EMAIL($email, getMessage('GUEST_THANX_CONFIRM'), $msg);
+                       sendEmail($email, getMessage('GUEST_THANX_CONFIRM'), $msg);
 
                        // Maybe he got "referaled"?
                        if (($rid > 0) && ($rid != $uid)) {
@@ -72,13 +72,13 @@ if (REQUEST_ISSET_GET(('hash'))) {
                                        array(bigintval($rid)), __FILE__, __LINE__);
                                if (SQL_NUMROWS($result) == 1) {
                                        // Update ref counter...
-                                       UPDATE_REF_COUNTER($rid);
+                                       updateReferalCounter($rid);
 
                                        // Ok, write the ref-points to this user and his parent-ref
                                        unset($GLOBALS['ref_level']);
 
                                        // Shall I "pay" the referal points imidiately?
-                                       if (getConfig('ref_payout') == "0") {
+                                       if (getConfig('ref_payout') == '0') {
                                                // Yes, "pay" it now
                                                $locked = false;
                                        } else {
@@ -110,10 +110,10 @@ if (REQUEST_ISSET_GET(('hash'))) {
                        // Account confirmed!
                        if (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
                                // Set special lead cookie
-                               set_session('lead_uid', bigintval($uid));
+                               setSession('lead_uid', bigintval($uid));
 
                                // Lead-Code mode enabled
-                               LOAD_URL("lead-confirm.php");
+                               redirectToUrl("lead-confirm.php");
                        } else {
                                define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_DONE'));
                                define('__UID', bigintval($uid));
@@ -121,20 +121,20 @@ if (REQUEST_ISSET_GET(('hash'))) {
                        }
                } elseif (defined('LEAD_CODE_ENABLED') && defined('LEAD_EXPIRY_TIME')) {
                        // Set special lead cookie
-                       set_session('lead_uid', bigintval($uid));
+                       setSession('lead_uid', bigintval($uid));
 
                        // Lead-Code mode enabled
-                       LOAD_URL("lead-confirm.php");
+                       redirectToUrl("lead-confirm.php");
                } else {
                        // Nobody was found unter this hash key... or our new member want's to confirm twice?
                        define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE'));
-                       define('__UID', "0");
+                       define('__UID', '0');
                        LOAD_TEMPLATE("guest_confirm_table");
                }
        } else {
                // Nobody was found unter this hash key... or our new member want's to confirm twice?
                define('__CONFIRM_MSG', getMessage('GUEST_CONFIRMED_TWICE'));
-               define('__UID', "0");
+               define('__UID', '0');
                LOAD_TEMPLATE("guest_confirm_table");
        }
 } elseif ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('email')))) {
@@ -148,11 +148,11 @@ if (REQUEST_ISSET_GET(('hash'))) {
                {
                case "UNCONFIRMED": // Account not confirmed
                        $msg = LOAD_EMAIL_TEMPLATE("guest_request_confirm", array('hash' => $DATA[2]), $DATA[0]);
-                       SEND_EMAIL(REQUEST_POST('email'), getMessage('REQUEST_CONFIRM_LINK_SUBJ'), $msg);
+                       sendEmail(REQUEST_POST('email'), getMessage('REQUEST_CONFIRM_LINK_SUBJ'), $msg);
                        $content = getMessage('CONFIRM_LINK_SENT');
                        break;
 
-               case "CONFIRMED": // Account already confirmed
+               case 'CONFIRMED': // Account already confirmed
                        $content = getMessage('LOGIN_ID_CONFIRMED');
                        break;
 
index ea727813a843cf0089b536dc12c0d394054f1ada..1d585370a6f543e744ffc11bff5722ada9031391 100644 (file)
@@ -49,11 +49,11 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 // Percent values etc.
-define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
-define('__REF_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
-define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
-define('__MIN_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_min')));
-define('__MAX_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_max')));
+define('__CHARGE_VALUE', translateComma(getConfig('doubler_charge') * 100));
+define('__REF_VALUE'   , translateComma(getConfig('doubler_ref') * 100));
+define('__TOTAL_VALUE' , translateComma(getConfig('doubler_points')));
+define('__MIN_VALUE'   , translateComma(getConfig('doubler_min')));
+define('__MAX_VALUE'   , translateComma(getConfig('doubler_max')));
 
 // Transfer referal ID
 define('__REFID', $GLOBALS['refid']);
@@ -74,13 +74,13 @@ case "RESET":
 }
 
 // Generate table with already payed out doubles
-define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE("0", "Y", "N", "DESC"));
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE('0', 'Y', 'N', "DESC"));
 
 // Generate table with next-to-run payouts
 define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE());
 
 // Generate timemark
-define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
+define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
 
 // Points left to double
 define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
index 69e77cdb883ac2533cb366d51efd804c4963ef2c..61303934d47c7fe202a2f722636047303a30e74c 100644 (file)
@@ -63,7 +63,7 @@ $add = '';
 if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) {
        // Maybe, then continue with it
        $uid = getUserId();
-} elseif ((REQUEST_ISSET_POST(('id'))) && (REQUEST_ISSET_POST(('password'))) && (IS_FORM_SENT())) {
+} elseif ((REQUEST_ISSET_POST('id')) && (REQUEST_ISSET_POST(('password'))) && (IS_FORM_SENT())) {
        // Set userid and crypt password when login data was submitted
        if ((EXT_IS_ACTIVE('nickname')) && (NICKNAME_PROBE_ON_USERID(REQUEST_POST('id')))) {
                // Nickname entered
@@ -75,7 +75,7 @@ if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) {
 } elseif (REQUEST_ISSET_POST(('new_pass'))) {
        // New password requested
        $uid = 0;
-       if (REQUEST_ISSET_POST(('id'))) $uid = REQUEST_POST('id');
+       if (REQUEST_ISSET_POST('id')) $uid = REQUEST_POST('id');
 } else {
        // Not logged in
        $uid = 0; $hash = '';
@@ -169,10 +169,10 @@ if (!empty($URL)) {
        // URL was constructed
        if (getTotalFatalErrors()) {
                // Fatal errors!
-               LOAD_INC_ONCE('inc/fatal_errors.php');
+               loadIncludeOnce('inc/fatal_errors.php');
        } else {
                // Load URL
-               LOAD_URL($URL);
+               redirectToUrl($URL);
        }
 } // END - if
 
index 993481f0e45c09cf9d60ce50c8e2458a5e961ca9..a9a263de05018039d883ddd7fc23b17561e8ea99 100644 (file)
@@ -47,18 +47,18 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('guest', __FILE__);
 
 // @TODO Rewrite all constants
-define('value', "value");
-define('lang', "lang");
-define('rows', "rows");
+define('value', 'value');
+define('lang', 'lang');
+define('rows', 'rows');
 
 // Get total confirmed user IDs...
-define('user_confirmed'  , round(GET_TOTAL_DATA("CONFIRMED"  , "user_data", 'userid', "status", true)));
-define('user_unconfirmed', round(GET_TOTAL_DATA("UNCONFIRMED", "user_data", 'userid', "status", true)));
-define('user_locked'     , round(GET_TOTAL_DATA("LOCKED"     , "user_data", 'userid', "status", true)));
+define('user_confirmed'  , round(GET_TOTAL_DATA('CONFIRMED'  , 'user_data', 'userid', 'status', true)));
+define('user_unconfirmed', round(GET_TOTAL_DATA('UNCONFIRMED', 'user_data', 'userid', 'status', true)));
+define('user_locked'     , round(GET_TOTAL_DATA('LOCKED'     , 'user_data', 'userid', 'status', true)));
 define('user_count'      , (constant('user_confirmed') + constant('user_unconfirmed') + constant('user_locked')));
 
 // Start of this exchange
-define('__MT_START', MAKE_DATETIME(getConfig('mt_start'), "3"));
+define('__MT_START', generateDateTime(getConfig('mt_start'), '3'));
 
 // Projected number of members
 define('__MT_STAGE', getConfig('mt_stage'));
@@ -71,10 +71,10 @@ if (constant('user_count')> 0) {
 }
 
 // Generate timestamp
-$TEST = MAKE_TIME(0, 0, 0, $PROJECTED);
+$TEST = makeTime(0, 0, 0, $PROJECTED);
 
 if ($TEST > time()) {
-       define('__MT_PROJECTED', MAKE_DATETIME($PROJECTED, "3"));
+       define('__MT_PROJECTED', generateDateTime($PROJECTED, '3'));
 } else {
        define('__MT_PROJECTED', getMessage('USER_PROJECTION_UNKNOWN'));
 }
@@ -92,32 +92,32 @@ SQL_FREERESULT($result_rec);
 define('user_max_rec', $dummy);
 
 // Max mails per day
-define('max', GET_TOTAL_DATA("CONFIRMED", "user_data", "max_mails", "status", false, " AND `max_mails` > 0"));
+define('max', GET_TOTAL_DATA('CONFIRMED', 'user_data', 'max_mails', 'status', false, " AND `max_mails` > 0"));
 
 // Max mails for this day
-define('rec', GET_TOTAL_DATA("CONFIRMED", "user_data", "receive_mails", "status", false, " AND `receive_mails` > 0"));
+define('rec', GET_TOTAL_DATA('CONFIRMED', 'user_data', 'receive_mails', 'status', false, " AND `receive_mails` > 0"));
 
 // Initial lots of variables
 $bmails = 0; $sent = 0; $max = 0; $rec = 0; $clicks = 0;
 
 // Mail orders (only current)
-$nmails = MEDIA_GET_ENTRY("normal_orders");
+$nmails = MEDIA_GET_ENTRY('normal_orders');
 if (empty($nmails)) $nmails = 0;
 
 // Mails sent so far
-$clicks = MEDIA_GET_ENTRY("normal_clicks");
-$sent   = MEDIA_GET_ENTRY("normal_send");
+$clicks = MEDIA_GET_ENTRY('normal_clicks');
+$sent   = MEDIA_GET_ENTRY('normal_send');
 if (empty($sent))   $sent   = 0;
 if (empty($clicks)) $clicks = 0;
 
 // Bonus mails
 if (EXT_IS_ACTIVE('bonus')) {
-       $bmails = MEDIA_GET_ENTRY("bonus_orders");
+       $bmails = MEDIA_GET_ENTRY('bonus_orders');
        if (empty($bmails)) $bmails = 0;
 
        // Count bonus mails clicks / sent mails
-       $dmy  = MEDIA_GET_ENTRY("bonus_clicks");
-       $dmy2 = MEDIA_GET_ENTRY("bonus_send");
+       $dmy  = MEDIA_GET_ENTRY('bonus_clicks');
+       $dmy2 = MEDIA_GET_ENTRY('bonus_send');
        if (empty($dmy))  $dmy  = 0;
        if (empty($dmy2)) $dmy2 = 0;
        $sent += $dmy2; $clicks += $dmy;
@@ -129,16 +129,16 @@ define('sent'      , $sent);
 // All clicks
 define('user_links', abs($sent - $clicks));
 
-$clr = "0.00000";
+$clr = '0.00000';
 if ($sent > 0) $clr = $clicks / $sent * 100;
-define('_clr', TRANSLATE_COMMA($clr)."%");
+define('_clr', translateComma($clr).'%');
 
 // Load jackpot
 $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
 list($jackpot) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 if (empty($jackpot)) $jackpot = 0;
-define('jackpot', TRANSLATE_COMMA($jackpot));
+define('jackpot', translateComma($jackpot));
 
 // Total referal link clicks, total logins
 $result = SQL_QUERY("SELECT DISTINCT SUM(d.ref_clicks), SUM(d.total_logins)
@@ -153,7 +153,7 @@ if (empty($points)) $points = 0;
 if (empty($ref))    $ref    = 0;
 if (empty($logins)) $logins = 0;
 
-define('__TOTAL_POINTS'   , TRANSLATE_COMMA($points));
+define('__TOTAL_POINTS'   , translateComma($points));
 define('__TOTAL_REFCLICKS', $ref);
 define('__TOTAL_LOGINS'   , $logins);
 
@@ -194,7 +194,7 @@ if (EXT_IS_ACTIVE('beg')) {
                'lang'  => MEDIA_BEG_CLICKS,
                'value' => $extra
        );
-       $OUT_EXTRA .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_EXTRA .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $ROWS_EXTRA++;
 }
 
@@ -213,31 +213,31 @@ if (EXT_IS_ACTIVE('doubler')) {
        if (empty($points2)) $points2 = 0;
 
        // Add header
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, getMessage('MEDIA_DOUBLER_HEADER'));
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_hrow', true, getMessage('MEDIA_DOUBLER_HEADER'));
 
        // Add first line (count)
        $content = array(
                'lang'  => getMessage('MEDIA_DOUBLER_COUNT'),
                'value' => $count1,
-               'rows'  => "4"
+               'rows'  => '4'
        );
        // Add points
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row2", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row2', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_DOUBLER_CPOINTS'),
-               'value' => TRANSLATE_COMMA($points1)
+               'value' => translateComma($points1)
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_DOUBLER_WAITING'),
-               'value' => TRANSLATE_COMMA($count2)
+               'value' => translateComma($count2)
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_DOUBLER_WPOINTS'),
-               'value' => TRANSLATE_COMMA($points2)
+               'value' => translateComma($points2)
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
 }
 
 if (EXT_IS_ACTIVE('holiday')) {
@@ -254,7 +254,7 @@ WHERE d.`holiday_active`='Y'",
                'lang'  => getMessage('MEDIA_HOLIDAY_COUNT'),
                'value' => $holiday
        );
-       $OUT_USER .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_USER .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $ROWS_USER++;
 }
 
@@ -279,28 +279,28 @@ ON t.userid=d.userid",
        if (empty($points_out)) $points_out = 0;
 
        // Add header
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, getMessage('MEDIA_TRANSFER_HEADER'));
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_hrow', true, getMessage('MEDIA_TRANSFER_HEADER'));
        $content = array(
                'lang'  => getMessage('MEDIA_TRANSFER_IN_COUNT'),
                'value' => $count_in,
-               'rows'  => "4"
+               'rows'  => '4'
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row2", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row2', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_TRANSFER_IN_POINTS'),
-               'value' => TRANSLATE_COMMA($points_in)
+               'value' => translateComma($points_in)
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_TRANSFER_OUT_COUNT'),
                'value' => $count_out
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
        $content = array(
                'lang'  => getMessage('MEDIA_TRANSFER_OUT_POINTS'),
-               'value' => TRANSLATE_COMMA($points_out)
+               'value' => translateComma($points_out)
        );
-       $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_row", true, $content);
+       $OUT_SPECIAL .= LOAD_TEMPLATE('mediadata_extra_row', true, $content);
 }
 
 define('__EXTRA_MEDIADATA'  , $OUT_EXTRA);
@@ -313,7 +313,7 @@ define('__ROWSPAN_USER'     , $ROWS_USER);
 
 // Patch level and it's timespamp
 define('__PATCH_LEVEL', getConfig('patch_level'));
-define('__PATCH_CTIME', MAKE_DATETIME(getConfig('patch_ctime'), "2"));
+define('__PATCH_CTIME', generateDateTime(getConfig('patch_ctime'), '2'));
 
 // Load template
 LOAD_TEMPLATE('mediadata');
index f23ee2efde5b8c9eddd3ebdcc18149473274fb9e..be0254f732f50cc7d02dae0f81ee625bba5208b1 100644 (file)
@@ -48,6 +48,7 @@ if (!defined('__SECURITY')) {
 // Add description as navigation point
 ADD_DESCR('guest', __FILE__);
 
+// Open div tag
 OUTPUT_HTML("<div align=\"center\">");
 
 // Check for possible running rallyes
@@ -59,26 +60,20 @@ FROM `{!_MYSQL_PREFIX!}_rallye_data` AS d, `{!_MYSQL_PREFIX!}_admins` AS a
 WHERE d.admin_id=a.id".$ADMIN." AND d.notified='Y'
 ORDER BY d.end_time LIMIT 1", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) == 1)
-{
+if (SQL_NUMROWS($result) == 1) {
        // Found some (normally one...
        list($id, $aid, $login, $title, $descr, $templ, $start, $end, $min_users, $min_prices) = SQL_FETCHROW($result);
 
        $expired = false;
-       if ($end < time())
-       {
+       if ($end < time()) {
                // Rallye is expired
-               define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
+               define('__RALLYE_EXTRAS', getMessage('RALLYE_HAS_EXPIRED'));
                $expired = true;
-       }
-        elseif (time() >= ($end - getConfig('one_day')))
-       {
+       } elseif (time() >= ($end - getConfig('one_day'))) {
                // Rallye will expire in less one day!
-               define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
-       }
-        else
-       {
-               define('__RALLYE_EXTRAS', "<a href=\"{!URL!}/modules.php?module=index&amp;what=register\">".RALLYE_REGISTER_NOW."</a>");
+               define('__RALLYE_EXTRAS', getMessage('RALLYE_EXPIRE_ONE_DAY'));
+       } else {
+               define('__RALLYE_EXTRAS', "<a href=\"{!URL!}/modules.php?module=index&amp;what=register\">{--RALLYE_REGISTER_NOW--}</a>");
        }
        // Set admin line (currently set to impressum, later to contact form)
        define('__RALLYE_ADMIN', "<a href=\"{!URL!}/modules.php?module=index&amp;what=impressum&amp;admin=".$aid."\">".$login."</a>");
@@ -96,39 +91,39 @@ if (SQL_NUMROWS($result) == 1)
        }
 
        // Set start and end time
-       define('__RALLYE_START', MAKE_DATETIME($start, "1"));
-       define('__RALLYE_END'  , MAKE_DATETIME($end  , "1"));
+       define('__RALLYE_START', generateDateTime($start, "1"));
+       define('__RALLYE_END'  , generateDateTime($end  , "1"));
 
        // Determine min_users
        define('__RALLYE_MAX_USERS', RALLYE_DETERMINE_MIN_USERS($min_users));
 
        if ($min_prices == 0) {
                // Rallye ends without user limitation
-               define('__RALLYE_MIN_PRICES', RALLYE_END_NO_PRICE_LIMITATION);
+               define('__RALLYE_MIN_PRICES', getMessage('RALLYE_END_NO_PRICE_LIMITATION'));
        } else {
                // Rallye ends when X members are totally in your exchange
-               define('__RALLYE_MIN_PRICES', RALLYE_END_PRICES_1." ".$min_prices." ".RALLYE_END_PRICES_2);
+               define('__RALLYE_MIN_PRICES', getMessage('RALLYE_END_PRICES_1') . ' ' . $min_prices . ' ' . getMessage('RALLYE_END_PRICES_2'));
        }
 
        if ($expired === true) {
                define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
-               define('__RALLYE_TOP_USERS', "<div align=\"center\" class=\"big\">".__RALLYE_EXTRAS."</div>");
-               define('__RALLYE_CAN_WIN_THIS', RALLYE_OUR_WINNERS_ARE);
+               define('__RALLYE_TOP_USERS', "<div align=\"center\" class=\"big\">{!__RALLYE_EXTRAS!}</div>");
+               define('__RALLYE_CAN_WIN_THIS', getMessage('RALLYE_OUR_WINNERS_ARE'));
        } else {
                define('__RALLYE_PRICES', RALLYE_ADD_PRICES($id, 'html'));
                define('__RALLYE_TOP_USERS', RALLYE_ADD_TOPUSERS($id, getUserId()));
-               define('__RALLYE_CAN_WIN_THIS', RALLYE_YOU_CAN_WIN);
+               define('__RALLYE_CAN_WIN_THIS', getMessage('RALLYE_YOU_CAN_WIN'));
        }
 
        // And load final template
        LOAD_TEMPLATE("guest_rallye_show");
-}
- else
-{
+} else {
        // No rallye found so far
        LOAD_TEMPLATE("guest_no_rallyes");
 }
-//
+
+// Close the div tag
 OUTPUT_HTML("</div>");
+
 //
 ?>
index 713787e4695764a986aa1afdfe64709d4f65ec96..2c4368b4a92f3d7d3485bf7d0c889d293d261930 100644 (file)
@@ -83,7 +83,7 @@ if ($GLOBALS['refid'] > 0) {
        if (SQL_NUMROWS($result) == 0) {
                // Not found so we set your refid!
                REQUEST_SET_POST('refid', getConfig('def_refid'));
-               set_session('refid', getConfig('def_refid'));
+               setSession('refid', getConfig('def_refid'));
        } else {
                // Use the refid here
                REQUEST_SET_POST('refid', $GLOBALS['refid']);
@@ -95,24 +95,24 @@ if (IS_FORM_SENT()) {
        //
        // Did he agree to our Terms Of Usage?
        if (REQUEST_POST('agree') != 'Y') {
-               REQUEST_SET_POST('agree', "!");
+               REQUEST_SET_POST('agree', '!');
                $FAILED = true;
        } // END - if
 
        // Did he enter a valid email address? (we really don't care about
        // that, he has to click on a confirmation link :P )
        if ((!REQUEST_ISSET_POST(('addy'))) || (!VALIDATE_EMAIL(REQUEST_POST('addy')))) {
-               REQUEST_SET_POST('addy', "!");
+               REQUEST_SET_POST('addy', '!');
                $FAILED = true;
        } // END - if
 
        // And what about surname and family's name?
        if (!REQUEST_ISSET_POST(('surname'))) {
-               REQUEST_SET_POST('surname', "!");
+               REQUEST_SET_POST('surname', '!');
                $FAILED = true;
        } // END - if
        if (!REQUEST_ISSET_POST(('family'))) {
-               REQUEST_SET_POST('family', "!");
+               REQUEST_SET_POST('family', '!');
                $FAILED = true;
        } // END - if
 
@@ -122,11 +122,11 @@ if (IS_FORM_SENT()) {
        // Did he enter his password twice?
        if (((!REQUEST_ISSET_POST(('pass1'))) || (!REQUEST_ISSET_POST(('pass2')))) || ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))))) {
                if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
-                       REQUEST_SET_POST('pass1', "!");
-                       REQUEST_SET_POST('pass2', "!");
+                       REQUEST_SET_POST('pass1', '!');
+                       REQUEST_SET_POST('pass2', '!');
                } else {
-                       if (!REQUEST_ISSET_POST(('pass1'))) { REQUEST_SET_POST('pass1', "!"); } else { REQUEST_SET_POST('pass1', ''); }
-                       if (!REQUEST_ISSET_POST(('pass2'))) { REQUEST_SET_POST('pass2', "!"); } else { REQUEST_SET_POST('pass2', ''); }
+                       if (!REQUEST_ISSET_POST(('pass1'))) { REQUEST_SET_POST('pass1', '!'); } else { REQUEST_SET_POST('pass1', ''); }
+                       if (!REQUEST_ISSET_POST(('pass2'))) { REQUEST_SET_POST('pass2', '!'); } else { REQUEST_SET_POST('pass2', ''); }
                }
                $FAILED = true;
        } // END - if
@@ -150,17 +150,20 @@ if (IS_FORM_SENT()) {
                } // END - if
        } // END - if
 
-       if ((REQUEST_POST('addy') != "!") && (getConfig('check_double_email') == 'Y')) {
+       if ((REQUEST_POST('addy') != '!') && (getConfig('check_double_email') == 'Y')) {
                // Does the email address already exists in our database?
-               $CHK = SEARCH_EMAIL_USERTAB(REQUEST_POST('addy'));
-               if ($CHK) { REQUEST_SET_POST('addy', "?"); $FAILED = true; }
+               $CHK = isEmailTaken(REQUEST_POST('addy'));
+               if ($CHK === true) {
+                       REQUEST_SET_POST('addy', '?');
+                       $FAILED = true;
+               } // END - if
        } // END - if
 
        // Check for IP timeout?
        if (getConfig('ip_timeout') > 0) {
                // Check his IP number
                $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
-                       array(GET_REMOTE_ADDR(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__);
+                       array(detectRemoteAddr(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
                        // But admins are allowed to fake their own exchange service.
@@ -175,36 +178,36 @@ if (IS_FORM_SENT()) {
 
 if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
        // Prepapre month and day of birth
-       if (strlen(REQUEST_POST('day'))   == 1) REQUEST_SET_POST('day'  , "0".REQUEST_POST('day'));
-       if (strlen(REQUEST_POST('month')) == 1) REQUEST_SET_POST('month', "0".REQUEST_POST('month'));
+       if (strlen(REQUEST_POST('day'))   == 1) REQUEST_SET_POST('day'  , '0'.REQUEST_POST('day'));
+       if (strlen(REQUEST_POST('month')) == 1) REQUEST_SET_POST('month', '0'.REQUEST_POST('month'));
 
        // Get total ...
        // ... confirmed, ...
-       $confirmedUsers   = GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true);
+       $confirmedUsers   = GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true);
        // ... unconfirmed ...
-       $unconfirmedUsers = GET_TOTAL_DATA("UNCONFIRMED", "user_data", 'userid', "status", true);
+       $unconfirmedUsers = GET_TOTAL_DATA('UNCONFIRMED', 'user_data', 'userid', 'status', true);
        // ... and locked users!
-       $lockedUsers      = GET_TOTAL_DATA("LOCKED", "user_data", 'userid', "status", true);
+       $lockedUsers      = GET_TOTAL_DATA('LOCKED', 'user_data', 'userid', 'status', true);
 
        // Generate hash which will be inserted into confirmation mail
-       $hash = generateHash(sha1($confirmedUsers.":".$unconfirmedUsers.":".$lockedUsers.":".REQUEST_POST('month')."-".REQUEST_POST('day')."-".REQUEST_POST('year').":".getenv('SERVER_NAME').":".GET_REMOTE_ADDR().":".GET_USER_AGENT()."/".constant('SITE_KEY')."/".constant('DATE_KEY')."/".constant('RAND_NUMBER')));
+       $hash = generateHash(sha1($confirmedUsers.constant('ENCRYPT_SEPERATOR').$unconfirmedUsers.constant('ENCRYPT_SEPERATOR').$lockedUsers.constant('ENCRYPT_SEPERATOR').REQUEST_POST('month').'-'.REQUEST_POST('day').'-'.REQUEST_POST('year').constant('ENCRYPT_SEPERATOR').getenv('SERVER_NAME').constant('ENCRYPT_SEPERATOR').detectRemoteAddr().constant('ENCRYPT_SEPERATOR').detectUserAgent().'/'.constant('SITE_KEY').'/'.constant('DATE_KEY').'/'.constant('RAND_NUMBER')));
 
        // Add design when extension sql_patches is v0.2.7 or greater
+       // @TODO Rewrite these all to a single filter
        $ADD1 = ''; $ADD2 = '';
        if (GET_EXT_VERSION('sql_patches') >= '0.2.7') {
                // Okay, add design here
-               $ADD1 = ", curr_theme";
-               $ADD2 = ", '".GET_CURR_THEME()."'";
+               $ADD1 = ", `curr_theme`";
+               $ADD2 = ", '".getCurrentTheme()."'";
        } // END - if
 
        // Check if I shall disable sending mail to newly registered members out about active/begging rallye
-       // @TODO Rewrite this to a single filter
        //
        // First comes first: begging rallye
        if (GET_EXT_VERSION('beg') >= '0.1.7') {
                // Okay, shall I disable now?
                if (getConfig('beg_new_mem_notify') != 'Y') {
-                       $ADD1 .= ", beg_ral_notify, beg_ral_en_notify";
+                       $ADD1 .= ", `beg_ral_notify`, `beg_ral_en_notify`";
                        $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
                } // END - if
        } // END - if
@@ -213,7 +216,7 @@ if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
        if (GET_EXT_VERSION('bonus') >= '0.7.7') {
                // Okay, shall I disable now?
                if (getConfig('bonus_new_mem_notify') != 'Y') {
-                       $ADD1 .= ", bonus_ral_notify, bonus_ral_en_notify";
+                       $ADD1 .= ", `bonus_ral_notify`, `bonus_ral_en_notify`";
                        $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
                } // END - if
        } // END - if
@@ -221,11 +224,11 @@ if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
        // Write user data to table
        if (EXT_IS_ACTIVE('country')) {
                // Save with new selectable country code
-               $countryRow = "country_code";
+               $countryRow = "`country_code`";
                $countryData = bigintval(REQUEST_POST('country_code'));
        } else {
                // Old way with enterable two-char-code
-               $countryRow = 'country';
+               $countryRow = "`country`";
                $countryData = substr(REQUEST_POST('cntry'), 0, 2);
        }
 
@@ -253,7 +256,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                bigintval(REQUEST_POST('max_mails')),
                bigintval(REQUEST_POST('refid')),
                $hash,
-               GET_REMOTE_ADDR(),
+               detectRemoteAddr(),
        ), __FILE__, __LINE__);
 
        // Get his userid
@@ -270,11 +273,11 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        // @TODO Rewrite this to a filter
        if (EXT_IS_ACTIVE('refback')) {
                // Update refback table
-               UPDATE_REFBACK_TABLE($userid);
+               updateRefbackTable($userid);
        } // END - if
 
        // Write his welcome-points
-       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1",
                array(bigintval($userid)), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
                // Add only when the line was not found (maybe some more secure?)
@@ -302,10 +305,10 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        } // END - if
 
        // Rewrite gender
-       $gender = TRANSLATE_GENDER(REQUEST_POST('gender'));
+       $gender = translateGender(REQUEST_POST('gender'));
 
        // ... rewrite a zero referal ID to the main title
-       if (REQUEST_POST('refid') == "0") REQUEST_SET_POST('refid', constant('MAIN_TITLE'));
+       if (REQUEST_POST('refid') == '0') REQUEST_SET_POST('refid', constant('MAIN_TITLE'));
 
        // Is ZIP code set?
        if (REQUEST_ISSET_POST('zip')) {
@@ -344,102 +347,102 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        }
 
        // Continue with birthday...
-       switch (GET_LANGUAGE())
+       switch (getLanguage())
        {
-       case "de":
-               $DATA['birthday'] = bigintval(REQUEST_POST('day')).".".bigintval(REQUEST_POST('month')).".".bigintval(REQUEST_POST('year'));
+       case 'de':
+               $DATA['birthday'] = bigintval(REQUEST_POST('day')).'.'.bigintval(REQUEST_POST('month')).'.'.bigintval(REQUEST_POST('year'));
                break;
 
        default:
-               $DATA['birthday'] = bigintval(REQUEST_POST('month'))."/".bigintval(REQUEST_POST('day'))."/".bigintval(REQUEST_POST('year'));
+               $DATA['birthday'] = bigintval(REQUEST_POST('month')).'/'.bigintval(REQUEST_POST('day')).'/'.bigintval(REQUEST_POST('year'));
                break;
        }
 
        // Display information to the user that he got mail and send it away
-       $msg_guest = LOAD_EMAIL_TEMPLATE("register-member", $DATA, $userid);
+       $msg_guest = LOAD_EMAIL_TEMPLATE('register-member', $DATA, $userid);
 
        // Send mail to user (confirmation link!)
        $EMAIL = $DATA['email'];
-       SEND_EMAIL ($DATA['email'], getMessage('GUEST_CONFIRM_LINK'), $msg_guest);
+       sendEmail ($DATA['email'], getMessage('GUEST_CONFIRM_LINK'), $msg_guest);
        $DATA['email'] = $EMAIL;
 
        // Send mail to admin
-       SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_ACCOUNT'), "register-admin", $DATA, $userid);
+       sendAdminNotification(getMessage('ADMIN_NEW_ACCOUNT'), 'register-admin', $DATA, $userid);
 
        // Output success registration
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('REGISTRATION_DONE'));
 } else {
-       if (REQUEST_POST('agree') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--HAVE_TO_AGREE--}</div>");
+       if (REQUEST_POST('agree') == '!') {
+               registerOutputFailedMessage('HAVE_TO_AGREE');
        } // END - if
 
-       if (REQUEST_POST('addy') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_EMAIL--}</div>");
+       if (REQUEST_POST('addy') == '!') {
+               registerOutputFailedMessage('ENTER_EMAIL');
                REQUEST_SET_POST('addy', '');
-       } elseif (REQUEST_POST('addy') == "?") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--EMAIL_ALREADY_DB--}</div>");
+       } elseif (REQUEST_POST('addy') == '?') {
+               registerOutputFailedMessage('EMAIL_ALREADY_DB');
                REQUEST_SET_POST('addy', '');
        }
 
-       if (REQUEST_POST('surname') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_SURNAME--}</div>");
+       if (REQUEST_POST('surname') == '!') {
+               registerOutputFailedMessage('ENTER_SURNAME');
                REQUEST_SET_POST('surname', '');
        } // END - if
 
-       if (REQUEST_POST('family') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_FAMILY--}</div>");
+       if (REQUEST_POST('family') == '!') {
+               registerOutputFailedMessage('ENTER_FAMILY');
                REQUEST_SET_POST('family', '');
        } // END - if
 
-       if ((REQUEST_POST('pass1') == "!") && (REQUEST_POST('pass2') == "!")) {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_BOTH_PASSWORDS--}</div>");
-       } elseif (REQUEST_POST('pass1') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_PASS1--}</div>");
-       } elseif (REQUEST_POST('pass2') == "!") {
-               OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_PASS2--}</div>");
+       if ((REQUEST_POST('pass1') == '!') && (REQUEST_POST('pass2') == '!')) {
+               registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
+       } elseif (REQUEST_POST('pass1') == '!') {
+               registerOutputFailedMessage('ENTER_PASS1');
+       } elseif (REQUEST_POST('pass2') == '!') {
+               registerOutputFailedMessage('ENTER_PASS2');
        }
 
        if ($SHORT_PASS === true) {
-               OUTPUT_HTML("<div class=\"register_failed\">{--SHORT_PASS--}: ".getConfig('pass_len')."</div>");
+               registerOutputFailedMessage('SHORT_PASS', ": ".getConfig('pass_len'));
        } // END - if
 
        if ($IP_TIMEOUT === true) {
-               OUTPUT_HTML("<div class=\"register_failed\">{--REMOTE_ADDR_TIMEOUT--}</div>");
+               registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
        } // END - if
 
        if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
-               OUTPUT_HTML("<div class=\"register_failed\">".sprintf(getMessage('CATS_LEAST'), getConfig('least_cats'))."</div>");
+               registerOutputFailedMessage(sprintf(getMessage('CATS_LEAST'), getConfig('least_cats')));
        } // END - if
 
        // Generate birthday selection
-       switch (GET_LANGUAGE())
+       switch (getLanguage())
        {
-       case "de": // German date format
-               define('BIRTHDAY_SELECTION', ADD_SELECTION("day", REQUEST_POST('day')).ADD_SELECTION("month", REQUEST_POST('month')).ADD_SELECTION("year", REQUEST_POST('year')));
+       case 'de': // German date format
+               define('BIRTHDAY_SELECTION', ADD_SELECTION('day', REQUEST_POST('day')).ADD_SELECTION('month', REQUEST_POST('month')).ADD_SELECTION('year', REQUEST_POST('year')));
                break;
 
        default: // Default is the US date format... :)
-               define('BIRTHDAY_SELECTION', ADD_SELECTION("month", REQUEST_POST('month')).ADD_SELECTION("day", REQUEST_POST('day')).ADD_SELECTION("year", REQUEST_POST('year')));
+               define('BIRTHDAY_SELECTION', ADD_SELECTION('month', REQUEST_POST('month')).ADD_SELECTION('day', REQUEST_POST('day')).ADD_SELECTION('year', REQUEST_POST('year')));
                break;
        }
 
        // Adds a table for the guests with all visible categories
-       define('CATEGORY_SELECTION', REGISTER_ADD_CATEGORY_TABLE('guest', true));
+       define('CATEGORY_SELECTION', registerGenerateCategoryTable('guest', true));
 
        // Adds maximum receiveable mails list... :)
-       define('MAX_RECEIVE_LIST', ADD_MAX_RECEIVE_LIST('guest', '', true));
+       define('MAX_RECEIVE_LIST', addMaxReceiveList('guest', '', true));
 
        // Shall I display the refid or shall I make it editable?
        if (getConfig('display_refid') == 'Y') {
                // Load "hide" form template
-               define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid']));
+               define('REFID_CONTENT', LOAD_TEMPLATE('guest_register_refid_hide', true, $GLOBALS['refid']));
        } else {
                // Load template to enter it
-               define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid", true, $GLOBALS['refid']));
+               define('REFID_CONTENT', LOAD_TEMPLATE('guest_register_refid', true, $GLOBALS['refid']));
        }
 
        // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
-       define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE("register_header", true));
+       define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE('register_header', true));
 
        // Please select at least x categories
        define('LEAST_CATS_VALUE', getConfig('least_cats'));
@@ -463,7 +466,7 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
                $OUT  = "<select name=\"country_code\" class=\"guest_select\" size=\"1\">\n";
                $whereStatement = "WHERE is_active='Y'";
                if (IS_ADMIN()) $whereStatement = '';
-               $OUT .= ADD_OPTION_LINES("countries", "id", "descr", REQUEST_POST('country_code'), "code", $whereStatement);
+               $OUT .= generateOptionList('countries', 'id', 'descr', REQUEST_POST('country_code'), 'code', $whereStatement);
                $OUT .= "</select>";
                define('__COUNTRY_CONTENT', $OUT);
        } else {
@@ -472,10 +475,10 @@ VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONF
        }
 
        // Set MUST_??? constants
-       if ((EXT_IS_ACTIVE('register')) && (GET_EXT_VERSION('register') > '0.0')) REGISTER_FILL_MUST_CONSTANTS();
+       if ((EXT_IS_ACTIVE('register')) && (GET_EXT_VERSION('register') > '0.0')) registerMustFillout();
 
        // Display registration form
-       LOAD_TEMPLATE("guest_register");
+       LOAD_TEMPLATE('guest_register');
 }
 
 //
index 7e50f1ed4bdd63cf5de76066d2e6386a7fb0c981..d9d1b21996dc53cec4ffb3ced3432419b9706d02 100644 (file)
@@ -88,10 +88,10 @@ if (SQL_NUMROWS($result_act) > 0) {
                        $content = array(
                                'sw'    => $SW,
                                'name'  => $content['pay_name'],
-                               'rate'  => TRANSLATE_COMMA($content['pay_rate']),
+                               'rate'  => translateComma($content['pay_rate']),
                                'min'   => $content['pay_min_count'],
                                'curr'  => $content['pay_currency'],
-                               'price' => TRANSLATE_COMMA($content['pay_min_count']),
+                               'price' => translateComma($content['pay_min_count']),
                        );
 
                        // Load row template and switch color
index 037f146eee79373b47254ef9452b78c0006388d5..192a4b4b225e377422114efeed6c33b35c22c502 100644 (file)
@@ -72,25 +72,25 @@ LIMIT 1", array(REQUEST_GET('hash')), __FILE__, __LINE__);
                $SPONSOR = SQL_FETCHARRAY($result);
 
                // Translate gender and comma
-               $SPONSOR['gender']  = TRANSLATE_GENDER($SPONSOR['gender']);
-               $SPONSOR['points'] = TRANSLATE_COMMA($SPONSOR['points']);
-               $SPONSOR['pay']    = TRANSLATE_COMMA($SPONSOR['pay']);
+               $SPONSOR['gender']  = translateGender($SPONSOR['gender']);
+               $SPONSOR['points'] = translateComma($SPONSOR['points']);
+               $SPONSOR['pay']    = translateComma($SPONSOR['pay']);
 
                // Unconfirmed account or changed email address?
                if ($SPONSOR['status'] == 'UNCONFIRMED') {
                        // Set account to pending
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='PENDING'
-WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
+WHERE `id`='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
                                array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
                        // Check on success
                        if (SQL_AFFECTEDROWS() == 1) {
                                // Prepare mail and send it to the sponsor
                                $message = LOAD_EMAIL_TEMPLATE('sponsor_pending', $SPONSOR);
-                               SEND_EMAIL($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $message);
+                               sendEmail($SPONSOR['email'], getMessage('SPONSOR_ACCOUNT_PENDING_SUBJ'), $message);
 
                                // Send email to admin
-                               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), 'admin_sponsor_pending', $SPONSOR);
+                               sendAdminNotification(getMessage('ADMIN_NEW_SPONSOR'), 'admin_sponsor_pending', $SPONSOR);
 
                                // Sponsor account set to pending
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACCOUNT_IS_PENDING'));
@@ -101,7 +101,7 @@ WHERE id='%s' AND hash='%s' AND `status`='UNCONFIRMED' LIMIT 1",
                } elseif ($SPONSOR['status'] == 'EMAIL') {
                        // Changed email adress need to be confirmed
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET `status`='CONFIRMED'
-WHERE id='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
+WHERE `id`='%s' AND hash='%s' AND `status`='EMAIL' LIMIT 1",
                                array(bigintval($SPONSOR['id']), REQUEST_GET('hash')), __FILE__, __LINE__);
 
                        // Check on success 
@@ -143,8 +143,8 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
                        $SPONSOR = SQL_FETCHARRAY($result);
 
                        // Translate some data
-                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
-                       $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
+                       $SPONSOR['gender']           = translateGender($SPONSOR['gender']);
+                       $SPONSOR['sponsor_created'] = generateDateTime($SPONSOR['sponsor_created']);
 
                        // Prepare email and send it to the sponsor
                        if ($SPONSOR['status'] == 'UNCONFIRMED') {
@@ -154,7 +154,7 @@ WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
                                // Confirmed email address
                                $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_email', $SPONSOR);
                        }
-                       SEND_EMAIL(REQUEST_POST('email'), SPONSOR_ACTIVATION_LINK_SUBJ, $msg_sponsor);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_ACTIVATION_LINK_SUBJ'), $msg_sponsor);
 
                        // Output message
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSOR_ACTIVATION_LINK_SENT'));
@@ -189,19 +189,19 @@ WHERE email='%s' AND id='%s' AND `status`='CONFIRMED' LIMIT 1",
                        $SPONSOR = SQL_FETCHARRAY($result);
 
                        // Translate some data
-                       $SPONSOR['gender']           = TRANSLATE_GENDER($SPONSOR['gender']);
-                       $SPONSOR['sponsor_created'] = MAKE_DATETIME($SPONSOR['sponsor_created']);
+                       $SPONSOR['gender']           = translateGender($SPONSOR['gender']);
+                       $SPONSOR['sponsor_created'] = generateDateTime($SPONSOR['sponsor_created']);
 
                        // Generate password
-                       $SPONSOR['password']        = GEN_PASS();
+                       $SPONSOR['password']        = generatePassword();
 
                        // Prepare email and send it to the sponsor
                        $msg_sponsor = LOAD_EMAIL_TEMPLATE('sponsor_lost', $SPONSOR);
-                       SEND_EMAIL(REQUEST_POST('email'), SPONSOR_LOST_PASSWORD_SUBJ, $msg_sponsor);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_LOST_PASSWORD_SUBJ'), $msg_sponsor);
 
                        // Update password
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_sponsor_data` SET password='%s'
-WHERE id='%s' LIMIT 1",
+WHERE `id`='%s' LIMIT 1",
                                array(md5($SPONSOR['password']), bigintval($SPONSOR['id'])), __FILE__, __LINE__);
 
                        // Output message
@@ -220,7 +220,7 @@ WHERE id='%s' LIMIT 1",
 } elseif (IS_FORM_SENT()) {
        // Check status and login data ...
        $result = SQL_QUERY_ESC("SELECT status FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' LIMIT 1",
+WHERE `id`='%s' AND password='%s' LIMIT 1",
                array(bigintval(REQUEST_POST('sponsorid')), md5(REQUEST_POST('pass'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
@@ -228,13 +228,13 @@ WHERE id='%s' AND password='%s' LIMIT 1",
                list($status) = SQL_FETCHROW($result);
                if ($status == 'CONFIRMED') {
                        // Is confirmed so both is fine and we can continue with login procedure
-                       $login = ((set_session('sponsorid'  , bigintval(REQUEST_POST('sponsorid')))) &&
-                                 (set_session('sponsorpass', md5(REQUEST_POST('pass'))           ))
+                       $login = ((setSession('sponsorid'  , bigintval(REQUEST_POST('sponsorid')))) &&
+                                 (setSession('sponsorpass', md5(REQUEST_POST('pass'))           ))
                        );
 
                        if ($login === true) {
                                // Cookie setup successfull so we can forward to sponsor area
-                               LOAD_URL('modules.php?module=sponsor');
+                               redirectToUrl('modules.php?module=sponsor');
                        } else {
                                // Cookie setup failed!
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SPONSPOR_COOKIE_SETUP_FAILED'));
index 0ab123a83bf7a582689c54a58777589520d9df7b..fbd31a5ef6cffa2852f38e28966d2f6b750ab878 100644 (file)
@@ -131,7 +131,7 @@ if (IS_FORM_SENT()) {
        if (!REQUEST_ISSET_POST(('url'))) {
                // Homepage URL is empty
                $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_EMPTY');
-       } elseif (!VALIDATE_URL(REQUEST_POST('url'))) {
+       } elseif (!isUrlValid(REQUEST_POST('url'))) {
                // Homepage URL is invalid
                $FORM_ERRORS[] = getMessage('SPONSOR_URL_IS_INVALID');
                REQUEST_SET_POST('url', '');
@@ -206,7 +206,7 @@ if ((IS_FORM_SENT()) && (count($FORM_ERRORS) == 0)) {
        // Calulate points
        $result = SQL_QUERY_ESC("SELECT (pay_rate * pay_min_count) AS points, pay_min_count AS pay, pay_currency AS curr
 FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes`
-WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
+WHERE `id`='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
        list($points, $pay, $curr) = SQL_FETCHROW($result);
 
        // Free memory
@@ -238,16 +238,16 @@ WHERE id='%s' LIMIT 1", array(REQUEST_POST('pay_type')), __FILE__, __LINE__);
                        define('__EMAIL'    , REQUEST_POST('email'));
                        define('__SURNAME'  , REQUEST_POST('surname'));
                        define('__FAMILY'   , REQUEST_POST('family'));
-                       define('__GENDER'   , TRANSLATE_GENDER(REQUEST_POST('gender')));
-                       define('__TIMESTAMP', MAKE_DATETIME(time(), 0));
+                       define('__GENDER'   , translateGender(REQUEST_POST('gender')));
+                       define('__TIMESTAMP', generateDateTime(time(), 0));
                        define('__PASSWORD' , REQUEST_POST('pass1'));
 
                        // Generate email and send it to the new sponsor
                        $EMAIL_MSG = LOAD_EMAIL_TEMPLATE("sponsor_confirm", $hash);
-                       SEND_EMAIL(REQUEST_POST('email'), getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG);
+                       sendEmail(REQUEST_POST('email'), getMessage('SPONSOR_PLEASE_CONFIRM_SUBJ'), $EMAIL_MSG);
 
                        // Send mail to admin
-                       SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash);
+                       sendAdminNotification(getMessage('ADMIN_NEW_SPONSOR'), "admin_sponsor_reg", $hash);
 
                        // Output message: DONE
                        $message = $messageArray['added'];
@@ -287,7 +287,7 @@ ORDER BY pay_name", __FILE__, __LINE__);
                while ($content = SQL_FETCHARRAY($result)) {
                        // Prepare content for output
                        $content['sw']  = $SW;
-                       $content['res'] = TRANSLATE_COMMA($content['pay_rate'] * $content['pay_min_count']);
+                       $content['res'] = translateComma($content['pay_rate'] * $content['pay_min_count']);
 
                        // Load row template and switch color
                        $OUT .= LOAD_TEMPLATE("guest_sponsor_payment_row", false, $content);
@@ -396,7 +396,7 @@ ORDER BY pay_name", __FILE__, __LINE__);
                // Prepare referal things
                if (!REQUEST_ISSET_GET(('refid'))) {
                        // No referal link
-                       define('__SPONSOR_REFID', "0");
+                       define('__SPONSOR_REFID', '0');
                } else  {
                        // Referal ID transmitted, we don't care here if it is right or not
                        define('__SPONSOR_REFID', bigintval(REQUEST_GET('refid')));
index 2727c2d9dc3a3f47f66374fa67e0f0a16bfc5ee8..2f4212d110ede3364b78caef0d67aa2414ad0fb9 100644 (file)
@@ -49,30 +49,30 @@ ADD_DESCR('guest', __FILE__);
 if (!REQUEST_ISSET_GET(('mode'))) REQUEST_SET_GET('mode', strtolower(getConfig('guest_stats')));
 
 switch (REQUEST_GET('mode')) {
-       case "members" :
-               setConfigEntry('guest_stats', "MEMBERS");
-               $lmode = "modules";
+       case 'members' :
+               setConfigEntry('guest_stats', 'MEMBERS');
+               $lmode = 'modules';
                $ltitle = getMessage('GUEST_STATS_MODULES');
                break;
 
-       case "modules" :
-               setConfigEntry('guest_stats', "MODULES");
-               $lmode = "members";
+       case 'modules' :
+               setConfigEntry('guest_stats', 'MODULES');
+               $lmode = 'members';
                $ltitle = getMessage('GUEST_STATS_MEMBERS');
                break;
 
-       case "inactive":
-               setConfigEntry('guest_stats', "INACTIVE");
-               $lmode = "inactive";
+       case 'inactive':
+               setConfigEntry('guest_stats', 'INACTIVE');
+               $lmode = 'inactive';
                $ltitle = getMessage('GUEST_STATS_INACTIVE');
                break;
 }
 
 switch (getConfig('guest_stats'))
 {
-case "MEMBERS": // Statistics about your members
+case 'MEMBERS': // Statistics about your members
        // Members yesterday / today online
-       $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_YDAY')." AND last_online < ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+       $ymem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_YDAY')." AND `last_online` < ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
        $tmem = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE last_online >= ".constant('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
 
        // Yesterday / today registered
@@ -80,8 +80,8 @@ case "MEMBERS": // Statistics about your members
        $treg = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE joined >= ".constant('START_TDAY'), __FILE__, __LINE__));
 
        // Only males / females
-       $male   = GET_TOTAL_DATA("M", "user_data", 'userid', "gender", true, " AND `status`='CONFIRMED'");
-       $female = GET_TOTAL_DATA("F", "user_data", 'userid', "gender", true, " AND `status`='CONFIRMED'");
+       $male   = GET_TOTAL_DATA('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
+       $female = GET_TOTAL_DATA('F', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
 
        // Unconfirmed accounts
        $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE status != 'CONFIRMED'", __FILE__, __LINE__));
@@ -96,10 +96,10 @@ case "MEMBERS": // Statistics about your members
                $month = $idx;
 
                // Append leading zero
-               if ($idx < 10) $month = "0".$idx;
+               if ($idx < 10) $month = '0'.$idx;
 
                // Count months
-               $months[$month] = GET_TOTAL_DATA(bigintval($month), "user_data", 'userid', "birth_month", true, " AND `status`='CONFIRMED'");
+               $months[$month] = GET_TOTAL_DATA(bigintval($month), 'user_data', 'userid', 'birth_month', true, " AND `status`='CONFIRMED'");
        }
 
        // Members in categories
@@ -116,7 +116,7 @@ case "MEMBERS": // Statistics about your members
        // Now we have all categories loaded, count members
        foreach ($cats as $id => $dummy) {
                // We only need id and nothing more to count...
-               $cat_cnt[$id] = GET_TOTAL_DATA(bigintval($id), "user_cats", "id", "cat_id", true);
+               $cat_cnt[$id] = GET_TOTAL_DATA(bigintval($id), 'user_cats', 'id', 'cat_id', true);
        }
 
        // Prepare data for the template
@@ -133,7 +133,7 @@ case "MEMBERS": // Statistics about your members
        define('__LINK_TITLE'  , $ltitle);
 
        // Generate monthly stats
-       $SW = 2; $r2 = " right2"; $l = "ll"; $r = "lr"; $OUT = '';
+       $SW = 2; $r2 = ' right2'; $l = 'll'; $r = 'lr'; $OUT = '';
        foreach ($months as $month => $cnt) {
                if ($SW == 2) $OUT .= "<tr>\n";
 
@@ -151,11 +151,11 @@ case "MEMBERS": // Statistics about your members
 
                if ($SW == 2) {
                        $r2 = '';
-                       $l = "rl"; $r = "rr";
+                       $l = 'rl'; $r = 'rr';
                } else {
                        $OUT .= "</tr>\n";
-                       $r2 = " right2";
-                       $l = "ll"; $r = "lr";
+                       $r2 = ' right2';
+                       $l = 'll'; $r = 'lr';
                }
                $SW = 3 - $SW;
        }
@@ -172,16 +172,16 @@ case "MEMBERS": // Statistics about your members
                );
 
                // Load row template and switch colors
-               $OUT .= LOAD_TEMPLATE("guest_stats_cats_row", true, $content);
+               $OUT .= LOAD_TEMPLATE('guest_stats_cats_row', true, $content);
                $SW = 3 - $SW;
        }
        define('__CATS_STATS_ROWS', $OUT);
 
        // Load final template
-       LOAD_TEMPLATE("guest_stats_member");
+       LOAD_TEMPLATE('guest_stats_member');
        break;
 
-case "MODULES": // TOP10 module clicks
+case 'MODULES': // TOP10 module clicks
        $AND = '';
        if (!IS_ADMIN()) $AND = " AND `locked`='N' AND `visible`='Y'";
        $guest_t10 = SQL_QUERY("SELECT counter, title FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE counter > 0".$AND." ORDER BY counter DESC LIMIT 0,10", __FILE__, __LINE__);
@@ -237,7 +237,7 @@ case "MODULES": // TOP10 module clicks
        }
        break;
 
-case "INACTIVE": // Deactivated stats
+case 'INACTIVE': // Deactivated stats
        LOAD_TEMPLATE('admin_settings_saved', false, "<strong>{--GUEST_STATS_DEACTIVATED--}</strong>");
        break;
 }
index 9c7464c94e60269f95dc8951a84005581b6bd8bd..60a4bd24d058d0388fdc3877d2d17b80323b6bbf 100644 (file)
@@ -78,8 +78,8 @@ while ($content = SQL_FETCHARRAY($result)) {
                'uid'    => $content['userid'],
                'nick'   => $content['nickname'],
                'logins' => $content['total_logins'],
-               'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
-               'last'   => MAKE_DATETIME($content['last_online'], "3"),
+               'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
+               'last'   => generateDateTime($content['last_online'], "3"),
        );
 
        // Load row template
@@ -148,8 +148,8 @@ while ($content = SQL_FETCHARRAY($result)) {
                'cnt'    => $cnt,
                'uid'    => $content['userid'],
                'nick'   => $content['nickname'],
-               'points' => TRANSLATE_COMMA($content['points']),
-               'last'   => MAKE_DATETIME($content['last_online'], "3")
+               'points' => translateComma($content['points']),
+               'last'   => generateDateTime($content['last_online'], "3")
        );
 
        // Load row template
@@ -219,8 +219,8 @@ while ($content = SQL_FETCHARRAY($result)) {
                'uid'    => $content['userid'],
                'refs'   => $content['refs'],
                'nick'   => $content['nickname'],
-               'points' => TRANSLATE_COMMA(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
-               'last'   => MAKE_DATETIME($content['last_online'], "3")
+               'points' => translateComma(GET_TOTAL_DATA($content['userid'], "user_points", "points")),
+               'last'   => generateDateTime($content['last_online'], "3")
        );
 
        // Load row template
index 3dd190a721e7e0dd2ab963d009e316a8b70e7fd2..5f1e1d30c6da468b72fa3c4d2d3d7ea6682c7320 100644 (file)
@@ -56,9 +56,9 @@ SQL_FREERESULT($result);
 
 // Prepare content
 $content = array(
-       'register'   => TRANSLATE_COMMA(getConfig('points_register')),
+       'register'   => translateComma(getConfig('points_register')),
        'ref_levels' => $cnt,
-       'ref_points' => TRANSLATE_COMMA(getConfig('points_ref'))
+       'ref_points' => translateComma(getConfig('points_ref'))
 );
 
 // Load default template
index ca226d5ffdb0b95242673d817947b4e5ef161e60..bf3491770c4730dbc7304d81ce0b631d08c896f9 100644 (file)
@@ -46,7 +46,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Special file
-LOAD_INC_ONCE("inc/rdf.class.php");
+loadIncludeOnce('inc/rdf.class.php');
 
 // Add description as navigation point
 ADD_DESCR('guest', __FILE__);
@@ -67,12 +67,12 @@ $rdf->set_Options(
 );
 
 // Use proxy?
-if ((getConfig('proxy_host') != "") && (getConfig('proxy_port') > 0)) {
+if ((getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0)) {
        // Set proxy data
        $rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port'));
 
        // Use auth?
-       if (getConfig('proxy_username') != "") {
+       if (getConfig('proxy_username') != '') {
                // Set auth data
                $rdf->set_proxy_auth(getConfig('proxy_username'), getConfig('proxy_password'));
        } // END  - if
index 751947117ce4b7178a304b1bba092bce05ead1a6..93b3faa943a27f5c197215fe358483532ec8627e 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!EXT_IS_ACTIVE('sql_patches')) {
        // The extension 'sql_patches' *MUST* be activated or you have lot's of problems!
-       LOAD_URL('admin.php');
+       redirectToUrl('admin.php');
 }
 
 // Load adverstising template
@@ -63,7 +63,7 @@ if (empty($GLOBALS['what'])) $GLOBALS['what'] = getConfig('index_home');
 // Adding the main content module here
 if (empty($GLOBALS['action'])) {
        // Get action value from what value
-       $GLOBALS['action'] = GET_ACTION('guest', $GLOBALS['what']);
+       $GLOBALS['action'] = getModeAction('guest', $GLOBALS['what']);
 } // END - if
 
 // Add the guest's menu here...
@@ -82,12 +82,12 @@ $GLOBALS['block_mode'] = false;
 $INC = sprintf("inc/modules/guest/action-%s.php", $GLOBALS['action']);
 
 // Is the file there?
-if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION('guest', $GLOBALS['action'], $GLOBALS['what']))) {
+if ((isIncludeReadable($INC)) && (isMenuActionValid('guest', $GLOBALS['action'], $GLOBALS['what']))) {
        // Requested module is available so we load it
-       LOAD_INC_ONCE($INC);
+       loadIncludeOnce($INC);
 } else {
        // Invalid module specified or not found...
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 if ((getConfig('guest_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
index 1c63c0aabb1d47e84b217660ef8c1e7f84cdcf87..7a1f7cc08634fb320914f6bb7c7f7b3c83aa7540 100644 (file)
@@ -44,22 +44,22 @@ if (!defined('__SECURITY')) {
 
 if (REQUEST_ISSET_GET(('url'))) {
        // Decode URL
-       $url = decodeString(str_replace(" ", "+", compileUriCode(urldecode(REQUEST_GET('url')))));
+       $url = decodeString(str_replace(' ', '+', compileUriCode(urldecode(REQUEST_GET('url')))));
 
        // Validate the URL
-       if (VALIDATE_URL($url)) {
+       if (isUrlValid($url)) {
                // Prepare data for the template
                define('__URL', $url);
 
                // Generate a JavaScript that redirects us
-               LOAD_TEMPLATE("loader");
+               LOAD_TEMPLATE('loader');
        } else {
                // URL invalid
-               LOAD_URL("index.php");
+               redirectToUrl('index.php');
        }
 } else {
        // Invalid or no URL entered!
-       LOAD_URL("index.php");
+       redirectToUrl('index.php');
 }
 
 //
index 40dbcc5e24803b7535756a9795de6a433b4226d4..eb333e70ceec20b46565b6fe537c3669c237b632 100644 (file)
@@ -43,15 +43,15 @@ if (!defined('__SECURITY')) {
 } elseif (!IS_MEMBER()) {
        $URL = 'modules.php?module=index';
        if ($check == 'mem_only') $URL .= '&amp;msg='.getCode('MODULE_MEM_ONLY').'&amp;mod='.$GLOBALS['module'];
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 }
 
 if ($status != 'CONFIRMED') {
        // If the status is different than confirmed move the user away from here
-       $errorCode = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
+       $errorCode = generateErrorCodeFromUserStatus($status);
 
        // Load URL
-       LOAD_URL('modules.php?module=index&amp;what=login&amp;login='.$errorCode);
+       redirectToUrl('modules.php?module=index&amp;what=login&amp;login=' . $errorCode);
 } // END - if
 
 // Load adverstising template
@@ -76,7 +76,7 @@ if (empty($GLOBALS['action'])) {
 
 // Add the member's menu here...
 if ((getConfig('member_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
-       ADD_MENU('member', GET_ACTION('member', $GLOBALS['what']), $GLOBALS['what']);
+       ADD_MENU('member', getModeAction('member', $GLOBALS['what']), $GLOBALS['what']);
 } // END - if
 
 // Menu -> content
@@ -84,12 +84,12 @@ OUTPUT_HTML("   </td>
   <td valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
 
 $INC = sprintf("inc/modules/member/action-%s.php", $act);
-if ((INCLUDE_READABLE($INC)) && (VALIDATE_MENU_ACTION('member', $GLOBALS['action'], $GLOBALS['what']))) {
+if ((isIncludeReadable($INC)) && (isMenuActionValid('member', $GLOBALS['action'], $GLOBALS['what']))) {
        // Requested module is available so we load it
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        // Invalid module specified or not found...
-       LOAD_URL('modules.php?module=login');
+       redirectToUrl('modules.php?module=login');
 }
 
 if ((getConfig('member_menu') == 'Y') || (!EXT_IS_ACTIVE('sql_patches', true))) {
index 5365e3cacd9c3adc52b3d9ae96cf69f99b46a056..1baf1ad3cc1f06f6117ae00ee34f3fc2b520f958 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_LOGGED_IN()) {
-       LOAD_URL(URL."/modules.php?module=index");
+       redirectToUrl(URL."/modules.php?module=index");
 } elseif ((!EXT_IS_ACTIVE("")) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, EXTENSION_PROBLEM_EXT_INACTIVE, "");
        return;
@@ -55,9 +55,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index b1193fedd6ade858f4e439e5e98e802b87c5f824..24c6e8e6f7b21cc2c061a9b0890f658dd3678190 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index 6a411a2658bc362bab9d4a9ce32c0d86b9c0cee0..87215727ff326db8ea65edbe422c7fdfbf203afc 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
@@ -55,9 +55,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index da7b6b15a3437faf061ca277efa8fab6d0bf4aec..aa719fd1c5174c673373995aad33b181e191f7f2 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index c4ee350af49738e5652ee6e59af0f11cf3a29d0b..f641c9c9ffc66af1a961bfc90a176740e0f471f6 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index 6cc872dbd993c4637f85ce6992a0a66c448ee72a..0bfcec04f74d8bfd25390dc83687a71e9605d0db 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index 383f1d5d90cf6e6353db346ac1993ca772f49b81..a48c1d5cf30cd8b9d77362600c761566fc3383e8 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('order')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'order'));
        return;
@@ -55,9 +55,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index 82fbabea5181ff8f12dfce887a6c91465dcfa2d7..083aa8b71e24bab198e99d01e43eb9a4da1b7cfa 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index a1ce6059b5620062c7378352560cff489be7c22e..ed3ec0f80cca63c31a6be5b8200f7e743dece3ea 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ($GLOBALS['block_mode']) {
        // Block mode detected
        return;
@@ -52,9 +52,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index 90574393b7b878c331b4d312dd5fdba26ff43236..66913d340b878f8c6b28b636eab649dcafc9d02a 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'surfbar'));
        return;
@@ -55,9 +55,9 @@ ADD_DESCR('member', __FILE__);
 
 // Load the include file
 $INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
-if (INCLUDE_READABLE($INC)) {
+if (isIncludeReadable($INC)) {
        // Ok, we finally load the member action module
-       LOAD_INC($INC);
+       loadInclude($INC);
 } else {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('MEMBER_404_ACTION'), $GLOBALS['what']));
 }
index c8d0c60f8dd7cc70f8be4bae53f4c9932a26d527..a0f61cac2684e218d2331cad0a83f4421a202841 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('theme')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'theme'));
        return;
@@ -58,10 +58,10 @@ if ($num_themes > 1) {
        $act = ''; $wht = '';
        if (!empty($GLOBALS['action'])) $act = SQL_ESCAPE($GLOBALS['action']);
        if (!empty($GLOBALS['what']))   $wht = SQL_ESCAPE($GLOBALS['what']);
-       $OUT = THEME_SELECTION_BOX("login", $act, $wht, $result_themes);
+       $OUT = generateThemeSelectionBox("login", $act, $wht, $result_themes);
 } elseif (($num_themes == 1) || ((!IS_ADMIN()) && ($num_themes == 0))) {
        // If there's only one just print it's name
-       define('__THEME_NAME', GET_CURR_THEME_NAME());
+       define('__THEME_NAME', getCurrentThemeName());
        $OUT = LOAD_TEMPLATE("theme_one", true);
 } elseif (IS_ADMIN()) {
        // If there is no theme installed and there's an admin notify him!
index 93fd2f79e77aeb236c276d15aa8f1f49656a1c8e..424604b434e790afa5e8f4ff94879235455bea3e 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_LOGGED_IN()) {
-       LOAD_URL(URL."/modules.php?module=index");
+       redirectToUrl(URL."/modules.php?module=index");
 }
 
 // Add description as navigation point
index 6ccb2d6e5d844b44fd802a19229ee8dcca81cd96..69abf3a0fac0f987762428119dd1a7e37251872d 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('__SECURITY')) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
index aee46824e1baa68620bed856612dfb73504e3f7f..5f3f53f5a06411c7b6f4a9a6329610b3f1230739 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
index 97f3a390ee7fa790b7ee85730103e8213776402b..11d98669df79464b26e781e120aa0770726de9e0 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
index 97f3a390ee7fa790b7ee85730103e8213776402b..11d98669df79464b26e781e120aa0770726de9e0 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
index 97f3a390ee7fa790b7ee85730103e8213776402b..11d98669df79464b26e781e120aa0770726de9e0 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bank')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bank'));
        return;
index 68a494205a0129eceae2faa768cddf38140a3788..9462fd67d8638789c7c22e07b4733d3076645688 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('beg')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'beg'));
        return;
@@ -77,10 +77,10 @@ if (empty($uid)) { $uid = getUserId(); $nickname = false; }
 // Prepare constants
 define('__BEG_UID'        , $uid);
 define('__BEG_CLICKS'     , $clicks);
-define('__BEG_POINTS'     , TRANSLATE_COMMA(getConfig('beg_points')));
-define('__BEG_POINTS_MAX' , TRANSLATE_COMMA(getConfig('beg_points_max')));
-define('__BEG_TIMEOUT'    , CREATE_FANCY_TIME(getConfig('beg_timeout')));
-define('__BEG_UID_TIMEOUT', CREATE_FANCY_TIME(getConfig('beg_uid_timeout')));
+define('__BEG_POINTS'     , translateComma(getConfig('beg_points')));
+define('__BEG_POINTS_MAX' , translateComma(getConfig('beg_points_max')));
+define('__BEG_TIMEOUT'    , createFancyTime(getConfig('beg_timeout')));
+define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_uid_timeout')));
 
 // Load template
 LOAD_TEMPLATE("member_".substr(basename(__FILE__), 5, -4));
index 324aea5cdee45eb89e220ad3996158b66e2103fc..cee62bc19af883a0b1c75703724ccddd91353674 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('beg')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'beg'));
        return;
@@ -54,7 +54,7 @@ ADD_DESCR('member', __FILE__);
 $lastOnline = "%s"; $ONLINE = '';
 if (EXT_IS_ACTIVE('autopurge')) {
        // Use last online timestamp to keep inactive members away from here
-       $lastOnline   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
        $ONLINE = getConfig('ap_inactive_since');
 }
 
@@ -75,8 +75,8 @@ if (SQL_NUMROWS($result) > 0) {
                        'sw'     => $SW,
                        'cnt'    => $cnt,
                        'uid'    => bigintval($content['userid']),
-                       'points' => TRANSLATE_COMMA($content['beg']),
-                       'last'   => MAKE_DATETIME($content['last_online'], "2"),
+                       'points' => translateComma($content['beg']),
+                       'last'   => generateDateTime($content['last_online'], "2"),
                );
 
                // Load row template
index 8b13ded196e1674a96c90653740c5857c954093e..d44f96177622a75828fc8877debba5a6d326cb10 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('bonus')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'bonus'));
        return;
@@ -69,7 +69,7 @@ if (GET_EXT_VERSION('bonus') >= '0.6.9') {
 $lastOnline = "%s"; $ONLINE = '';
 if (EXT_IS_ACTIVE('autopurge')) {
        // Use last online timestamp to keep inactive members away from here
-       $lastOnline   = " AND last_online >= (UNIX_TIMESTAMP() - %s)";
+       $lastOnline   = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
        $ONLINE = getConfig('ap_inactive_since');
 }
 
@@ -91,8 +91,8 @@ if (SQL_NUMROWS($result) > 0) {
                $content['sw']     = $SW;
                $content['cnt']    = $cnt;
                $content['uid']    = bigintval($content['uid']);
-               $content['points'] = TRANSLATE_COMMA($content['points']);
-               $content['last']   = MAKE_DATETIME($content['last'], "2");
+               $content['points'] = translateComma($content['points']);
+               $content['last']   = generateDateTime($content['last'], "2");
 
                // Load row template
                $OUT .= LOAD_TEMPLATE("member_bonus_row", true, $content);
index 8b8dbd80a449e1d5a990befd6b33acacd87deace..93da79f9ab9e70e162492ae3eff8148b0d96ed87 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
@@ -73,7 +73,7 @@ if ($cats > 0) {
                        switch ($joined) {
                                case 'Y':
                                        $sql = '';
-                                       $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
+                                       $result_user = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
                                         array($UID, bigintval($cat)), __FILE__, __LINE__);
 
                                        if (SQL_NUMROWS($result_user) == 0) {
index 76834e96be1ab4b7c56d535f692b69ef4d3cca2e..0941c4a58dd65deb23193e111b23e138c88f232c 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('doubler')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'doubler'));
        return;
@@ -51,11 +51,11 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('member', __FILE__);
 
 // Percent values etc.
-define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('doubler_charge') * 100));
-define('__REF_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_ref') * 100));
-define('__TOTAL_VALUE' , TRANSLATE_COMMA(getConfig('doubler_points')));
-define('__MIN_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_min')));
-define('__MAX_VALUE'   , TRANSLATE_COMMA(getConfig('doubler_max')));
+define('__CHARGE_VALUE', translateComma(getConfig('doubler_charge') * 100));
+define('__REF_VALUE'   , translateComma(getConfig('doubler_ref') * 100));
+define('__TOTAL_VALUE' , translateComma(getConfig('doubler_points')));
+define('__MIN_VALUE'   , translateComma(getConfig('doubler_min')));
+define('__MAX_VALUE'   , translateComma(getConfig('doubler_max')));
 
 // Transfer referal ID
 if (EXT_IS_ACTIVE('nickname')) {
@@ -75,7 +75,7 @@ if (EXT_IS_ACTIVE('nickname')) {
 }
 
 // Usage counter
-define('__DOUBLER_COUNTER', TRANSLATE_COMMA(getConfig('doubler_counter')));
+define('__DOUBLER_COUNTER', translateComma(getConfig('doubler_counter')));
 
 // Which mail-send-mode did the admin setup?
 switch (getConfig('doubler_send_mode')) {
@@ -94,19 +94,19 @@ default:
 }
 
 // Generate table with already payed out doubles
-define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE(getUserId(), "Y", "N", "DESC"));
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE(getUserId(), 'Y', 'N', "DESC"));
 
 // Generate table with next-to-run payouts
 define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE(getUserId()));
 
 // Generate table with refferal payouts
-define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE(getUserId(), "N", "Y", "DESC"));
+define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE(getUserId(), 'N', 'Y', "DESC"));
 
 // Generate timemark
-define('__TIMEOUT_MARK', CREATE_FANCY_TIME(getConfig('doubler_timeout')));
+define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
 
 // Points left to double
-define('__LEFT_VALUE', TRANSLATE_COMMA(DOUBLER_GET_TOTAL_POINTS_LEFT()));
+define('__LEFT_VALUE', translateComma(DOUBLER_GET_TOTAL_POINTS_LEFT()));
 
 // Load template
 LOAD_TEMPLATE("member_doubler");
index 2ac2d50c93b67e5194acaa07d282e93e1bb5a032..bded579f07ff21abc95ea5b84d406be1a2dd4be6 100644 (file)
@@ -41,13 +41,13 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
 ADD_DESCR('member', __FILE__);
 
 // Simply redirect...
-LOAD_URL('modules.php?module=index');
+redirectToUrl('modules.php?module=index');
 //
 ?>
index 701f60d93e8bce553987d04064ac9b098ee8248f..7a1fa8642a0f8361cf9976cebbf86a2ad619a6e4 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('holiday')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'holiday'));
        return;
@@ -79,7 +79,7 @@ if ((SQL_NUMROWS($result1) == 1) || (SQL_NUMROWS($result2) == 1)) {
                }
 
                // Display message and exit here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), MAKE_DATETIME($stamp, '1')));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('HOLIDAY_MEMBER_ORDER'), generateDateTime($stamp, '1')));
                return;
        }
 }
@@ -119,10 +119,10 @@ WHERE userid=%s LIMIT 1",
 
                // Send mail to member
                $msg = LOAD_EMAIL_TEMPLATE('member_holiday_request', REQUEST_POST('comments'), getUserId());
-               SEND_EMAIL(getUserId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $msg);
+               sendEmail(getUserId(), getMessage('HOLIDAY_MEMBER_SUBJECT'), $msg);
 
                // Send mail to all admins
-               SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', REQUEST_POST('comments'), getUserId());
+               sendAdminNotification(getMessage('HOLIDAY_ADMIN_SUBJECT'), 'admin_holiday_request', REQUEST_POST('comments'), getUserId());
 
                // Create task
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','HOLIDAY_REQUEST','{--HOLIDAY_ADMIN_SUBJECT--}','%s', UNIX_TIMESTAMP())",
@@ -151,8 +151,8 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
                        SQL_FREERESULT($result);
 
                        // Prepare it for the template
-                       define('__HOLIDAY_START', MAKE_DATETIME($start, "3"));
-                       define('__HOLIDAY_END'  , MAKE_DATETIME($end  , "3"));
+                       define('__HOLIDAY_START', generateDateTime($start, "3"));
+                       define('__HOLIDAY_END'  , generateDateTime($end  , "3"));
 
                        // Deactivate it now
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
@@ -164,7 +164,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
 
                        // Send email to admin
-                       SEND_ADMIN_NOTIFICATION(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', array(), getUserId());
+                       sendAdminNotification(getMessage('HOLIDAY_ADMIN_DEAC_SUBJ'), 'admin_holiday_deactivated', array(), getUserId());
 
                        // Display message to user
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('HOLIDAY_MEMBER_DEACTIVATED_NOW'));
@@ -201,9 +201,9 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
                                SQL_FREERESULT($result);
 
                                // Prepare it for the template
-                               define('__HOLIDAY_START', MAKE_DATETIME($start , '3'));
-                               define('__HOLIDAY_END'  , MAKE_DATETIME($end   , '3'));
-                               define('__HOLIDAY_LOCK' , MAKE_DATETIME($locked, '1'));
+                               define('__HOLIDAY_START', generateDateTime($start , '3'));
+                               define('__HOLIDAY_END'  , generateDateTime($end   , '3'));
+                               define('__HOLIDAY_LOCK' , generateDateTime($locked, '1'));
 
                                // Load template
                                LOAD_TEMPLATE('member_holiday_deactivate');
@@ -215,7 +215,7 @@ WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
 SET `holiday_active`='N'
 WHERE userid=%s LIMIT 1", array(getUserId()), __FILE__, __LINE__);
-                               LOAD_URL('modules.php?module=login&amp;what=holiday');
+                               redirectToUrl('modules.php?module=login&amp;what=holiday');
                                return;
                        }
                        break;
index 277ba64c8d36859b6505072307b404228dce4ce3..90a6f7aadde8a04189d70b261f909ed50d28959f 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('html_mail')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'html_mail'));
        return;
index dd905f4329f77902645faae1c7b04ef3037c6e04..fa02eecd8d2a605081d107e527cad43f20db37e3 100644 (file)
@@ -41,15 +41,15 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Base URL for redirection (both cases)
 $URL = 'modules.php?module=index&amp;msg=';
 
-if (destroy_user_session()) {
+if (destroyUserSession()) {
        // Remove theme cookie as well
-       set_session('mxchange_theme', '');
+       setSession('mxchange_theme', '');
 
        // Logout completed
        $URL .= getCode('LOGOUT_DONE');
@@ -59,7 +59,7 @@ if (destroy_user_session()) {
 }
 
 // Load the URL
-LOAD_URL($URL);
+redirectToUrl($URL);
 
 //
 ?>
index fcc3fba59c93e6337093ec1e5393504769e6f348..a9ce3466a403cad306656ff81342702329a4e9a3 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('mydata')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'mydata'));
        return;
@@ -53,45 +53,45 @@ ADD_DESCR('member', __FILE__);
 define('UID_VALUE', getUserId()); $URL = '';
 
 // Detect what the member wants to do
-$mode = "show"; // Show his data
-if (REQUEST_ISSET_POST(('save')))   $mode = "save";   // Save entered data
-if (REQUEST_ISSET_POST('edit'))    $mode = "edit";   // Edit data
-if (REQUEST_ISSET_POST(('notify'))) $mode = "notify"; // Switch off notification
+$mode = 'show'; // Show his data
+if (REQUEST_ISSET_POST(('save')))   $mode = 'save';   // Save entered data
+if (REQUEST_ISSET_POST('edit'))     $mode = 'edit';   // Edit data
+if (REQUEST_ISSET_POST(('notify'))) $mode = 'notify'; // Switch off notification
 
 switch ($mode)
 {
-case "show": // Show his data
+case 'show': // Show his data
        if (EXT_IS_ACTIVE('country', true)) {
                // New way                         0        1         2          3         4     5     6        7           8            9       10      11           12           13
                $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-                array(UID_VALUE), __FILE__, __LINE__);
+                       array(getUserId()), __FILE__, __LINE__);
        } else {
                // Old way                         0        1         2        3      4     5     6        7           8            9       10      11           12           13
                $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-                array(UID_VALUE), __FILE__, __LINE__);
+                       array(getUserId()), __FILE__, __LINE__);
        }
        $DATA = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
        // Translate / add some things
-       $DATA[10] = TRANSLATE_GENDER($DATA[10]);
-       $DATA[13] = MAKE_DATETIME($DATA[13], "0");
+       $DATA[10] = translateGender($DATA[10]);
+       $DATA[13] = generateDateTime($DATA[13], '0');
 
        // How far is last change on his profile away from now?
        if ((($DATA[13] + getConfig('profile_lock')) > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
                // You cannot change your account
-               define('CHANGE', "<div class=\"member_failed\">".sprintf(getMessage('MEMBER_PROFILE_LOCKED'), MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0"))."</div>");
+               define('CHANGE', "<div class=\"member_failed\">".sprintf(getMessage('MEMBER_PROFILE_LOCKED'), generateDateTime($DATA[13] + getConfig('profile_lock'), '0'))."</div>");
        } else {
                // He is allowed to change his profile
                define('CHANGE', LOAD_TEMPLATE("member_mydata_button", true));
        }
 
-       if (strlen($DATA[7]) == 1) $DATA[7] = "0".$DATA[7];
-       if (strlen($DATA[8]) == 1) $DATA[8] = "0".$DATA[8];
+       if (strlen($DATA[7]) == 1) $DATA[7] = '0'.$DATA[7];
+       if (strlen($DATA[8]) == 1) $DATA[8] = '0'.$DATA[8];
 
-       switch (GET_LANGUAGE()) {
-               case "de": define('DOB', $DATA[7].".".$DATA[8].".".$DATA[9]); break;
-               default  : define('DOB', $DATA[8]."-".$DATA[7]."-".$DATA[9]); break;
+       switch (getLanguage()) {
+               case 'de': define('DOB', $DATA[7].'.'.$DATA[8].'.'.$DATA[9]); break;
+               default  : define('DOB', $DATA[8].'-'.$DATA[7].'-'.$DATA[9]); break;
        }
 
        if (EXT_IS_ACTIVE('country')) {
@@ -100,10 +100,10 @@ case "show": // Show his data
        }
 
        // Load template
-       LOAD_TEMPLATE("member_mydata_overview");
+       LOAD_TEMPLATE('member_mydata_overview');
        break;
 
-case "edit": // Edit data
+case 'edit': // Edit data
        if (EXT_IS_ACTIVE('country', true)) {
                // New way                         0        1         2          3         4     5     6        7           8            9       10      11           12           13
                $result = SQL_QUERY_ESC("SELECT surname, family, street_nr, country_code, zip, city, email, birth_day, birth_month, birth_year, gender, max_mails, receive_mails, last_update
@@ -122,43 +122,43 @@ FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
 
        // How far is last change on his profile away from now?
        if (($DATA[13] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
-               $DATA[13] = MAKE_DATETIME($DATA[13] + getConfig('profile_lock'), "0");
+               $DATA[13] = generateDateTime($DATA[13] + getConfig('profile_lock'), '0');
                // You cannot change your account
-               LOAD_TEMPLATE("member_mydata_locked");
+               LOAD_TEMPLATE('member_mydata_locked');
        } else {
                // He is allowed to change his profile
                switch ($DATA[10])
                {
-               case "M":
+               case 'M':
                        define('M_DEFAULT', ' selected="selected"');
                        define('F_DEFAULT', '');
                        define('C_DEFAULT', '');
                        break;
 
-               case "F":
+               case 'F':
                        define('M_DEFAULT', '');
                        define('F_DEFAULT', ' selected="selected"');
                        define('C_DEFAULT', '');
                        break;
 
-               case "C":
+               case 'C':
                        define('M_DEFAULT', '');
                        define('F_DEFAULT', '');
                        define('C_DEFAULT', ' selected="selected"');
                        break;
                }
                $DOB = '';
-               switch (GET_LANGUAGE())
+               switch (getLanguage())
                {
-               case "de": // German date format
+               case 'de': // German date format
                        // Day
-                       $DOB .= ADD_SELECTION("day", $DATA[7]);
+                       $DOB .= ADD_SELECTION('day', $DATA[7]);
 
                        // Month
-                       $DOB .= ADD_SELECTION("month", $DATA[8]);
+                       $DOB .= ADD_SELECTION('month', $DATA[8]);
 
                        // Year
-                       $DOB .= ADD_SELECTION("year", $DATA[9]);
+                       $DOB .= ADD_SELECTION('year', $DATA[9]);
                        break;
 
                default: // Default is the US date format... :)
@@ -166,14 +166,14 @@ FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
                }
 
                define('DOB', $DOB);
-               define('MAX_REC_LIST', ADD_MAX_RECEIVE_LIST('member', $DATA[11], true));
+               define('MAX_REC_LIST', addMaxReceiveList('member', $DATA[11], true));
 
                if (EXT_IS_ACTIVE('country')) {
                        // Generate selection box
                        $OUT  = "<select name=\"country_code\" class=\"member_select\" size=\"1\">\n";
                        $whereStatement = "WHERE is_active='Y'";
                        if (IS_ADMIN()) $whereStatement = '';
-                       $OUT .= ADD_OPTION_LINES("countries", "id", "descr", $DATA[3], "code", $whereStatement);
+                       $OUT .= generateOptionList("countries", "id", "descr", $DATA[3], "code", $whereStatement);
                        $OUT .= "</select>";
                        define('__COUNTRY_CONTENT', $OUT);
                } else {
@@ -182,21 +182,21 @@ FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
                }
 
                // Load template
-               LOAD_TEMPLATE("member_mydata_edit");
+               LOAD_TEMPLATE('member_mydata_edit');
        }
        break;
 
-case "save": // Save entered data
+case 'save': // Save entered data
        // Load old email / password:      0        1          2
        $result = SQL_QUERY_ESC("SELECT email, password, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-        array(UID_VALUE), __FILE__, __LINE__);
+               array(getUserId()), __FILE__, __LINE__);
        $DATA = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
        $DATA[3] = $DATA[2] + getConfig('profile_lock');
 
        // How far is last change on his profile away from now?
        if (($DATA[3] > time()) && (!IS_ADMIN()) && (getConfig('profile_lock') > 0)) {
-               $DATA[3] = MAKE_DATETIME($DATA[3] + getConfig('profile_lock'), "0");
+               $DATA[3] = generateDateTime($DATA[3] + getConfig('profile_lock'), '0');
                // You cannot change your account
                LOAD_TEMPLATE("member_mydata_locked");
        } elseif (!VALIDATE_EMAIL(REQUEST_POST('addy'))) {
@@ -247,7 +247,7 @@ array(
        bigintval(REQUEST_POST('year')),
        bigintval(REQUEST_POST('max_mails')),
        UID_VALUE,
-       get_session('u_hash')
+       getSession('u_hash')
  ), __FILE__, __LINE__);
                        } else {
                                // Old way
@@ -276,7 +276,7 @@ array(
        bigintval(REQUEST_POST('year')),
        bigintval(REQUEST_POST('max_mails')),
        UID_VALUE,
-       get_session('u_hash')
+       getSession('u_hash')
  ), __FILE__, __LINE__);
                        }
 
@@ -284,7 +284,7 @@ array(
                        $modes = explode(';', $mode);
 
                        // ... and run them through
-                       SEND_MODE_MAILS ('mydata', $modes);
+                       sendModeMails ('mydata', $modes);
                } else {
                        // Entered wrong pass for updating profile
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEBER_UPDATE_PWD_WRONG'));
@@ -292,7 +292,7 @@ array(
        }
        break;
 
-case "notify": // Switch off notfication
+case 'notify': // Switch off notfication
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET notified='N', last_update=UNIX_TIMESTAMP() WHERE userid=%s LIMIT 1",
                array(getUserId()), __FILE__, __LINE__);
        $URL = 'modules.php?module=login&amp;what=welcome&amp;msg=' . urlencode(getMessage('PROFILE_UPDATED'));
@@ -301,7 +301,7 @@ case "notify": // Switch off notfication
 
 if (!empty($URL)) {
        // Load generated URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 }
 
 //
index 46daf1dbc7fb3a22db2b16bf93b72edc8c17caa1..5cac3962b529e4b53346fc740078936b61a6b5c9 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('newsletter')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'newsletter'));
        return;
@@ -57,9 +57,9 @@ list($status, $until, $span) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
 // Remember charge value
-define('__CHARGE_VALUE', TRANSLATE_COMMA(getConfig('nl_charge')));
+define('__CHARGE_VALUE', translateComma(getConfig('nl_charge')));
 
-if ((IS_FORM_SENT()) && ($status == 'Y') && ($span == "0")) {
+if ((IS_FORM_SENT()) && ($status == 'Y') && ($span == '0')) {
        // Save request
        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_timespan='".(getConfig('one_day') * 30)."' WHERE userid=%s LIMIT 1",
                array(getUserId()), __FILE__, __LINE__);
@@ -73,10 +73,10 @@ VALUES ('0','NEW','NL_UNSUBSCRIBE','{--ADMIN_NL_SUBJECT--}','".$admin_msg."', UN
 
        // Send mail to member
        $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_request", array(), getUserId());
-       SEND_EMAIL(getUserId(), getMessage('NL_MEMBER_SUBJECT'), $msg);
+       sendEmail(getUserId(), getMessage('NL_MEMBER_SUBJECT'), $msg);
 
        // Send mail to all admins
-       SEND_ADMIN_NOTIFICATION(getMessage('NL_ADMIN_SUBJECT'), "admin_newsletter_request", array(), getUserId());
+       sendAdminNotification(getMessage('NL_ADMIN_SUBJECT'), "admin_newsletter_request", array(), getUserId());
 
        // Display message
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('NL_MEMBER_REQUEST_DONE'));
@@ -98,7 +98,7 @@ VALUES ('0','NEW','NL_UNSUBSCRIBE','{--ADMIN_NL_SUBJECT--}','".$admin_msg."', UN
 
        case 'N': // Does not receive the newsletter
                define('__STATUS_VALUE', getMessage('NL_MEMBER_OFF'));
-               define('__UNTIL_VALUE' , MAKE_DATETIME($until, "2"));
+               define('__UNTIL_VALUE' , generateDateTime($until, "2"));
                define('NL_SUBMIT'     , getMessage('NL_MEMBER_SUBMIT_ON'));
                break;
        }
index b7517830bc8ba6d69e3f57a23fbd7f8b3deb70f6..0895810e901f86500772b1a05a0ddb4619c32324 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('nickname')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'nickname'));
        return;
index 1b29ed347c1276cc936f7c1a0dadfef2bd4f100d..0f1f3f6169feb083501a3d80e345bd81059181c6 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('order')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'order'));
        return;
@@ -166,7 +166,7 @@ WHERE sender=%s AND url='%s' AND timestamp > (UNIX_TIMESTAMP() - %s) LIMIT 1",
                } // END - if
 
                // Validate URL
-               if (!VALIDATE_URL(REQUEST_POST('url'))) {
+               if (!isUrlValid(REQUEST_POST('url'))) {
                        // URL is invalid!
                        $URL = 'modules.php?module=login&amp;what=order&amp;msg=' . getCode('INVALID_URL');
                } // END - if
@@ -226,7 +226,7 @@ ORDER BY d.%s %s",
                        while ($content = SQL_FETCHARRAY($result)) {
                                if ($HOLIDAY) {
                                        // Check for his holiday status
-                                       $result_holiday = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_holidays`
+                                       $result_holiday = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_holidays`
 WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1",
  array(bigintval($content['userid'])), __FILE__, __LINE__);
                                        if (SQL_NUMROWS($result_holiday) == 1) $content['userid'] = 0; // Exclude user who are in holiday
@@ -259,16 +259,16 @@ WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIME
                        if ($MAX_SEND > REQUEST_POST('receiver')) $MAX_SEND = REQUEST_POST('receiver');
 
                        // Calculate used points
-                       $USED = $MAX_SEND * GET_PAY_POINTS(bigintval(REQUEST_POST('type')));
+                       $USED = $MAX_SEND * getPaymentPoints(bigintval(REQUEST_POST('type')));
 
                        // Fix empty zip code
-                       if (!REQUEST_ISSET_POST('zip')) REQUEST_SET_POST('zip', "0");
+                       if (!REQUEST_ISSET_POST('zip')) REQUEST_SET_POST('zip', '0');
 
                        // Check if he has enougth points for this order and selected more than 0 receivers
                        if (($USED > 0) && ($USED <= $total) && ($MAX_SEND > 0)) {
                                // Gettings points is okay, so we can add $USED later from
                                $TIME = time();
-                               if (($id == "0") || ($type != "TEMP")) {
+                               if (($id == '0') || ($type != "TEMP")) {
                                        // New order
                                        $id = 0;
                                        if (EXT_IS_ACTIVE('html_mail')) {
@@ -320,7 +320,7 @@ cat_id=%s,
 target_send=%s,
 zip=%s,
 html_msg='%s'
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
 array(
        REQUEST_POST('subject'),
        REQUEST_POST('text'),
@@ -345,7 +345,7 @@ url='%s',
 cat_id=%s,
 target_send=%s,
 zip=%s
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
 array(
        REQUEST_POST('subject'),
        REQUEST_POST('text'),
@@ -363,7 +363,7 @@ array(
                                // Do we need to get the ID number?
                                if ($id == 0) {
                                        // Order is placed as temporary. We need to get it's id for the frametester
-                                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_pool` WHERE sender=%s AND subject='%s' AND payment_id=%s AND data_type='TEMP' AND timestamp=%s LIMIT 1",
                                        array(
                                                getUserId(),
                                                REQUEST_POST('subject'),
@@ -422,7 +422,7 @@ array(
                                $CATS['name'][] = $content['cat'];
 
                                // Select users in current category
-                               $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY userid",
+                               $result_uids = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE cat_id=%s AND userid != '%s' ORDER BY `userid` ASC",
                                        array(bigintval($content['id']), getUserId()), __FILE__, __LINE__);
 
                                $uid_cnt = 0;
@@ -483,12 +483,12 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                switch (REQUEST_GET('msg'))
                                {
                                case getCode('URL_TLOCK'):
-                                       $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s LIMIT 1",
+                                       $result = SQL_QUERY_ESC("SELECT timestamp FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s LIMIT 1",
                                         array(bigintval(REQUEST_GET('id'))), __FILE__, __LINE__);
 
                                        // Load timestamp from last order
                                        list($LORDER) = SQL_FETCHROW($result);
-                                       $LORDER = MAKE_DATETIME($LORDER, "1");
+                                       $LORDER = generateDateTime($LORDER, "1");
 
                                        // Free memory
                                        SQL_FREERESULT($result);
@@ -522,7 +522,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                        break;
 
                                case getCode('BLIST_URL'):
-                                       $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".MAKE_DATETIME(REQUEST_GET('blist'), "0");
+                                       $message = "{--MEMBER_URL_BLACK_LISTED--}<br />\n{--MEMBER_BLIST_TIME--}: ".generateDateTime(REQUEST_GET('blist'), '0');
                                        break;
 
                                case getCode('NO_RECS_LEFT'):
@@ -576,7 +576,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                SQL_FREERESULT($result);
 
                                // Output user's points
-                               $total = TRANSLATE_COMMA($total);
+                               $total = translateComma($total);
 
                                // Check how many mail orders he has placed today and how many he's allowed to send
                                switch (getConfig('order_max_full'))
@@ -622,7 +622,6 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                // Free result
                                SQL_FREERESULT($result);
 
-                               // 01      2              21    12                                    2    23         443    3          3210
                                if ((REQUEST_ISSET_POST(('data'))) || ((getConfig('order_multi_page') != 'Y') && ((!IS_ADMIN()) && (!EXT_IS_ACTIVE('html_mail'))))) {
                                        // Pre-output categories
                                        $CAT = '';
@@ -635,7 +634,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                                        // Mail type
                                        $type = '';
                                        foreach ($typeS as $key => $value) {
-                                               $P = TRANSLATE_COMMA($typeS[$key][1]);
+                                               $P = translateComma($typeS[$key][1]);
                                                if (is_array($value)) {
                                                        // Output option line
                                                        $type .= "      <option value=\"".$typeS[$key][0]."\"";
@@ -717,7 +716,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
                // No cateogries are defined yet
                LOAD_TEMPLATE('admin_settings_saved', false, "<span class=\"member_failed\">{--MEMBER_NO_CATS--}</span>");
        }
-} elseif ($mmails == "0") {
+} elseif ($mmails == '0') {
        // Please set more than 0 mails per day
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_HAS_ZERO_MMAILS'));
 } else {
@@ -727,7 +726,7 @@ LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__);
 
 if (!empty($URL)) {
        // Redirect to requested URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 } // END - if
 
 //
index 84d5483cd2d477f0c09d97b85bb351b955f44e24..4eb6016eda609d4b49c727cf6125ff7ae4fc9cfa 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // Not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('payout')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'payout'));
        return;
@@ -79,7 +79,7 @@ SQL_FREERESULT($result_depths);
 $USED = GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
 
 // Translate point into comma
-$TPTS = TRANSLATE_COMMA($TPTS - $USED);
+$TPTS = translateComma($TPTS - $USED);
 
 // Sanity check...
 if (empty($TPTS)) $TPTS = "0.00000";
@@ -89,7 +89,8 @@ if (!REQUEST_ISSET_GET(('payout'))) {
        $result = SQL_QUERY_ESC("SELECT id, type, rate, min_points, allow_url
 FROM `{!_MYSQL_PREFIX!}_payout_types`
 WHERE %s >= min_points
-ORDER BY type", array(REVERT_COMMA($TPTS)), __FILE__, __LINE__);
+ORDER BY type ASC",
+               array(convertCommaToDot($TPTS)), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Free memory
                SQL_FREERESULT($result);
@@ -132,9 +133,9 @@ ORDER BY p.payout_timestamp DESC",
                                $content = array(
                                        'sw'     => $SW,
                                        'acc'    => $content['target_account'],
-                                       'points' => TRANSLATE_COMMA($content['payout_total'])." ".COMPILE_CODE($content['type']),
+                                       'points' => translateComma($content['payout_total'])." ".COMPILE_CODE($content['type']),
                                        'bank'   => $content['target_bank'],
-                                       'stamp'  => MAKE_DATETIME($content['payout_timestamp'], "2"),
+                                       'stamp'  => generateDateTime($content['payout_timestamp'], "2"),
                                        'status' => $content['status']
                                );
 
@@ -159,7 +160,7 @@ ORDER BY p.payout_timestamp DESC",
        }
 } else {
        // Chedk if he can get paid by selected type
-       $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url AS allow FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT type, rate, min_points, allow_url AS allow FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE `id`=%s LIMIT 1",
                array(bigintval(REQUEST_GET('payout'))), __FILE__, __LINE__);
 
        if (SQL_NUMROWS($result) == 1) {
@@ -182,7 +183,7 @@ ORDER BY p.payout_timestamp DESC",
                define('PAYOUT_MAX_VALUE' , $max);
                define('PAYOUT_TYPE_VALUE', COMPILE_CODE($content['type']));
 
-               if (REVERT_COMMA($TPTS) >= $content['min_points']) {
+               if (convertCommaToDot($TPTS) >= $content['min_points']) {
                        // Ok, he can get be paid
                        if ((IS_FORM_SENT()) && ($PAYOUT <= $PAY_MAX) && ($PAYOUT >= $content['min_points'])) {
                                // Calculate exact value
@@ -230,8 +231,9 @@ VALUES (%s,%s,%s,'%s',%s, UNIX_TIMESTAMP(), 'NEW','%s')",
                                        $msg_mem = LOAD_EMAIL_TEMPLATE("member_payout_request", array(), getUserId());
                                        $msg_adm = LOAD_EMAIL_TEMPLATE("admin_payout_request", array(), getUserId());
                                        $admin_tpl = '';
-                                       if (GET_EXT_VERSION('admins') >= '0.4.1')
-                                       {
+
+                                       // @TODO Rewrite this to a filter
+                                       if (GET_EXT_VERSION('admins') >= '0.4.1') {
                                                $admin_tpl = "admin_payout_request";
                                        }
                                }
@@ -245,10 +247,10 @@ VALUES (0, 'NEW','PAYOUT_REQUEST','[payout:] {--PAYOUT_REQUEST_ADMIN--}','%s', U
 ), __FILE__, __LINE__);
 
                                // Send out mails
-                               SEND_EMAIL(getUserId(), getMessage('PAYOUT_REQUEST_MEMBER'), $msg_mem);
+                               sendEmail(getUserId(), getMessage('PAYOUT_REQUEST_MEMBER'), $msg_mem);
 
                                // To admin(s)
-                               SEND_ADMIN_NOTIFICATION(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, array(), getUserId());
+                               sendAdminNotification(getMessage('PAYOUT_REQUEST_ADMIN'), $admin_tpl, array(), getUserId());
 
                                // Load template and output it
                                LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PAYOUT_REQUEST_SENT'));
index a1840572702d3317594969c0f0cbacbe288c56a5..59abf34a1342ddd2287bc1b34aad924ac040d5d0 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
@@ -92,9 +92,9 @@ while ($content = SQL_FETCHARRAY($result_depths)) {
        // Transfer data to array for template
        $content = array(
                'lvl'    => $content['level'],
-               'per'    => TRANSLATE_COMMA($content['percents']),
-               'points' => TRANSLATE_COMMA($points),
-               'refs'   => TRANSLATE_COMMA($REFS),
+               'per'    => translateComma($content['percents']),
+               'points' => translateComma($points),
+               'refs'   => translateComma($REFS),
        );
 
        // Output row
@@ -134,13 +134,13 @@ if (GET_EXT_VERSION('user') >= '0.1.2') {
 }
 
 // If TLOCK is 0 add 3 zeros for floating
-if ($TLOCK == "0") $TLOCK = "0.00000";
+if ($TLOCK == '0') $TLOCK = "0.00000";
 
 // Remember several values in constants
-define('__USED_VALUE' , TRANSLATE_COMMA($USED));
-define('__TPTS_VALUE' , TRANSLATE_COMMA($TPTS - $USED));
+define('__USED_VALUE' , translateComma($USED));
+define('__TPTS_VALUE' , translateComma($TPTS - $USED));
 define('__TREF_VALUE' , $TREF);
-define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK));
+define('__TLOCK_VALUE', translateComma($TLOCK));
 
 // Fixes a bug when there is no bonus extension installed
 if (EXT_VERSION_IS_OLDER('bonus', '0.4.4')) setConfigEntry('bonus_active', "X");
@@ -159,18 +159,18 @@ if ((GET_EXT_VERSION('bonus') >= '0.2.2') && (EXT_IS_ACTIVE('bonus')) && (getCon
        SQL_FREERESULT($result);
 
        // Prepare constants
-       define('__TURBO_VALUE',  TRANSLATE_COMMA($turbo));
-       define('__LOGIN_VALUE',  TRANSLATE_COMMA($login));
+       define('__TURBO_VALUE',  translateComma($turbo));
+       define('__LOGIN_VALUE',  translateComma($login));
 
        if (GET_EXT_VERSION('bonus') >= '0.4.4') {
                // Add referal, stats and order bonys
-               define('__REF_VALUE'  ,  TRANSLATE_COMMA($ref));
-               define('__ORDER_VALUE',  TRANSLATE_COMMA($order));
-               define('__STATS_VALUE',  TRANSLATE_COMMA($stats));
+               define('__REF_VALUE'  ,  translateComma($ref));
+               define('__ORDER_VALUE',  translateComma($order));
+               define('__STATS_VALUE',  translateComma($stats));
        }
 
        // Total bonus points
-       define('__TTOTAL_VALUE', TRANSLATE_COMMA($turbo + $login + $ref + $order + $stats));
+       define('__TTOTAL_VALUE', translateComma($turbo + $login + $ref + $order + $stats));
 
        // Output rows
        define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true));
@@ -205,7 +205,7 @@ if (EXT_IS_ACTIVE('user')) {
 
 if (EXT_IS_ACTIVE('payout')) {
        // Payput extension is installed and active so we can check if the user has enougth points
-       PAYOUT_OUTPUT_PAYOUT_LIST(REVERT_COMMA(($TPTS - $USED)));
+       PAYOUT_OUTPUT_PAYOUT_LIST(convertCommaToDot(($TPTS - $USED)));
 }
 
 //
index e59bb5811bf00e3873f63bae448cb36edc0dd133..eb8b8136155cb2ca10371cdbaf68ca0b8b8f0910 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // User is not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('primera')) && (!IS_ADMIN())) {
        // Extension 'primera' is not activated
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'primera'));
@@ -53,7 +53,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('member', __FILE__);
 
 // Check if the admin has entered the data
-if ((getConfig('primera_api_name') == "") || (getConfig('primera_api_md5') == "")) {
+if ((getConfig('primera_api_name') == '') || (getConfig('primera_api_md5') == '')) {
        // Something important is missing...
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('PRIMERA_MEMBER_API_DATA_MISSING'));
        return;
@@ -94,8 +94,8 @@ if (!REQUEST_ISSET_GET(('mode'))) {
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'         => MAKE_DATETIME($data['primera_timestamp'], "2"),
-                               'points'                => TRANSLATE_COMMA($data['primera_amount']),
+                               'stamp'         => generateDateTime($data['primera_timestamp'], "2"),
+                               'points'                => translateComma($data['primera_amount']),
                                'acc'           => SQL_ESCAPE($data['primera_account']),
                                'status'                => PRIMERA_TRANSFER_STATUS($data['primera_type']),
                                'raw_type'      => strtolower($data['primera_type']),
@@ -119,7 +119,7 @@ if (REQUEST_GET('mode') == "pay") {
        $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
 
        // No dots here...
-       $points = explode(".", $points);
+       $points = explode('.', $points);
        $points = bigintval($points[0]);
 
        // Remove the registration fee
@@ -128,13 +128,13 @@ if (REQUEST_GET('mode') == "pay") {
        // Is this enougth for a payout?
        if ($points < getConfig('primera_min_payout')) {
                // No, then abort here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'), TRANSLATE_COMMA(getConfig('primera_min_payout'))));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('PRIMERA_MEMBER_MIN_PAYOUT_PAYOUT'), translateComma(getConfig('primera_min_payout'))));
                return;
        }
 
        // Add points to content array
        $content['points']              = $points;
-       $content['min_points']  = TRANSLATE_COMMA(getConfig('primera_min_payout'));
+       $content['min_points']  = translateComma(getConfig('primera_min_payout'));
 
        // Get Primera id
        $content['primera_nickname'] = '';
@@ -187,7 +187,7 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
                                        $locked = true;
 
                                        // Shall I "pay" the referal points imidiately?
-                                       if (getConfig('ref_payout') == "0") {
+                                       if (getConfig('ref_payout') == '0') {
                                                // Yes, "pay" it now
                                                $locked = false;
                                        } // END - if
index 67fb92f25f8f50353cd43a45522824e3cdd14269..dbc3bce2b48210c2e5009699afb678ec7732df43 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('rallye')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'rallye'));
        return;
@@ -97,8 +97,8 @@ if (SQL_NUMROWS($result) == 1) {
        define('__RALLYE_MAX_PRICES',  RALLYE_DETERMINE_MIN_PRICES($min_prices));
 
        // Set start and end time
-       define('__RALLYE_START', MAKE_DATETIME($start, "1"));
-       define('__RALLYE_END'  , MAKE_DATETIME($end  , "1"));
+       define('__RALLYE_START', generateDateTime($start, "1"));
+       define('__RALLYE_END'  , generateDateTime($end  , "1"));
 
        if ($expired === true) {
                define('__RALLYE_PRICES', RALLYE_LIST_WINNERS($id));
index a9d8a4ab7c7b93ce6870a24b7cfefcd2de6816c6..3b2513acb4dcb6d7a9fe69f0c77a63ab0f94b96a 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // User is not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('refback')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'refback'));
        return;
@@ -60,11 +60,11 @@ if (getConfig('refback_enabled') != 'Y') {
 ADD_DESCR('member', __FILE__);
 
 // Was the form submitted?
-if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST(('id')))) {
+if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('id'))) {
        // Okay, has the user entered some values?
        if (REQUEST_ISSET_POST(('percents'))) {
                // Revert german commta for testing
-               $percents = REVERT_COMMA(REQUEST_POST('percents'));
+               $percents = convertCommaToDot(REQUEST_POST('percents'));
 
                // Validate percents
                if ((($percents >= getConfig('refback_min_perc')) || (round($percents) == 0)) && ($percents <= getConfig('refback_max_perc'))) {
@@ -93,9 +93,9 @@ if ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST(('id')))) {
                $content = GET_USER_REF_ENTRY(REQUEST_POST('id'));
 
                // Translate comma
-               $content['refback'] = TRANSLATE_COMMA($content['refback']);
-               $content['min']     = TRANSLATE_COMMA(getConfig('refback_min_perc').".0");
-               $content['max']     = TRANSLATE_COMMA(getConfig('refback_max_perc').".0");
+               $content['refback'] = translateComma($content['refback']);
+               $content['min']     = translateComma(getConfig('refback_min_perc').".0");
+               $content['max']     = translateComma(getConfig('refback_max_perc').".0");
 
                // Load form for editing
                LOAD_TEMPLATE("member_refback_edit", false, $content);
@@ -127,9 +127,9 @@ if (SQL_NUMROWS($result) > 0) {
 
                        // Add/"translate" more content
                        $refRow['sw']      = $SW;
-                       $refRow['points']  = TRANSLATE_COMMA($refRow['points']);
-                       $refRow['refback'] = TRANSLATE_COMMA($refRow['refback']);
-                       $refRow['status']  = TRANSLATE_STATUS($refRow['status']);
+                       $refRow['points']  = translateComma($refRow['points']);
+                       $refRow['refback'] = translateComma($refRow['refback']);
+                       $refRow['status']  = translateUserStatus($refRow['status']);
                        if (empty($refRow['nickname'])) $refRow['nickname'] = '---';
 
                        // Load row template
@@ -145,8 +145,8 @@ if (SQL_NUMROWS($result) > 0) {
                } // END - foreach
 
                // Remember the content
-               $content['counter']  = TRANSLATE_COMMA($counter);
-               $content['percents'] = TRANSLATE_COMMA($content['percents']);
+               $content['counter']  = translateComma($counter);
+               $content['percents'] = translateComma($content['percents']);
                $content['rows']     = $rows;
 
                // Load level template
index 69172291568c4be0907e05b4e8456ff7855c4ce9..64e00bf64faa9d6cf29f07e77f6e5719695da347 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
@@ -86,7 +86,7 @@ if (SQL_NUMROWS($result) > 0) {
                $test = str_replace(constant('URL'), constant('PATH'), $content['url']); $size = 0;
                if ($test == $content['url']) {
                        // Download banner (I hope you keep the banner on same server???)
-                       $fp = GET_URL($content['url']); $bannerContent = '';
+                       $fp = sendGetRequest($content['url']); $bannerContent = '';
                        if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0) {
                                // Loads only found banner, when there is a 404 error this foreach() command
                                // will cause an "Invalid argument supplied for foreach()" error
@@ -95,11 +95,11 @@ if (SQL_NUMROWS($result) > 0) {
                                }
                        }
                        $size = strlen($bannerContent);
-               } elseif (FILE_READABLE($test)) {
+               } elseif (isFileReadable($test)) {
                        $size = filesize($test);
                }
 
-               if ($size > 0) $content['alternate'] .= " (".TRANSLATE_COMMA(round($size/102.4)/10)." {--KBYTES--})";
+               if ($size > 0) $content['alternate'] .= " (".translateComma(round($size/102.4)/10)." {--KBYTES--})";
 
                // Load banner data
                // @TODO Rewritings: alt->alternate,cnt->counter,cks->clicks,uid->userid in template
index 0ebafb38c36c80b710f6ada254b9cae9f8cc18a0..ec95e5364ffcf14716f217f493fa43f80aff6f21 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // User is not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
@@ -66,13 +66,13 @@ if (SQL_NUMROWS($result) > 0) {
                $SW = 2;
 
                // Check for users ref in this level
-               foreach (GET_USER_REF_POINTS(getUserId(), $content['level']) as $refRow) {
+               foreach (getUserReferalPoints(getUserId(), $content['level']) as $refRow) {
                        // Add/"translate" more content
                        $refRow['sw']          = $SW;
-                       $refRow['points']      = TRANSLATE_COMMA($refRow['points']);
-                       $refRow['status']      = TRANSLATE_STATUS($refRow['status']);
-                       $refRow['unconfirmed'] = TRANSLATE_COMMA($refRow['unconfirmed']);
-                       $refRow['clickrate']   = TRANSLATE_COMMA($refRow['clickrate'], true, 1);
+                       $refRow['points']      = translateComma($refRow['points']);
+                       $refRow['status']      = translateUserStatus($refRow['status']);
+                       $refRow['unconfirmed'] = translateComma($refRow['unconfirmed']);
+                       $refRow['clickrate']   = translateComma($refRow['clickrate'], true, 1);
                        if (empty($refRow['nickname'])) $refRow['nickname'] = '---';
 
                        // Load row template
@@ -84,8 +84,8 @@ if (SQL_NUMROWS($result) > 0) {
                } // END - foreach
 
                // Remember the content
-               $content['counter']  = TRANSLATE_COMMA($counter);
-               $content['percents'] = TRANSLATE_COMMA($content['percents'], true, 1);
+               $content['counter']  = translateComma($counter);
+               $content['percents'] = translateComma($content['percents'], true, 1);
                $content['rows']     = $rows;
 
                // Load level template
index da94b15f8fb2f63b1dfdbcc3b0bfdd37564752d5..b951a952774c117ad20f266d56d6bbf4461d7837 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('sponsor')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'sponsor'));
        return;
index cc43347ac9a5dd4f935247c2c97622b0c88c5266..38d199573bc117adc710312fc2bc7ff45afd131d 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
@@ -69,13 +69,13 @@ if (SQL_NUMROWS($result) > 0) {
                $content = array(
                        'sw'    => $SW,
                        'id'    => $data['id'],
-                       'cat'   => GET_CATEGORY($data['cat_id']),
-                       'pay'   => GET_PAYMENT($data['payment_id']),
+                       'cat'   => getCategory($data['cat_id']),
+                       'pay'   => getPaymentTitlePrice($data['payment_id']),
                        'subj'  => COMPILE_CODE($data['subject']),
                        'url'   => DEREFERER($data['url']),
-                       'stamp' => MAKE_DATETIME($data['timestamp'], "2"),
+                       'stamp' => generateDateTime($data['timestamp'], "2"),
                        'recs'  => $data['target_send'],
-                       'type'  => TRANSLATE_POOL_TYPE($data['data_type']),
+                       'type'  => translatePoolType($data['data_type']),
                        'zip'   => $data['zip']
                );
 
@@ -111,13 +111,13 @@ if (SQL_NUMROWS($result) > 0) {
                // Prepare data for the template
                $content = array(
                        'sw'    => $SW,
-                       'cat'   => GET_CATEGORY($data[1]),
-                       'pay'   => GET_PAYMENT($data[2]),
+                       'cat'   => getCategory($data[1]),
+                       'pay'   => getPaymentTitlePrice($data[2]),
                        'subj'  => COMPILE_CODE($data[3]),
                        'url'   => DEREFERER($data[4]),
-                       'stamp' => MAKE_DATETIME($data[5], "2"),
+                       'stamp' => generateDateTime($data[5], "2"),
                        'recs'  => $data[6],
-                       'sent'  => MAKE_DATETIME($data[7], "2"),
+                       'sent'  => generateDateTime($data[7], "2"),
                        'clix'  => $data[8],
                        'perc'  => COMPILE_CODE($data[8] / $data[6] * 100)."%",
                );
index 2755feeaca049a23aa7e33b20074f867df8490b7..747ea4078d6bb296024bf6e16c484ab17fbc1ec7 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }  elseif (!IS_MEMBER()){
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('support')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'support'));
        return;
@@ -81,14 +81,14 @@ if ((!IS_FORM_SENT()) || (!REQUEST_ISSET_POST(('qsummary')))) {
        } // END - switch
 
        // Send mail to admin
-       SEND_ADMIN_NOTIFICATION($subj_a, $a_tpl, array('text' => REQUEST_POST('qdetails')), getUserId());
+       sendAdminNotification($subj_a, $a_tpl, array('text' => REQUEST_POST('qdetails')), getUserId());
 
        // Send mail to user
-       SEND_EMAIL(getUserId(), $subj_m, $msg_m);
+       sendEmail(getUserId(), $subj_m, $msg_m);
 
        // Drop a message in the admin's area
        SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_task_system` (userid, assigned_admin, status, task_type, subject, text, task_created) VALUES ('%s','0','NEW','SUPPORT_MEMBER','%s','%s', UNIX_TIMESTAMP())",
-               array(getUserId(), $subj_a, REQUEST_POST('qsummary').":".array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
+               array(getUserId(), $subj_a, REQUEST_POST('qsummary').':'.array('text' => REQUEST_POST('qdetails'))), __FILE__, __LINE__);
 
        // Form sent
        LOAD_TEMPLATE("member_support_contcted");
index 6320482153db8a4155e09fef01007e983e21d296..5b2515bf2ac16ad626db14a24a42830f32a31c60 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // Redirect
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'surfbar'));
        return;
@@ -79,8 +79,8 @@ if (!SURFBAR_IF_USER_BOOK_MORE_URLS()) {
 } else {
        // Prepare some content
        $content = array(
-               'reward'     => TRANSLATE_COMMA(SURFBAR_DETERMINE_REWARD(true)),
-               'costs'      => TRANSLATE_COMMA(SURFBAR_DETERMINE_COSTS(true)),
+               'reward'     => translateComma(SURFBAR_DETERMINE_REWARD(true)),
+               'costs'      => translateComma(SURFBAR_DETERMINE_COSTS(true)),
                'max_order'  => getConfig('surfbar_max_order'),
                'curr_order' => SURFBAR_GET_TOTAL_USER_URLS()
        );
index ce6655905febda1e54f75359dc41cef0acd83b01..b2494b9b00f412ca3d7a48638a4dce62d814cb57 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'surfbar'));
        return;
@@ -54,11 +54,11 @@ ADD_DESCR('member', __FILE__);
 $URLs = SURFBAR_GET_USER_URLS();
 
 // Are there entries or form is submitted?
-if ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('action'))) && (REQUEST_ISSET_POST(('id')))) {
+if ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('action'))) && (REQUEST_ISSET_POST('id'))) {
        // Process the form
        if (SURFBAR_MEMBER_DO_FORM(REQUEST_POST_ARRAY(), $URLs)) {
                // Action performed but shall we display it?
-               if (((REQUEST_POST('action') != "edit") && (REQUEST_POST('action') != "delete")) || (REQUEST_ISSET_POST(('execute')))) {
+               if (((REQUEST_POST('action') != 'edit') && (REQUEST_POST('action') != "delete")) || (REQUEST_ISSET_POST(('execute')))) {
                        // Display "action done" message if action is wether 'edit' nor 'delete' or has been executed
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_SURFBAR_ACTION_DONE'));
                } // END - if
@@ -75,12 +75,12 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_POST(('action'))) && (REQUEST_ISSET_POST(
                $content['url'] = DEREFERER($content['url']);
                if ($content['views_total'] > 0) {
                        // Include link to stats
-                       $content['views_total'] = "[<a href=\"{!URL!}/modules.php?module=login&amp;what=surfbar_list\">".TRANSLATE_COMMA($content['views_total'])."</a>]";
+                       $content['views_total'] = "[<a href=\"{!URL!}/modules.php?module=login&amp;what=surfbar_list\">".translateComma($content['views_total'])."</a>]";
                } // END - if
-               $content['registered']  = MAKE_DATETIME($content['registered'], "2");
-               $content['last_locked'] = MAKE_DATETIME($content['last_locked'], "2");
+               $content['registered']  = generateDateTime($content['registered'], "2");
+               $content['last_locked'] = generateDateTime($content['last_locked'], "2");
                $content['actions']     = SURFBAR_MEMBER_ACTIONS($content['id'], $content['status']);
-               $content['status']      = SURFBAR_TRANSLATE_STATUS($content['status']);
+               $content['status']      = surfbarTranslateUserStatus($content['status']);
                if (empty($content['lock_reason'])) {
                        // Fixes some HTML problems with empty cells
                        $content['lock_reason'] = '---';
index f81baeaff7af69b69e1ec4724b528d3107d1ab2f..7f95a74b2752f642698ee4ef55aa97c66c81028e 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // Not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'surfbar'));
        return;
@@ -53,36 +53,36 @@ ADD_DESCR('member', __FILE__);
 
 // Prepare content for output
 $content = array(
-       'surfbar_static_reward' => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
-       'surfbar_static_time'   => CREATE_FANCY_TIME(getConfig('surfbar_static_time')),
-       'surfbar_static_lock'   => CREATE_FANCY_TIME(getConfig('surfbar_static_lock')),
-       'surfbar_total_urls'    => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0")
+       'surfbar_static_reward' => translateComma(getConfig('surfbar_static_reward')),
+       'surfbar_static_time'   => createFancyTime(getConfig('surfbar_static_time')),
+       'surfbar_static_lock'   => createFancyTime(getConfig('surfbar_static_lock')),
+       'surfbar_total_urls'    => SURFBAR_GET_TOTAL_URLS('ACTIVE', '0')
 );
 
 // In dynamic mode we need some more data
-if (getConfig('surfbar_pay_model') == "DYNAMIC") {
+if (getConfig('surfbar_pay_model') == 'DYNAMIC') {
        // Total URLs
        $content = array(
-               'surfbar_dynamic_percent' => TRANSLATE_COMMA(getConfig('surfbar_dynamic_percent')),
-               'surfbar_total_urls'      => SURFBAR_GET_TOTAL_URLS("ACTIVE", "0"),
+               'surfbar_dynamic_percent' => translateComma(getConfig('surfbar_dynamic_percent')),
+               'surfbar_total_urls'      => SURFBAR_GET_TOTAL_URLS('ACTIVE', '0'),
                'surfbar_user_urls'       => SURFBAR_GET_TOTAL_USER_URLS(),
                'surfbar_total_online'    => SURFBAR_DETERMINE_TOTAL_ONLINE(),
-               'surfbar_total_users'     => TRANSLATE_COMMA(GET_TOTAL_DATA("CONFIRMED", "user_data", 'userid', "status", true)),
-               'surfbar_min_reward'      => TRANSLATE_COMMA(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
-               'surfbar_max_reward'      => TRANSLATE_COMMA(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
-               'surfbar_min_time'        => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
-               'surfbar_max_time'        => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
-               'surfbar_dynamic_lock'    => CREATE_FANCY_TIME(SURFBAR_CALCULATE_DYNAMIC_LOCK()),
-               'surfbar_static_reward'   => TRANSLATE_COMMA(getConfig('surfbar_static_reward')),
-               'surfbar_static_time'     => CREATE_FANCY_TIME(getConfig('surfbar_static_time'))
+               'surfbar_total_users'     => translateComma(GET_TOTAL_DATA('CONFIRMED', 'user_data', 'userid', 'status', true)),
+               'surfbar_min_reward'      => translateComma(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
+               'surfbar_max_reward'      => translateComma(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
+               'surfbar_min_time'        => createFancyTime(SURFBAR_CALCULATE_DYNAMIC_MIN_VALUE()),
+               'surfbar_max_time'        => createFancyTime(SURFBAR_CALCULATE_DYNAMIC_MAX_VALUE()),
+               'surfbar_dynamic_lock'    => createFancyTime(SURFBAR_CALCULATE_DYNAMIC_LOCK()),
+               'surfbar_static_reward'   => translateComma(getConfig('surfbar_static_reward')),
+               'surfbar_static_time'     => createFancyTime(getConfig('surfbar_static_time'))
        );
 } // END - if
 
 // Load the template
-LOAD_TEMPLATE("member_surfbar_start_".strtolower(getConfig('surfbar_pay_model')), false, $content);
+LOAD_TEMPLATE('member_surfbar_start_' . strtolower(getConfig('surfbar_pay_model')), false, $content);
 
 // Load surfbar link template
-LOAD_TEMPLATE("member_surfbar_link");
+LOAD_TEMPLATE('member_surfbar_link');
 
 //
 ?>
index 630c39b67e48c948f15c6d27ece44016e91a5309..4a0de8da061c42892254f5449dc41982969cd3cd 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('surfbar')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'surfbar'));
        return;
index fba00ca0ea5892e6f251f19dbd7bc070b8f80ad6..26865409cbba09a67049a5dd262e7aad06c9744c 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('theme')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'theme'));
        return;
@@ -59,7 +59,7 @@ if (REQUEST_ISSET_POST(('member_theme'))) {
        $newTheme = SQL_ESCAPE(REQUEST_POST('member_theme'));
 
        // Change to new theme
-       set_session('mxchange_theme', $newTheme);
+       setSession('mxchange_theme', $newTheme);
 
        // Theme saved!
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('MEMBER_THEME_SAVED'));
@@ -81,9 +81,9 @@ while ($entry = readdir($handle)) {
        // Construct absolute theme.php file name
        $INC = sprintf("theme/%s/theme.php", $entry);
 
-       if (($entry != ".") && ($entry != "..") && (INCLUDE_READABLE($INC)) && (THEME_IS_ACTIVE($entry))) {
+       if ((!isDirectory($entry)) && (isIncludeReadable($INC)) && (isThemeActive($entry))) {
                // Found a valid directory so let's load it's theme.php file
-               LOAD_INC($INC);
+               loadInclude($INC);
 
                // Add found theme to array
                $THEMES['theme_unix'][]   = $entry;
@@ -105,7 +105,7 @@ array_pk_sort($THEMES, array("theme_name"));
 $OUT = ''; $SW = 2;
 foreach ($THEMES['theme_unix'] as $key => $unix) {
        $default = '';
-       if (get_session('mxchange_theme') == $unix) $default = ' selected="selected"';
+       if (getSession('mxchange_theme') == $unix) $default = ' selected="selected"';
 
        // Add row
        $OUT .= "<tr>
@@ -114,7 +114,7 @@ foreach ($THEMES['theme_unix'] as $key => $unix) {
   </td>
   <td class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">".$THEMES['theme_name'][$key]."</td>
   <td class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
-    <a href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")"."\">".$THEMES['theme_author'][$key]."</a>
+    <a href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")'.'\">".$THEMES['theme_author'][$key]."</a>
   </td>
   <td class=\"switch_sw".$SW." bottom2 right2\" align=\"center\">
     <a href=\"".DEREFERER($THEMES['theme_url'][$key])."\" target=\"_blank\">".$THEMES['theme_url'][$key]."</a>
index cb4ace1868daa811518ee723f83403282ee7c63a..923ef52a4e03941842fe1b31bd65eba52fa596f2 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('transfer')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'transfer'));
        return;
@@ -116,13 +116,13 @@ case "new": // Start new transfer
                        // @TODO Rewrite all these constants to array elements
                        if ($uid1 == getUserId()) {
                                // Data row 1 is sender's data
-                               define('__SENDER_GENDER'   , TRANSLATE_GENDER($gender1));
+                               define('__SENDER_GENDER'   , translateGender($gender1));
                                define('__SENDER_NICK'     , $nick1);
                                define('__SENDER_SNAME'    , $sname1);
                                define('__SENDER_FNAME'    , $fname1);
                                define('__SENDER_EMAIL'    , $email1);
                                // Data row 2 is recpient's data
-                               define('__RECIPIENT_GENDER', TRANSLATE_GENDER($gender2));
+                               define('__RECIPIENT_GENDER', translateGender($gender2));
                                define('__RECIPIENT_NICK'  , $nick2);
                                define('__RECIPIENT_SNAME' , $sname2);
                                define('__RECIPIENT_FNAME' , $fname2);
@@ -133,13 +133,13 @@ case "new": // Start new transfer
                                $TEST_NICK_REC = $nick2;
                        } else {
                                // Data row 2 is sender's data
-                               define('__SENDER_GENDER'   , TRANSLATE_GENDER($gender2));
+                               define('__SENDER_GENDER'   , translateGender($gender2));
                                define('__SENDER_NICK'     , $nick2);
                                define('__SENDER_SNAME'    , $sname2);
                                define('__SENDER_FNAME'    , $fname2);
                                define('__SENDER_EMAIL'    , $email2);
                                // Data row 1 is recpient's data
-                               define('__RECIPIENT_GENDER', TRANSLATE_GENDER($gender1));
+                               define('__RECIPIENT_GENDER', translateGender($gender1));
                                define('__RECIPIENT_NICK'  , $nick1);
                                define('__RECIPIENT_SNAME' , $sname1);
                                define('__RECIPIENT_FNAME' , $fname1);
@@ -168,7 +168,7 @@ case "new": // Start new transfer
 
                        // Remember transfer reason and fancy date/time in constants
                        define('__TRANSFER_REASON', REQUEST_POST('reason'));
-                       define('__TRANSFER_EXPIRES', CREATE_FANCY_TIME(getConfig('transfer_age')));
+                       define('__TRANSFER_EXPIRES', createFancyTime(getConfig('transfer_age')));
 
                        // Generate tranafer id
                        define('__TRANS_ID', bigintval(generateRandomCodde("10", mt_rand(0, 99999), getUserId(), REQUEST_POST('reason'))));
@@ -182,22 +182,22 @@ case "new": // Start new transfer
                                __FILE__, __LINE__);
 
                        // Add points to account *directly* ...
-                       ADD_POINTS_REFSYSTEM("member_transfer", bigintval(REQUEST_POST('to_uid')), bigintval(REQUEST_POST('points')), false, "0", false, "direct");
+                       ADD_POINTS_REFSYSTEM_DIRECT('member_transfer', bigintval(REQUEST_POST('to_uid')), bigintval(REQUEST_POST('points')));
 
                        // ... and add it to current user's used points
                        SUB_POINTS('transfer', getUserId(), REQUEST_POST('points'));
 
                        // First send email to recipient
                        $msg = LOAD_EMAIL_TEMPLATE("member_transfer_recipient", '', constant('__RECIPIENT_UID'));
-                       SEND_EMAIL(constant('__RECIPIENT_EMAIL'), getMessage('TRANSFER_MEMBER_RECIPIENT_SUBJ').": ".$SENDER, $msg);
+                       sendEmail(constant('__RECIPIENT_EMAIL'), getMessage('TRANSFER_MEMBER_RECIPIENT_SUBJ').": ".$SENDER, $msg);
 
                        // Second send email to sender
                        $msg = LOAD_EMAIL_TEMPLATE("member_transfer_sender", '', constant('__SENDER_UID'));
-                       SEND_EMAIL(constant('__SENDER_EMAIL'), getMessage('TRANSFER_MEMBER_SENDER_SUBJ').": ".$RECIPIENT, $msg);
+                       sendEmail(constant('__SENDER_EMAIL'), getMessage('TRANSFER_MEMBER_SENDER_SUBJ').": ".$RECIPIENT, $msg);
 
                        // At last send admin mail(s)
                        $ADMIN_SUBJ = sprintf("%s (%s->%s)", getMessage('TRANSFER_ADMIN_SUBJECT'), $SENDER, $RECIPIENT);
-                       SEND_ADMIN_NOTIFICATION($ADMIN_SUBJ, "admin_transfer_points");
+                       sendAdminNotification($ADMIN_SUBJ, "admin_transfer_points");
 
                        // Transfer is completed
                        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('TRANSFER_COMPLETED')."<br /><a href=\"{!URL!}/modules.php?module=login&amp;what=transfer\">{--TRANSFER_CONTINUE_OVERVIEW--}</a>");
@@ -232,11 +232,11 @@ case "new": // Start new transfer
                // Load member list
                if (EXT_IS_ACTIVE('nickname')) {
                        // Load userid and nickname
-                       $result = SQL_QUERY_ESC("SELECT userid, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid",
+                       $result = SQL_QUERY_ESC("SELECT userid, nickname FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY `userid` ASC",
                         array(getUserId()), __FILE__, __LINE__);
                } else {
                        // Load only userid
-                       $result = SQL_QUERY_ESC("SELECT userid, userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY userid",
+                       $result = SQL_QUERY_ESC("SELECT userid, userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' AND opt_in='Y' AND userid != '%s' ORDER BY `userid` ASC",
                         array(getUserId()), __FILE__, __LINE__);
                }
 
@@ -329,16 +329,16 @@ case "list_out": // List only outgoing transactions
                // @TODO This should be somehow rewritten to $content = SQL_FETCHARRAY(), see switch() block above for SQL queries
                while (list($tid, $uid, $points, $reason, $stamp) = SQL_FETCHROW($result)) {
                        // Rewrite points
-                       if ($type == "OUT") $points = $points."-";
+                       if ($type == "OUT") $points = $points.'-';
 
                        // Prepare content for template
                        $content = array(
                                'sw'     => $SW,
                                'tid'    => $id,
-                               'stamp'  => MAKE_DATETIME($stamp, "3"),
+                               'stamp'  => generateDateTime($stamp, "3"),
                                'uid'    => $uid,
                                'reason' => $reason,
-                               'points' => TRANSLATE_COMMA($points)
+                               'points' => translateComma($points)
                        );
 
                        // Load row template
@@ -421,12 +421,12 @@ array(getUserId(), getConfig('transfer_max')), __FILE__, __LINE__);
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result)) {
                        // Rewrite points
-                       if ($content['trans_type'] == "OUT") $content['points'] = "-".$content['points']."";
+                       if ($content['trans_type'] == "OUT") $content['points'] = '-'.$content['points']."";
 
                        // Prepare content for template
                        $content['sw']     = $SW;
-                       $content['time']   = MAKE_DATETIME($content['time_trans'], "3");
-                       $content['points'] = TRANSLATE_COMMA($content['points']);
+                       $content['time']   = generateDateTime($content['time_trans'], "3");
+                       $content['points'] = translateComma($content['points']);
 
                        // Load row template
                        $OUT .= LOAD_TEMPLATE("member_transfer_row", true, $content);
@@ -532,7 +532,7 @@ case "": // Overview page
        // Check for latest out-transfers
        $result = SQL_QUERY_ESC("SELECT time_trans
 FROM `{!_MYSQL_PREFIX!}_user_transfers_out`
-WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND userid=%s
+WHERE time_trans > (UNIX_TIMESTAMP() - %s) AND `userid`=%s
 ORDER BY time_trans DESC
 LIMIT 1", array(getConfig('transfer_timeout'), getUserId()), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
@@ -542,12 +542,13 @@ LIMIT 1", array(getConfig('transfer_timeout'), getUserId()), __FILE__, __LINE__)
                // Load newest transaction
                list($newest) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
-               define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), MAKE_DATETIME($newest, "3")));
+               define('__TRANSFER_SETTINGS_CONTENT', sprintf(getMessage('TRANSFER_LATEST_IS'), generateDateTime($newest, "3")));
        }
 
        // Load template
        LOAD_TEMPLATE("member_transfer_overview");
        break;
 }
+
 //
 ?>
index 78449324e601d0ac5834007b6017014b4bea87d7..73eff91ad6b0ad403c47d99656a675c7236be0cd 100644 (file)
@@ -41,9 +41,9 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('mailid')) && (!IS_ADMIN())) {
-       LOAD_URL('modules.php?module=login');
+       redirectToUrl('modules.php?module=login');
 }
 
 // Add description as navigation point
@@ -54,7 +54,7 @@ if ((REQUEST_ISSET_GET(('bonusid'))) && (EXT_IS_ACTIVE('bonus'))) {
        // Display bonus mail by loading it's full data
        $result_data = SQL_QUERY_ESC("SELECT id, subject, timestamp, cat_id, points, text, is_notify, data_type, time, url
 FROM `{!_MYSQL_PREFIX!}_bonus`
-WHERE id=%s LIMIT 1",
+WHERE `id`=%s LIMIT 1",
                array(bigintval(REQUEST_GET('bonusid'))), __FILE__, __LINE__);
 
        // Load data
@@ -63,17 +63,17 @@ WHERE id=%s LIMIT 1",
        // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
-       $content['category']  = GET_CATEGORY($content['cat_id']);
-       $content['points']    = TRANSLATE_COMMA($content['points']);
-       $content['is_notify'] = TRANSLATE_YESNO($content['is_notify']);
-       $content['sender']    = _ADMIN_SHORT;
-       $content['time']      = CREATE_FANCY_TIME($content['time']);
+       $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+       $content['category']  = getCategory($content['cat_id']);
+       $content['points']    = translateComma($content['points']);
+       $content['is_notify'] = translateYesNo($content['is_notify']);
+       $content['sender']    = getMessage('_ADMIN_SHORT');
+       $content['time']      = createFancyTime($content['time']);
        $content['uid']       = getUserId();
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('bonusid', $content['id']), '2')
+               generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
@@ -98,15 +98,15 @@ WHERE s.id=%s LIMIT 1",
        // Translate some data
        $content['subject']   = COMPILE_CODE($content['subject']);
        $content['text']      = COMPILE_CODE($content['text']);
-       $content['timestamp'] = MAKE_DATETIME($content['timestamp'], '2');
-       $content['category']  = GET_CATEGORY($content['cat_id']);
-       $content['points']    = TRANSLATE_COMMA($content['points']);
-       $content['time']      = CREATE_FANCY_TIME($content['time']);
+       $content['timestamp'] = generateDateTime($content['timestamp'], '2');
+       $content['category']  = getCategory($content['cat_id']);
+       $content['points']    = translateComma($content['points']);
+       $content['time']      = createFancyTime($content['time']);
        $content['uid']       = getUserId();
 
        // Get timestamp from insert
        $content['user_status'] = sprintf(getMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON'),
-               MAKE_DATETIME(USER_STATS_GET_TIMESTAMP('mailid', $content['id']), '2')
+               generateDateTime(getTimestampFromUserStats('mailid', $content['id']), '2')
        );
 
        // Display it depending on mail (data) type
@@ -149,7 +149,7 @@ LIMIT 1",
                        break;
 
                case 'BONUS':
-                       $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                       $result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                         array(bigintval($id2)), __FILE__, __LINE__);
                        $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
                        break;
@@ -193,9 +193,9 @@ LIMIT 1",
                                'type'    => $type,
                                'subject' => $subject,
                                'sender'  => $sender,
-                               'stamp'   => MAKE_DATETIME($timestamp, '2'),
-                               'cat'     => GET_CATEGORY($cat),
-                               'points'  => TRANSLATE_COMMA($pay),
+                               'stamp'   => generateDateTime($timestamp, '2'),
+                               'cat'     => getCategory($cat),
+                               'points'  => translateComma($pay),
                        );
 
                        // Load row template
@@ -234,7 +234,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Remember total points
-       define('__TOTAL_POINTS', TRANSLATE_COMMA($sum));
+       define('__TOTAL_POINTS', translateComma($sum));
 
        // Remember all generated rows in constant for the template
        define('__UNCONFIRMED_ROWS', $OUT);
index 129f95ea8369bbc073739fdae3cee258b75500fd..8aa3ff90674f5c2fc2f6746667fb1be608a1531a 100644 (file)
@@ -41,21 +41,23 @@ if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 } elseif (!IS_MEMBER()) {
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 }
 
 // Add description as navigation point
 ADD_DESCR ('member', basename(__FILE__));
 
 // Export data for template
-define('_LAST_ONLINE_VALUE', MAKE_DATETIME($GLOBALS['last']['online']));
-define('_LAST_MODULE_VALUE', GET_MOD_DESCR('member', $GLOBALS['last']['module']));
+$content = array(
+       'last_online' => generateDateTime($GLOBALS['last']['online']),
+       'last_module' => getModuleDescription('member', $GLOBALS['last']['module'])
+);
 
 // Load header template
-LOAD_TEMPLATE("member_welcome_header");
+LOAD_TEMPLATE("member_welcome_header", false, $content);
 
 // Chedk if he is returning from a profile update notification
-$result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE notified='Y' AND userid=%s LIMIT 1",
+$result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE notified='Y' AND `userid`=%s LIMIT 1",
        array(getUserId()), __FILE__, __LINE__);
 
 if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE('profile'))) {
index 654b1b26694a272b18191b48503998e8f7edc475..c7fa6d1532dda70582c997bcbb5ce1bcd79b2d65 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('__SECURITY')) {
        require($INC);
 } elseif (!IS_MEMBER()) {
        // User is not logged in
-       LOAD_URL('modules.php?module=index');
+       redirectToUrl('modules.php?module=index');
 } elseif ((!EXT_IS_ACTIVE('wernis')) && (!IS_ADMIN())) {
        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis'));
        return;
@@ -52,7 +52,7 @@ if (!defined('__SECURITY')) {
 ADD_DESCR('member', __FILE__);
 
 // Check if the admin has entered the data
-if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
+if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
        // Something important is missing...
        LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_API_DATA_MISSING'));
        return;
@@ -94,8 +94,8 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'    => MAKE_DATETIME($data['wernis_timestamp'], "2"),
-                               'points'   => TRANSLATE_COMMA($data['wernis_amount']),
+                               'stamp'    => generateDateTime($data['wernis_timestamp'], "2"),
+                               'points'   => translateComma($data['wernis_amount']),
                                'acc'      => bigintval($data['wernis_account']),
                                'status'   => WERNIS_TRANSFER_STATUS($data['wernis_type']),
                                'raw_type' => strtolower($data['wernis_type']),
@@ -142,17 +142,17 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        // Is this enougth for a payout?
        if ($points < getConfig('wernis_min_payout')) {
                // No, then abort here
-               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), TRANSLATE_COMMA(getConfig('wernis_min_payout'))));
+               LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), translateComma(getConfig('wernis_min_payout'))));
                return;
        } // END - if
 
        // No dots here...
-       $points = explode(".", $points);
+       $points = explode('.', $points);
        $points = bigintval($points[0]);
 
        // Add points to content array
-       $content['points']     = TRANSLATE_COMMA($points);
-       $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_payout'));
+       $content['points']     = translateComma($points);
+       $content['min_points'] = translateComma(getConfig('wernis_min_payout'));
 
        // Add fees to array
        WERNIS_ADD_FEES_TO_ARRAY($content);
@@ -175,8 +175,8 @@ if ((!REQUEST_ISSET_GET(('mode'))) || (REQUEST_GET('mode') == "choose")) {
        $points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
 
        // Prepare data for the template
-       $content['points']     = TRANSLATE_COMMA($points);
-       $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_withdraw'));
+       $content['points']     = translateComma($points);
+       $content['min_points'] = translateComma(getConfig('wernis_min_withdraw'));
        $content['wds66_id']   = '';
 
        // Add fees to array
@@ -231,7 +231,7 @@ if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
                                        if ($success) {
                                                // Add it to this amount
                                                unset($GLOBALS['ref_level']);
-                                               ADD_POINTS_REFSYSTEM("wernis_withdraw", getUserId(), bigintval(REQUEST_POST('amount')), false, 0, false, "direct");
+                                               ADD_POINTS_REFSYSTEM_DIRECT('wernis_withdraw', getUserId(), bigintval(REQUEST_POST('amount')));
 
                                                // Update the user data as well..
                                                SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
index 24b51118d277b075fa7ef272d7c1a56e798ccb09..c4db5c2f9fd28de59b1dead685d6a483c22ebed1 100644 (file)
@@ -68,7 +68,7 @@ if (empty($URL)) {
        }
 
        // Update sending pool
-       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='%s' WHERE id=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
+       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='%s' WHERE `id`=%s AND sender=%s AND data_type='TEMP' LIMIT 1",
                array($type, bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
 
        // Finally is the entry valid?
@@ -80,14 +80,14 @@ if (empty($URL)) {
                SQL_FREERESULT($result);
 
                // Load mail again...              0       1        2           3          4      5      6         7
-               $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM `{!_MYSQL_PREFIX!}_pool` WHERE id=%s AND sender=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT subject, text, receivers, payment_id, timestamp, url, cat_id, target_send FROM `{!_MYSQL_PREFIX!}_pool` WHERE `id`=%s AND sender=%s LIMIT 1",
                        array(bigintval(REQUEST_GET('order')), getUserId()), __FILE__, __LINE__);
                $DATA = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
                if (empty($DATA[0])) $DATA[0] = getMessage('DEFAULT_SUBJECT_LINE');
 
                // Calculate used points
-               $USED = $DATA[7] * GET_PAY_POINTS($DATA[3]);
+               $USED = $DATA[7] * getPaymentPoints($DATA[3]);
 
                // Update used points
                $add = '';
@@ -99,27 +99,27 @@ if (empty($URL)) {
                        'blocks'   => getConfig('max_send'),
                        'subject'  => $DATA[0],
                        'text'     => $DATA[1],
-                       'payment'  => GET_PAYMENT($DATA[3]),
-                       'category' => GET_CATEGORY($DATA[6]),
+                       'payment'  => getPaymentTitlePrice($DATA[3]),
+                       'category' => getCategory($DATA[6]),
                        'url'      => $DATA[5]
                );
 
                // Send an email to the user
                $msg_mem = LOAD_EMAIL_TEMPLATE('order-member', $content, getUserId());
-               SEND_EMAIL($email, getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
+               sendEmail($email, getMessage('MEMBER_NEW_QUEUE'), $msg_mem);
 
                // Notify admins about this
-               SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
+               sendAdminNotification(getMessage('ADMIN_NEW_QUEUE'), 'order-admin', $content, getUserId());
 
                // Output back bottom
                LOAD_TEMPLATE('member_order-back', false);
        } else {
                // Matching line not found or already 'placed' in send queue
-               LOAD_URL('modules.php?module=login');
+               redirectToUrl('modules.php?module=login');
        }
 } else {
        // Redirect...
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 }
 
 //
index ba9a45360eacd2a846a7aecfd604492b7b4281b0..cb46839d0a31873e14dc3e0bd80e98ef86a7b62c 100644 (file)
@@ -54,21 +54,21 @@ gender, surname, family, street_nr1, street_nr2, zip, city, country,
 phone, fax, cell, email, url,
 status, receive_warnings
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' LIMIT 1",
-       array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
+WHERE `id`='%s' AND password='%s' LIMIT 1",
+       array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
 
 // Entry found?
 if (SQL_NUMROWS($result) == 1) {
        // Load sponsor data
        $content = SQL_FETCHARRAY($result);
-       if ($content['status'] == "CONFIRMED") {
+       if ($content['status'] == 'CONFIRMED') {
                // Check if form was submitted or not
                if (IS_FORM_SENT()) {
                        // Check passwords
                        if (!REQUEST_ISSET_POST(('pass_old'))) {
                                // No current password entered
                                $message = getMessage('SPONSOR_NO_CURRENT_PASSWORD_ENTERED');
-                       } elseif (md5(REQUEST_POST('pass_old')) != get_session('sponsorpass')) {
+                       } elseif (md5(REQUEST_POST('pass_old')) != getSession('sponsorpass')) {
                                // Entered password didn't match password in DB
                                $message = getMessage('SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB');
                        } elseif ((REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') != REQUEST_POST('pass2'))) {
@@ -144,12 +144,12 @@ if (SQL_NUMROWS($result) == 1) {
                }
        } else {
                // Locked or so?
-               $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
+               $STATUS = sponsorTranslateUserStatus($content['status']);
                $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
        }
 } else {
        // Sponsor account not found!
-       $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid')));
+       $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), getSession('sponsorid')));
 }
 
 // Free memory
index ea4c4e4fd66e7686eb023add0c1f7aecd927fb00..bf986e0d7b6b7fa2f098ccb5e151d70dafbe5878 100644 (file)
@@ -51,19 +51,19 @@ if (!defined('__SECURITY')) {
 // Data for the formular
 $result = SQL_QUERY_ESC("SELECT status, receive_warnings, warning_interval, email, surname, family, gender
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' LIMIT 1",
- array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
+WHERE `id`='%s' AND password='%s' LIMIT 1",
+ array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
 if (SQL_NUMROWS($result) == 1) {
        // Load sponsor data
        $content = SQL_FETCHARRAY($result);
-       if ($content['status'] == "CONFIRMED") {
+       if ($content['status'] == 'CONFIRMED') {
                // Check if form was submitted or not
                if (IS_FORM_SENT()) {
                        // Check passwords
                        if (!REQUEST_ISSET_POST(('password'))) {
                                // No current password entered
                                $message = SPONSOR_NO_CURRENT_PASSWORD_ENTERED;
-                       } elseif (md5(REQUEST_POST('password')) != get_session('sponsorpass')) {
+                       } elseif (md5(REQUEST_POST('password')) != getSession('sponsorpass')) {
                                // Entered password didn't match password in DB
                                $message = SPONSOR_CURRENT_PASSWORD_DIDNOT_MATCH_DB;
                        } else {
@@ -106,19 +106,19 @@ if (SQL_NUMROWS($result) == 1) {
                        }
 
                        // Translate current interval into fancy string
-                       define('__CURRENT', CREATE_FANCY_TIME($content['warning_interval']));
+                       define('__CURRENT', createFancyTime($content['warning_interval']));
 
                        // Output formular
                        $OUT = LOAD_TEMPLATE("sponsor_settings_form", true, $content);
                }
        } else {
                // Locked or so?
-               $STATUS = SPONSOR_TRANSLATE_STATUS($content['status']);
+               $STATUS = sponsorTranslateUserStatus($content['status']);
                $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_FAILED'), $STATUS));
        }
 } else {
        // Sponsor account not found!
-       $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), get_session('sponsorid')));
+       $OUT = LOAD_TEMPLATE('admin_settings_saved', true, sprintf(getMessage('SPONSOR_ACCOUNT_404'), getSession('sponsorid')));
 }
 
 // Free memory
index df6f2329424f0ad364f4850f3f595cad5eed436e..05462781e2c65f12b7830e7d7f7b3bb28e100ca9 100644 (file)
@@ -51,18 +51,18 @@ if (!defined('__SECURITY')) {
 // Load some data
 $result = SQL_QUERY_ESC("SELECT gender, surname, family, (points_amount - points_used) AS points
 FROM `{!_MYSQL_PREFIX!}_sponsor_data`
-WHERE id='%s' AND password='%s' LIMIT 1",
- array(bigintval(get_session('sponsorid')), get_session('sponsorpass')), __FILE__, __LINE__);
+WHERE `id`='%s' AND password='%s' LIMIT 1",
+ array(bigintval(getSession('sponsorid')), getSession('sponsorpass')), __FILE__, __LINE__);
 list($gender, $surname, $family, $points) = SQL_FETCHROW($result);
 
 // Free memory
 SQL_FREERESULT($result);
 
 // Prepare data for the template
-define('__GENDER'  , TRANSLATE_GENDER($gender));
+define('__GENDER'  , translateGender($gender));
 define('__SURNAME', $surname);
 define('__FAMILY' , $family);
-define('__POINTS' , TRANSLATE_COMMA($points));
+define('__POINTS' , translateComma($points));
 
 // Load main template
 $OUT = LOAD_TEMPLATE("sponsor_welcome", true);
index adc07ca534af20436289f3738cf009e5a5314690..673e63a05e6ed9ad895ffbd43937a2b14f0003c5 100644 (file)
@@ -49,7 +49,7 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled()) || (getConfig('beg
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
-$curr = date("m", time());
+$curr = date('m', time());
 
 // Check if month is done
 if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getConfig('beg_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) {
@@ -68,7 +68,7 @@ if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getC
                // Use last online stamp only when autopurge for inactive members is activated
                if ((getConfig('ap_inactive_since') > 0) && (getConfig('beg_active') == 'Y')) {
                        // Okay, include last online timestamp
-                       $whereStatement1 .= sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig(('ap_inactive_since')));;
+                       $whereStatement1 .= sprintf(" AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig(('ap_inactive_since')));;
                } // END - if
        } // END - if
 
@@ -84,15 +84,15 @@ LIMIT %s",
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Add points to user's account directly
-                       ADD_POINTS_REFSYSTEM("monthly_beg", $content['userid'], $content['points'], false, "0", false, "direct");
+                       ADD_POINTS_REFSYSTEM_DIRECT('monthly_beg', $content['userid'], $content['points']);
 
                        // Translate gender/points
-                       $content['gender'] = TRANSLATE_GENDER($content['gender']);
-                       $content['points'] = TRANSLATE_COMMA($content['points']);
+                       $content['gender'] = translateGender($content['gender']);
+                       $content['points'] = translateComma($content['points']);
 
                        // Load email template and email it away
                        $msg = LOAD_EMAIL_TEMPLATE("member_beg", $content, bigintval($content['userid']));
-                       SEND_EMAIL($content['email'], BEG_MONTHLY_RALLYE, $msg);
+                       sendEmail($content['email'], getMessage('BEG_MONTHLY_RALLYE'), $msg);
                } // END - while
 
                // Reset accounts
index 55254d14a6ffb2d748f69a4eed686dd4f061d2b0..6490b4702509225a2b8eb850ae8485366276b7db 100644 (file)
@@ -49,7 +49,7 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
-$curr = date("m", time());
+$curr = date('m', time());
 
 if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($GLOBALS['output_mode'] != 1)) {
        // Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
@@ -61,7 +61,7 @@ if (($curr != getConfig('last_month')) && (getConfig('bonus_ranks') > 0) && ($GL
                // Use last online stamp only when autopurge for inactive members is activated
                if (getConfig('ap_inactive_since') > 0) {
                        // Okay, include last online timestamp
-                       $whereStatement1 = sprintf("WHERE `status`='CONFIRMED' AND last_online >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
+                       $whereStatement1 = sprintf("WHERE `status`='CONFIRMED' AND `last_online` >= (UNIX_TIMESTAMP() - %s)", getConfig('ap_inactive_since'));
                        $whereStatement2 = getConfig(('bonus_ranks'));
                } // END - if
        } // END - if
@@ -94,15 +94,15 @@ LIMIT %s",
                        // Make sure zero points are not mailed
                        if ($content['points'] > 0) {
                                // Add points to user's account directly
-                               ADD_POINTS_REFSYSTEM("monthly_bonus", $content['uid'], $content['points'], false, "0", false, "direct");
+                               ADD_POINTS_REFSYSTEM_DIRECT('monthly_bonus', $content['uid'], $content['points']);
 
                                // Translate gender/points
-                               $content['gender']       = TRANSLATE_GENDER($content['gender']);
-                               $content['points'] = TRANSLATE_COMMA($content['points']);
+                               $content['gender']       = translateGender($content['gender']);
+                               $content['points'] = translateComma($content['points']);
 
                                // Load email template and email it away
                                $msg = LOAD_EMAIL_TEMPLATE("member_bonus", $content['points'], bigintval($content['uid']));
-                               SEND_EMAIL($content['email'], BONUS_MONTHLY_ONLINE_BONUS, $msg);
+                               sendEmail($content['email'], getMessage('BONUS_MONTHLY_ONLINE_BONUS'), $msg);
                        } // END - if
                } // END - while
 
index a85faab0dc571a47c490e27b6de92ad0e6b9908c..6c2303c7a2a3c58dc4530e44b21023daf7479507 100644 (file)
@@ -49,24 +49,24 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Get current month (2 digits)
-$curr = date("m", time());
+$curr = date('m', time());
 
 if (getConfig('last_month') != $curr) {
        // Check for unsubscribed members
-       $result = SQL_QUERY("SELECT userid, email, nl_until FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nl_receive='N' ORDER BY userid", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT `userid`, `email`, `nl_until` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nl_receive`='N' ORDER BY `userid` ASC", __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0) {
                // Some unsubscriptions are found so we reset them to receive newsletters
                while ($content = SQL_FETCHARRAY($result)) {
                        // Update account
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET nl_receive='Y', nl_until='0' WHERE userid=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `nl_receive`='Y', `nl_until`=0 WHERE `userid`=%s LIMIT 1",
                                array(bigintval($content['userid'])), __FILE__, __LINE__);
 
                        // Send email to him
                        $msg = LOAD_EMAIL_TEMPLATE("member_newsletter_reset", true, bigintval($content['userid']));
-                       SEND_EMAIL($content['email'], getMessage('NL_MEMBER_RESET_SUBJECT'), $msg);
+                       sendEmail($content['email'], getMessage('NL_MEMBER_RESET_SUBJECT'), $msg);
 
                        // Send email to admin
-                       SEND_ADMIN_NOTIFICATION(getMessage('NL_ADMIN_SUBJECT'), "admin_newsletter_reset", array(), getUserId());
+                       sendAdminNotification(getMessage('NL_ADMIN_SUBJECT'), "admin_newsletter_reset", array(), getUserId());
                } // END - if
 
                // Free memory
index addf0240a991de109b1344b6c7e1f6ce65f4e4e8..353bf62d3ede8b957c1f76727ec5bf3a58cbec45 100644 (file)
@@ -49,7 +49,7 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
-UPDATE_CONFIG("surfbar_monthly_counter", "0");
+updateConfiguration('surfbar_monthly_counter', '0');
 
 //
 ?>
index 6bcae05430d7de23000b7efa94aa674a3dc0b844..6e257ae8042df648001cd7537f94dedb6b0c2880 100644 (file)
@@ -48,7 +48,7 @@ require('inc/functions.php');
 // Load more function libraries or includes
 foreach (array('request-functions', 'session-functions', 'config-functions', 'code-functions', 'inc-functions', 'filters', 'mysql-manager', 'extensions', 'db/lib', 'handler', 'hooks') as $lib) {
        // Load special functions
-       LOAD_INC_ONCE('inc/' . $lib . '.php');
+       loadIncludeOnce('inc/' . $lib . '.php');
 } // END - foreach
 
 // Set error handler
@@ -106,24 +106,24 @@ if ((!isInstalling()) && (isInstalled())) {
                                loadConfiguration();
 
                                // Load "databases" aka static arrays
-                               LOAD_INC_ONCE('inc/databases.php');
+                               loadIncludeOnce('inc/databases.php');
 
                                // Init session
-                               LOAD_INC_ONCE('inc/session.php');
+                               loadIncludeOnce('inc/session.php');
 
                                // Load versions
-                               LOAD_INC_ONCE('inc/versions.php');
+                               loadIncludeOnce('inc/versions.php');
 
                                // Loading patching system is required here...
-                               LOAD_INC_ONCE('inc/patch-system.php'); // Initialize patch system
+                               loadIncludeOnce('inc/patch-system.php'); // Initialize patch system
 
                                // Run daily reset
-                               LOAD_INC_ONCE('inc/check-reset.php');
+                               loadIncludeOnce('inc/check-reset.php');
 
                                // Load admin include file if he is admin
                                if (IS_ADMIN()) {
                                        // Administrative functions
-                                       LOAD_INC_ONCE('inc/modules/admin/admin-inc.php');
+                                       loadIncludeOnce('inc/modules/admin/admin-inc.php');
                                } // END - if
                                //* DEBUG: */ ADD_POINTS_REFSYSTEM('test', 36, 1000);
                                //* DEBUG: */ die();
@@ -131,8 +131,8 @@ if ((!isInstalling()) && (isInstalled())) {
                                // Get all values
                                if (($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) {
                                        if (empty($GLOBALS['module']))  $GLOBALS['module'] = 'empty';
-                                       if (empty($GLOBALS['what']))    $GLOBALS['what']   = GET_WHAT($GLOBALS['module']);
-                                       if (empty($GLOBALS['action']))  $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                                       if (empty($GLOBALS['what']))    $GLOBALS['what']   = getWhatFromModule($GLOBALS['module']);
+                                       if (empty($GLOBALS['action']))  $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']);
                                } else {
                                        // Set action/what to empty
                                        $GLOBALS['action'] = '';
@@ -143,11 +143,11 @@ if ((!isInstalling()) && (isInstalled())) {
                                runFilterChain('init');
 
                                // Set default 'what' value
-                               //* DEBUG: */ OUTPUT_HTML("-".$GLOBALS['module']."/".$GLOBALS['what']."-<br />");
+                               //* DEBUG: */ OUTPUT_HTML('-'.$GLOBALS['module'].'/'.$GLOBALS['what']."-<br />");
                                if ((empty($GLOBALS['what'])) && (empty($GLOBALS['action'])) && ($GLOBALS['output_mode'] != 1) && ($GLOBALS['output_mode'] != -1)) {
                                        if ($GLOBALS['module'] == 'admin') {
                                                // Set 'action' value to 'login' in admin menu
-                                               $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
+                                               $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']);
                                        } elseif (($GLOBALS['module'] == 'index') || ($GLOBALS['module'] == 'login')) {
                                                // Set 'what' value to 'welcome' in guest and member menu
                                                $GLOBALS['what'] = 'welcome';
@@ -159,7 +159,7 @@ if ((!isInstalling()) && (isInstalled())) {
                                } // END - if
 
                                // Update sending pool
-                               if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) LOAD_INC_ONCE('inc/pool-update.php'); // Sends out mails in configureable steps
+                               if (($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != '-1')) loadIncludeOnce('inc/pool-update.php'); // Sends out mails in configureable steps
 
                                // Load all active extension including language files when not upgrading.
                                // Check module for testing and count one click
@@ -197,30 +197,30 @@ if ((!isInstalling()) && (isInstalled())) {
        if (!isset($GLOBALS['output_mode'])) $GLOBALS['output_mode'] = '0';
 
        // Include databases.php
-       LOAD_INC_ONCE('inc/databases.php');
+       loadIncludeOnce('inc/databases.php');
 
        // Init session
-       LOAD_INC_ONCE('inc/session.php');
+       loadIncludeOnce('inc/session.php');
 
        // Load versions
-       LOAD_INC_ONCE('inc/versions.php');
+       loadIncludeOnce('inc/versions.php');
 
        // Check if we are in installation routine
        if ((!isInstalling()) && ($GLOBALS['output_mode'] != '1') && ($GLOBALS['output_mode'] != -1)) {
                // Redirect to the installation system
-               LOAD_URL('install.php');
+               redirectToUrl('install.php');
        } // END - if
 
        // Double-check installation mode
        if ((!isInstalled()) || (!isAdminRegistered())) {
                // Check for file permissions
-               if (!IS_INC_WRITEABLE('config')) {
+               if (!isIncludeWriteable('config')) {
                        addFatalMessage(__FILE__, __LINE__, getMessage('CONFIG_IS_WRITE_PROTECTED'));
                } // END - if
-               if (!IS_INC_WRITEABLE('dummy')) {
+               if (!isIncludeWriteable('dummy')) {
                        addFatalMessage(__FILE__, __LINE__, getMessage('DUMMY_IS_WRITE_PROTECTED'));
                } // END - if
-               if (!IS_INC_WRITEABLE('.secret/dummy')) {
+               if (!isIncludeWriteable('.secret/dummy')) {
                        addFatalMessage(__FILE__, __LINE__, getMessage('SECRET_IS_WRITE_PROTECTED'));
                } // END - if
        } // END - if
@@ -234,9 +234,9 @@ if ((!isInstalling()) && (isInstalled())) {
 
 if ((getTotalFatalErrors() > 0) && (isInstalled()) && (!isInstalling()) && ($GLOBALS['output_mode'] != '1')) {
        // One or more fatal error(s) occur during connect...
-       LOAD_INC_ONCE('inc/header.php');
-       LOAD_INC_ONCE('inc/fatal_errors.php');
-       LOAD_INC_ONCE('inc/footer.php');
+       loadIncludeOnce('inc/header.php');
+       loadIncludeOnce('inc/fatal_errors.php');
+       loadIncludeOnce('inc/footer.php');
 } // END - if
 
 //
index e4ef99b7002818d881166f91de7c301e61aa6422..be375eea693240de433a91fd2ff6667ca89417d4 100644 (file)
@@ -42,8 +42,8 @@ if (!defined('__SECURITY')) {
        require($INC);
 }
 
-// Returns the title for given module
-function ADD_MODULE_TITLE ($mod) {
+// "Getter" for module title
+function getModuleTitle ($mod) {
        // Init variables
        $name = '';
        $result = false;
@@ -83,6 +83,32 @@ function ADD_MODULE_TITLE ($mod) {
        return $name;
 }
 
+// "Getter" for module description
+function getModuleDescription ($mode, $wht, $column = 'what') {
+       // Fix empty "what"
+       if (empty($wht)) {
+               $wht = "welcome";
+               if (getConfig('index_home') != '') $wht = getConfig('index_home');
+       } // END - if
+
+       // Default is not found
+       $ret = "??? (".$wht.")";
+
+       // Look for title
+       $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
+               array($mode, $column, $wht), __FUNCTION__, __LINE__);
+
+       // Is there an entry?
+       if (SQL_NUMROWS($result) == 1) {
+               // Fetch the title
+               list($ret) = SQL_FETCHROW($result);
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+       return $ret;
+}
+
 // Check validity of a given module name (no file extension)
 function checkModulePermissions ($mod) {
        // Filter module name (names with low chars and underlines are fine!)
@@ -104,17 +130,17 @@ function checkModulePermissions ($mod) {
        // Major error in module registry is the default
        $ret = "major";
 
-       // Check if script is installed if not return a "done" to prevent some errors
+       // Check if script is installed if not return a 'done' to prevent some errors
        if ((!isInstalled()) || (isInstalling()) || (!isAdminRegistered())) {
                // Not installed or no admin registered or in installation phase
-               return "done";
+               return 'done';
        } // END - if
 
        // Init variables
-       $locked = "Y";
-       $hidden = "N";
-       $admin  = "N";
-       $mem    = "N";
+       $locked = 'Y';
+       $hidden = 'N';
+       $admin  = 'N';
+       $mem    = 'N';
        $found  = false;
 
        // Check if cache is latest version
@@ -159,7 +185,7 @@ function checkModulePermissions ($mod) {
                //  Admin access            ----- Guest access -----           --- Guest   or   member? ---
                if ((IS_ADMIN()) || (($locked == 'N') && ($admin == 'N') && (($mem == 'N') || (IS_MEMBER())))) {
                        // If you are admin you are welcome for everything!
-                       $ret = "done";
+                       $ret = 'done';
                } elseif ($locked == 'Y') {
                        // Module is locked
                        $ret = "locked";
@@ -183,7 +209,7 @@ function checkModulePermissions ($mod) {
        // Still no luck or not found?
        if (($ret == "cache_miss") || (!$found)) {
                //              ----- Legacy module -----                                               ---- Module in base folder  ----                       --- Module with extension's name ---
-               if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
+               if ((isFileReadable(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (isFileReadable(sprintf("%s%s.php", constant('PATH'), $mod))) || (isFileReadable(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
                        // Data is missing so we add it
                        if (GET_EXT_VERSION('sql_patches') >= '0.3.6') {
                                // Since 0.3.6 we have a has_menu column, this took me a half hour
@@ -275,7 +301,7 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
                        break;
                }
                $dummy = substr($search, 0, -4);
-               $AND .= " AND `action`='".GET_ACTION($ACC_LVL, $dummy)."'";
+               $AND .= " AND `action`='".getModeAction($ACC_LVL, $dummy)."'";
        } elseif (($ACC_LVL == 'sponsor') || ($ACC_LVL == "engine")) {
                // Sponsor / engine menu
                $type     = "what";
@@ -322,15 +348,15 @@ function ADD_DESCR ($ACC_LVL, $FQFN, $return = false, $output = true) {
                        return $ret;
                } elseif (((GET_EXT_VERSION('sql_patches') >= '0.2.3') && (getConfig('youre_here') == 'Y')) || ((IS_ADMIN()) && ($modCheck == 'admin'))) {
                        // Output HTML code
-                       $OUT = $prefix."<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$modCheck."&amp;".$type."=".$search.$LINK_ADD."\">".$ret."</a></strong>\n";
+                       $OUT = $prefix."<strong><a class=\"you_are_here\" href=\"{!URL!}/modules.php?module=".$modCheck.'&amp;'.$type.'='.$search.$LINK_ADD."\">".$ret."</a></strong>\n";
 
                        // Can we close the you-are-here navigation?
-                       //* DEBUG: */ echo __LINE__."*".$type."/".$GLOBALS['what']."*<br />\n";
+                       //* DEBUG: */ echo __LINE__."*".$type.'/'.$GLOBALS['what']."*<br />\n";
                        if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
-                               //* DEBUG: */ echo __LINE__."+".$type."+<br />\n";
+                               //* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
                                // Add closing div and br-tag
                                $OUT .= "</div><br />\n";
-                               $GLOBALS['nav_depth'] = "0";
+                               $GLOBALS['nav_depth'] = '0';
 
                                // Run the filter chain
                                $ret = runFilterChain('post_youhere_line', array('access_level' => $ACC_LVL, 'type' => $type, 'content' => ""));
@@ -361,7 +387,7 @@ function ADD_MENU ($mode, $act, $wht) {
        $sub_what = '';
 
        // is the menu action valid?
-       if (!VALIDATE_MENU_ACTION($mode, $act, $wht, true)) {
+       if (!isMenuActionValid($mode, $act, $wht, true)) {
                return getCode('MENU_NOT_VALID');
        } // END - if
 
@@ -373,12 +399,12 @@ function ADD_MENU ($mode, $act, $wht) {
        // Load SQL data and add the menu to the output stream...
        $result_main = SQL_QUERY_ESC("SELECT title, action FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE (`what`='' OR `what` IS NULL)".$AND." ORDER BY `sort`",
                array($mode), __FUNCTION__, __LINE__);
-       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$main_action.'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
        if (SQL_NUMROWS($result_main) > 0) {
                OUTPUT_HTML("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"".$mode."_menu\">");
                // There are menus available, so we simply display them... :)
                while ($content = SQL_FETCHARRAY($result_main)) {
-                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
+                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$sub_what.':'.$GLOBALS['what']."*<br />\n";
                        // Init variables
                        $GLOBALS['block_mode'] = false;
                        $act = $content['action'];
@@ -409,13 +435,13 @@ function ADD_MENU ($mode, $act, $wht) {
                                        // Full file name for checking menu
                                        //* DEBUG: */ echo __LINE__.":!!!!".$content['sub_what']."!!!<br />\n";
                                        $INC = sprintf("inc/modules/%s/what-%s.php", $mode, $content['sub_what']);
-                                       if (INCLUDE_READABLE($INC)) {
+                                       if (isIncludeReadable($INC)) {
                                                if ((!empty($wht)) && (($wht == $content['sub_what']))) {
                                                        $OUT = "<strong>";
                                                }
 
                                                // Navigation link
-                                               $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&amp;what=".$content['sub_what'].ADD_URL_DATA("")."\" target=\"_self\">";
+                                               $OUT .= "<a name=\"menu\" class=\"menu_blur\" href=\"{!URL!}/modules.php?module=".$GLOBALS['module']."&amp;what=".$content['sub_what'].addUrlData("")."\" target=\"_self\">";
                                        } else {
                                                $OUT .= "<em>";
                                        }
@@ -423,7 +449,7 @@ function ADD_MENU ($mode, $act, $wht) {
                                        // Menu title
                                        $OUT .= getConfig('menu_blur_spacer') . $content['sub_title'];
 
-                                       if (INCLUDE_READABLE($INC)) {
+                                       if (isIncludeReadable($INC)) {
                                                $OUT .= "</a>";
                                        } else {
                                                $OUT .= "</em>";
@@ -453,21 +479,21 @@ function ADD_MENU ($mode, $act, $wht) {
                                // This is a menu block... ;-)
                                $GLOBALS['block_mode'] = true;
                                $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $mode, $content['action']);
-                               if (FILE_READABLE($INC_BLOCK)) {
+                               if (isFileReadable($INC_BLOCK)) {
                                        // Load include file
                                        if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("<tr>
 
   <td class=\"".$mode."_menu_whats\">");
-                                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
-                                       LOAD_INC($INC_BLOCK);
-                                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
+                                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
+                                       loadInclude($INC_BLOCK);
+                                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
                                        if ((!EXT_IS_ACTIVE($content['action'])) || ($content['action'] == 'online')) OUTPUT_HTML("  </td>
 </tr>");
                                }
-                               //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
+                               //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
                        }
                        $main_cnt++;
-                       //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
+                       //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
                        if (SQL_NUMROWS($result_main) > $main_cnt) {
                                OUTPUT_HTML("<tr><td class=\"".$mode."_menu_seperator\"></td></tr>");
                        } // END - if
@@ -477,13 +503,79 @@ function ADD_MENU ($mode, $act, $wht) {
                SQL_FREERESULT($result_main);
 
                // Close table
-               //* DEBUG: */ echo __LINE__."/".$main_cnt."/".$content['action']."/".$content['sub_what'].":".$GLOBALS['what']."*<br />\n";
+               //* DEBUG: */ echo __LINE__.'/'.$main_cnt.'/'.$content['action'].'/'.$content['sub_what'].':'.$GLOBALS['what']."*<br />\n";
                OUTPUT_HTML("</table>");
        }
 }
 
+// Checks wether the current user is a member
+function IS_MEMBER () {
+       // @TODO Why is this global??? #100
+       global $status;
+
+       if (!is_array($GLOBALS['last'])) $GLOBALS['last'] = array();
+       $ret = false;
+
+       // is the cache entry there?
+       if (isset($GLOBALS['cache_array']['is_member'])) {
+               // Then return it
+               return $GLOBALS['cache_array']['is_member'];
+       } // END - if
+
+       // Fix "deleted" cookies first
+       fixDeletedCookies(array('userid', 'u_hash'));
+
+       // Are cookies set?
+       if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) {
+               // Cookies are set with values, but are they valid?
+               $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+                       array(getUserId()), __FUNCTION__, __LINE__);
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load data from cookies
+                       list($password, $status, $mod, $onl) = SQL_FETCHROW($result);
+
+                       // Validate password by created the difference of it and the secret key
+                       $valPass = generatePassString($password);
+
+                       // Transfer last module and online time
+                       if ((!empty($mod)) && (empty($GLOBALS['last']['module']))) {
+                               $GLOBALS['last']['module'] = $mod;
+                               $GLOBALS['last']['online'] = $onl;
+                       } // END - if
+
+                       // So did we now have valid data and an unlocked user?
+                       //* DEBUG: */ echo $valPass."<br />".getSession('u_hash')."<br />";
+                       if (($status == 'CONFIRMED') && ($valPass == getSession('u_hash'))) {
+                               // Account is confirmed and all cookie data is valid so he is definely logged in! :-)
+                               $ret = true;
+                       } else {
+                               // Maybe got locked etc.
+                               //* DEBUG: */ echo __LINE__."!!!<br />";
+                               destroyUserSession();
+                       }
+               } else {
+                       // Cookie data is invalid!
+                       //* DEBUG: */ echo __LINE__."***<br />";
+                       destroyUserSession();
+               }
+
+               // Free memory
+               SQL_FREERESULT($result);
+       } else {
+               // Cookie data is invalid!
+               //* DEBUG: */ echo __LINE__."///<br />";
+               destroyUserSession();
+       }
+
+       // Cache status
+       $GLOBALS['cache_array']['is_member'] = $ret;
+
+       // Return status
+       return $ret;
+}
+
 // This patched function will reduce many SELECT queries for the specified or current admin login
-function IS_ADMIN ($admin="") {
+function IS_ADMIN ($admin = '') {
        // Init variables
        $ret = false; $passCookie = ''; $valPass = '';
        //* DEBUG: */ echo __LINE__."ADMIN:".$admin."<br />";
@@ -491,10 +583,10 @@ function IS_ADMIN ($admin="") {
        // If admin login is not given take current from cookies...
        if ((empty($admin)) && (isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5'))) {
                // Get admin login and password from session/cookies
-               $admin = get_session('admin_login');
-               $passCookie = get_session('admin_md5');
+               $admin = getSession('admin_login');
+               $passCookie = getSession('admin_md5');
        }
-       //* DEBUG: */ echo __LINE__."ADMIN:".$admin."/".$passCookie."<br />";
+       //* DEBUG: */ echo __LINE__."ADMIN:".$admin.'/'.$passCookie."<br />";
 
        // Search in array for entry
        if (isset($GLOBALS['cache_array']['admin_hash'])) {
@@ -533,7 +625,7 @@ function IS_ADMIN ($admin="") {
 
        if (!empty($valPass)) {
                // Check if password is valid
-               //* DEBUG: */ print __FUNCTION__."*".$valPass."/".$passCookie."*<br />\n";
+               //* DEBUG: */ print __FUNCTION__."*".$valPass.'/'.$passCookie."*<br />\n";
                $ret = (($valPass == $passCookie) || ((strlen($valPass) == 32) && ($valPass == md5($passCookie))) || (($valPass == "*FAILED*") && (!EXT_IS_ACTIVE('cache'))));
        }
 
@@ -543,7 +635,7 @@ function IS_ADMIN ($admin="") {
 }
 
 // Generates a list of "max receiveable emails per day"
-function ADD_MAX_RECEIVE_LIST ($mode, $default = "", $return = false) {
+function addMaxReceiveList ($mode, $default = '', $return = false) {
        $OUT = '';
        $result = false;
 
@@ -597,7 +689,7 @@ function ADD_MAX_RECEIVE_LIST ($mode, $default = "", $return = false) {
 }
 
 // Checks wether the given email address is used.
-function SEARCH_EMAIL_USERTAB ($email) {
+function isEmailTaken ($email) {
        // Query the database
        $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE email LIKE '{PER}%s{PER}' LIMIT 1",
                array($email), __FUNCTION__, __LINE__);
@@ -612,74 +704,8 @@ function SEARCH_EMAIL_USERTAB ($email) {
        return $ret;
 }
 
-// Checks wether the current user is a member
-function IS_MEMBER () {
-       // @TODO Why is this global??? #100
-       global $status;
-
-       if (!is_array($GLOBALS['last'])) $GLOBALS['last'] = array();
-       $ret = false;
-
-       // is the cache entry there?
-       if (isset($GLOBALS['cache_array']['is_member'])) {
-               // Then return it
-               return $GLOBALS['cache_array']['is_member'];
-       } // END - if
-
-       // Fix "deleted" cookies first
-       FIX_DELETED_COOKIES(array('userid', 'u_hash'));
-
-       // Are cookies set?
-       if ((isUserIdSet()) && (isSessionVariableSet('u_hash'))) {
-               // Cookies are set with values, but are they valid?
-               $result = SQL_QUERY_ESC("SELECT password, status, last_module, last_online FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
-                       array(getUserId()), __FUNCTION__, __LINE__);
-               if (SQL_NUMROWS($result) == 1) {
-                       // Load data from cookies
-                       list($password, $status, $mod, $onl) = SQL_FETCHROW($result);
-
-                       // Validate password by created the difference of it and the secret key
-                       $valPass = generatePassString($password);
-
-                       // Transfer last module and online time
-                       if ((!empty($mod)) && (empty($GLOBALS['last']['module']))) {
-                               $GLOBALS['last']['module'] = $mod;
-                               $GLOBALS['last']['online'] = $onl;
-                       } // END - if
-
-                       // So did we now have valid data and an unlocked user?
-                       //* DEBUG: */ echo $valPass."<br />".get_session('u_hash')."<br />";
-                       if (($status == "CONFIRMED") && ($valPass == get_session('u_hash'))) {
-                               // Account is confirmed and all cookie data is valid so he is definely logged in! :-)
-                               $ret = true;
-                       } else {
-                               // Maybe got locked etc.
-                               //* DEBUG: */ echo __LINE__."!!!<br />";
-                               destroy_user_session();
-                       }
-               } else {
-                       // Cookie data is invalid!
-                       //* DEBUG: */ echo __LINE__."***<br />";
-                       destroy_user_session();
-               }
-
-               // Free memory
-               SQL_FREERESULT($result);
-       } else {
-               // Cookie data is invalid!
-               //* DEBUG: */ echo __LINE__."///<br />";
-               destroy_user_session();
-       }
-
-       // Cache status
-       $GLOBALS['cache_array']['is_member'] = $ret;
-
-       // Return status
-       return $ret;
-}
-
 // Validate the given menu action
-function VALIDATE_MENU_ACTION ($mode, $act, $wht, $UPDATE=false) {
+function isMenuActionValid ($mode, $act, $wht, $UPDATE=false) {
        // Is the cache entry there and we shall not update?
        if ((isset($GLOBALS['cache_array']['action_valid'][$mode][$act][$wht])) && ($UPDATE === false)) {
                // Count cache hit
@@ -696,7 +722,7 @@ function VALIDATE_MENU_ACTION ($mode, $act, $wht, $UPDATE=false) {
        $add = '';
        if ((!IS_ADMIN()) && ($mode != 'admin')) $add = " AND `locked`='N'";
 
-       //* DEBUG: */ echo __LINE__.":".$mode."/".$act."/".$wht."*<br />\n";
+       //* DEBUG: */ echo __LINE__.':'.$mode.'/'.$act.'/'.$wht."*<br />\n";
        if (($mode != 'admin') && ($UPDATE === true)) {
                // Update guest or member menu
                $sql = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
@@ -732,32 +758,7 @@ function VALIDATE_MENU_ACTION ($mode, $act, $wht, $UPDATE=false) {
 }
 
 //
-function GET_MOD_DESCR($mode, $wht, $column="what") {
-       // Fix empty "what"
-       if (empty($wht)) {
-               $wht = "welcome";
-               if (getConfig('index_home') != "") $wht = getConfig('index_home');
-       } // END - if
-
-       // Default is not found
-       $ret = "??? (".$wht.")";
-
-       // Look for title
-       $result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_%s_menu` WHERE %s='%s' LIMIT 1",
-               array($mode, $column, $wht), __FUNCTION__, __LINE__);
-
-       // Is there an entry?
-       if (SQL_NUMROWS($result) == 1) {
-               // Fetch the title
-               list($ret) = SQL_FETCHROW($result);
-       } // END - if
-
-       // Free result
-       SQL_FREERESULT($result);
-       return $ret;
-}
-//
-function SEND_MODE_MAILS($mod, $modes) {
+function sendModeMails ($mod, $modes) {
        global $DATA;
 
        // Load hash
@@ -768,11 +769,11 @@ function SEND_MODE_MAILS($mod, $modes) {
                list($hashDB) = SQL_FETCHROW($result_main);
 
                // Extract salt from cookie
-               $salt = substr(get_session('u_hash'), 0, -40);
+               $salt = substr(getSession('u_hash'), 0, -40);
 
                // Now let's compare passwords
                $hash = generatePassString($hashDB);
-               if (($hash == get_session('u_hash')) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
+               if (($hash == getSession('u_hash')) || (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) {
                        // Load user's data
                        $result = SQL_QUERY_ESC("SELECT gender, surname, family, street_nr, country, zip, city, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND password='%s' LIMIT 1",
                                array(getUserId(), $hashDB), __FUNCTION__, __LINE__);
@@ -784,7 +785,7 @@ function SEND_MODE_MAILS($mod, $modes) {
                                SQL_FREERESULT($result);
 
                                // Translate gender
-                               $DATA[0] = TRANSLATE_GENDER($DATA[0]);
+                               $DATA[0] = translateGender($DATA[0]);
 
                                // Clear/init the content variable
                                $content = '';
@@ -799,16 +800,16 @@ function SEND_MODE_MAILS($mod, $modes) {
                                                case 'normal': break; // Do not add any special lines
 
                                                case 'email': // Email was changed!
-                                                       $content = MEMBER_CHANGED_EMAIL.": ".REQUEST_POST('old_addy')."\n";
+                                                       $content = getMessage('MEMBER_CHANGED_EMAIL').": ".REQUEST_POST('old_addy')."\n";
                                                        break;
 
                                                case 'pass': // Password was changed
-                                                       $content = MEMBER_CHANGED_PASS."\n";
+                                                       $content = getMessage('MEMBER_CHANGED_PASS')."\n";
                                                        break;
 
                                                default:
                                                        DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unknown mode %s detected.", $mode));
-                                                       $content = MEMBER_UNKNOWN_MODE.": ".$mode."\n\n";
+                                                       $content = getMessage('MEMBER_UNKNOWN_MODE').": ".$mode."\n\n";
                                                        break;
                                                } // END - switch
                                        } // END - if
@@ -824,7 +825,7 @@ function SEND_MODE_MAILS($mod, $modes) {
                                        if (getConfig('admin_notify') == 'Y') {
                                                // The admin needs to be notified about a profile change
                                                $msg_admin = "admin_mydata_notify";
-                                               $sub_adm   = ADMIN_CHANGED_DATA;
+                                               $sub_adm   = getMessage('ADMIN_CHANGED_DATA');
                                        } else {
                                                // No mail to admin
                                                $msg_admin = '';
@@ -832,15 +833,15 @@ function SEND_MODE_MAILS($mod, $modes) {
                                        }
 
                                        // Set subject lines
-                                       $sub_mem = MEMBER_CHANGED_DATA;
+                                       $sub_mem = getMessage('MEMBER_CHANGED_DATA');
 
                                        // Output success message
-                                       $content = "<span class=\"member_done\">".MYDATA_MAIL_SENT."</span>";
+                                       $content = "<span class=\"member_done\">{--MYDATA_MAIL_SENT--}</span>";
                                        break;
 
                                default:
                                        DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Unsupported module %s detected.", $mod));
-                                       $content = "<span class=\"member_failed\">".UNKNOWN_MODULE."</span>";
+                                       $content = "<span class=\"member_failed\">{--UNKNOWN_MODULE--}</span>";
                                        break;
                                } // END - switch
                        } else {
@@ -859,14 +860,14 @@ function SEND_MODE_MAILS($mod, $modes) {
        // Send email to user if required
        if ((!empty($sub_mem)) && (!empty($msg))) {
                // Send member mail
-               SEND_EMAIL($DATA[7], $sub_mem, $msg);
+               sendEmail($DATA[7], $sub_mem, $msg);
        } // END - if
 
        // Send only if no other error has occured
        if (empty($content)) {
                if ((!empty($sub_adm)) && (!empty($msg_admin))) {
                        // Send admin mail
-                       SEND_ADMIN_NOTIFICATION($sub_adm, $msg_admin, $content, getUserId());
+                       sendAdminNotification($sub_adm, $msg_admin, $content, getUserId());
                } elseif (getConfig('admin_notify') == 'Y') {
                        // Cannot send mails to admin!
                        $content = getMessage('CANNOT_SEND_ADMIN_MAILS');
@@ -890,14 +891,14 @@ function countModuleHit($mod) {
 }
 
 // Get action value from mode (admin/guest/member) and what-value
-function GET_ACTION ($mode, &$wht) {
+function getModeAction ($mode, &$wht) {
        // Init status
        $ret = '';
 
-       //* DEBUG: */ echo __LINE__."=".$mode."/".$wht."/".$GLOBALS['action']."=<br />";
+       //* DEBUG: */ echo __LINE__.'='.$mode.'/'.$wht.'/'.$GLOBALS['action']."=<br />";
        if ((empty($wht)) && ($mode != 'admin')) {
                $wht = "welcome";
-               if (getConfig('index_home') != "") $wht = getConfig('index_home');
+               if (getConfig('index_home') != '') $wht = getConfig('index_home');
        } // END - if
 
        if ($mode == 'admin') {
@@ -939,12 +940,12 @@ function GET_ACTION ($mode, &$wht) {
 
                // Free memory
                SQL_FREERESULT($result);
-       } elseif ((GET_EXT_VERSION('sql_patches') == "") && ($mode != 'admin')) {
+       } elseif ((GET_EXT_VERSION('sql_patches') == '') && ($mode != 'admin')) {
                // No sql_patches installed, but maybe we need to register an admin?
                if (isAdminRegistered()) {
                        // Redirect
                        // @TODO Why does this lead into an endless loop but we still need it???
-                       // @TODO Commented out LOAD_URL('admin.php');
+                       // @TODO Commented out redirectToUrl('admin.php');
                } // END - if
        }
 
@@ -953,7 +954,7 @@ function GET_ACTION ($mode, &$wht) {
 }
 
 // Get category name back
-function GET_CATEGORY ($cid) {
+function getCategory ($cid) {
        // Default is not found
        $ret = getMessage('_CATEGORY_404');
 
@@ -963,7 +964,7 @@ function GET_CATEGORY ($cid) {
                $ret = getMessage('_CATEGORY_NONE');
        } elseif ($cid > 0) {
                // Lookup the category in database
-               $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE `id`=%s LIMIT 1",
                        array(bigintval($cid)), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Category found... :-)
@@ -979,12 +980,12 @@ function GET_CATEGORY ($cid) {
 }
 
 // Get a string of "mail title" and price back
-function GET_PAYMENT ($pid, $full=false) {
+function getPaymentTitlePrice ($pid, $full=false) {
        // Default is not found
        $ret = getMessage('_PAYMENT_404');
 
        // Load payment data
-       $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT mail_title, price FROM `{!_MYSQL_PREFIX!}_payments` WHERE `id`=%s LIMIT 1",
                array(bigintval($pid)), __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 1) {
                // Payment type found... :-)
@@ -994,7 +995,7 @@ function GET_PAYMENT ($pid, $full=false) {
                } else {
                        // Return title and price
                        list($t, $p) = SQL_FETCHROW($result);
-                       $ret = $t.' / '.TRANSLATE_COMMA($p).' {!POINTS!}';
+                       $ret = $t.' / '.translateComma($p).' {!POINTS!}';
                }
        }
 
@@ -1006,20 +1007,29 @@ function GET_PAYMENT ($pid, $full=false) {
 }
 
 // Get (basicly) the price of given payment id
-function GET_PAY_POINTS ($pid, $lookFor = 'price') {
+function getPaymentPoints ($pid, $lookFor = 'price') {
+       // Default value...
        $ret = '-1';
-       $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE id=%s LIMIT 1",
+
+       // Search for it in database
+       $result = SQL_QUERY_ESC("SELECT %s FROM `{!_MYSQL_PREFIX!}_payments` WHERE `id`=%s LIMIT 1",
                array($lookFor, $pid), __FUNCTION__, __LINE__);
+
+       // Is the entry there?
        if (SQL_NUMROWS($result) == 1) {
                // Payment type found... :-)
                list($ret) = SQL_FETCHROW($result);
-               SQL_FREERESULT($result);
-       }
+       } // END - if
+
+       // Free result
+       SQL_FREERESULT($result);
+
+       // Return value
        return $ret;
 }
 
 // Remove a receiver's ID from $receivers and add a link for him to confirm
-function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id='', $bonus=false) {
+function removeReceiver (&$receivers, $key, $uid, $pool_id, $stats_id='', $bonus=false) {
        // Default is not removed
        $ret = 'failed';
 
@@ -1035,7 +1045,7 @@ function REMOVE_RECEIVER (&$receivers, $key, $uid, $pool_id, $stats_id='', $bonu
                        if ($bonus) { $type = 'BONUS'; $rowName = 'bonus_id'; }
 
                        // Try to look the entry up
-                       $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND userid=%s AND link_type='%s' LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE %s='%s' AND `userid`=%s AND link_type='%s' LIMIT 1",
                                array($rowName, $stats_id, bigintval($uid), $type), __FUNCTION__, __LINE__);
 
                        // Was it *not* found?
@@ -1104,7 +1114,7 @@ function GET_TOTAL_DATA ($search, $tableName, $lookFor = 'id', $whereStatement =
        return $ret;
 }
 // Getter fro ref level percents
-function GET_REF_LEVEL_PERCENTS ($level) {
+function getReferalLevelPercents ($level) {
        // Default is zero
        $per = 0;
 
@@ -1137,6 +1147,7 @@ function GET_REF_LEVEL_PERCENTS ($level) {
        // Return percent
        return $per;
 }
+
 /**
  *
  * Dynamic referal system, can also send mails!
@@ -1147,10 +1158,10 @@ function GET_REF_LEVEL_PERCENTS ($level) {
  * send_notify = shall I send the referal an email or not?
  * rid         = inc/modules/guest/what-confirm.php need this (DEPRECATED???)
  * locked      = Shall I pay it to normal (false) or locked (true) points ammount?
- * add_mode    = Add points only to $uid or also refs? (WARNING! Changing "ref" to "direct"
+ * add_mode    = Add points only to $uid or also refs? (WARNING! Changing 'ref' to 'direct'
  *               for default value will cause no referal will get points ever!!!)
  */
-function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid='0', $locked=false, $add_mode='ref') {
+function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify = false, $rid = '0', $locked = false, $add_mode = 'ref') {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        global $DATA;
 
@@ -1198,7 +1209,7 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                $GLOBALS['cache_array']['add_uid'][$ref] = $uid;
 
                // Get percents
-               $per = GET_REF_LEVEL_PERCENTS($GLOBALS['ref_level']);
+               $per = getReferalLevelPercents($GLOBALS['ref_level']);
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},points={$points},depth={$GLOBALS['ref_level']},per={$per},mode={$add_mode}<br />\n";
 
                // Some percents found?
@@ -1246,22 +1257,22 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
                                // Load email template
                                $msg = LOAD_EMAIL_TEMPLATE('confirm-referal', $content, bigintval($uid));
 
-                               SEND_EMAIL($email, THANX_REFERRAL_ONE, $msg);
-                       } elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == "direct") && (!defined('__POINTS_VALUE'))) {
+                               sendEmail($email, THANX_REFERRAL_ONE, $msg);
+                       } elseif (($send_notify) && ($ref == 0) && (!$locked) && ($add_mode == 'direct') && (!defined('__POINTS_VALUE'))) {
                                // Direct payment shall be notified about
                                define('__POINTS_VALUE', $ref_points);
 
                                // Prepare content
                                $content = array(
                                        'text'   => getMessage('REASON_DIRECT_PAYMENT'),
-                                       'points' => TRANSLATE_COMMA($ref_points)
+                                       'points' => translateComma($ref_points)
                                );
 
                                // Load message
                                $msg = LOAD_EMAIL_TEMPLATE('add-points', $content, $uid);
 
                                // And sent it away
-                               SEND_EMAIL($email, getMessage('SUBJECT_DIRECT_PAYMENT'), $msg);
+                               sendEmail($email, getMessage('SUBJECT_DIRECT_PAYMENT'), $msg);
                                if (!REQUEST_ISSET_GET(('mid'))) LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED'));
                        }
 
@@ -1278,8 +1289,14 @@ function ADD_POINTS_REFSYSTEM ($subject, $uid, $points, $send_notify=false, $rid
        SQL_FREERESULT($result_user);
        //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
 }
-//
-function UPDATE_REF_COUNTER ($uid) {
+
+// Wrapper function for ADD_POINTS_REFSYSTEM()
+function ADD_POINTS_REFSYSTEM_DIRECT ($subject, $uid, $points) {
+       return ADD_POINTS_REFSYSTEM($subject, $uid, $points, false, 0, false, 'direct');
+}
+
+// Updates the referal counter
+function updateReferalCounter ($uid) {
        // Make it sure referal level zero (member him-/herself) is at least selected
        if (empty($GLOBALS['cache_array']['ref_level'][$uid])) $GLOBALS['cache_array']['ref_level'][$uid] = 1;
        //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):uid={$uid},level={$GLOBALS['cache_array']['ref_level'][$uid]}<br />\n";
@@ -1312,7 +1329,7 @@ function UPDATE_REF_COUNTER ($uid) {
        if (($ref > 0) && ($ref != $uid)) {
                // Move to next referal level and count his counter one up!
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - ADVANCE!<br />\n";
-               $GLOBALS['cache_array']['ref_level'][$uid]++; UPDATE_REF_COUNTER($ref);
+               $GLOBALS['cache_array']['ref_level'][$uid]++; updateReferalCounter($ref);
        } elseif ((($ref == $uid) || ($ref == 0)) && (GET_EXT_VERSION('cache') >= '0.1.2')) {
                // Remove cache here
                //* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):ref={$ref} - CACHE!<br />\n";
@@ -1324,7 +1341,7 @@ function UPDATE_REF_COUNTER ($uid) {
 
        // Handle refback here if extension is installed
        if (EXT_IS_ACTIVE('refback')) {
-               UPDATE_REFBACK_table($uid);
+               updateRefbackTable($uid);
        } // END - if
 }
 
@@ -1335,7 +1352,7 @@ function SEND_ADMIN_EMAILS ($subj, $msg) {
        $result = SQL_QUERY("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` ORDER BY `id` ASC", __FUNCTION__, __LINE__);
        while ($content = SQL_FETCHARRAY($result)) {
                // Send the email out
-               SEND_EMAIL($content['email'], $subj, $msg);
+               sendEmail($content['email'], $subj, $msg);
        } // END - if
 
        // Free result
@@ -1358,7 +1375,7 @@ function GET_ADMIN_ID ($login) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_admins` WHERE login='%s' LIMIT 1",
                        array($login), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        list($ret) = SQL_FETCHROW($result);
@@ -1371,9 +1388,9 @@ function GET_ADMIN_ID ($login) {
 }
 
 // "Getter" for current admin id
-function GET_CURRENT_ADMIN_ID () {
+function getCurrentAdminId () {
        // Get the admin login from session
-       $adminLogin = get_session('admin_login');
+       $adminLogin = getSession('admin_login');
 
        // "Solve" it into an id
        $adminId = GET_ADMIN_ID($adminLogin);
@@ -1395,7 +1412,7 @@ function GET_ADMIN_HASH ($aid) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT password FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                 array($aid), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Fetch data
@@ -1410,8 +1427,9 @@ function GET_ADMIN_HASH ($aid) {
        }
        return $ret;
 }
-//
-function GET_ADMIN_LOGIN ($aid) {
+
+// "Getter" for admin login
+function getAdminLogin ($aid) {
        // By default a non-existent login is returned (other functions react on this!)
        $ret = '***';
 
@@ -1423,7 +1441,7 @@ function GET_ADMIN_LOGIN ($aid) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result = SQL_QUERY_ESC("SELECT login FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT login FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array(bigintval($aid)), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Fetch data
@@ -1438,8 +1456,9 @@ function GET_ADMIN_LOGIN ($aid) {
        }
        return $ret;
 }
+
 // Get email address of admin id
-function GET_ADMIN_EMAIL ($aid) {
+function getAdminEmail ($aid) {
        // By default an invalid emails is returned
        $ret = '***';
 
@@ -1451,7 +1470,7 @@ function GET_ADMIN_EMAIL ($aid) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result_aid = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result_aid = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array(bigintval($aid)), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result_aid) == 1) {
                        // Get data
@@ -1468,8 +1487,9 @@ function GET_ADMIN_EMAIL ($aid) {
        // Return email
        return $ret;
 }
+
 // Get default ACL  of admin id
-function GET_ADMIN_DEFAULT_ACL ($aid) {
+function getAdminDefaultAcl ($aid) {
        // By default an invalid ACL value is returned
        $ret = '***';
 
@@ -1485,7 +1505,7 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
                incrementConfigEntry('cache_hits');
        } elseif (!EXT_IS_ACTIVE('cache')) {
                // Load from database
-               $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM `{!_MYSQL_PREFIX!}_admins` WHERE id=%s LIMIT 1",
+               $result_aid = SQL_QUERY_ESC("SELECT default_acl FROM `{!_MYSQL_PREFIX!}_admins` WHERE `id`=%s LIMIT 1",
                        array(bigintval($aid)), __FUNCTION__, __LINE__);
                if (SQL_NUMROWS($result_aid) == 1) {
                        // Fetch data
@@ -1502,8 +1522,9 @@ function GET_ADMIN_DEFAULT_ACL ($aid) {
        // Return email
        return $ret;
 }
-//
-function ADD_OPTION_LINES ($table, $id, $name, $default='', $special='', $where='') {
+
+// Generates an option list from various parameters
+function generateOptionList ($table, $id, $name, $default='', $special='', $where='') {
        $ret = '';
        if ($table == '/ARRAY/') {
                // Selection from array
@@ -1518,7 +1539,7 @@ function ADD_OPTION_LINES ($table, $id, $name, $default='', $special='', $where=
        } else {
                // Data from database
                $SPEC = ', '.$id;
-               if (!empty($special)) $SPEC = ', '.$special;
+               if (!empty($special)) $SPEC = ', ' . $special;
                $ORDER = $name.$SPEC;
                if ($table == 'country') $ORDER = $special;
                $result = SQL_QUERY_ESC("SELECT %s, %s".$SPEC." FROM `{!_MYSQL_PREFIX!}_%s` ".$where." ORDER BY %s",
@@ -1560,8 +1581,8 @@ function activateExchange () {
                // Activate System
                SET_SQLS(array(
                        "UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', `hidden`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1",
-                       "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what='order' OR `what`='unconfirmed' LIMIT 2",
-                       "UPDATE `{!_MYSQL_PREFIX!}_config` SET activate_xchange='0' WHERE config=0 LIMIT 1"
+                       "UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2",
+                       "UPDATE `{!_MYSQL_PREFIX!}_config` SET `activate_xchange`=0 WHERE `config`=0 LIMIT 1"
                ));
 
                // Run SQLs
@@ -1574,8 +1595,8 @@ function activateExchange () {
        } // END - if
 }
 
-//
-function DELETE_USER_ACCOUNT ($uid, $reason) {
+// Deletes a user account with given reason
+function deleteUserAccount ($uid, $reason) {
        $points = 0;
        $result = SQL_QUERY_ESC("SELECT (SUM(p.points) - d.used_points) AS points
 FROM `{!_MYSQL_PREFIX!}_user_points` AS p
@@ -1612,14 +1633,14 @@ WHERE p.userid=%s", array(bigintval($uid)), __FUNCTION__, __LINE__);
 
        // Now a mail to the user and that's all...
        $msg = LOAD_EMAIL_TEMPLATE("del-user", array('text' => $reason), $uid);
-       SEND_EMAIL($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg);
+       sendEmail($uid, getMessage('ADMIN_DEL_ACCOUNT'), $msg);
 
        // Ok, delete the account!
        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array(bigintval($uid)), __FUNCTION__, __LINE__);
 }
 
-//
-function META_DESCRIPTION ($mod, $wht) {
+// Generates meta description for given module and 'what' value
+function generateMetaDescriptionCode ($mod, $wht) {
        // Exclude admin and member's area
        if (($mod != 'admin') && ($mod != 'login')) {
                // Construct dynamic description
@@ -1632,7 +1653,8 @@ function META_DESCRIPTION ($mod, $wht) {
        // Remove depth
        unset($GLOBALS['ref_level']);
 }
-//
+
+// Adds points to the jackpot
 function ADD_JACKPOT($points) {
        $result = SQL_QUERY("SELECT points FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE ok='ok' LIMIT 1", __FUNCTION__, __LINE__);
        if (SQL_NUMROWS($result) == 0) {
@@ -1647,7 +1669,8 @@ function ADD_JACKPOT($points) {
                        array($points), __FUNCTION__, __LINE__);
        }
 }
-//
+
+// Subtracts points from the jackpot
 function SUB_JACKPOT($points) {
        // First failed
        $ret = '-1';
@@ -1674,11 +1697,11 @@ function SUB_JACKPOT($points) {
 
 // Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
 function IS_DEMO () {
-       return ((EXT_IS_ACTIVE('demo')) && (get_session('admin_login') == 'demo'));
+       return ((EXT_IS_ACTIVE('demo')) && (getSession('admin_login') == 'demo'));
 }
 
 // Gets the matching what name from module
-function GET_WHAT ($modCheck) {
+function getWhatFromModule ($modCheck) {
        // Is the request element set?
        if (REQUEST_ISSET_GET('what')) {
                // Then return this!
@@ -1686,7 +1709,7 @@ function GET_WHAT ($modCheck) {
        } // END - if
 
        $wht = '';
-       //* DEBUG: */ echo __LINE__."!".$modCheck."!<br />\n";
+       //* DEBUG: */ echo __LINE__.'!'.$modCheck."!<br />\n";
        switch ($modCheck)
        {
        case 'admin':
@@ -1728,7 +1751,7 @@ function SUB_POINTS ($subject, $uid, $points) {
 }
 
 // Update config entries
-function UPDATE_CONFIG ($entries, $values, $updateMode='') {
+function updateConfiguration ($entries, $values, $updateMode='') {
        // Do not update config in CSS mode
        if (($GLOBALS['output_mode'] == '1') || ($GLOBALS['output_mode'] == -1)) {
                return;
@@ -1789,6 +1812,7 @@ function UPDATE_CONFIG ($entries, $values, $updateMode='') {
 }
 
 // Prepares an SQL statement part for HTML mail and/or holiday depency
+// @TODO Can this be rewritten to a filter?
 function PREPARE_SQL_HTML_HOLIDAY ($mode) {
        // Exclude no users by default
        $MORE = '';
@@ -1805,7 +1829,7 @@ function PREPARE_SQL_HTML_HOLIDAY ($mode) {
 }
 
 // "Getter" for total available receivers
-function GET_TOTAL_RECEIVERS ($mode='normal') {
+function getTotalReceivers ($mode='normal') {
        // Query database
        $result_all = SQL_QUERY("SELECT userid
 FROM `{!_MYSQL_PREFIX!}_user_data`
@@ -1823,7 +1847,7 @@ WHERE `status`='CONFIRMED' AND receive_mails > 0 ".PREPARE_SQL_HTML_HOLIDAY($mod
 }
 
 // Returns HTML code with an "<option> list" of all categories
-function ADD_CATEGORY_OPTIONS ($mode) {
+function generateCategoryOptionsList ($mode) {
        // Prepare WHERE statement
        $whereStatement = " WHERE `visible`='Y'";
        if (IS_ADMIN()) $whereStatement = '';
@@ -1889,7 +1913,7 @@ WHERE userid=%s AND `status`='CONFIRMED' AND receive_mails > 0".PREPARE_SQL_HTML
 }
 
 // Add bonus mail to queue
-function ADD_BONUS_MAIL_TO_QUEUE ($subject, $text, $receiverList, $points, $seconds, $url, $cat, $mode='normal', $receiver=0) {
+function addBonusMailToQueue ($subject, $text, $receiverList, $points, $seconds, $url, $cat, $mode='normal', $receiver=0) {
        // Is admin or bonus extension there?
        if (!IS_ADMIN()) {
                // Abort here
@@ -1900,7 +1924,7 @@ function ADD_BONUS_MAIL_TO_QUEUE ($subject, $text, $receiverList, $points, $seco
        }
 
        // Calculcate target sent
-       $target = SELECTION_COUNT(explode(';', $receiverList));
+       $target = countSelection(explode(';', $receiverList));
 
        // Receiver is zero?
        if ($receiver == 0) {
@@ -1952,7 +1976,7 @@ VALUES ('%s','%s','%s','%s','%s','NEW', UNIX_TIMESTAMP(),'%s','%s','%s','%s')",
 }
 
 // Generate a receiver list for given category and maximum receivers
-function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") {
+function generateReceiverList ($cat, $receiver, $mode = '') {
        // Init variables
        $CAT_TABS     = "%s";
        $CAT_WHERE    = '';
@@ -1966,7 +1990,7 @@ function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") {
        // Is the receiver zero and mode set?
        if (($receiver == 0) && (!empty($mode))) {
                // Auto-fix receiver maximum
-               $receiver = GET_TOTAL_RECEIVERS($mode);
+               $receiver = getTotalReceivers($mode);
        } // END - if
 
        // Category given?
@@ -2012,7 +2036,7 @@ function GENERATE_RECEIVER_LIST ($cat, $receiver, $mode="") {
 }
 
 // Get timestamp for given stats type and data
-function USER_STATS_GET_TIMESTAMP ($type, $data, $uid = 0) {
+function getTimestampFromUserStats ($type, $data, $uid = 0) {
        // Default timestamp is zero
        $stamp = 0;
 
@@ -2048,7 +2072,7 @@ LIMIT 1",
 }
 
 // Inserts user stats
-function USER_STATS_INSERT_RECORD ($uid, $type, $data) {
+function insertUserStatsRecord ($uid, $type, $data) {
        // Is the extension installed and updated?
        if ((!EXT_IS_ACTIVE('sql_patches')) || (EXT_VERSION_IS_OLDER('sql_patches', '0.5.6'))) {
                // Return zero here
@@ -2056,7 +2080,7 @@ function USER_STATS_INSERT_RECORD ($uid, $type, $data) {
        } // END - if
 
        // Does it exist?
-       if ((!USER_STATS_GET_TIMESTAMP($type, $data, $uid)) && (!is_array($data))) {
+       if ((!getTimestampFromUserStats($type, $data, $uid)) && (!is_array($data))) {
                // Then insert it!
                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
                        array(bigintval($uid), $type, $data), __FUNCTION__, __LINE__);
@@ -2067,7 +2091,7 @@ function USER_STATS_INSERT_RECORD ($uid, $type, $data) {
 }
 
 // "Getter" for array for user refs and points in given level
-function GET_USER_REF_POINTS ($uid, $level) {
+function getUserReferalPoints ($uid, $level) {
        //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
        // Default is no refs and no nickname
        $add = '';
@@ -2109,12 +2133,12 @@ ORDER BY ur.refid ASC",
                        } // END - if
 
                        // Activity is 'active' by default because if autopurge is not installed
-                       $row['activity'] = MEMBER_ACTIVITY_ACTIVE;
+                       $row['activity'] = getMessage('MEMBER_ACTIVITY_ACTIVE');
 
                        // Is autopurge installed and the user inactive?
                        if ((EXT_IS_ACTIVE('autopurge')) && ((time() - getConfig('ap_inactive_since')) >= $row['last_online']))  {
                                // Inactive user!
-                               $row['activity'] = MEMBER_ACTIVITY_INACTIVE;
+                               $row['activity'] = getMessage('MEMBER_ACTIVITY_INACTIVE');
                        } // END - if
 
                        // Remove some entries
@@ -2135,8 +2159,8 @@ ORDER BY ur.refid ASC",
        return $refs;
 }
 
-// Recuced the amount of received emails for the receipients for given email
-function REDUCED_RECIPIENT_RECEIVED_MAILS ($column, $id, $count) {
+// Recuce the amount of received emails for the receipients for given email
+function reduceRecipientReceivedMails ($column, $id, $count) {
        // Search for mail in database
        $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `%s`=%s ORDER BY `userid` ASC LIMIT %s",
                array($column, bigintval($id), $count), __FUNCTION__, __LINE__);
index fd799e0e3775362c9d918a0301117bd9840a505f..ace6c372964da7ff986b32b0ff7d95c9602d9142 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 // Check for patch level differences between databases and current hard-coded
 if ((constant('CURR_SVN_REVISION') > getConfig('patch_level')) || (getConfig('patch_level') == "CURR_SVN_REVISION") || (getConfig('patch_ctime') == "UNIX_TIMES")) {
        // Update database and CONFIG array
-       UPDATE_CONFIG(array("patch_level", "patch_ctime"), array(constant('CURR_SVN_REVISION'), "UNIX_TIMESTAMP()"));
+       updateConfiguration(array("patch_level", "patch_ctime"), array(constant('CURR_SVN_REVISION'), "UNIX_TIMESTAMP()"));
        setConfigEntry('patch_level', constant('CURR_SVN_REVISION'));
        setConfigEntry('patch_ctime', time());
 } // END - if
index dc7da9a39475335c4002f6652a7f8d9ce394a704..30eb9f4e06c1c933d12d452854b4be94cdd1468f 100644 (file)
@@ -53,7 +53,7 @@ $GLOBALS['pool_cnt'] = 0;
 
 // Init & set the include pool
 INIT_INC_POOL();
-SET_INC_POOL(GET_DIR_AS_ARRAY('inc/pool/', 'pool-'));
+SET_INC_POOL(getArrayFromDirectory('inc/pool/', 'pool-'));
 
 // Run the filter
 runFilterChain('load_includes');
index 579b138ad5f8fa202d7f7e8b47cec44847000f77..f2259d1bfe8d8fb1750b107d2f0c15c7f932f7c3 100644 (file)
@@ -71,7 +71,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        $DATA['url'] = COMPILE_CODE($DATA['url']);
 
                        // Message is active in queue
-                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='QUEUE' WHERE id=%s LIMIT 1",
+                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='QUEUE' WHERE `id`=%s LIMIT 1",
                                array(bigintval($DATA['id'])), __FILE__, __LINE__);
 
                        // "Explode" all receivers into an array
@@ -83,7 +83,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                $RECEIVERS = array($DATA['receivers']);
                        } else {
                                // No users left
-                               $RECEIVERS = array("0");
+                               $RECEIVERS = array('0');
                        }
                        $dummy = $RECEIVERS;
 
@@ -91,7 +91,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        // We can now send mails to them...
                        foreach ($RECEIVERS as $key => $uid) {
                                // Load personal data
-                               //* DEBUG: */ echo "*L:".__LINE__."/".$uid."*<br />";
+                               //* DEBUG: */ echo "*L:".__LINE__.'/'.$uid."*<br />";
                                $result_user = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
                                        array(bigintval($uid)), __FILE__, __LINE__);
 
@@ -102,7 +102,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                        //* DEBUG: */ echo "OK!/L:".__LINE__."<br />";
 
                                        // Mark this user as "spammed" ;-) And place a line for him...
-                                       if (REMOVE_RECEIVER($dummy, $key, $uid, $DATA['id'], $DATA['id'], true) == "done") {
+                                       if (removeReceiver($dummy, $key, $uid, $DATA['id'], $DATA['id'], true) == 'done') {
                                                // Replace text variables
                                                foreach ($GLOBALS['replacer'] as $key => $value) {
                                                        if (isset($DATA[$key])) $DATA['text'] = str_replace($value, $DATA[$key], $DATA['text']);
@@ -112,9 +112,9 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                $content = array(
                                                        'id'       => $DATA['id'],
                                                        'url'      => $DATA['url'],
-                                                       'time'     => CREATE_FANCY_TIME($DATA['time']),
-                                                       'points'   => TRANSLATE_COMMA($DATA['points']),
-                                                       'category' => GET_CATEGORY($DATA['cat_id']),
+                                                       'time'     => createFancyTime($DATA['time']),
+                                                       'points'   => translateComma($DATA['points']),
+                                                       'category' => getCategory($DATA['cat_id']),
                                                        'text'     => $DATA['text']
                                                );
 
@@ -124,10 +124,10 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                // Send mail away
                                                if (isset($DATA['html_msg'])) {
                                                        // Send HTML?
-                                                       SEND_EMAIL($email, $DATA['subject'], $mailText, $DATA['html_msg']);
+                                                       sendEmail($email, $DATA['subject'], $mailText, $DATA['html_msg']);
                                                } else {
                                                        // No HTML mail!
-                                                       SEND_EMAIL($email, $DATA['subject'], $mailText);
+                                                       sendEmail($email, $DATA['subject'], $mailText);
                                                }
 
                                                // Count one up and remove entry from dummy array
@@ -140,7 +140,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                                } // END - if
 
                                                // Do we have send maximum mails?
-                                               if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (SELECTION_COUNT($dummy) == 0)) {
+                                               if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
                                                        // Yes, we have
                                                        //* DEBUG: */ echo "*EXIT/L:".__LINE__."<br />";
                                                        break;
@@ -157,15 +157,15 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                // Update entry (or add missing
                                $P = $GLOBALS['pool_cnt'];
                                if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
-                               //* DEBUG: */ echo "+MEDIA/L:".__LINE__."/".$P."+<br />";
+                               //* DEBUG: */ echo "+MEDIA/L:".__LINE__.'/'.$P."+<br />";
                                MEDIA_UPDATE_ENTRY(array("total_send", "bonus_send"), 'add', $P);
                        } // END - if
 
                        // Close sending system
-                       //* DEBUG: */ echo "-L:".__LINE__."/".SELECTION_COUNT($dummy)."-<br />";
-                       if (SELECTION_COUNT($dummy) == 0) {
+                       //* DEBUG: */ echo "-L:".__LINE__.'/'.countSelection($dummy)."-<br />";
+                       if (countSelection($dummy) == 0) {
                                // Queue reached!
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
                                        array(bigintval($DATA['id'])), __FILE__, __LINE__);
                                //* DEBUG: */ echo "*L:".__LINE__."*<br />";
 
@@ -177,8 +177,8 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                                } // END - if
                        } elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
                                // Update bonus pool
-                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET data_type='NEW', target_send=%s, receivers='%s' WHERE id=%s LIMIT 1",
-                                       array(SELECTION_COUNT($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
+                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET `data_type`='NEW', `target_send`=%s, `receivers`='%s' WHERE `id`=%s LIMIT 1",
+                                       array(countSelection($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
                                //* DEBUG: */ echo "*L:".__LINE__."<pre>";
                                //* DEBUG: */ print_r($dummy);
                                //* DEBUG: */ echo "</pre>\n!!!<br />";
index afe9db0c1d17283ebc3181486e46bf1ee89e5860..1be90b21c5237e05f7c1b614d8169a339487eaeb 100644 (file)
@@ -62,16 +62,16 @@ if (EXT_IS_ACTIVE('html_mail')) {
 }
 
 // Reset variables
-$cnt2 = 0; $lastSentId = 0; $cnt_back = array("0"); $pointsBack = array("0");
+$cnt2 = 0; $lastSentId = 0; $cnt_back = array('0'); $pointsBack = array('0');
 if (SQL_NUMROWS($result_main) > 0) {
        // Parse all mails
        while ($DATA = SQL_FETCHROW($result_main)) {
                // Set mail order as 'active'. That means it will be sent out
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='ACTIVE' WHERE id=%s AND data_type='NEW' LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='ACTIVE' WHERE `id`=%s AND data_type='NEW' LIMIT 1",
                        array($DATA[0]), __FILE__, __LINE__);
 
                // Check fetched data for HTML
-               $HTML = $DATA[10]; if ($HTML == $DATA[0]) $HTML = "N";
+               $HTML = $DATA[10]; if ($HTML == $DATA[0]) $HTML = 'N';
 
                // Compile URL and subject line
                $DATA[7] = COMPILE_CODE($DATA[7]);
@@ -87,7 +87,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                $RECEIVERS = array($DATA[4]);
                        } else {
                                // No users left
-                               $RECEIVERS = array("0");
+                               $RECEIVERS = array('0');
                        }
                        $dummy = $RECEIVERS;
 
@@ -99,7 +99,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        array(bigintval($uid)), __FILE__, __LINE__);
 
                                // Is his data available?
-                               //* DEBUG: */ echo "*L:".__LINE__."/".SQL_NUMROWS($result_user)."*<br />";
+                               //* DEBUG: */ echo "*L:".__LINE__.'/'.SQL_NUMROWS($result_user)."*<br />";
                                if (SQL_NUMROWS($result_user) == 1) {
                                        // The final receiver does exists so we can continue...
                                        list($gender, $sname, $fname, $email) = SQL_FETCHROW($result_user);
@@ -108,36 +108,36 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        SQL_FREERESULT($result_user);
 
                                        // Do we have a stats entry?
-                                       $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+                                       $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1",
                                                array($DATA[0], $DATA[1], $DATA[6]), __FILE__, __LINE__);
 
                                        // If there's no stats entry add it!
-                                       //* DEBUG: */ echo "!L:".__LINE__."/".SQL_NUMROWS($result_stats)."!<br />";
+                                       //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
                                        if (SQL_NUMROWS($result_stats) == 0) {
                                                // No entry was found, so we add him!
                                                SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_stats` (pool_id , userid, cat_id, payment_id, subject, url , max_rec , timestamp_ordered, timestamp_sstart) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s' , UNIX_TIMESTAMP())",
                                                        array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[9]), bigintval($DATA[5]), $DATA[2], $DATA[7], $DATA[8], bigintval($DATA[6])), __FILE__, __LINE__);
 
                                                // Receive it's ID for the links table
-                                               $result_stats = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND userid=%s AND timestamp_ordered='%s' LIMIT 1",
+                                               $result_stats = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE pool_id=%s AND `userid`=%s AND timestamp_ordered='%s' LIMIT 1",
                                                        array(bigintval($DATA[0]), bigintval($DATA[1]), bigintval($DATA[6])), __FILE__, __LINE__);
                                        } // END - if
 
-                                       //* DEBUG: */ echo "!L:".__LINE__."/".SQL_NUMROWS($result_stats)."!<br />";
+                                       //* DEBUG: */ echo "!L:".__LINE__.'/'.SQL_NUMROWS($result_stats)."!<br />";
                                        if (SQL_NUMROWS($result_stats) == 1) {
                                                // We got one!
                                                list($stats_id) = SQL_FETCHROW($result_stats);
 
                                                // Mark this user as "spammed" ;-) And place a line for him...
-                                               //* DEBUG: */ echo "?L:".__LINE__."/".$dummy."/".$key."/".$uid."(".$DATA[1].")/".$DATA[0]."/".$stats_id."?<br />";
-                                               switch (REMOVE_RECEIVER($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
+                                               //* DEBUG: */ echo "?L:".__LINE__.'/'.$dummy.'/'.$key.'/'.$uid."(".$DATA[1].")/".$DATA[0].'/'.$stats_id."?<br />";
+                                               switch (removeReceiver($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
                                                {
-                                               case "done":
+                                               case 'done':
                                                        // Prepare the mail
                                                        $DATA[11] = bigintval($stats_id);
                                                        $DATA[12] = $sname;
                                                        $DATA[13] = $fname;
-                                                       $DATA[14] = TRANSLATE_GENDER($gender);
+                                                       $DATA[14] = translateGender($gender);
 
                                                        // Replace text variables
                                                        foreach ($GLOBALS['replacer'] as $key => $value) {
@@ -149,9 +149,9 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                                'id'         => $DATA[11],
                                                                'url'        => $DATA[7],
                                                                'sender_uid' => $DATA[1],
-                                                               'category'   => GET_CATEGORY($DATA[9]),
-                                                               'time'       => CREATE_FANCY_TIME(GET_PAY_POINTS($DATA[5], "time")),
-                                                               'points'     => TRANSLATE_COMMA(GET_PAY_POINTS($DATA[5], "payment")),
+                                                               'category'   => getCategory($DATA[9]),
+                                                               'time'       => createFancyTime(getPaymentPoints($DATA[5], "time")),
+                                                               'points'     => translateComma(getPaymentPoints($DATA[5], "payment")),
                                                                'text'       => $DATA[3]
                                                        );
 
@@ -159,7 +159,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        $mailText = LOAD_EMAIL_TEMPLATE("normal-mail", $content, bigintval($uid));
 
                                                        // Send mail away
-                                                       SEND_EMAIL($email, $DATA[2], $mailText, $HTML);
+                                                       sendEmail($email, $DATA[2], $mailText, $HTML);
 
                                                        // Count sent mails...
                                                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
@@ -180,31 +180,31 @@ if (SQL_NUMROWS($result_main) > 0) {
 
                                                        // And count up the mail
                                                        $GLOBALS['pool_cnt']++;
-                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."*<br />";
+                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."*<br />";
                                                        break;
 
                                                case "already":
                                                        // Entry already found, but we still count one up!
                                                        $GLOBALS['pool_cnt']++;
-                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."<br />";
+                                                       //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$GLOBALS['pool_cnt']."<br />";
                                                        break;
                                                }
                                        }
 
                                        // Do we have reached the maximum to send mails? || (getConfig('max_send') >= $GLOBALS['pool_cnt'])
-                                       //* DEBUG: */ echo "*L:".__LINE__."/".$GLOBALS['pool_cnt'].">=".$DATA[8]."/".getConfig('max_send').">=".$GLOBALS['pool_cnt']."/".$lastSentId."!=".$DATA[0]."*<br />";
+                                       //* DEBUG: */ echo "*L:".__LINE__.'/'.$GLOBALS['pool_cnt'].">=".$DATA[8].'/'.getConfig('max_send').">=".$GLOBALS['pool_cnt'].'/'.$lastSentId."!=".$DATA[0]."*<br />";
                                        if ((($GLOBALS['pool_cnt'] >= $DATA[8])) && ($lastSentId != $DATA[0])) {
                                                // Prepare content
                                                $content = array(
                                                        'sender_uid' => $DATA[1],
-                                                       'category'   => GET_CATEGORY($DATA[9]),
+                                                       'category'   => getCategory($DATA[9]),
                                                        'text'       => $DATA[3],
                                                        'url'        => $DATA[7],
-                                                       'expiration' => CREATE_FANCY_TIME(GET_PAY_POINTS($DATA[5], "time"))
+                                                       'expiration' => createFancyTime(getPaymentPoints($DATA[5], "time"))
                                                );
 
                                                // Yes we do, so we notify admin and sender about fully sent mail!
-                                               SEND_ADMIN_NOTIFICATION(ADMIN_SUBJ_SEND_DONE, "done-admin", $content, $uid);
+                                               sendAdminNotification(ADMIN_SUBJ_SEND_DONE, "done-admin", $content, $uid);
 
                                                // Get sender's data
                                                $result_sender = SQL_QUERY_ESC("SELECT surname, family, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
@@ -219,18 +219,18 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        $mailText = LOAD_EMAIL_TEMPLATE("done-member", $content, $DATA[1]);
 
                                                        // Send it also waway
-                                                       SEND_EMAIL($email, MEMBER_SUBJ_SEND_DONE, $mailText);
+                                                       sendEmail($email, MEMBER_SUBJ_SEND_DONE, $mailText);
                                                } // END - if
 
                                                // Free result
                                                SQL_FREERESULT($result_sender);
 
                                                // Set status to SEND because we completely send it away
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='SEND', target_send='0', receivers='' WHERE id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
                                                        array(bigintval($DATA[0])), __FILE__, __LINE__);
 
                                                // Update send-completed-time
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET `timestamp_send`=UNIX_TIMESTAMP() WHERE `pool_id`=%s LIMIT 1",
                                                        array(bigintval($DATA[0])), __FILE__, __LINE__);
 
                                                $lastSentId = $DATA[0]; $GLOBALS['pool_cnt'] = 0;
@@ -243,7 +243,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                        MEDIA_UPDATE_ENTRY(array("total_orders", "normal_orders"), 'add', 1);
                                                } // END - if
 
-                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$P."<br />";
+                                               //* DEBUG: */ echo"*EXIT/L:".__LINE__.'/'.$P."<br />";
                                                break;
                                        }
                                        // Do we have send maximum mails?
@@ -251,7 +251,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                                // There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
                                                $add = '';
                                                if ($GLOBALS['pool_cnt'] <= $DATA[8]) $add = ", target_send=target_send-".$GLOBALS['pool_cnt'];
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW', receivers='%s'".$add." WHERE id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='NEW', receivers='%s'".$add." WHERE `id`=%s LIMIT 1",
                                                 array(implode(';', $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
 
                                                //* DEBUG: */ echo"*EXIT/L:".__LINE__."*<br />";
@@ -262,16 +262,16 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        SQL_FREERESULT($result_stats);
                                } else {
                                        // User does not exists so we have add the sender's points back to sender's account
-                                       if (($RECEIVERS[0] == "0") || (empty($RECEIVERS[0]))) {
+                                       if (($RECEIVERS[0] == '0') || (empty($RECEIVERS[0]))) {
                                                // List was empty
-                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='SEND' WHERE id=%s LIMIT 1",
+                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET data_type='SEND' WHERE `id`=%s LIMIT 1",
                                                 array(bigintval($DATA[0])), __FILE__, __LINE__);
                                        } else {
                                                // Is the userid set?
                                                if ($uid > 0) {
                                                        // User does not exists, pay points back
-                                                       $points = GET_PAY_POINTS($DATA[5]);
-                                                       ADD_POINTS_REFSYSTEM("pool_payback", $DATA[1], $points, false, "0", false, "direct");
+                                                       $points = getPaymentPoints($DATA[5]);
+                                                       ADD_POINTS_REFSYSTEM_DIRECT('pool_payback', $DATA[1], $points);
 
                                                        // Add points together and remove user
                                                        $pointsBack[$DATA[1]] += $points;
@@ -285,7 +285,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        unset($dummy[$key]);
 
                                        // Update receivers
-                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET receivers='%s' WHERE id=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_pool` SET receivers='%s' WHERE `id`=%s LIMIT 1",
                                                array(implode(';', $dummy), bigintval($DATA[0])), __FILE__, __LINE__);
                                }
                        }
@@ -300,7 +300,7 @@ if (SQL_NUMROWS($result_main) > 0) {
                        if (($PB > 0) && ($uid > 0)) {
                                // Prepare content
                                $content = array(
-                                       'points' => TRANSLATE_COMMA($DATA[10])
+                                       'points' => translateComma($DATA[10])
                                );
 
                                // We have to pay back some points to the sender (we add them directly :-P)
@@ -317,13 +317,13 @@ if (SQL_NUMROWS($result_main) > 0) {
                                        $mailText = LOAD_EMAIL_TEMPLATE("back-member", $content, bigintval($uid));
 
                                        // Send mail out to member
-                                       SEND_EMAIL($email, MEMBER_BACK_JACKPOT." (".$uid.")", $mailText);
+                                       sendEmail($email, getMessage('MEMBER_BACK_JACKPOT')." (".$uid.")", $mailText);
                                } else {
                                        // Add to jackpot
                                        ADD_JACKPOT($PB);
 
                                        // Send mail out to admin
-                                       SEND_ADMIN_NOTIFICATION(ADMIN_BACK_JACKPOT." (".$uid.")", "back-admin", $content, 'admin');
+                                       sendAdminNotification(getMessage('ADMIN_BACK_JACKPOT')." (".$uid.")", "back-admin", $content, 'admin');
                                }
                        } // END - if
                } // END - foreach
index 74f3ee3a2da98669330af11520294b4e228a92ff..042f44c740ff20ac2fa71aa97ba6e8507957d1ff 100644 (file)
@@ -52,26 +52,26 @@ WHERE
        (last_update < (UNIX_TIMESTAMP() - %s) AND last_update != 0 AND last_profile_sent < (UNIX_TIMESTAMP() - %s))
 OR
        (last_update=0 AND last_profile_sent=0 AND joined < (UNIX_TIMESTAMP() - %s))
-ORDER BY userid", array(getConfig('profile_update'), getConfig('resend_profile_update'), getConfig('profile_update')), __FILE__, __LINE__);
+ORDER BY `userid` ASC", array(getConfig('profile_update'), getConfig('resend_profile_update'), getConfig('profile_update')), __FILE__, __LINE__);
 
        // Do we have some notifications to sent?
        if (SQL_NUMROWS($result) > 0) {
                // We need to send-out notifications...
                while ($content = SQL_FETCHARRAY($result)) {
                        // Translate timestamp
-                       $content['joined'] = MAKE_DATETIME($content['joined'], "0");
+                       $content['joined'] = generateDateTime($content['joined'], '0');
 
-                       if (round($content['last_update']) == "0") {
+                       if (round($content['last_update']) == '0') {
                                // Has never changed his accont
                                $content['last_update'] = getMessage('PROFILE_NEVER_CHANGED');
                        } else {
                                // Has changed his account
-                               $content['last_update'] = MAKE_DATETIME($content['last_update'], "0");
+                               $content['last_update'] = generateDateTime($content['last_update'], '0');
                        }
 
                        // Load email template and send mail away
                        $msg = LOAD_EMAIL_TEMPLATE("profile-updte", '', bigintval($content['userid']));
-                       SEND_EMAIL($content['email'], getMessage('PROFILE_OUTDATED'), $msg);
+                       sendEmail($content['email'], getMessage('PROFILE_OUTDATED'), $msg);
 
                        // Update profile data
                        SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET last_profile_sent=UNIX_TIMESTAMP(), notified='Y' WHERE userid=%s LIMIT 1",
index b8f862fee9011d8409d4da0675298e8cd362ec87..e88d7c9860c2bc02096c11de1e67c167078be79b 100644 (file)
@@ -64,7 +64,7 @@ function REQUEST_GET ($element) {
 }
 
 // Checks if an element in $_GET exists
-function REQUEST_ISSET_GET ($element, $subElement="") {
+function REQUEST_ISSET_GET ($element, $subElement = '') {
        if (empty($subElement)) {
                return ((isset($_GET[$element])) && (!empty($_GET[$element])));
        } else {
index 0266abc2f3cb661e9d9c63948fa51911d6dfa082..844c5182daae7e13b519d043ffef9b9d19535277 100644 (file)
@@ -58,7 +58,7 @@ if (GET_EXT_VERSION('order') >= '0.1.1') {
 }
 
 // Transfer points from locked_points to points
-$result_daily = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND `status`='CONFIRMED' ORDER BY userid", __FILE__, __LINE__);
+$result_daily = SQL_QUERY("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE ref_payout=0 AND `status`='CONFIRMED' ORDER BY `userid` ASC", __FILE__, __LINE__);
 
 //* DEBUG: */ echo basename(__FILE__).":payout=0;daily|numRows=".SQL_NUMROWS($result_daily)."<br />\n";
 if (SQL_NUMROWS($result_daily) > 0) {
index ccfca682f4265fddcd45c445896a652e164f810a..a98000981bb9fb3ac8f57b839e9cae0a3fb37499 100644 (file)
@@ -74,14 +74,14 @@ LIMIT 1",
 
                        // Prepare all data for the template
                        $content = array(
-                               'activated' => MAKE_DATETIME($content['holiday_activated'], "1"),
-                               'start'     => MAKE_DATETIME($content['holiday_start']    , "1"),
-                               'end'       => MAKE_DATETIME($content['holiday_end']      , "1")
+                               'activated' => generateDateTime($content['holiday_activated'], "1"),
+                               'start'     => generateDateTime($content['holiday_start']    , "1"),
+                               'end'       => generateDateTime($content['holiday_end']      , "1")
                        );
 
                        // Send email to user
                        $msg = LOAD_EMAIL_TEMPLATE("member_holiday_activated", $content, $content['userid']);
-                       SEND_EMAIL($content['userid'], getMessage('HOLIDAY_MEMBER_ACTIVATED_SUBJ'), $msg);
+                       sendEmail($content['userid'], getMessage('HOLIDAY_MEMBER_ACTIVATED_SUBJ'), $msg);
 
                        // Update account
                        ADD_SQL(SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data`
index c56b63f6c5ddaf10f833307511918be75e0bd1de..ae7c8df0a07c7f68b0b93f4bf865084d4d1a2582 100644 (file)
@@ -49,7 +49,7 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset surfbar counter
-UPDATE_CONFIG(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
+updateConfiguration(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
 setConfigEntry('surfbar_yester_counter', getConfig('surfbar_daily_counter'));
 setConfigEntry('surfbar_daily_counter' , 0);
 
index a9bb806cff547fcb332508472fa0dc2f942f47d5..9dcaf9989bc43ac24245c70be7581b682bb694f7 100644 (file)
@@ -48,7 +48,7 @@ if (!defined('__SECURITY')) {
 if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 
 // Simply reset the requests here
-UPDATE_CONFIG("yoomedia_requests_remain", getConfig('yoomedia_requests_total'));
+updateConfiguration('yoomedia_requests_remain', getConfig('yoomedia_requests_total'));
 
 //
 ?>
index 99f62f6725c40117fd72a7feae10e5260fcde506..1c2245aebb494810d5cd5231a7fa633fc2d5f15f 100644 (file)
@@ -59,7 +59,7 @@ echo "<html>
 <tr><td height=\"10\"></td></tr>
 <tr>
   <td align=\"center\">
-    <strong>".GET_REMOTE_ADDR()."</strong>
+    <strong>".detectRemoteAddr()."</strong>
   </td>
 </tr>
 </table>
index 17988417c414ba93129f5bd682f2b0a3cfdb7524..a2d1e8c22bc8b2f623b35ee4b26cd1f485c47c2d 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Unset/set session variables
-function set_session ($var, $value) {
+function setSession ($var, $value) {
        // Abort in CSS mode here
        if ($GLOBALS['output_mode'] == 1) return true;
 
@@ -51,25 +51,25 @@ function set_session ($var, $value) {
        $var = trim(SQL_ESCAPE($var)); $value = trim($value);
 
        // Is the session variable set?
-       if (("".$value."" == "") && (isSessionVariableSet($var))) {
+       if (("".$value."" == '') && (isSessionVariableSet($var))) {
                // Remove the session
-               //* DEBUG: */ echo "UNSET:".$var."=".get_session($var)."<br />\n";
+               //* DEBUG: */ echo "UNSET:".$var.'='.getSession($var)."<br />\n";
                unset($_SESSION[$var]);
                return session_unregister($var);
        } elseif (("".$value."" != '') && (!isSessionVariableSet($var))) {
                // Set session
-               //* DEBUG: */ echo "SET:".$var."=".$value."<br />\n";
+               //* DEBUG: */ echo "SET:".$var.'='.$value."<br />\n";
                $_SESSION[$var] =  $value;
                return session_register($var);
        } elseif (!empty($value)) {
                // Update session
-               //* DEBUG: */ echo "UPDATE:".$var."=".$value."<br />\n";
+               //* DEBUG: */ echo "UPDATE:".$var.'='.$value."<br />\n";
                $_SESSION[$var] = $value;
                return true;
        }
 
        // Ignored (but valid)
-       //* DEBUG: */ echo "IGNORED:".$var."=".$value."<br />\n";
+       //* DEBUG: */ echo "IGNORED:".$var.'='.$value."<br />\n";
        return true;
 }
 
@@ -80,7 +80,7 @@ function isSessionVariableSet ($var) {
 }
 
 // Returns wether the value of the session variable or NULL if not set
-function get_session ($var) {
+function getSession ($var) {
        // Default is not found! ;-)
        $value = null;
 
@@ -103,21 +103,21 @@ function get_session ($var) {
 }
 
 // Destroy user session
-function destroy_user_session () {
+function destroyUserSession () {
        // Reset userid
        setUserId(0);
 
        // Remove all user data from session
-       return ((set_session('userid', '')) && (set_session('u_hash', '')));
+       return ((setSession('userid', '')) && (setSession('u_hash', '')));
 }
 
 // Destroys the admin session
 function destroyAdminSession ($destroy = true) {
        // Kill maybe existing session variables including array elements
-       set_session('admin_login', '');
-       set_session('admin_md5'  , '');
-       set_session('admin_last' , '');
-       set_session('admin_to'   , '');
+       setSession('admin_login', '');
+       setSession('admin_md5'  , '');
+       setSession('admin_last' , '');
+       setSession('admin_to'   , '');
 
        // Destroy session and return status
        if ($destroy) {
index 1e156d17e7174a386df97f29b8425f89374dd8ea..d48a53441934e718a1f5621de945c718947550dc 100644 (file)
@@ -43,7 +43,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Set session save path if set
-if (getConfig('session_save_path') != "") {
+if (getConfig('session_save_path') != '') {
        // Please make sure this valid!
        session_save_path(getConfig('session_save_path'));
 } // END - if
@@ -52,10 +52,10 @@ if (getConfig('session_save_path') != "") {
 session_start();
 
 // Load language system
-LOAD_INC_ONCE("inc/language.php");
+loadIncludeOnce('inc/language.php');
 
 // Load extensions here
-LOAD_INC_ONCE("inc/load_extensions.php");
+loadIncludeOnce('inc/load_extensions.php');
 
 // Determine and set referal id
 DETERMINE_REFID();
@@ -68,7 +68,7 @@ if (isSessionVariableSet('userid')) {
        // Is it valid?
        if (!IS_MEMBER()) {
                // Then destroy the user id
-               destroy_user_session();
+               destroyUserSession();
 
                // Kill userid
                setUserId(0);
@@ -86,7 +86,7 @@ if ((basename($_SERVER['PHP_SELF']) == 'index.php') || (basename($_SERVER['PHP_S
        }
 } // END - if
 
-//* DEBUG: */ print("<pre>".print_r($_SESSION, true)."</pre>");
+//* DEBUG: */ print('<pre>'.print_r($_SESSION, true).'</pre>');
 
 //
 ?>
index 3d42a33b845f9d43730373c05a5359623ce55183..1f67d01d93161a4715799d0e4b38aa8204471841 100644 (file)
@@ -46,11 +46,11 @@ if (!defined('__SECURITY')) {
 $result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url
 FROM `{!_MYSQL_PREFIX!}_user_stats`
 WHERE max_rec=clicks AND clicks>0 AND bonus_stats_active='N'
-ORDER BY userid", __FILE__, __LINE__);
+ORDER BY `userid` ASC", __FILE__, __LINE__);
 
 if (SQL_NUMROWS($result_bonus) > 0) {
        // Remember stats bonus in constant
-       define('__STATS_BONUS', TRANSLATE_COMMA(getConfig('bonus_stats')));
+       define('__STATS_BONUS', translateComma(getConfig('bonus_stats')));
 
        // We found some mail orders...
        while ($content = SQL_FETCHARRAY($result_bonus)) {
@@ -59,14 +59,14 @@ if (SQL_NUMROWS($result_bonus) > 0) {
                        array(getConfig('bonus_stats'), bigintval($content['userid'])), __FILE__, __LINE__);
 
                // Translate some data
-               $content['timestamp'] MAKE_DATETIME($content['timestamp_ordered'], "2");
+               $content['timestamp'] generateDateTime($content['timestamp_ordered'], "2");
 
                // Load email template and send email
                $msg = LOAD_EMAIL_TEMPLATE("member_stats_bonus", $content, bigintval($content['userid']));
-               SEND_EMAIL($content['userid'], getMessage('BONUS_MEMBER_STATS_SUBJECT'), $msg);
+               sendEmail($content['userid'], getMessage('BONUS_MEMBER_STATS_SUBJECT'), $msg);
 
                // Update database
-               $result_update = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET bonus_stats_active='Y' WHERE id=%s LIMIT 1",
+               $result_update = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET bonus_stats_active='Y' WHERE `id`=%s LIMIT 1",
                        array(bigintval($content['id'])), __FILE__, __LINE__);
        } // END - while
 
index d08d66b07b5260dba85c8a934ad8da700d1c6ef1..a7312b5589155be7af4c275cb0d994eefe521747 100644 (file)
@@ -61,18 +61,18 @@ if (($GLOBALS['output_mode'] == "1") || (getConfig('css_php') == "DIRECT")) {
        // Output inclusion lines
        foreach ($STYLES as $value) {
                // Only include found CSS files (to reduce 404 requests)
-               $basePath = sprintf("%stheme/%s/css/", constant('PATH'), GET_CURR_THEME());
+               $basePath = sprintf("%stheme/%s/css/", constant('PATH'), getCurrentTheme());
                $FQFN = $basePath . $value;
 
                // Do include only existing files and whose are not empty
-               if ((FILE_READABLE($FQFN)) && (filesize($FQFN) > 0)) {
+               if ((isFileReadable($FQFN)) && (filesize($FQFN) > 0)) {
                        switch (getConfig('css_php')) {
                                case 'DIRECT':
-                                       OUTPUT_HTML('<link rel="stylesheet" type="text/css" href="{!URL!}/theme/' . GET_CURR_THEME() . '/' . $value . '" />');
+                                       OUTPUT_HTML('<link rel="stylesheet" type="text/css" href="{!URL!}/theme/' . getCurrentTheme() . '/' . $value . '" />');
                                        break;
 
                                case 'FILE':
-                                       OUTPUT_HTML(READ_FILE($FQFN));
+                                       OUTPUT_HTML(readFromFile($FQFN));
                                        break;
                        } // END - switch
                } // END - if
index e4bc4f643642aa5e1e490dfcc3ad32d54f61533c..78770742b250bbcb23c3d8ae12c1e56ba13f9a09 100644 (file)
@@ -49,7 +49,7 @@ if (($GLOBALS['output_mode'] == 1) || (!isResetModeEnabled())) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Reset the surfbar counter
-UPDATE_CONFIG("surfbar_weekly_counter", "0");
+updateConfiguration('surfbar_weekly_counter', '0');
 
 //
 ?>
index 11e2b2f5c6db3931e4358d543efdc24edde2b5de..80da5beba5f4784b0a8ee04a6c0b4e798fc9f813 100644 (file)
--- a/index.php
+++ b/index.php
@@ -56,7 +56,7 @@ require('inc/config.php');
 // Is the script installed?
 if (isInstalled()) {
        // Header
-       LOAD_INC('inc/header.php');
+       loadInclude('inc/header.php');
 
        // Fix missing array elements here
        if (!isConfigEntrySet('index_delay'))  setConfigEntry('index_delay' , 0);
@@ -67,32 +67,32 @@ if (isInstalled()) {
                // Is the index page configured for redirect pr not?
                if (getConfig('index_cookie') > 0) {
                        // Set cookie and remeber it for specified time
-                       set_session('visited', 'true');
+                       setSession('visited', 'true');
                } elseif (isSessionVariableSet('visited')) {
                        // Remove cookie when admin set 0 in setup
-                       set_session('visited', '');
+                       setSession('visited', '');
                }
 
                // Template laden
-               LOAD_TEMPLATE('index', false, ADD_URL_DATA(''));
+               LOAD_TEMPLATE('index', false, addUrlData(''));
 
                // Shall I insert an automated forward?
                if (getConfig('index_delay') > 0) {
                        // This will be a JavaScript-redirect!
                        define('__DELAY_VALUE', (getConfig('index_delay') * 1000 + 500));
-                       define('__MOD_VALUE'  , ADD_URL_DATA('index'));
+                       define('__MOD_VALUE'  , addUrlData('index'));
                        LOAD_TEMPLATE('index_forward');
                } // END - if
        } else {
                // Redirect to main page
-               LOAD_URL('modules.php?module=index');
+               redirectToUrl('modules.php?module=index');
        }
 
        // Footer
-       LOAD_INC('inc/footer.php');
+       loadInclude('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // All done here...
index 0253d0e1d423a73aa2d8c1b59e4ee8f8deaaa8ec..788f7bfa026a2f11065b1b0d47b399c01b4e5198 100644 (file)
@@ -66,11 +66,11 @@ $GLOBALS['module'] = 'install';
 require('inc/config.php');
 
 // Header
-LOAD_INC('inc/header.php');
+loadInclude('inc/header.php');
 
 // Reload page to page=welcome when it is not specified
 if (!REQUEST_ISSET_GET('page')) {
-       LOAD_URL('install.php?page=welcome');
+       redirectToUrl('install.php?page=welcome');
 } // END - if
 
 // Already installed?
@@ -85,14 +85,14 @@ if (getTotalFatalErrors() == 0) {
        LOAD_TEMPLATE('install_header');
 
        // Here start's our installtion stuff
-       LOAD_INC_ONCE('inc/install-inc.php');
+       loadIncludeOnce('inc/install-inc.php');
 
        // Close main installation table
        LOAD_TEMPLATE('install_footer');
 }
 
 // Footer
-LOAD_INC('inc/footer.php');
+loadInclude('inc/footer.php');
 
 //
 ?>
diff --git a/js.php b/js.php
index e86211a103d0a767e2e42bd2dd6ec5016d279588..7096cee19621c75d244e34ca4991a5dae034b328 100644 (file)
--- a/js.php
+++ b/js.php
@@ -65,7 +65,7 @@ if ((isInstalled()) && (REQUEST_ISSET_GET(('tag')))) {
        header('Content-type: text/javascript');
 
        // Load header
-       LOAD_INC_ONCE('inc/header.php');
+       loadIncludeOnce('inc/header.php');
 
        // Prepare include file for looking
        $INC = sprintf("inc/js/tag-%s.php",
@@ -73,13 +73,13 @@ if ((isInstalled()) && (REQUEST_ISSET_GET(('tag')))) {
        );
 
        // Is that file readable?
-       if (INCLUDE_READABLE($INC)) {
+       if (isIncludeReadable($INC)) {
                // Include it
-               LOAD_INC_ONCE($INC);
+               loadIncludeOnce($INC);
        } // END - if 
 
        // Load footer
-       LOAD_INC_ONCE('inc/footer.php');
+       loadIncludeOnce('inc/footer.php');
 } // END - if
 
 // Shutdown
index 1fb03bf8ab260fc88129a322cf131a0983e69ba6..53c2bfaaf699df4179436990408fb3e50bd3c4da 100644 (file)
@@ -56,7 +56,7 @@ require('inc/config.php');
 // Is the script installed?
 if (isInstalled()) {
        // Header
-       LOAD_INC('inc/header.php');
+       loadInclude('inc/header.php');
 
        // Initialize the array for the template
        $content = array(
@@ -68,10 +68,10 @@ if (isInstalled()) {
        if (isSessionVariableSet('lead_uid')) {
                // Is the user-account unlocked and valid?
                $result = SQL_QUERY_ESC("SELECT email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s AND `status`='CONFIRMED' LIMIT 1",
-                       array(bigintval(get_session('lead_uid'))), __FILE__, __LINE__);
+                       array(bigintval(getSession('lead_uid'))), __FILE__, __LINE__);
                if (SQL_NUMROWS($result) == 1) {
                        // Secure the ID number
-                       $content['lead_uid'] = bigintval(get_session('lead_uid'));
+                       $content['lead_uid'] = bigintval(getSession('lead_uid'));
 
                        // Load the email address
                        list($email) = SQL_FETCHROW($result);
@@ -91,10 +91,10 @@ if (isInstalled()) {
        LOAD_TEMPLATE('lead_code', false, $content);
 
        // Footer
-       LOAD_INC('inc/footer.php');
+       loadInclude('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // All done here...
index eabaef64e219cbee1949370291b8c7722f37a842..8ee88290dab538122be2b1e86aa9818d9d0ae72a 100644 (file)
--- a/login.php
+++ b/login.php
@@ -57,14 +57,14 @@ if (isInstalled()) {
        // Is this a member?
        if (IS_MEMBER()) {
                // Then redirect into login area
-               LOAD_URL('modules.php?module=login');
+               redirectToUrl('modules.php?module=login');
        } else {
                // Guests will be redirected to login form
-               LOAD_URL('modules.php?module=index&amp;what=login');
+               redirectToUrl('modules.php?module=index&amp;what=login');
        }
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index 5a176e4410fa06ab59ac4537a65f4656bf8cdf80..d61a17441aab468a3b59b12cc0741db2d21876d5 100644 (file)
@@ -67,17 +67,17 @@ if (isInstalled()) {
                // Maybe he wants to confirm an email?
                if ($url_mid > 0) {
                        // Normal-Mails
-                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND `userid`=%s LIMIT 1",
                                array($url_mid, $url_uid), __FILE__, __LINE__);
                        $type = 'mailid'; $urlId = $url_mid;
                } elseif ($url_bid > 0) {
                        // Bonus-Mail
-                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND `userid`=%s LIMIT 1",
                                array($url_bid, $url_uid), __FILE__, __LINE__);
                        $type = 'bonusid'; $urlId = $url_bid;
                } else {
                        // Problem: No ID entered
-                       LOAD_URL('index.php');
+                       redirectToUrl('index.php');
                }
 
                if (SQL_NUMROWS($result) == 1) {
@@ -91,7 +91,7 @@ if (isInstalled()) {
                        {
                        case 'NORMAL':
                                // Is the stats ID valid?
-                               $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT pool_id, url, subject FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `id`=%s LIMIT 1",
                                        array($url_mid), __FILE__, __LINE__);
                                break;
 
@@ -100,7 +100,7 @@ if (isInstalled()) {
                                REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
 
                                // Bonus-Mails
-                               $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                               $result = SQL_QUERY_ESC("SELECT id, url, subject FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                        array($url_bid), __FILE__, __LINE__);
                                break;
                        }
@@ -130,8 +130,8 @@ if (isInstalled()) {
                                                                array(bigintval($pool)), __FILE__, __LINE__);
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($pay) = SQL_FETCHROW($result);
-                                                               $time      = GET_PAY_POINTS($pay, 'time');
-                                                               $payment   = GET_PAY_POINTS($pay, 'payment');
+                                                               $time      = getPaymentPoints($pay, 'time');
+                                                               $payment   = getPaymentPoints($pay, 'payment');
                                                                $isValid   = true;
                                                        }
 
@@ -140,7 +140,7 @@ if (isInstalled()) {
                                                        break;
 
                                                case 'BONUS':
-                                                       $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                                                       $result = SQL_QUERY_ESC("SELECT points, time FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                                                array($url_bid), __FILE__, __LINE__);
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($points, $time) = SQL_FETCHROW($result);
@@ -154,7 +154,7 @@ if (isInstalled()) {
                                                }
 
                                                // Add header
-                                               LOAD_INC_ONCE('inc/header.php');
+                                               loadIncludeOnce('inc/header.php');
 
                                                // Was that mail a valid one?
                                                if ($isValid === true) {
@@ -200,7 +200,7 @@ if (isInstalled()) {
        if (!empty($msg)) {
                switch (getConfig('mailid_error_redirect')) {
                        case 'INDEX': // Redirect to index page
-                               LOAD_URL('modules.php?module=index&amp;msg='.$msg.'&amp;ext=mailid');
+                               redirectToUrl('modules.php?module=index&amp;msg='.$msg.'&amp;ext=mailid');
                                break;
 
                        case 'REJECT': // Redirect to rejection page
@@ -209,16 +209,16 @@ if (isInstalled()) {
 
                        default:
                                DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown status %s detected in mailid_error_redirect.", getConfig('mailid_error_redirect')));
-                               LOAD_URL('modules.php?module=index&amp;msg=' . getCode('UNKNOWN_STATUS') . '&amp;ext=mailid');
+                               redirectToUrl('modules.php?module=index&amp;msg=' . getCode('UNKNOWN_STATUS') . '&amp;ext=mailid');
                                break;
                }
        } else {
                // Include footer
-               LOAD_INC_ONCE('inc/footer.php');
+               loadIncludeOnce('inc/footer.php');
        }
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Shutdown
index 9a6c54cc648eed1f1d77c439864d6377b0d984ef..a02e39ffbd815905cf3266b623f6e7be04440a42 100644 (file)
@@ -65,15 +65,15 @@ if (isInstalled()) {
        // 01        1        12            2    2            21    1                   22     10
        if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
                // No image? Then output header
-               if ($mode != 'img') LOAD_INC_ONCE('inc/header.php');
+               if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
                // Maybe he wants to confirm an email?
                if ($url_mid > 0) {
-                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE stats_id=%s AND `userid`=%s LIMIT 1",
                         array($url_mid, $url_uid), __FILE__, __LINE__);
                        $type = 'mailid'; $urlId = $url_mid;
                } elseif ($url_bid > 0) {
-                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND userid=%s LIMIT 1",
+                       $result = SQL_QUERY_ESC("SELECT id, link_type FROM `{!_MYSQL_PREFIX!}_user_links` WHERE bonus_id=%s AND `userid`=%s LIMIT 1",
                         array($url_bid, $url_uid), __FILE__, __LINE__);
                        $type = 'bonusid'; $urlId = $url_bid;
                }
@@ -85,12 +85,12 @@ if (isInstalled()) {
                        switch ($ltype)
                        {
                        case 'NORMAL':
-                               $result_mailid = SQL_QUERY_ESC("SELECT pool_id, userid, id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE id=%s LIMIT 1",
+                               $result_mailid = SQL_QUERY_ESC("SELECT pool_id, userid, id FROM `{!_MYSQL_PREFIX!}_user_stats` WHERE `id`=%s LIMIT 1",
                                        array($url_mid), __FILE__, __LINE__);
                                break;
 
                        case 'BONUS':
-                               $result_mailid = SQL_QUERY_ESC("SELECT id, id, is_notify FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                               $result_mailid = SQL_QUERY_ESC("SELECT id, id, is_notify FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                        array($url_bid), __FILE__, __LINE__);
                                break;
                        }
@@ -134,8 +134,8 @@ if (isInstalled()) {
                                                        // Entry found?
                                                        if (SQL_NUMROWS($result) == 1) {
                                                                list($pay) = SQL_FETCHROW($result);
-                                                               $time      = GET_PAY_POINTS($pay, 'time');
-                                                               $payment   = GET_PAY_POINTS($pay, 'payment');
+                                                               $time      = getPaymentPoints($pay, 'time');
+                                                               $payment   = getPaymentPoints($pay, 'payment');
                                                                $isValid   = true;
                                                        } // END - if
 
@@ -144,7 +144,7 @@ if (isInstalled()) {
                                                        break;
 
                                                case 'BONUS':
-                                                       $result = SQL_QUERY_ESC("SELECT time, points FROM `{!_MYSQL_PREFIX!}_bonus` WHERE id=%s LIMIT 1",
+                                                       $result = SQL_QUERY_ESC("SELECT time, points FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `id`=%s LIMIT 1",
                                                                array(bigintval($pool)), __FILE__, __LINE__);
 
                                                        // Entry found?
@@ -176,7 +176,7 @@ if (isInstalled()) {
                                                                        switch ($ltype)
                                                                        {
                                                                        case 'NORMAL':
-                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET clicks=clicks + 1 WHERE `id`=%s LIMIT 1",
                                                                                        array($url_mid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -188,7 +188,7 @@ if (isInstalled()) {
                                                                                break;
 
                                                                        case 'BONUS':
-                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE id=%s LIMIT 1",
+                                                                               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_bonus` SET clicks=clicks + 1 WHERE `id`=%s LIMIT 1",
                                                                                        array($url_bid), __FILE__, __LINE__);
 
                                                                                // Update mediadata as well
@@ -201,7 +201,7 @@ if (isInstalled()) {
                                                                        }
 
                                                                        // Export data into constants for the template
-                                                                       define('_POINTS_VALUE'   , TRANSLATE_COMMA($payment));
+                                                                       define('_POINTS_VALUE'   , translateComma($payment));
                                                                        define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
 
                                                                        // Only when user extension = v0.1.2: Update mails-confirmed counter
@@ -220,7 +220,7 @@ if (isInstalled()) {
                                                                        } // END - if
 
                                                                        // Insert stats record
-                                                                       USER_STATS_INSERT_RECORD($url_uid, $type, $stats_data);
+                                                                       insertUserStatsRecord($url_uid, $type, $stats_data);
 
                                                                        // Right code entered?
                                                                        if (bigintval(REQUEST_POST('gfx_check')) == $img_code) {
@@ -257,13 +257,13 @@ if (isInstalled()) {
                                                                                                        if ($locked) $template = 'mailid_points_locked2';
                                                                                                        define('_UID_VALUE' , $url_uid);
                                                                                                        define('_TYPE_VALUE', $type);
-                                                                                                       define('_DATA_VALUE', TRANSLATE_COMMA($urlId));
+                                                                                                       define('_DATA_VALUE', translateComma($urlId));
                                                                                                } // END - if
                                                                                        } // END - if
                                                                                } // END - if
 
                                                                                // Load total points
-                                                                               define('__TOTAL_POINTS', TRANSLATE_COMMA(
+                                                                               define('__TOTAL_POINTS', translateComma(
                                                                                        GET_TOTAL_DATA($url_uid, 'user_points', 'points') -
                                                                                        GET_TOTAL_DATA($url_uid, 'user_data', 'used_points'))
                                                                                );
@@ -273,14 +273,14 @@ if (isInstalled()) {
                                                                        } else {
                                                                                // Wrong image code! So add points to sender's account
                                                                                unset($GLOBALS['ref_level']);
-                                                                               ADD_POINTS_REFSYSTEM('mailid_payback', $sender, $payment, false, 0, false, 'direct');
+                                                                               ADD_POINTS_REFSYSTEM_DIRECT('mailid_payback', $sender, $payment);
 
                                                                                // Load template
                                                                                LOAD_TEMPLATE('mailid_points_failed');
                                                                        }
 
                                                                        // Remove link from table
-                                                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE id=%s LIMIT 1",
+                                                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_links` WHERE `id`=%s LIMIT 1",
                                                                                array(bigintval($lid)), __FILE__, __LINE__);
                                                                        break;
 
@@ -298,7 +298,7 @@ if (isInstalled()) {
                                                                                define('_TEMPLATE_BANNER', LOAD_TEMPLATE('mailid_banner', true));
                                                                                if (getConfig('code_length') > 0) {
                                                                                        // Generate Code
-                                                                                       define('_IMAGE_CODE', IMG_CODE($code, $type, $urlId, $url_uid));
+                                                                                       define('_IMAGE_CODE', generateCaptchaCode($code, $type, $urlId, $url_uid));
                                                                                        $templ = 'mailid_enter_code';
                                                                                } else {
                                                                                        // Disabled code
@@ -351,12 +351,12 @@ if (isInstalled()) {
                // Insert footer if no image
                if ($mode != 'img') {
                        // Write footer
-                       LOAD_INC_ONCE('inc/footer.php');
+                       loadIncludeOnce('inc/footer.php');
                } // END - if
        }
 } elseif ($mode != 'img') {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index f079d6e11a47819e032cad62f379c14bbffc82a9..47fa7a3c0ad58eec9388f935812e2bbb68f33985 100644 (file)
@@ -75,7 +75,7 @@ if (IS_MEMBER()) {
                $username = '<em>{--_UNKNOWN--}</em>';
 
                // Destroy session
-               destroy_user_session();
+               destroyUserSession();
 
                // Kill userid
                setUserId(0);
@@ -92,7 +92,7 @@ if (IS_MEMBER()) {
 }
 
 // The header file
-LOAD_INC_ONCE('inc/header.php');
+loadIncludeOnce('inc/header.php');
 
 // Modules are by default not valid!
 $MOD_VALID = false; $check = 'failed';
@@ -111,12 +111,12 @@ if ((getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && ($GLOBALS['module'] !=
        case 'mem_only':
        case 'done':
                // Does the module exists on local file system?
-               if ((FILE_READABLE(constant('__MODULE'))) && (getTotalFatalErrors() == 0)) {
+               if ((isFileReadable(constant('__MODULE'))) && (getTotalFatalErrors() == 0)) {
                        // Module is valid, active and located on the local disc...
                        $MOD_VALID = true;
                } elseif (!empty($URL)) {
                        // An URL was specified so we load the de-referrer module
-                       LOAD_URL(DEREFERER($URL));
+                       redirectToUrl(DEREFERER($URL));
                } elseif (getTotalFatalErrors() == 0) {
                        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module']));
                }
@@ -127,7 +127,7 @@ if ((getConfig('maintenance') == 'Y') && (!IS_ADMIN()) && ($GLOBALS['module'] !=
                break;
 
        case 'locked':
-               if (!FILE_READABLE(constant('__MODULE'))) {
+               if (!isFileReadable(constant('__MODULE'))) {
                        // Module does addionally not exists
                        addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('LANG_MOD_REG_404'), $GLOBALS['module']));
                } // END - if
@@ -152,11 +152,11 @@ if (($MOD_VALID) && (defined('__MODULE'))) {
        /////////////////////////////////////////////
        //
        // Everything is okay so we can load the module
-       LOAD_INC_ONCE(constant('__MODULE'));
+       loadIncludeOnce(constant('__MODULE'));
 } // END - if
 
 // Next-to-end add the footer
-LOAD_INC_ONCE('inc/footer.php');
+loadIncludeOnce('inc/footer.php');
 
 //
 ?>
diff --git a/ref.php b/ref.php
index 91274c2382b19c819afa410057adbb5fb15dd25b..4ec740b1c883d5c4c524f39f5775d8fb04f74d74 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -91,7 +91,7 @@ if (isInstalled()) {
                if (empty($ref)) $ref = 0;
 
                // Update session
-               set_session('refid', $ref);
+               setSession('refid', $ref);
 
                // We have an refid here. So we simply add it
                $URL .= bigintval($ref);
@@ -108,10 +108,10 @@ if (isInstalled()) {
        }
 
        // Load the URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index c41dc5b5cd2bd73602232b0d9d2db76dcb24955b..019e0c9e50934639d8528c64830dce0a37e3c49c 100644 (file)
@@ -57,7 +57,7 @@ REDIRECT_ON_UNINSTALLED_EXTENSION('bonus');
 // List only rankings when script is installed
 if (isInstalled()) {
        // Include header
-       LOAD_INC('inc/header.php');
+       loadInclude('inc/header.php');
 
        if ((REQUEST_GET('uid') > 0) && (REQUEST_GET('d') > 0) && (REQUEST_ISSET_GET(('t')))) {
                // Set row name
@@ -93,11 +93,11 @@ LIMIT 1",
                                $content = SQL_FETCHARRAY($result);
 
                                // Prepare constants for the pre-template
-                               define('__GENDER'   , TRANSLATE_GENDER($content['gender']));
+                               define('__GENDER'   , translateGender($content['gender']));
                                define('__SNAME'    , $content['surname']);
                                define('__FNAME'    , $content['family']);
                                define('__RANK'     , BIGINTVAL($content['level']));
-                               define('__POINTS'   , TRANSLATE_COMMA($content['points']));
+                               define('__POINTS'   , translateComma($content['points']));
                                define('__MAILID'   , bigintval(REQUEST_GET('d')));
                                define('__RANK_ROWS', BONUS_MAKE_RANK_ROWS(bigintval(REQUEST_GET('d')), $t, bigintval(REQUEST_GET('uid'))));
 
@@ -135,10 +135,10 @@ LIMIT 1",
        LOAD_TEMPLATE('show_bonus');
 
        // Include footer
-       LOAD_INC('inc/footer.php');
+       loadInclude('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index a93348c753e9c177b69b682a8f2269462adb603e..c4e1b4a0d0a8b9b9e807eaa49e32e09bd6066477 100644 (file)
@@ -64,10 +64,10 @@ if (isInstalled()) {
        }
 
        // Load the URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index 1f9a3eec0a9482264242f69f632223e54c20f143..b9dc1a13c9597e0dc5e334211470d3b885907b4a 100644 (file)
@@ -70,10 +70,10 @@ if (isInstalled()) {
        }
 
        // Load the URL
-       LOAD_URL($URL);
+       redirectToUrl($URL);
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index 13e583ca25841ef4905b584a53d63698c7132a0d..6736b927c2bc4dc7cd14f5c1e1a0452066ce9361 100644 (file)
@@ -63,7 +63,7 @@ if (isInstalled()) {
        if (!IS_MEMBER()) {
                // Redirect
                // @TODO Display quick login form here or redirect as configured
-               LOAD_URL('modules.php?module=index');
+               redirectToUrl('modules.php?module=index');
        } // END - if
 
        // Handle tasks on self-maintenance
@@ -73,7 +73,7 @@ if (isInstalled()) {
        if ((SURFBAR_CHECK_RELOAD_FULL()) || ((REQUEST_ISSET_GET(('frame'))) && (in_array(REQUEST_GET('frame'), array('stop', 'stop2', 'stats', 'textlinks'))))) {
                // Reload-lock is full, surfbar stopped so...
                // Load header
-               LOAD_INC_ONCE('inc/header.php');
+               loadIncludeOnce('inc/header.php');
 
                // Load template
                if (((REQUEST_ISSET_GET(('frame'))) && (REQUEST_GET('frame') == 'stop')) || (!REQUEST_ISSET_GET(('frame')))) {
@@ -91,14 +91,14 @@ if (isInstalled()) {
 
                        // Prepare content
                        $content = array(
-                               'points'   => TRANSLATE_COMMA($points),
+                               'points'   => translateComma($points),
                                'online'   => SURFBAR_DETERMINE_TOTAL_ONLINE(),
                                'reload'   => (getConfig('surfbar_stats_reload') * 1000),
-                               'c_total'  => TRANSLATE_COMMA(getConfig('surfbar_total_counter')),
-                               'c_today'  => TRANSLATE_COMMA(getConfig('surfbar_daily_counter')),
-                               'c_yester' => TRANSLATE_COMMA(getConfig('surfbar_yester_counter')),
-                               'c_week'   => TRANSLATE_COMMA(getConfig('surfbar_weekly_counter')),
-                               'c_month'  => TRANSLATE_COMMA(getConfig('surfbar_monthly_counter')),
+                               'c_total'  => translateComma(getConfig('surfbar_total_counter')),
+                               'c_today'  => translateComma(getConfig('surfbar_daily_counter')),
+                               'c_yester' => translateComma(getConfig('surfbar_yester_counter')),
+                               'c_week'   => translateComma(getConfig('surfbar_weekly_counter')),
+                               'c_month'  => translateComma(getConfig('surfbar_monthly_counter')),
                        );
 
                        // Load template for "stats" page
@@ -123,7 +123,7 @@ if (isInstalled()) {
                        // Load template for stopped surfbar
                        LOAD_TEMPLATE('surfbar_stopped', false, $content);
                }
-       } elseif ((REQUEST_ISSET_GET(('check'))) && (REQUEST_ISSET_GET(('id'))) && (REQUEST_ISSET_GET(('salt')))) {
+       } elseif ((REQUEST_ISSET_GET(('check'))) && (REQUEST_ISSET_GET('id')) && (REQUEST_ISSET_GET(('salt')))) {
                // Dummy next id get
                SURFBAR_DETERMINE_NEXT_ID(REQUEST_GET('id'));
 
@@ -166,7 +166,7 @@ if (isInstalled()) {
                                        'id'          => $nextId,
                                        'check'       => SURFBAR_GENERATE_VALIDATION_CODE($nextId),
                                        'salt'        => SURFBAR_GET_SALT(),
-                                       'reward'      => TRANSLATE_COMMA(SURFBAR_GET_REWARD($nextId)),
+                                       'reward'      => translateComma(SURFBAR_GET_REWARD($nextId)),
                                        'url'         => SURFBAR_GET_URL($nextId),
                                        'curr_reload' => SURFBAR_GET_USER_LOCKS(),
                                        'max_urls'    => SURFBAR_GET_TOTAL_URLS(),
@@ -189,7 +189,7 @@ if (isInstalled()) {
                }
 
                // Load header
-               LOAD_INC_ONCE('inc/header.php');
+               loadIncludeOnce('inc/header.php');
 
                // Load that template
                //* DEBUG: */ die("templateName={$templateName}<br />\n<strong>content</strong>=<pre>".print_r($content, true)."</pre>");
@@ -197,10 +197,10 @@ if (isInstalled()) {
        }
 
        // Load footer
-       LOAD_INC_ONCE('inc/footer.php');
+       loadIncludeOnce('inc/footer.php');
 } else {
        // You have to install first!
-       LOAD_URL('install.php');
+       redirectToUrl('install.php');
 }
 
 // Really all done here... ;-)
index 9cc257813f43cecac4953d175c3957994a27fcba..22b3ec2047203583d73304ec0bb919a451f0496c 100644 (file)
@@ -21,7 +21,7 @@
                <td align="right">{--ENTER_MAX_VALUE--}:</td>
                <td class="seperator" width="10">&nbsp;</td>
                <td><input type="text" name="max" class="admin_normal" size="5"
-                       maxlength="5" value=""></td>
+                       maxlength="5" /></td>
                <td class="seperator" width="10">&nbsp;</td>
        </tr>
        <tr>
@@ -32,7 +32,7 @@
                <td align="right">{--ENTER_MAX_COMMENT--}:</td>
                <td class="seperator" width="10">&nbsp;</td>
                <td><input type="text" name="comment" class="admin_normal"
-                       size="10" maxlength="255" value=""></td>
+                       size="10" maxlength="255" /></td>
                <td class="seperator" width="10">&nbsp;</td>
        </tr>
        <tr>
index 2a75253fa7d7858fe66fe036774e38e13ca37ad1..c943b2bec57d94d9745dac1ada423a3606cba2a0 100644 (file)
@@ -4,15 +4,15 @@
     <input type="hidden" name="id[$content[id]]" class="admin_normal" value="1" />
   </td>
   <td class="switch_sw$content[sw] bottom2 right2">
-    &nbsp;<input type="text" name="name[$content[id]]" class="admin_normal" size="16" maxlength="" value="$content[name]" />
+    &nbsp;<input type="text" name="name[$content[id]]" class="admin_normal" size="16" maxlength="255" value="$content[name]" />
   </td>
   <td class="switch_sw$content[sw] bottom2 right2">
-    &nbsp;<input type="text" name="rate[$content[id]]" class="admin_normal" size="19" maxlength="" value="$content[rate]" />
+    &nbsp;<input type="text" name="rate[$content[id]]" class="admin_normal" size="19" maxlength="255" value="$content[rate]" />
   </td>
   <td class="switch_sw$content[sw] bottom2 right2">
     &nbsp;<input type="text" name="min[$content[id]]" class="admin_normal" size="3" maxlength="20" value="$content[min]" />
   </td>
   <td class="switch_sw$content[sw] bottom2">
-    &nbsp;<input type="text" name="curr[$content[id]]" class="admin_normal" size="5" maxlength="" value="$content[curr]" />
+    &nbsp;<input type="text" name="curr[$content[id]]" class="admin_normal" size="5" maxlength="255" value="$content[curr]" />
   </td>
 </tr>
\ No newline at end of file
index aaa01686961f2b092dac53cfbcddab7cdfe870d7..cc45d8a2bc7ba030a5609eae6abc0ee55da55b68 100644 (file)
@@ -8,7 +8,7 @@
                <td align="right">{--SELECT_CATEGORY--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td><select name="cat" size="1" class="admin_select">
-                       <option value="" disabled>{--PLEASE_SELECT--}</option>
+                       <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
                        <option value="0">{--ALL_MEMBERS--} ({!__ALL_VALUE!})</option>
                        {!__OPTION_LINES!}
                </select></td>
index 9fdba296725209daa36f6b49647930cbc1e9e030..50b1aa4f6ae202d6f2ab529dceefef58343ab31f 100644 (file)
@@ -10,7 +10,7 @@
        <td align="right" style="padding-right:5px">{--SELECT_CATEGORY--}:</td>
        <td>
                <select name="cat" size="1" class="admin_select">
-                       <option value="" disabled>{--PLEASE_SELECT--}</option>
+                       <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
                        <option value="0">{--ALL_MEMBERS--} ($content[all])</option>
                        $content[categories]
                </select>
index 4a11d3cb4fe7f882a56b528c0914cf029dc3f105..978897310476b9429a1faf02b9c05d16fea48e8f 100644 (file)
@@ -35,7 +35,7 @@
                <div>Gelinkte Seiten, die sich ausserhalb von {!URL!} befinden,
                mache ich mich nicht mit verantwortlich und distanziere mich hiermit
                ausdr&uuml;cklich von diesen und deren Inhalten! Bitte beachte den <a
-                       href="" target="_blank">Disclaimer</a>!<br />
+                       href="#" target="_blank">Disclaimer</a>!<br />
                </div></td>
        </tr>
 </table>
\ No newline at end of file
index 93340d4a1c3ff5597630fdac9136d3e40e8de1d9..2d332bb6008bb0c030484201389939853b5537d3 100644 (file)
@@ -9,7 +9,7 @@
                <td align="right">{--SELECT_MAIL_TYPE--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td><select name="type" size="1" class="member_select">
-                       <option value="" disabled>{--PLEASE_SELECT--}</option>
+                       <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
                        {--TYPE_SELECTION--}
                </select></td>
                <td width="10" class="seperator">&nbsp;</td>
@@ -22,7 +22,7 @@
                <td align="right">{--SELECT_CATEGORY--}:</td>
                <td width="10" class="seperator">&nbsp;</td>
                <td><select name="cat" size="1" class="member_select">
-                       <option value="" disabled>{--PLEASE_SELECT--}</option>
+                       <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
                        {!CATEGORY_SELECTION!}
                </select></td>
                <td width="10" class="seperator">&nbsp;</td>
index 569ba5370db5ca0d0c622170ed5239923f8e987a..20df921c798204c5c8b9b09e0a08dba201de235d 100644 (file)
@@ -16,7 +16,7 @@
                <td align="center" class="left2 right2">
                <div align="left"><pre style="margin-bottom: 5px">Ich habe eine Frage zu folgendem:</pre></div>
                <select name="qsummary" size="1" class="member_select">
-                       <option value="" disabled>- - - Bitte ausw&auml;hlen! - - -</option>
+                       <option value="X" disabled="disabled">- - - Bitte ausw&auml;hlen! - - -</option>
                        <option value="ordr">Alles rund um die Mailbuchung</option>
                        <option value="unconfirmed">Nicht best&auml;tigte Mails</option>
                        <option value="reflink">Referal-Link (und Werbebanner)</option>
index 90853bd209aa25b35995389422cddd36bb9cba6a..c876c54fb4b15200efbe1922860549469bb68525 100644 (file)
@@ -1,8 +1,10 @@
 <table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
        <td width="10" class="seperator">&nbsp;</td>
-       <td class="member_content">{--LAST_ONLINE--}: <strong>{!_LAST_ONLINE_VALUE!}</strong><br />
-       {--LAST_MODULE--}: <strong>{!_LAST_MODULE_VALUE!}</strong></td>
+       <td class="member_content">
+               {--LAST_ONLINE--}: <strong>$content[last_online]</strong><br />
+               {--LAST_MODULE--}: <strong>$content[last_module]</strong>
+       </td>
 </tr>
 <tr>
        <td colspan="2" height="7" class="seperator">&nbsp;</td>
index c45b4c5cf585503d616f6421200a55552b563dac..dc5caa5cc071dc38520025c5df5d39d16c6c7b45 100644 (file)
@@ -1,6 +1,6 @@
-<NOSCRIPT>{--LOAD_URL_ERROR_1--}<a href="$content" rel="external" title="$content">$content</a>{--LOAD_URL_ERROR_2--}</NOSCRIPT>
-<SCRIPT language="JavaScript" type="text/javascript">
+<noscript>{--LOAD_URL_ERROR_1--}<a href="$content" rel="external" title="$content">$content</a>{--LOAD_URL_ERROR_2--}</noscript>
+<script language="JavaScript" type="text/javascript">
 <!--
 document.location.href='$content';
 //-->
-</SCRIPT>
+</script>
index 1c07db66493e8e1d77c7e2c9067fcf02c4b9cb3e..9603fee8e3b4469d3cd4da8eefa29262c34a2e33 100644 (file)
@@ -1,6 +1,6 @@
 Es wurde die Erweiterung <strong>$content</strong> in Ihrem {!MT_WORD!}
 automatisch deaktiviert, da sie veraltet ist und bald von mxchange.org nicht
 mehr unterst&uuml;tzt wird. Bitte schauen Sie in <a
- href="" title="Direktlink zu den Forenank&uuml;ndigungen" target="_blank">den
+ href="http://forum.mxchange.org/forum-6.html" title="Direktlink zu den Forenank&uuml;ndigungen" target="_blank">den
 Forenank&uuml;ndigungen</a> nach, ob bereits ein Eintrag zu der deaktivierten
 Erweiterung existiert. Dort sollte immer eine Ersatzerweiterung angegeben sein.
index 304460de25763f318bdd3acbeace9ffa0efb749b..100e3e7b0c2b058c729d3d9e199701834d239363 100644 (file)
--- a/view.php
+++ b/view.php
@@ -52,24 +52,24 @@ require('inc/config.php');
 
 if (((REQUEST_ISSET_GET(('user'))) || (REQUEST_ISSET_GET(('reseller')))) && (REQUEST_ISSET_GET(('banner')))) {
        // for later things... ;-)
-       $result = SQL_QUERY_ESC("SELECT url FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE id=%s LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT url FROM `{!_MYSQL_PREFIX!}_refbanner` WHERE `id`=%s LIMIT 1",
                array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) == 1)  {
                list($url) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
-               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET counter=counter+1 WHERE id=%s LIMIT 1",
+               SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refbanner` SET counter=counter+1 WHERE `id`=%s LIMIT 1",
                        array(bigintval(REQUEST_GET('banner'))), __FILE__, __LINE__);
 
                $type = substr($url, -3);
                header ('Content-Type: image/' . $type);
-               LOAD_URL($url, false);
+               redirectToUrl($url, false);
        } else {
                // Free memory
                SQL_FREERESULT($result);
        }
 } else {
        // Do nothing for now
-       LOAD_URL('index.php');
+       redirectToUrl('index.php');
 }
 
 // Shutdown