From 7b0f17cd637e388049d2167811e4332cec1e979b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 3 Apr 2009 09:32:14 +0000 Subject: [PATCH] New naming convention applied to many functions, see #118 for details --- DOCS/TODOs.txt | 107 ++- admin.php | 6 +- agb.php | 4 +- beg.php | 28 +- birthday_confirm.php | 14 +- click.php | 8 +- confirm.php | 4 +- css.php | 6 +- debug.php | 4 +- doubler.php | 32 +- img.php | 10 +- inc/autopurge.php | 2 +- inc/autopurge/purge-general.php | 10 +- inc/autopurge/purge-inact.php | 16 +- inc/autopurge/purge-mails.php | 2 +- inc/autopurge/purge-tsks.php | 2 +- inc/autopurge/purge-unconfirmed.php | 6 +- inc/check-reset.php | 2 +- inc/config-functions.php | 2 +- inc/config.php | 6 +- inc/databases.php | 17 +- inc/db/lib-mysql3.php | 12 +- inc/db/lib.php | 4 +- inc/doubler_send.php | 14 +- inc/extensions.php | 106 +-- inc/extensions/ext-admins.php | 6 +- inc/extensions/ext-autopurge.php | 6 +- inc/extensions/ext-beg.php | 6 +- inc/extensions/ext-birthday.php | 2 +- inc/extensions/ext-bonus.php | 10 +- inc/extensions/ext-cache.php | 6 +- inc/extensions/ext-country.php | 2 +- inc/extensions/ext-debug.php | 2 +- inc/extensions/ext-doubler.php | 2 +- inc/extensions/ext-holiday.php | 2 +- inc/extensions/ext-html_mail.php | 26 +- inc/extensions/ext-maintenance.php | 2 +- inc/extensions/ext-mediadata.php | 2 +- inc/extensions/ext-mydata.php | 2 +- inc/extensions/ext-nickname.php | 2 +- inc/extensions/ext-optimize.php | 2 +- inc/extensions/ext-order.php | 2 +- inc/extensions/ext-other.php | 2 +- inc/extensions/ext-payout.php | 2 +- inc/extensions/ext-rallye.php | 8 +- inc/extensions/ext-register.php | 10 +- inc/extensions/ext-rewrite.php | 12 +- inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-sql_patches.php | 30 +- inc/extensions/ext-surfbar.php | 4 +- inc/extensions/ext-task.php | 6 +- inc/extensions/ext-theme.php | 2 +- inc/extensions/ext-transfer.php | 2 +- inc/extensions/ext-user.php | 4 +- inc/extensions/ext-yoomedia.php | 4 +- inc/fatal_errors.php | 2 +- inc/filters.php | 24 +- inc/footer.php | 4 +- inc/functions.php | 868 +++++++++--------- inc/gen_mediadata.php | 2 +- inc/gen_refback.php | 6 +- inc/gen_sql_patches.php | 24 +- inc/header.php | 12 +- inc/inc-functions.php | 13 +- inc/install-inc.php | 12 +- inc/language.php | 10 +- inc/libs/admins_functions.php | 68 +- inc/libs/autopurge_functions.php | 6 +- inc/libs/beg_functions.php | 2 +- inc/libs/bonus_functions.php | 18 +- inc/libs/cache_functions.php | 12 +- inc/libs/country_functions.php | 2 +- inc/libs/doubler_functions.php | 12 +- inc/libs/holiday_functions.php | 15 +- inc/libs/html_mail_functions.php | 4 +- inc/libs/mediadata_functions.php | 36 +- inc/libs/newsletter_functions.php | 10 +- inc/libs/nickname_functions.php | 2 +- inc/libs/online_functions.php | 12 +- inc/libs/payout_functions.php | 2 +- inc/libs/primera_functions.php | 46 +- inc/libs/rallye_functions.php | 76 +- inc/libs/refback_functions.php | 24 +- inc/libs/register_functions.php | 31 +- inc/libs/removeip_functions.php | 6 +- inc/libs/rewrite_functions.php | 8 +- inc/libs/security_functions.php | 6 +- inc/libs/sponsor_functions.php | 62 +- inc/libs/surfbar_functions.php | 236 +++-- inc/libs/task_functions.php | 220 ++--- inc/libs/theme_functions.php | 22 +- inc/libs/transfer_functions.php | 10 +- inc/libs/user_functions.php | 20 +- inc/libs/wernis_functions.php | 122 +-- inc/libs/yoomedia_functions.php | 18 +- inc/load_cache.php | 2 +- inc/load_extensions.php | 28 +- inc/loader/load_cache-revision.php | 2 +- inc/mails/beg_mails.php | 14 +- inc/mails/birthday_mails.php | 32 +- inc/mails/bonus_mails.php | 6 +- inc/modules/admin.php | 30 +- inc/modules/admin/action- | 4 +- inc/modules/admin/action-admins.php | 4 +- inc/modules/admin/action-bank.php | 4 +- inc/modules/admin/action-country.php | 4 +- inc/modules/admin/action-doubler.php | 4 +- inc/modules/admin/action-email.php | 4 +- inc/modules/admin/action-holiday.php | 4 +- inc/modules/admin/action-login.php | 4 +- inc/modules/admin/action-logout.php | 4 +- inc/modules/admin/action-menu.php | 4 +- inc/modules/admin/action-misc.php | 4 +- inc/modules/admin/action-mods.php | 4 +- inc/modules/admin/action-newsletter.php | 4 +- inc/modules/admin/action-payouts.php | 4 +- inc/modules/admin/action-primera.php | 4 +- inc/modules/admin/action-rallye.php | 4 +- inc/modules/admin/action-repair.php | 4 +- inc/modules/admin/action-setup.php | 4 +- inc/modules/admin/action-sponsor.php | 4 +- inc/modules/admin/action-stats.php | 4 +- inc/modules/admin/action-surfbar.php | 4 +- inc/modules/admin/action-task.php | 4 +- inc/modules/admin/action-theme.php | 4 +- inc/modules/admin/action-transfer.php | 4 +- inc/modules/admin/action-user.php | 4 +- inc/modules/admin/action-wernis.php | 4 +- inc/modules/admin/admin-inc.php | 158 ++-- inc/modules/admin/overview-inc.php | 126 +-- inc/modules/admin/what-add_points.php | 14 +- inc/modules/admin/what-add_rallye.php | 12 +- inc/modules/admin/what-add_surfbar_url.php | 4 +- inc/modules/admin/what-admin_add.php | 4 +- inc/modules/admin/what-adminedit.php | 20 +- inc/modules/admin/what-admins_add.php | 2 +- inc/modules/admin/what-admins_contct.php | 8 +- inc/modules/admin/what-admins_edit.php | 20 +- inc/modules/admin/what-admins_mails.php | 12 +- inc/modules/admin/what-cache_stats.php | 8 +- inc/modules/admin/what-chk_regs.php | 8 +- inc/modules/admin/what-config_admins.php | 36 +- inc/modules/admin/what-config_autopurge.php | 12 +- inc/modules/admin/what-config_beg.php | 20 +- inc/modules/admin/what-config_bonus.php | 32 +- inc/modules/admin/what-config_cache.php | 4 +- inc/modules/admin/what-config_cats.php | 22 +- inc/modules/admin/what-config_doubler.php | 28 +- inc/modules/admin/what-config_email.php | 18 +- inc/modules/admin/what-config_holiday.php | 2 +- inc/modules/admin/what-config_home.php | 4 +- inc/modules/admin/what-config_mediadata.php | 8 +- inc/modules/admin/what-config_mods.php | 14 +- inc/modules/admin/what-config_newsletter.php | 4 +- inc/modules/admin/what-config_order.php | 6 +- inc/modules/admin/what-config_other.php | 20 +- inc/modules/admin/what-config_payouts.php | 35 +- inc/modules/admin/what-config_points.php | 37 +- .../admin/what-config_rallye_prices.php | 24 +- inc/modules/admin/what-config_register.php | 2 +- inc/modules/admin/what-config_register2.php | 14 +- inc/modules/admin/what-config_rewrite.php | 2 +- inc/modules/admin/what-config_secure.php | 6 +- inc/modules/admin/what-config_surfbar.php | 34 +- inc/modules/admin/what-config_transfer.php | 4 +- inc/modules/admin/what-config_wernis.php | 10 +- inc/modules/admin/what-del_email.php | 42 +- inc/modules/admin/what-del_holiday.php | 14 +- inc/modules/admin/what-del_sponsor.php | 14 +- inc/modules/admin/what-del_transfer.php | 10 +- inc/modules/admin/what-del_user.php | 6 +- inc/modules/admin/what-edit_emails.php | 12 +- inc/modules/admin/what-edit_sponsor.php | 34 +- inc/modules/admin/what-email_archiv.php | 10 +- inc/modules/admin/what-email_details.php | 20 +- inc/modules/admin/what-extensions.php | 32 +- inc/modules/admin/what-guestedit.php | 16 +- inc/modules/admin/what-list_autopurge.php | 12 +- inc/modules/admin/what-list_bank_package.php | 30 +- inc/modules/admin/what-list_beg.php | 22 +- inc/modules/admin/what-list_bonus.php | 26 +- inc/modules/admin/what-list_cats.php | 6 +- inc/modules/admin/what-list_country.php | 18 +- inc/modules/admin/what-list_doubler.php | 16 +- inc/modules/admin/what-list_holiday.php | 10 +- inc/modules/admin/what-list_links.php | 12 +- inc/modules/admin/what-list_newsletter.php | 4 +- inc/modules/admin/what-list_notifications.php | 8 +- inc/modules/admin/what-list_payouts.php | 30 +- inc/modules/admin/what-list_primera.php | 6 +- inc/modules/admin/what-list_rallyes.php | 106 +-- inc/modules/admin/what-list_refs.php | 42 +- inc/modules/admin/what-list_sponsor.php | 34 +- inc/modules/admin/what-list_sponsor_pay.php | 16 +- inc/modules/admin/what-list_sponsor_pays.php | 4 +- inc/modules/admin/what-list_surfbar_urls.php | 60 +- inc/modules/admin/what-list_task.php | 34 +- inc/modules/admin/what-list_transfer.php | 10 +- inc/modules/admin/what-list_unconfirmed.php | 14 +- inc/modules/admin/what-list_user.php | 72 +- inc/modules/admin/what-list_wernis.php | 6 +- inc/modules/admin/what-list_yoomedia_tm.php | 8 +- inc/modules/admin/what-lock_sponsor.php | 18 +- inc/modules/admin/what-lock_user.php | 26 +- inc/modules/admin/what-logs.php | 8 +- inc/modules/admin/what-maintenance.php | 6 +- inc/modules/admin/what-memedit.php | 33 +- inc/modules/admin/what-optimize.php | 10 +- inc/modules/admin/what-overview.php | 2 +- inc/modules/admin/what-payments.php | 22 +- inc/modules/admin/what-refbanner.php | 14 +- inc/modules/admin/what-repair_amnu.php | 10 +- inc/modules/admin/what-repair_cats.php | 2 +- inc/modules/admin/what-repair_gmnu.php | 8 +- inc/modules/admin/what-repair_mmnu.php | 8 +- inc/modules/admin/what-send_bonus.php | 6 +- inc/modules/admin/what-send_newsletter.php | 2 +- inc/modules/admin/what-sub_points.php | 10 +- inc/modules/admin/what-surfbar_stats.php | 12 +- inc/modules/admin/what-theme_check.php | 14 +- inc/modules/admin/what-theme_edit.php | 18 +- inc/modules/admin/what-theme_import.php | 12 +- inc/modules/admin/what-unlock_emails.php | 24 +- inc/modules/admin/what-unlock_sponsor.php | 32 +- .../admin/what-unlock_surfbar_urls.php | 4 +- inc/modules/admin/what-updates.php | 12 +- inc/modules/admin/what-usage.php | 8 +- inc/modules/admin/what-user_contct.php | 4 +- inc/modules/admin/what-usr_online.php | 20 +- inc/modules/chk_login.php | 8 +- inc/modules/frametester.php | 8 +- inc/modules/guest/action- | 4 +- inc/modules/guest/action-admin.php | 4 +- inc/modules/guest/action-main.php | 4 +- inc/modules/guest/action-members.php | 4 +- inc/modules/guest/action-online.php | 14 +- inc/modules/guest/action-sponsor.php | 4 +- inc/modules/guest/action-themes.php | 4 +- inc/modules/guest/what-active.php | 4 +- inc/modules/guest/what-admin.php | 2 +- inc/modules/guest/what-beg.php | 8 +- inc/modules/guest/what-confirm.php | 22 +- inc/modules/guest/what-doubler.php | 14 +- inc/modules/guest/what-login.php | 8 +- inc/modules/guest/what-mediadata.php | 82 +- inc/modules/guest/what-rallyes.php | 43 +- inc/modules/guest/what-register.php | 141 +-- inc/modules/guest/what-sponsor_infos.php | 4 +- inc/modules/guest/what-sponsor_login.php | 38 +- inc/modules/guest/what-sponsor_reg.php | 16 +- inc/modules/guest/what-stats.php | 48 +- inc/modules/guest/what-top10.php | 12 +- inc/modules/guest/what-welcome.php | 4 +- inc/modules/guest/what-wernis_portal.php | 6 +- inc/modules/index.php | 10 +- inc/modules/loader.php | 10 +- inc/modules/login.php | 14 +- inc/modules/member/action- | 6 +- inc/modules/member/action-account.php | 6 +- inc/modules/member/action-bank.php | 6 +- inc/modules/member/action-extras.php | 6 +- inc/modules/member/action-logout.php | 6 +- inc/modules/member/action-main.php | 6 +- inc/modules/member/action-order.php | 6 +- inc/modules/member/action-rals.php | 6 +- inc/modules/member/action-stats.php | 6 +- inc/modules/member/action-surfbar.php | 6 +- inc/modules/member/action-themes.php | 6 +- inc/modules/member/what- | 2 +- inc/modules/member/what-bank_create.php | 2 +- inc/modules/member/what-bank_deposit.php | 2 +- inc/modules/member/what-bank_infos.php | 2 +- inc/modules/member/what-bank_output.php | 2 +- inc/modules/member/what-bank_withdraw.php | 2 +- inc/modules/member/what-beg.php | 10 +- inc/modules/member/what-beg2.php | 8 +- inc/modules/member/what-bonus.php | 8 +- inc/modules/member/what-categories.php | 4 +- inc/modules/member/what-doubler.php | 22 +- inc/modules/member/what-guest.php | 4 +- inc/modules/member/what-holiday.php | 22 +- inc/modules/member/what-html_mail.php | 2 +- inc/modules/member/what-logout.php | 8 +- inc/modules/member/what-mydata.php | 78 +- inc/modules/member/what-newsletter.php | 12 +- inc/modules/member/what-nickname.php | 2 +- inc/modules/member/what-order.php | 35 +- inc/modules/member/what-payout.php | 24 +- inc/modules/member/what-points.php | 30 +- inc/modules/member/what-primera.php | 16 +- inc/modules/member/what-rallyes.php | 6 +- inc/modules/member/what-refback.php | 22 +- inc/modules/member/what-reflinks.php | 8 +- inc/modules/member/what-reflist.php | 16 +- inc/modules/member/what-sponsor.php | 2 +- inc/modules/member/what-stats.php | 18 +- inc/modules/member/what-support.php | 8 +- inc/modules/member/what-surfbar_book.php | 6 +- inc/modules/member/what-surfbar_list.php | 14 +- inc/modules/member/what-surfbar_start.php | 36 +- inc/modules/member/what-surfbar_stats.php | 2 +- inc/modules/member/what-themes.php | 12 +- inc/modules/member/what-transfer.php | 41 +- inc/modules/member/what-unconfirmed.php | 40 +- inc/modules/member/what-welcome.php | 12 +- inc/modules/member/what-wernis.php | 22 +- inc/modules/order.php | 18 +- inc/modules/sponsor/account.php | 12 +- inc/modules/sponsor/settings.php | 14 +- inc/modules/sponsor/welcome.php | 8 +- inc/monthly/monthly_beg.php | 12 +- inc/monthly/monthly_bonus.php | 12 +- inc/monthly/monthly_newsletter.php | 10 +- inc/monthly/monthly_surfbar.php | 2 +- inc/mysql-connect.php | 44 +- inc/mysql-manager.php | 446 ++++----- inc/patch-system.php | 2 +- inc/pool-update.php | 2 +- inc/pool/pool-bonus.php | 32 +- inc/pool/pool-user.php | 72 +- inc/profile-updte.php | 10 +- inc/request-functions.php | 2 +- inc/reset/reset_daily.php | 2 +- inc/reset/reset_holiday.php | 8 +- inc/reset/reset_surfbar.php | 2 +- inc/reset/reset_yoomedia.php | 2 +- inc/security.php | 2 +- inc/session-functions.php | 26 +- inc/session.php | 10 +- inc/stats_bonus.php | 10 +- inc/stylesheet.php | 8 +- inc/weekly/weekly_surfbar.php | 2 +- index.php | 16 +- install.php | 8 +- js.php | 8 +- lead-confirm.php | 10 +- login.php | 6 +- mailid.php | 26 +- mailid_top.php | 38 +- modules.php | 14 +- ref.php | 6 +- show_bonus.php | 10 +- sponsor_confirm.php | 4 +- sponsor_ref.php | 4 +- surfbar.php | 26 +- templates/de/html/admin/admin_add_max.tpl | 4 +- .../admin/admin_list_sponsor_pay_edit_row.tpl | 6 +- .../de/html/admin/admin_send_bonus_form.tpl | 2 +- .../de/html/admin/admin_send_yoomedia.tpl | 2 +- templates/de/html/index.tpl | 2 +- .../de/html/member/member_order_page2.tpl | 4 +- .../de/html/member/member_support_form.tpl | 2 +- .../de/html/member/member_welcome_header.tpl | 6 +- templates/de/html/redirect_url.tpl | 6 +- .../de/html/task/task_ext_deactivated.tpl | 2 +- view.php | 8 +- 356 files changed, 3572 insertions(+), 3438 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 7e0d780754..eb4caf6032 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -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); @@ -49,13 +53,14 @@ ./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 @@ -126,8 +131,8 @@ ./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 @@ -145,8 +150,8 @@ ./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 @@ -167,10 +172,11 @@ ./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 @@ -181,20 +187,21 @@ ./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 diff --git a/admin.php b/admin.php index d8c4f7cec6..61891e3b8a 100644 --- 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&sql_patches=1'); + redirectToUrl('modules.php?module=admin&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 a05c889d0b..1c4a033e2f 100644 --- 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&what=agb'); + redirectToUrl('modules.php?module=index&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 f849daf87e..da8503b9d4 100644 --- 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&msg='.$msg.'&ext=beg'); + if ((!empty($msg)) && (!empty($msg))) redirectToUrl('modules.php?module=index&msg='.$msg.'&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... ;-) diff --git a/birthday_confirm.php b/birthday_confirm.php index 3d71b7971e..ff57185dad 100644 --- a/birthday_confirm.php +++ b/birthday_confirm.php @@ -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).")
\n"; + //* DEBUG: */ echo "uid=".$uid.",chk=".$chk." (".strlen($chk).'/'.strlen(REQUEST_GET('check')).'/'.SQL_NUMROWS($result).")
\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... ;-) diff --git a/click.php b/click.php index d5addc6764..82ec364614 100644 --- 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(); diff --git a/confirm.php b/confirm.php index 3ca3a5e3be..5caeae5be7 100644 --- a/confirm.php +++ b/confirm.php @@ -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 3babf5ce26..2c9c3369f8 100644 --- 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'); // ?> diff --git a/debug.php b/debug.php index 39248d2dfd..654823a20c 100644 --- 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')); diff --git a/doubler.php b/doubler.php index 189925ac4c..04f02e8177 100644 --- a/doubler.php +++ b/doubler.php @@ -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 cac96c6648..351b7e1137 100644 --- 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... ;-) diff --git a/inc/autopurge.php b/inc/autopurge.php index fc56479628..5f2af6265f 100644 --- a/inc/autopurge.php +++ b/inc/autopurge.php @@ -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'); diff --git a/inc/autopurge/purge-general.php b/inc/autopurge/purge-general.php index acaacc33ff..0e4d9ee522 100644 --- a/inc/autopurge/purge-general.php +++ b/inc/autopurge/purge-general.php @@ -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 diff --git a/inc/autopurge/purge-inact.php b/inc/autopurge/purge-inact.php index a69541665e..285a3abc78 100644 --- a/inc/autopurge/purge-inact.php +++ b/inc/autopurge/purge-inact.php @@ -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 diff --git a/inc/autopurge/purge-mails.php b/inc/autopurge/purge-mails.php index 05c3242fb4..8599f88107 100644 --- a/inc/autopurge/purge-mails.php +++ b/inc/autopurge/purge-mails.php @@ -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 } diff --git a/inc/autopurge/purge-tsks.php b/inc/autopurge/purge-tsks.php index 1903319a0f..68ba60ff67 100644 --- a/inc/autopurge/purge-tsks.php +++ b/inc/autopurge/purge-tsks.php @@ -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 diff --git a/inc/autopurge/purge-unconfirmed.php b/inc/autopurge/purge-unconfirmed.php index 152689ba98..0ad79fdabf 100644 --- a/inc/autopurge/purge-unconfirmed.php +++ b/inc/autopurge/purge-unconfirmed.php @@ -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 diff --git a/inc/check-reset.php b/inc/check-reset.php index 1e583da042..56ffcadbbc 100644 --- a/inc/check-reset.php +++ b/inc/check-reset.php @@ -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(); diff --git a/inc/config-functions.php b/inc/config-functions.php index 3fd823f6c7..186ede8339 100644 --- a/inc/config-functions.php +++ b/inc/config-functions.php @@ -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 diff --git a/inc/config.php b/inc/config.php index 3988d8648b..dfc866fb73 100644 --- a/inc/config.php +++ b/inc/config.php @@ -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); diff --git a/inc/databases.php b/inc/databases.php index 52101360c3..f06b34c034 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -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 = ''; diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index 3ef8c2acc8..b0de8af3fc 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -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."
\n"; + //* DEBUG: */ print __LINE__.':'.$sql."
\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."
\n"; + //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."
\n"; // Remove brackes $columnName = str_replace("(", '', str_replace(")", '', $columnName)); - //* DEBUG: */ print __LINE__.":".$columnName."----------------".$begin."
\n"; + //* DEBUG: */ print __LINE__.':'.$columnName."----------------".$begin."
\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."
\n"; + //* DEBUG: */ print __LINE__.':'.$sql."
\n"; $result = SQL_QUERY($sql, $F, $L, false); } // END - if } else { // Other ALTER TABLE query - //* DEBUG: */ print __LINE__.":".$sql."
\n"; + //* DEBUG: */ print __LINE__.':'.$sql."
\n"; $result = SQL_QUERY($sql, $F, $L, false); } diff --git a/inc/db/lib.php b/inc/db/lib.php index 31e2194b31..72a1f6a525 100644 --- a/inc/db/lib.php +++ b/inc/db/lib.php @@ -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')." -> R.I.P."); diff --git a/inc/doubler_send.php b/inc/doubler_send.php index b9f06e0191..9388fc6b82 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -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 diff --git a/inc/extensions.php b/inc/extensions.php index 8f1e65b4ab..d6c49ad67c 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -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."
\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!
\n"; + //* DEBUG: */ print __FUNCTION__."[".__LINE__."]:insert=".EXT_GET_CURR_NAME().'/'.EXT_GET_VERSION()." - INSERT!
\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()."
\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&logout=1&' . $EXT_LOAD_MODE . '=sql_patches'); + redirectToUrl('modules.php?module=admin&logout=1&' . $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&logout=1&' . $load_mode . '=sql_patches'); + redirectToUrl('modules.php?module=admin&logout=1&' . $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&msg=' . getCode('EXTENSION_PROBLEM') . '&ext=' . $ext_name); + redirectToUrl('modules.php?module=index&msg=' . getCode('EXTENSION_PROBLEM') . '&ext=' . $ext_name); } // END - if } diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index da94d02963..5702053bc2 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -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("set_session() mit @-Zeichen gegen ungewollte Ausgaben abgesichert."); + EXT_SET_UPDATE_NOTES("setSession() 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'); // ?> diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 78f3c9baf0..439280c270 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -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 ADMIN_USER_PROFILE_LINK() ausgelagert."); + EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion generateUserProfileLink() 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 ADMIN_USER_PROFILE_LINK() ausgelagert."); + EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion generateUserProfileLink() 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'); // ?> diff --git a/inc/extensions/ext-beg.php b/inc/extensions/ext-beg.php index 4b90e4b27e..1fe6c89720 100644 --- a/inc/extensions/ext-beg.php +++ b/inc/extensions/ext-beg.php @@ -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')"); diff --git a/inc/extensions/ext-birthday.php b/inc/extensions/ext-birthday.php index 2d18f81549..fe6cebbd3a 100644 --- a/inc/extensions/ext-birthday.php +++ b/inc/extensions/ext-birthday.php @@ -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 diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index bbe4664e28..11316d0360 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -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 "nach oben gerutsch"."); diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 1dd7055d2e..5720fb4219 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -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__, "(".__LINE__."): ".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'); // ?> diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 8ed70b39b7..58c2069238 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -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'); // ?> diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 165c5f215a..94c0a7808c 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -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'); // ?> diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 282cffbf93..26b47623fd 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -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 diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 259077c9d1..a54950bc13 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -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 ADMIN_USER_PROFILE_LINK() ausgelagert."); + EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion generateUserProfileLink() ausgelagert."); break; case '0.0.9': // SQL queries for v0.0.9 diff --git a/inc/extensions/ext-html_mail.php b/inc/extensions/ext-html_mail.php index 0d20e30f7b..b32605ae41 100644 --- a/inc/extensions/ext-html_mail.php +++ b/inc/extensions/ext-html_mail.php @@ -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?) diff --git a/inc/extensions/ext-maintenance.php b/inc/extensions/ext-maintenance.php index e2a38bafb0..3e1c405d72 100644 --- a/inc/extensions/ext-maintenance.php +++ b/inc/extensions/ext-maintenance.php @@ -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'); // ?> diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index a3e03c74d0..d98c951260 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -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'); // ?> diff --git a/inc/extensions/ext-mydata.php b/inc/extensions/ext-mydata.php index 04732f2eea..3933871672 100644 --- a/inc/extensions/ext-mydata.php +++ b/inc/extensions/ext-mydata.php @@ -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 country, die Sie sich noch optional von meiner Seite herunterladen müssen.

-Wichtig: Laden Sie noch die Template member_mydata_overview und member_mydata_edit (beide zu finden unter templates/".GET_LANGUAGE()."/html/member/ !) mit hoch!"); +Wichtig: Laden Sie noch die Template member_mydata_overview und member_mydata_edit (beide zu finden unter templates/".getLanguage()."/html/member/ !) mit hoch!"); // Depends on 'country'! EXT_ADD_UPDATE_DEPENDS('country'); diff --git a/inc/extensions/ext-nickname.php b/inc/extensions/ext-nickname.php index 266e224bf2..53e42ef4e0 100644 --- a/inc/extensions/ext-nickname.php +++ b/inc/extensions/ext-nickname.php @@ -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'); diff --git a/inc/extensions/ext-optimize.php b/inc/extensions/ext-optimize.php index de106a14ca..6dc8c6eed0 100644 --- a/inc/extensions/ext-optimize.php +++ b/inc/extensions/ext-optimize.php @@ -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'); // ?> diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 9131000301..044217af8b 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -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 WHERE ext_active='Y' tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt."); + EXT_SET_UPDATE_NOTES("Ein WHERE `ext_active`='Y' tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt."); break; case '0.4.5': // SQL queries for v0.4.5 diff --git a/inc/extensions/ext-other.php b/inc/extensions/ext-other.php index dcb4ddf277..36d58b5a2f 100644 --- a/inc/extensions/ext-other.php +++ b/inc/extensions/ext-other.php @@ -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'); // ?> diff --git a/inc/extensions/ext-payout.php b/inc/extensions/ext-payout.php index 246d48770d..f050ce9489 100644 --- a/inc/extensions/ext-payout.php +++ b/inc/extensions/ext-payout.php @@ -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 ADMIN_USER_PROFILE_LINK() ausgelagert."); + EXT_SET_UPDATE_NOTES("Link zum Mitgliedsprofil in Funktion generateUserProfileLink() ausgelagert."); break; case '0.2.8': // SQL queries for v0.2.8 diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index d57f91383c..90b7f0d1ec 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -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 generateUserProfileLink() 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
  • $DATA[min_users]
  • $DATA[min_prices]
  • -Zudem sollten Sie mindestens folgende Templates (in templates/".GET_LANGUAGE()."/html/guest/ !) aktualisieren:
    +Zudem sollten Sie mindestens folgende Templates (in templates/".getLanguage()."/html/guest/ !) aktualisieren: