From: Roland Häder Date: Sat, 8 Jan 2011 20:41:08 +0000 (+0000) Subject: Some code cleanups/fixes: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=99be3ce68f08d6e36202789168188a9078b04aea;p=mailer.git Some code cleanups/fixes: - Function translateUserStatus() does now have a default value, only because it is better coding practice to init your variables before a switch() command - Language string ACCOUNT_STATUS_UNKNOWN_STATUS renamed and moved a little - TODOs.txt updated --- diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 434a16949a..04667bf5fb 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -44,11 +44,11 @@ ./inc/extensions-functions.php:434:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/extensions-functions.php:564: // @TODO Extension is loaded, what next? ./inc/functions.php:110: // @TODO Extension 'msg' does not exist -./inc/functions.php:1505: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? -./inc/functions.php:1593: // @TODO Are these convertions still required? -./inc/functions.php:1611:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:1508: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? +./inc/functions.php:1596: // @TODO Are these convertions still required? +./inc/functions.php:1614:// @TODO Rewrite this function to use readFromFile() and writeToFile() ./inc/functions.php:181:// @TODO Rewrite this to an extension 'smtp' -./inc/functions.php:2272: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2275: // @TODO This is still very static, rewrite it somehow ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInInclude(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); ./inc/language/de.php:1087:// @TODO Rewrite these two constants @@ -94,7 +94,7 @@ ./inc/libs/user_functions.php:611: // @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-extensions.php:13: * @TODO Rewrite this whole file * +./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file * ./inc/module-functions.php:267: // @TODO Nothing helped??? ./inc/module-functions.php:308: // @TODO Rewrite this to a filter ./inc/modules/admin/admin-inc.php:170: // @TODO This and the next getCurrentAdminId() call might be moved into the templates? @@ -241,6 +241,7 @@ ./inc/loader/load_cache-refsystem.php:2:// @DEPRECATED ./inc/loader/load_cache-revision.php:2:// @DEPRECATED ./inc/loader/load_cache-them.php:2:// @DEPRECATED +./inc/loader/load-extensions.php:2:// @DEPRECATED ./inc/modules/admin/admin-inc.php:437:// @DEPRECATED ./inc/reset/reset_100_bonus.php:2:// @DEPRECATED ./inc/reset/reset_autopurge.php:2:// @DEPRECATED diff --git a/inc/functions.php b/inc/functions.php index 60e7da54cb..bbedbfac61 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -427,6 +427,9 @@ function translateGender ($gender) { // "Translates" the user status function translateUserStatus ($status) { + // Default status is unknown if something goes through + $ret = '{--ACCOUNT_STATUS_UNKNOWN--}'; + // Generate message depending on status switch ($status) { case 'UNCONFIRMED': diff --git a/inc/language/de.php b/inc/language/de.php index 490be12ee2..772503e97a 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -462,8 +462,8 @@ addMessages(array( '_UID' => "Mitglieder-Id", 'REMOTE_IP' => "IP-Nummer", 'REFERAL_UID' => "Werber-Id", - 'ACCOUNT_STATUS_UNKNOWN_STATUS' => "Unbekannter Status %s erkannt.", 'ACCOUNT_STATUS' => "Account-Status", + 'ACCOUNT_STATUS_UNKNOWN' => "Unbekannter Status %s erkannt.", 'ACCOUNT_STATUS_UNCONFIRMED' => "Unbestätigt", 'ACCOUNT_STATUS_CONFIRMED' => "Bestätigt", 'ACCOUNT_STATUS_LOCKED' => "Gesperrt", diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 011fdb8736..c225215424 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -216,7 +216,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), return $ret; } -// +// Translate the account status function sponsorTranslateUserStatus ($status) { // Construct constant name $constantName = sprintf("ACCOUNT_STATUS_%s", $status); @@ -229,7 +229,7 @@ function sponsorTranslateUserStatus ($status) { // Not found! //* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unknown status %s detected.", $status)); - $ret = getMaskedMessage('ACCOUNT_STATUS_UNKNOWN_STATUS', $status); + $ret = getMaskedMessage('ACCOUNT_STATUS_UNKNOWN', $status); } // Return status