From 6bcc8f1ebbd646d15c5905a5cec47d1c1e446238 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 26 Jul 2009 19:43:14 +0000 Subject: [PATCH] Some rewrites, TODOs handled: - Some rewrites of ugly code - Internal TODO closed - New TODOs added - TODOs.txt updated --- DOCS/TODOs.txt | 89 ++++++++++--------- inc/functions.php | 3 + inc/modules/admin/what-admin_add.php | 5 +- inc/modules/admin/what-admins_add.php | 15 ++-- inc/modules/admin/what-config_admins.php | 2 +- inc/modules/admin/what-config_cats.php | 2 +- inc/modules/admin/what-config_payouts.php | 2 +- .../admin/what-config_rallye_prices.php | 2 +- inc/modules/admin/what-guest_add.php | 7 +- inc/modules/admin/what-list_country.php | 2 +- inc/modules/admin/what-list_sponsor_pay.php | 12 +-- inc/modules/admin/what-mem_add.php | 5 +- templates/de/html/admin/admin_admins_add.tpl | 8 +- 13 files changed, 84 insertions(+), 70 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 8225c9e087..6bd21db085 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -1,7 +1,7 @@ ### WARNING: THIS FILE IS AUTO-GENERATED BY DOCS/todo-builder.sh (1000/quix0r) ### ### DO NOT EDIT THIS FILE. ### ./beg.php:193: // @TODO Opps, what is missing here??? -./inc/cache/config-local.php:117:// @TODO Rewrite the following three constants, somehow... +./inc/cache/config-local.php:120:// @TODO Rewrite the following three constants, somehow... ./inc/config-functions.php:182: // @TODO Make this all better... :-/ ./inc/config-functions.php:207: // @TODO Rewrite these all to config entries, if somehow possible ./inc/extensions/ext-sql_patches.php:705: // @TODO Rewrite this to a filter! @@ -10,22 +10,24 @@ ./inc/extensions/ext-surfbar.php:237: // @TODO Set some constants we need??? ./inc/extensions.php:355:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/extensions.php:431: // @TODO Extension is loaded, what next? -./inc/functions.php:1221: // @TODO Rewrite this unnice code -./inc/functions.php:1282: // @TODO Remove this if() block if all is working fine -./inc/functions.php:1582: // @TODO This can be, somehow, rewritten -./inc/functions.php:2456: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? -./inc/functions.php:2458: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? -./inc/functions.php:247: // @TODO Fine all templates which are using these direct variables and rewrite them. -./inc/functions.php:248: // @TODO After this step is done, this else-block is history -./inc/functions.php:2519:// @TODO Please describe this function -./inc/functions.php:2531: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); -./inc/functions.php:2614: // @TODO Add a little more infos here -./inc/functions.php:2625: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. -./inc/functions.php:2802:// @TODO Rewrite this function to use readFromFile() and writeToFile() -./inc/functions.php:463:// @TODO Rewrite this to an extension 'smtp' +./inc/functions.php:1224: // @TODO Rewrite this unnice code +./inc/functions.php:1285: // @TODO Remove this if() block if all is working fine +./inc/functions.php:1585: // @TODO This can be, somehow, rewritten +./inc/functions.php:211: // @TODO Remove this sanity-check if all is fine +./inc/functions.php:2459: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? +./inc/functions.php:2461: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? +./inc/functions.php:250: // @TODO Fine all templates which are using these direct variables and rewrite them. +./inc/functions.php:251: // @TODO After this step is done, this else-block is history +./inc/functions.php:2522:// @TODO Please describe this function +./inc/functions.php:2534: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); +./inc/functions.php:2617: // @TODO Add a little more infos here +./inc/functions.php:2628: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. +./inc/functions.php:2785: // @TODO Are these convertions still required? +./inc/functions.php:2803:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:466:// @TODO Rewrite this to an extension 'smtp' ./inc/install-inc.php:20: * @TODO Rewrite all constants in this include file * -./inc/language/de.php:1157:// @TODO Rewrite these two constants -./inc/language/de.php:1173:// @TODO Rewrite these five constants +./inc/language/de.php:1159:// @TODO Rewrite these two constants +./inc/language/de.php:1175:// @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. ./inc/language/de.php:855:// @TODO Are these constants still used? ./inc/language/de.php:866:// @TODO Are these constants longer used? @@ -43,14 +45,14 @@ ./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/register_functions.php:62: // @TODO Rewrite these constants, too -./inc/libs/surfbar_functions.php:1475: // @TODO This can be somehow rewritten -./inc/libs/surfbar_functions.php:948: // @TODO Invalid salt should be refused +./inc/libs/surfbar_functions.php:1481: // @TODO This can be somehow rewritten +./inc/libs/surfbar_functions.php:954: // @TODO Invalid salt should be refused ./inc/libs/task_functions.php:261: // @TODO These can be rewritten to filter ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters ./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); ./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); ./inc/libs/user_functions.php:377: // @TODO Can this query be merged with above query? -./inc/libs/yoomedia_functions.php:65: $response = YOOMEDIA_QUERY_API("out_textmail.php", true); // @TODO Ask Yoo!Media for test script +./inc/libs/yoomedia_functions.php:65: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script ./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block ./inc/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? @@ -64,21 +66,24 @@ ./inc/modules/admin/overview-inc.php:253: // @TODO Rewrite this to something with include files ./inc/modules/admin/overview-inc.php:291: // @TODO This may also be rewritten to include files ./inc/modules/admin/overview-inc.php:293: default: // @TODO Unknown support mode +./inc/modules/admin/overview-inc.php:425: // @TODO Try to move this in includes ./inc/modules/admin/overview-inc.php:444: // @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:95: // @TODO Why is this set to 'done'? ./inc/modules/admin/what-add_points.php:120: // @TODO Rewrite these both constants ./inc/modules/admin/what-add_points.php:54: // @TODO Rewrite this constant -./inc/modules/admin/what-admin_add.php:120: // @TODO This can be somehow rewritten to a function -./inc/modules/admin/what-admin_add.php:77: // @TODO This can be somehow rewritten to a function +./inc/modules/admin/what-add_surfbar_url.php:57: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite REQUEST_POST() calls to $POST +./inc/modules/admin/what-admin_add.php:121: // @TODO This can be somehow rewritten to a function +./inc/modules/admin/what-admin_add.php:62: // @TODO Cant this be rewritten? +./inc/modules/admin/what-admin_add.php:78: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-adminedit.php:250: // @TODO Rewrite this constant -./inc/modules/admin/what-admins_add.php:68: // @TODO Do we still need this ugly code here? ./inc/modules/admin/what-admins_mails.php:100: // @TODO Rewrite this constant ./inc/modules/admin/what-admins_mails.php:173: // @TODO Rewrite this constant ./inc/modules/admin/what-admins_mails.php:61: // @TODO Can this be rewritten??? ./inc/modules/admin/what-chk_regs.php:62: // @TODO Rewritings: sname->surname,fname->family,ip->REMOTE_ADDR,ref->refid,hash->user_hash in template ./inc/modules/admin/what-chk_regs.php:81: // @TODO Rewrite this constant -./inc/modules/admin/what-config_admins.php:160: // @TODO This causes the whole (!) menu cache being rebuild +./inc/modules/admin/what-config_admins.php:154: // @TODO Rewrite this to filter 'run_sqls' +./inc/modules/admin/what-config_admins.php:164: // @TODO This causes the whole (!) menu cache being rebuild ./inc/modules/admin/what-config_cats.php:192: // @TODO Rewrite this constant ./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 @@ -97,10 +102,11 @@ ./inc/modules/admin/what-edit_emails.php:113: // @TODO Yet another constant to rewrite ./inc/modules/admin/what-edit_emails.php:60: // @TODO More constants to rewrite ./inc/modules/admin/what-edit_emails.php:95: // @TODO Rewritings: subj->subject in template -./inc/modules/admin/what-extensions.php:154: // @TODO Rewrite this constant -./inc/modules/admin/what-extensions.php:333: // @TODO Rewrite this to a filter -./inc/modules/admin/what-guest_add.php:122: // @TODO This can be somehow rewritten to a function -./inc/modules/admin/what-guest_add.php:77: // @TODO This can be somehow rewritten to a function +./inc/modules/admin/what-extensions.php:159: // @TODO Rewrite this constant +./inc/modules/admin/what-extensions.php:338: // @TODO Rewrite this to a filter +./inc/modules/admin/what-guest_add.php:123: // @TODO This can be somehow rewritten to a function +./inc/modules/admin/what-guest_add.php:62: // @TODO Cant this be rewritten? +./inc/modules/admin/what-guest_add.php:78: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-guestedit.php:284: // @TODO Rewrite this constant ./inc/modules/admin/what-list_autopurge.php:55:// @TODO Rewrite those lines to filter ./inc/modules/admin/what-list_autopurge.php:78: // @TODO Rewritings: sname->surname,fname->family in templates @@ -133,8 +139,9 @@ ./inc/modules/admin/what-lock_user.php:133: // @TODO Rewrite these all constants ./inc/modules/admin/what-logs.php:69: // @TODO Fix content-type here ./inc/modules/admin/what-logs.php:72: // @TODO Fix content-type here -./inc/modules/admin/what-mem_add.php: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-mem_add.php:121: // @TODO This can be somehow rewritten to a function +./inc/modules/admin/what-mem_add.php:63: // @TODO Cant this be rewritten? +./inc/modules/admin/what-mem_add.php:79: // @TODO This can be somehow rewritten to a function ./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 @@ -192,24 +199,24 @@ ./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: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:1770: // @TODO Find a way for updating $_CONFIG here -./inc/mysql-manager.php:1794: // @TODO Find a way for updating $_CONFIG here -./inc/mysql-manager.php:1817:// @TODO Can this be rewritten to a filter? -./inc/mysql-manager.php:1879: // @TODO Rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1552: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1595: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:1773: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1797: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1820:// @TODO Can this be rewritten to a filter? +./inc/mysql-manager.php:1882: // @TODO Rewrite this to $content = SQL_FETCHARRAY() ./inc/mysql-manager.php:199: // @TODO Nothing helped??? -./inc/mysql-manager.php:2173: // @TODO This can be somehow rewritten +./inc/mysql-manager.php:2176: // @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 redirectToUrl('admin.php'); +./inc/mysql-manager.php:950: // @TODO Why does this lead into an endless loop but we still need it??? +./inc/mysql-manager.php:951: // @TODO Commented out redirectToUrl('admin.php'); ./inc/wrapper-functions.php:152:// @TODO Implement $compress ./inc/wrapper-functions.php:159:// @TODO Implement $decompress -./inc/wrapper-functions.php:385:// @TODO Do some more sanity check here +./inc/wrapper-functions.php:391:// @TODO Do some more sanity check here ./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:232: // @DEPRECATED Try to rewrite the if() condition -./inc/functions.php:246: // @DEPRECATED +./inc/functions.php:235: // @DEPRECATED Try to rewrite the if() condition +./inc/functions.php:249: // @DEPRECATED ./inc/language-functions.php:55: // @DEPRECATED Language array element found in BIG_LETTERS ./inc/language-functions.php:58: // @DEPRECATED Deprecated constant found diff --git a/inc/functions.php b/inc/functions.php index 71538ea798..2900e464e0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -208,6 +208,9 @@ function getTotalFatalErrors () { // Load a template file and return it's content (only it's name; do not use ' or ") function LOAD_TEMPLATE ($template, $return=false, $content=array()) { + // @TODO Remove this sanity-check if all is fine + if (!is_bool($return)) debug_report_bug('return is not bool (' . gettype($return) . ')'); + // Add more variables which you want to use in your template files global $DATA, $username; diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 18a9dcfdee..34a57b82f0 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -46,9 +46,9 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Check if the admin has entered title and what-php file name... -if (((!REQUEST_ISSET_POST(('title'))) || (!REQUEST_ISSET_POST(('menu'))) || (!REQUEST_ISSET_POST(('descr')))) && (isFormSent())) { +if (((!REQUEST_ISSET_POST('title')) || (!REQUEST_ISSET_POST(('menu'))) || (!REQUEST_ISSET_POST(('descr')))) && (isFormSent())) { REQUEST_UNSET_POST('ok'); -} +} // END - if if (!isFormSent()) { @@ -59,6 +59,7 @@ if (!isFormSent()) $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure + // @TODO Cant this be rewritten? while ($content = SQL_FETCHARRAY($result)) { // Menu actions $menus[] = $content['action']; diff --git a/inc/modules/admin/what-admins_add.php b/inc/modules/admin/what-admins_add.php index d9fd08a64d..1d936d423b 100644 --- a/inc/modules/admin/what-admins_add.php +++ b/inc/modules/admin/what-admins_add.php @@ -40,7 +40,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); -} +} // END - if // Add description as navigation point ADD_DESCR('admin', __FILE__); @@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__); // Display form is default $FORM = true; -if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('login')) && (REQUEST_ISSET_POST('email')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) { +if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST('login')) && (REQUEST_ISSET_POST('email')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))) && (REQUEST_POST('pass1') == REQUEST_POST('pass2'))) { // Add admin when not added already if (REGISTER_ADMIN(REQUEST_POST('login'), generateHash(REQUEST_POST('pass1')), REQUEST_POST('email')) == 'done') { // Do not ouput any form! @@ -64,13 +64,14 @@ if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST('login')) && (REQUEST_I // Shall we display the form? if ($FORM === true) { - // Set missing elements - // @TODO Do we still need this ugly code here? - if (!REQUEST_ISSET_POST('login')) REQUEST_SET_POST('login', ''); - if (!REQUEST_ISSET_POST('email')) REQUEST_SET_POST('email', ''); + // Prepare content + $content = merge_array( + array('login' => '', 'email' => ''), + REQUEST_POST_ARRAY() + ); // Load form from template - LOAD_TEMPLATE('admin_admins_add', REQUEST_POST_ARRAY()); + LOAD_TEMPLATE('admin_admins_add', false, $content); } // END - if // diff --git a/inc/modules/admin/what-config_admins.php b/inc/modules/admin/what-config_admins.php index 14cb457419..f09c25a149 100644 --- a/inc/modules/admin/what-config_admins.php +++ b/inc/modules/admin/what-config_admins.php @@ -167,7 +167,7 @@ if ((REQUEST_ISSET_POST('edit')) && ($SEL > 0)) { // Entries deleted LOAD_TEMPLATE('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED')); -} elseif (REQUEST_ISSET_POST(('add'))) { +} elseif (REQUEST_ISSET_POST('add')) { // Check if everything is fine... $mode = getAdminDefaultAcl(bigintval(REQUEST_POST('admin_id'))); diff --git a/inc/modules/admin/what-config_cats.php b/inc/modules/admin/what-config_cats.php index 42e35ff3d0..fbede77ba6 100644 --- a/inc/modules/admin/what-config_cats.php +++ b/inc/modules/admin/what-config_cats.php @@ -49,7 +49,7 @@ ADD_DESCR('admin', __FILE__); // Init variable to avoid a notice $CATS = ''; -if (REQUEST_ISSET_POST(('add'))) { +if (REQUEST_ISSET_POST('add')) { // Add a new category $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_cats` WHERE cat='%s' LIMIT 1", array(REQUEST_POST('catname')), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-config_payouts.php b/inc/modules/admin/what-config_payouts.php index 47b031141f..19b350a141 100644 --- a/inc/modules/admin/what-config_payouts.php +++ b/inc/modules/admin/what-config_payouts.php @@ -48,7 +48,7 @@ ADD_DESCR('admin', __FILE__); if (REQUEST_ISSET_POST(('rate'))) REQUEST_SET_POST('rate', convertCommaToDot(REQUEST_POST('rate'))); -if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('title'))) && (REQUEST_POST('rate') > 0)) { +if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST('title')) && (REQUEST_POST('rate') > 0)) { // Add new payout type $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_payout_types` WHERE type='%s' LIMIT 1", array(REQUEST_POST('title')), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-config_rallye_prices.php b/inc/modules/admin/what-config_rallye_prices.php index 380f1856be..a3d8edee32 100644 --- a/inc/modules/admin/what-config_rallye_prices.php +++ b/inc/modules/admin/what-config_rallye_prices.php @@ -47,7 +47,7 @@ ADD_DESCR('admin', __FILE__); if (REQUEST_ISSET_GET(('rallye'))) { // Price submitted? - if (REQUEST_ISSET_POST(('add'))) { + if (REQUEST_ISSET_POST('add')) { if ((REQUEST_ISSET_POST(('level'))) && ((REQUEST_ISSET_POST(('points'))) || (REQUEST_ISSET_POST(('info'))))) { // Submitted data is valid, but maybe we already have this price level? $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_rallye_prices` WHERE rallye_id=%s AND price_level='%s' LIMIT 1", diff --git a/inc/modules/admin/what-guest_add.php b/inc/modules/admin/what-guest_add.php index 650e4ed667..a9ceac643f 100644 --- a/inc/modules/admin/what-guest_add.php +++ b/inc/modules/admin/what-guest_add.php @@ -46,10 +46,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Check if the admin has entered title and what-php file name... -if (((!REQUEST_ISSET_POST(('title'))) || (!REQUEST_ISSET_POST(('menu')))) && (isFormSent())) { +if (((!REQUEST_ISSET_POST('title')) || (!REQUEST_ISSET_POST(('menu')))) && (isFormSent())) { // Abort adding the menu entry REQUEST_UNSET_POST('ok'); -} +} // END - if if (!isFormSent()) { // Create arrays @@ -59,6 +59,7 @@ if (!isFormSent()) { $result = SQL_QUERY("SELECT action, title, sort FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure + // @TODO Cant this be rewritten? while ($content = SQL_FETCHARRAY($result)) { // Menu actions $menus[] = $content['action']; @@ -68,7 +69,7 @@ if (!isFormSent()) { // Below this menu point should the new be added so we simply increase the sort value by 1 :-) $below[] = $content['sort'] + 1; - } + } // END - while // Free memory SQL_FREERESULT($result); diff --git a/inc/modules/admin/what-list_country.php b/inc/modules/admin/what-list_country.php index 780a8f392c..5ccf118757 100644 --- a/inc/modules/admin/what-list_country.php +++ b/inc/modules/admin/what-list_country.php @@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Add new code? -if ((REQUEST_ISSET_POST(('add'))) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ISSET_POST(('descr')))) { +if ((REQUEST_ISSET_POST('add')) && (REQUEST_ISSET_POST(('code'))) && (REQUEST_ISSET_POST(('descr')))) { // Check if country code does already exist $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_countries` WHERE code='%s' LIMIT 1", array(strtoupper(REQUEST_POST('code'))), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-list_sponsor_pay.php b/inc/modules/admin/what-list_sponsor_pay.php index 512e2a7064..dbf1afe7a6 100644 --- a/inc/modules/admin/what-list_sponsor_pay.php +++ b/inc/modules/admin/what-list_sponsor_pay.php @@ -47,15 +47,15 @@ ADD_DESCR('admin', __FILE__); $message = ''; -if (REQUEST_ISSET_POST(('add'))) { +if (REQUEST_ISSET_POST('add')) { // Check input variables - if (!REQUEST_ISSET_POST(('pay_name'))) REQUEST_UNSET_POST(('add')); - if ((round(REQUEST_POST('pay_rate')) == 0) || (!REQUEST_ISSET_POST(('pay_rate')))) REQUEST_UNSET_POST(('add')); + if (!REQUEST_ISSET_POST(('pay_name'))) REQUEST_UNSET_POST('add'); + if ((round(REQUEST_POST('pay_rate')) == 0) || (!REQUEST_ISSET_POST(('pay_rate')))) REQUEST_UNSET_POST('add'); REQUEST_SET_POST('pay_min_count', bigintval(REQUEST_POST('pay_min_count'))); - if ((REQUEST_POST('pay_min_count') == 0) || (!REQUEST_ISSET_POST(('pay_min_count')))) REQUEST_UNSET_POST(('add')); - if (!REQUEST_ISSET_POST(('pay_currency'))) REQUEST_UNSET_POST(('add')); + if ((REQUEST_POST('pay_min_count') == 0) || (!REQUEST_ISSET_POST(('pay_min_count')))) REQUEST_UNSET_POST('add'); + if (!REQUEST_ISSET_POST(('pay_currency'))) REQUEST_UNSET_POST('add'); } elseif ((REQUEST_ISSET_POST('edit')) || (REQUEST_ISSET_POST('del')) || (REQUEST_ISSET_POST('change')) || (REQUEST_ISSET_POST('remove'))) { // Check if at least one entry was selected @@ -103,7 +103,7 @@ SET pay_name='%s', pay_rate='%s', pay_min_count='%s', pay_currency='%s' WHERE `i } } -if (REQUEST_ISSET_POST(('add'))) { +if (REQUEST_ISSET_POST('add')) { // Check if entry with same name does exists $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_sponsor_paytypes` WHERE pay_name='%s' LIMIT 1", array(REQUEST_POST('pay_name')), __FILE__, __LINE__); diff --git a/inc/modules/admin/what-mem_add.php b/inc/modules/admin/what-mem_add.php index 3269df0ff7..5004189a9e 100644 --- a/inc/modules/admin/what-mem_add.php +++ b/inc/modules/admin/what-mem_add.php @@ -47,7 +47,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR('admin', __FILE__); // Check if the admin has entered title and what-php file name... -if ((!REQUEST_ISSET_POST(('title'))) && (isFormSent())) { +if ((!REQUEST_ISSET_POST('title')) && (isFormSent())) { REQUEST_UNSET_POST('ok'); } // END - if @@ -60,6 +60,7 @@ if (!isFormSent()) { __FILE__, __LINE__); if (SQL_NUMROWS($result) > 0) { // Read menu structure + // @TODO Cant this be rewritten? while ($content = SQL_FETCHARRAY($result)) { // Menu actions $menus[] = $content['action']; @@ -69,7 +70,7 @@ if (!isFormSent()) { // Below this menu point should the new be added so we simply increase the sort value by 1 :-) $below[] = $content['sort'] + 1; - } + } // END - if // Free memory SQL_FREERESULT($result); diff --git a/templates/de/html/admin/admin_admins_add.tpl b/templates/de/html/admin/admin_admins_add.tpl index 4ff1ef47be..fe291db834 100644 --- a/templates/de/html/admin/admin_admins_add.tpl +++ b/templates/de/html/admin/admin_admins_add.tpl @@ -11,7 +11,7 @@ {--ADMIN_ADMINS_ENTER_LOGIN--}:   + class="admin_normal" size="10" maxlength="255" value="$content[login]" />   @@ -20,7 +20,7 @@ {--ADMIN_ADMINS_ENTER_EMAIL--}:   + size="25" maxlength="255" value="$content[email]" />   @@ -29,7 +29,7 @@ {--ADMIN_ADMINS_ENTER_PASS1--}:   + size="10" maxlength="255" />   @@ -38,7 +38,7 @@ {--ADMIN_ADMINS_ENTER_PASS2--}:   + size="10" maxlength="255" />   -- 2.30.2