Some code cleanups/fixes:
authorRoland Häder <roland@mxchange.org>
Sat, 8 Jan 2011 20:41:08 +0000 (20:41 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 8 Jan 2011 20:41:08 +0000 (20:41 +0000)
- 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

DOCS/TODOs.txt
inc/functions.php
inc/language/de.php
inc/libs/sponsor_functions.php

index 434a169..04667bf 100644 (file)
 ./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?
 ./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
index 60e7da5..bbedbfa 100644 (file)
@@ -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':
index 490be12..772503e 100644 (file)
@@ -462,8 +462,8 @@ addMessages(array(
        '_UID' => "Mitglieder-Id",
        'REMOTE_IP' => "IP-Nummer",
        'REFERAL_UID' => "Werber-Id",
-       'ACCOUNT_STATUS_UNKNOWN_STATUS' => "Unbekannter Status <span class=\"data\">%s</span> erkannt.",
        'ACCOUNT_STATUS' => "Account-Status",
+       'ACCOUNT_STATUS_UNKNOWN' => "Unbekannter Status <span class=\"data\">%s</span> erkannt.",
        'ACCOUNT_STATUS_UNCONFIRMED' => "<span class=\"status_unconfirmed\">Unbest&auml;tigt</span>",
        'ACCOUNT_STATUS_CONFIRMED' => "<span class=\"status_confirmed\">Best&auml;tigt</span>",
        'ACCOUNT_STATUS_LOCKED' => "<span class=\"status_locked\">Gesperrt</span>",
index 011fdb8..c225215 100644 (file)
@@ -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