From 9b93cb80c13ee59fbd935b2988127cf4a1135000 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 6 Jul 2011 08:47:01 +0000 Subject: [PATCH] More code parts could take advantage of previously improved fixEmptyContentToDashes(): - More code parts, all checked for ext-nickname is installed/active in an extra ugly looking if() block, could be improved by previously rewritten function fixEmptyContentToDashes(). - Some internal TODOs closed - TODOs.txt updated --- DOCS/TODOs.txt | 32 +++++++-------- inc/gen_refback.php | 2 +- inc/language/de.php | 1 - inc/libs/bonus_functions.php | 9 ----- inc/libs/refback_functions.php | 27 ++++++------- inc/libs/user_functions.php | 4 +- inc/modules/admin/what-list_user.php | 22 ----------- inc/modules/guest/what-active.php | 10 +---- inc/modules/guest/what-top10.php | 20 ---------- inc/modules/member/what-doubler.php | 9 ----- inc/modules/member/what-transfer.php | 39 +++++-------------- inc/modules/member/what-unconfirmed.php | 8 ++-- inc/mysql-manager.php | 18 ++++----- .../de/html/admin/admin_list_user_row.tpl | 2 +- .../de/html/admin/admin_user_details.tpl | 2 +- templates/de/html/guest/guest_active_row.tpl | 2 +- .../de/html/guest/guest_top10_row_earner.tpl | 2 +- .../de/html/guest/guest_top10_row_login.tpl | 2 +- .../de/html/guest/guest_top10_row_refs.tpl | 2 +- .../de/html/member/member_bonus_turbo_row.tpl | 12 ++++-- templates/de/html/member/member_doubler.tpl | 2 +- .../de/html/member/member_ref_list_row.tpl | 2 +- 22 files changed, 67 insertions(+), 162 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 3f99346055..605bc0690f 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -55,9 +55,9 @@ ./inc/functions.php:2201: // @TODO Rename column data_type to e.g. mail_status ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); -./inc/language/de.php:1080: // @TODO Rewrite these two constants -./inc/language/de.php:1101: // @TODO Rewrite these three constants -./inc/language/de.php:772:// @TODO Are these constants longer used? +./inc/language/de.php:1079: // @TODO Rewrite these two constants +./inc/language/de.php:1100: // @TODO Rewrite these three constants +./inc/language/de.php:771:// @TODO Are these constants longer used? ./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function. ./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no * @@ -66,7 +66,7 @@ ./inc/language/sponsor_de.php:117:// @TODO Rewrite these four constants to one and use sprintf() ./inc/libs/admins_functions.php:451: // @TODO This can be, somehow, rewritten ./inc/libs/beg_functions.php:55: // @TODO Try to rewrite the following unset() -./inc/libs/bonus_functions.php:203: // @TODO Move this HTML to a template +./inc/libs/bonus_functions.php:194: // @TODO Move this HTML to a template ./inc/libs/doubler_functions.php:44:// @TODO Lame description ./inc/libs/doubler_functions.php:91: // @TODO Can't this be moved into EL? ./inc/libs/mailid_functions.php:47: // @TODO Rewrite this to a dynamic include or so @@ -87,11 +87,11 @@ ./inc/libs/task_functions.php:240: // @TODO These can be rewritten to filter ./inc/libs/task_functions.php:51:// @TODO Move all extension-dependent queries into filters ./inc/libs/theme_functions.php:93: // @TODO Can't this be rewritten to an API function? -./inc/libs/user_functions.php:144: // @TODO These two constants are no longer used, maybe we reactivate this code? -./inc/libs/user_functions.php:232:// @TODO Double-check configuration entry here -./inc/libs/user_functions.php:327: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); -./inc/libs/user_functions.php:356: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); -./inc/libs/user_functions.php:623: // @TODO Try to rewrite the following unset() +./inc/libs/user_functions.php:146: // @TODO These two constants are no longer used, maybe we reactivate this code? +./inc/libs/user_functions.php:234:// @TODO Double-check configuration entry here +./inc/libs/user_functions.php:329: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); +./inc/libs/user_functions.php:358: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); +./inc/libs/user_functions.php:625: // @TODO Try to rewrite the following unset() ./inc/libs/yoomedia_functions.php:114: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script ./inc/load_config.php:75: // @TODO Rewrite them to avoid this else block ./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file * @@ -142,10 +142,8 @@ ./inc/modules/admin/what-list_refs.php:107: // @TODO Try to rewrite some to EL ./inc/modules/admin/what-list_unconfirmed.php:107: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus ./inc/modules/admin/what-list_unconfirmed.php:84: // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}'); -./inc/modules/admin/what-list_user.php:165: // @TODO Rewrite these to filters -./inc/modules/admin/what-list_user.php:273: // @TODO Rewrite this into a filter -./inc/modules/admin/what-list_user.php:322: // @TODO Rewrite this into a filter -./inc/modules/admin/what-list_user.php:57:// @TODO Rewrite these if-blocks in a filter +./inc/modules/admin/what-list_user.php:257: // @TODO Rewrite this into a filter +./inc/modules/admin/what-list_user.php:300: // @TODO Rewrite this into a filter ./inc/modules/admin/what-logs.php:64: // @TODO Fix content-type here ./inc/modules/admin/what-logs.php:70: // @TODO Fix content-type here ./inc/modules/admin/what-mem_add.php:124: // @TODO This can be somehow rewritten to a function @@ -174,9 +172,7 @@ ./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '' . $content['login'] . ''; ./inc/modules/member/what-refback.php:124: // @TODO UNUSED: $refRow['status'] = translateUserStatus($refRow['status']); ./inc/modules/member/what-reflinks.php:52:// @TODO Move this into a filter -./inc/modules/member/what-transfer.php:134: // @TODO Rewrite this to a filter -./inc/modules/member/what-transfer.php:223: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries -./inc/modules/member/what-transfer.php:96: // @TODO Rewrite this to a filter +./inc/modules/member/what-transfer.php:127: // @TODO Rewrite this to a filter ./inc/modules/member/what-unconfirmed.php:138: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() ./inc/modules/member/what-unconfirmed.php:203: // @TODO This 'userid' cannot be saved because of encapsulated EL code ./inc/modules/order.php:74: // @TODO Unused: 2,4 @@ -185,8 +181,8 @@ ./inc/mysql-manager.php:1485: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() ./inc/mysql-manager.php:1573: // @TODO Rewrite these lines to a filter ./inc/mysql-manager.php:1597: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:1965: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:2009:// @TODO Fix inconsistency between last_module and getWhat() +./inc/mysql-manager.php:1961: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:2005:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:371: // @TODO Try to rewrite this to one or more functions ./inc/mysql-manager.php:44:// @TODO Can we cache this? ./inc/purge/purge-inact.php:55: // @TODO Rewrite these if() blocks to a filter diff --git a/inc/gen_refback.php b/inc/gen_refback.php index fe3b8672b2..59e457098d 100644 --- a/inc/gen_refback.php +++ b/inc/gen_refback.php @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { loadIncludeOnce('inc/libs/refback_functions.php'); // Sanity-check: Do we have ref level 0? -$result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__); +$result = SQL_QUERY('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0 OR `level` IS NULL', __FILE__, __LINE__); if (!SQL_HASZERONUMS($result)) { // Remove index temporaly SQL_ALTER_TABLE('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__); diff --git a/inc/language/de.php b/inc/language/de.php index b3578e0a24..886d79ea0a 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -740,7 +740,6 @@ addMessages(array( 'OWN_POINTS' => "Eigenes Guthaben", 'ADMIN_TASK_INFOS' => "Infos", 'NICKNAME' => "Nickname", - 'EXT_NICKNAME_404' => "Erweiterung nickname fehlt.", 'ADMIN_PROBLEM_NO_MENU' => "Konnte keine Menüeinträge finden.", 'USER_REFERAL_404' => "Dieses Mitglied hat keine Referals gemacht.", 'USER_NICKNAME' => "Nickname", diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index 7bbf24eee9..fe9d30de02 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -173,15 +173,6 @@ LIMIT 1", if (SQL_NUMROWS($result_users) == 1) { // Load data $rows = merge_array($rows, SQL_FETCHARRAY($result_users)); - - // Is ext-nickname active? - if (isExtensionActive('nickname')) { - // Then get the nickname - $nick = getNickname($rows['userid']); - - // Is it not empty? Then use it - if (!empty($nick)) $rows['userid'] = $nick; - } // END - if } // END - if // Free result diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 0911ea9b45..18b9ff9490 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -285,33 +285,28 @@ function updateRefbackTable ($userid) { function getArrayFromRefbackUserRefs ($userid, $level) { //* DEBUG: */ print("----------------------- ".__FUNCTION__." - ENTRY ------------------------