More fixes for broken admin area
authorRoland Häder <roland@mxchange.org>
Sat, 29 Jan 2011 05:00:53 +0000 (05:00 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 29 Jan 2011 05:00:53 +0000 (05:00 +0000)
DOCS/TODOs.txt
inc/extensions/ext-autopurge.php
inc/libs/admins_functions.php
inc/libs/task_functions.php
inc/modules/admin.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-overview.php
inc/template-functions.php

index 7531723..12f2211 100644 (file)
 ./inc/mysql-manager.php:368:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1045:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1056:                     // @TODO Deprecate this thing
-./inc/template-functions.php:1143:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1176:             // @TODO Add a little more infos here
-./inc/template-functions.php:1485:// @TODO Lame description for this function
-./inc/template-functions.php:1507:                     // @TODO Move this in a filter
+./inc/template-functions.php:1047:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1058:                     // @TODO Deprecate this thing
+./inc/template-functions.php:1145:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1178:             // @TODO Add a little more infos here
+./inc/template-functions.php:1487:// @TODO Lame description for this function
+./inc/template-functions.php:1509:                     // @TODO Move this in a filter
 ./inc/template-functions.php:189:       * @TODO On some pages this is buggy
 ./inc/template-functions.php:265:      // @TODO Remove this sanity-check if all is fine
 ./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
index c2d8d5f..22fbfc7 100644 (file)
@@ -248,7 +248,7 @@ switch (getExtensionMode()) {
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Template-Problem beseitigt. Dies verhinderte das Abspeichern der Einstellungen.");
                                break;
-               }
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
@@ -263,7 +263,7 @@ switch (getExtensionMode()) {
        default: // Unknown extension mode
                logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
                break;
-}
+} // END - switch
 
 // [EOF]
 ?>
index 354a3f0..8802c59 100644 (file)
@@ -380,7 +380,7 @@ function adminsRemoveAdminAccount ($postData) {
                // Delete only when it's not your own account!
                if (($del == 1) && (getCurrentAdminId() != $id)) {
                        // Rewrite his tasks to all admins
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `assigned_admin`=%s",
+                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `assigned_admin`=%s",
                                array($id), __FUNCTION__, __LINE__);
 
                        // Remove account
index 1d04801..6698aba 100644 (file)
@@ -278,7 +278,7 @@ ORDER BY
                $WHATs[]  = 'list_payouts';
                $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_WAITING_TITLE--}';
-               addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC");
+               addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_payouts` ORDER BY `userid` ASC');
                $WHATs[]  = 'list_payouts';
                $DESCRs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_PAYOUTS_ALL_TITLE--}';
@@ -286,7 +286,7 @@ ORDER BY
 
        if (isExtensionActive('wernis')) {
                // List new wernis requests
-               addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC");
+               addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_wernis` ORDER BY `userid` ASC');
                $WHATs[]  = 'list_wernis';
                $DESCRs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_WERNIS_ALL_TITLE--}';
@@ -294,7 +294,7 @@ ORDER BY
 
        if (isExtensionActive('primera')) {
                // List new primera requests
-               addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC");
+               addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_primera` ORDER BY `userid` ASC');
                $WHATs[]  = 'list_primera';
                $DESCRs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_PRIMERA_ALL_TITLE--}';
@@ -302,7 +302,7 @@ ORDER BY
 
        if (isExtensionActive('holiday')) {
                // List holiday requests
-               addSql("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC");
+               addSql('SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_holidays` ORDER BY `userid` ASC');
                $WHATs[]  = 'list_holiday';
                $DESCRs[] = '{--ADMIN_TASK_LIST_HOLIDAYS--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_HOLIDAYS_TITLE--}';
@@ -387,7 +387,7 @@ ORDER BY
                $WHATs[]  = 'list_doubler&amp;mode=waiting&amp;select=all';
                $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE--}';
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_doubler` ORDER BY `id` ASC');
                $WHATs[]  = 'list_doubler';
                $DESCRs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_DOUBLER_ALL_TITLE--}';
@@ -396,7 +396,7 @@ ORDER BY
        //
        // All referal banner
        //
-       addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC");
+       addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC');
        $WHATs[] = 'refbanner';
        $DESCRs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL--}';
        $TITLEs[] = '{--ADMIN_TASK_LIST_REFBANNER_ALL_TITLE--}';
@@ -412,7 +412,7 @@ ORDER BY
        //
        // All extensions
        //
-       addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC");
+       addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` ORDER BY `id` ASC');
        $WHATs[] = 'extensions';
        $DESCRs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL--}';
        $TITLEs[] = '{--ADMIN_TASK_LIST_EXTENSIONS_ALL_TITLE--}';
@@ -427,7 +427,7 @@ ORDER BY
 
        if (isExtensionActive('engine')) {
                // List all export accounts
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_accounts` ORDER BY `id` ASC');
                $WHATs[]  = 'list_engine';
                $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_TITLE--}';
@@ -439,13 +439,13 @@ ORDER BY
                $TITLEs[] = '{--ADMIN_TASK_UNLOCK_ENGINE_TITLE--}';
 
                // List all safes
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_safe` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_safe` ORDER BY `id` ASC');
                $WHATs[]  = 'list_engine&amp;mode=safe';
                $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_SAFES_TITLE--}';
 
                // List all export URLs
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_urls` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_engine_urls` ORDER BY `id` ASC');
                $WHATs[]  = 'engine_urls';
                $DESCRs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_ENGINE_URLS_TITLE--}';
@@ -453,7 +453,7 @@ ORDER BY
 
        if (isExtensionActive('sponsor')) {
                // List all sponsors
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` ORDER BY `id` ASC');
                $WHATs[]  = 'list_sponsor';
                $DESCRs[] = '{--ADMIN_TASK_LIST_SPONSOR--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_SPONSOR_TITLE--}';
@@ -491,7 +491,7 @@ ORDER BY
 
        if (isExtensionActive('country')) {
                // List country codes
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY `id` ASC');
                $WHATs[]  = 'list_country';
                $DESCRs[] = '{--ADMIN_TASK_LIST_COUNTRY--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_COUNTRY_TITLE--}';
@@ -499,7 +499,7 @@ ORDER BY
 
        if (isExtensionActive('theme')) {
                // List all themes
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_themes` ORDER BY `id` ASC');
                $WHATs[]  = 'theme_edit';
                $DESCRs[] = '{--ADMIN_TASK_LIST_THEME_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_THEME_ALL_TITLE--}';
@@ -513,7 +513,7 @@ ORDER BY
 
        if (isExtensionActive('admins')) {
                // List all administrator logins
-               addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC");
+               addSql('SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `id` ASC');
                $WHATs[]  = 'admins_edit';
                $DESCRs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_ADMINS_ALL_TITLE--}';
@@ -521,7 +521,7 @@ ORDER BY
 
        if (isExtensionActive('surfbar')) {
                // List all URLs in surfbar
-               addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC");
+               addSql('SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC');
                $WHATs[]  = 'list_surfbar_urls';
                $DESCRs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL--}';
                $TITLEs[] = '{--ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE--}';
@@ -537,7 +537,9 @@ ORDER BY
        $EXTRAS .= createExtraTaskRows($WHATs, $DESCRs, $TITLEs);
 
        // If empty just keep a forced-space left for CSS issues
-       if (empty($EXTRAS)) $EXTRAS = '&nbsp;';
+       if (empty($EXTRAS)) {
+               $EXTRAS = '&nbsp;';
+       } // END - if
 
        // Add compiled string to constant for final template
        $content['extra_table'] = $EXTRAS;
@@ -565,7 +567,9 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                        );
 
                        // Rewrite CSS class if not last entry is reached
-                       if ($key < (count($sqls) - 1)) $content['bottom'] = 'bottom';
+                       if ($key < (count($sqls) - 1)) {
+                               $content['bottom'] = 'bottom';
+                       } // END - if
 
                        if ((!SQL_HASZERONUMS($result)) && (!empty($WHATs[$key]))) {
                                if (empty($TITLEs[$key])) {
@@ -588,5 +592,5 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
        return loadTemplate('admin_overview_task_extras', true, $OUT);
 }
 
-//
+// [EOF]
 ?>
index 65ee546..eef42ad 100644 (file)
@@ -122,9 +122,10 @@ if (!isAdminRegistered()) {
                } // END - if
 
                // Init array elements
-               $content['login_message']   = '';
-               $content['pass1_message']    = '';
-               $content['pass2_message']    = '';
+               $content['login_message'] = '';
+               $content['pass1_message'] = '';
+               $content['pass2_message'] = '';
+               $content['error_message'] = '';
 
                // Yet-another notice-fix
                if ((isFormSent()) && (postRequestParameter('ok') == '***')) {
@@ -134,18 +135,28 @@ if (!isAdminRegistered()) {
                        $pass2Message = '';
 
                        // No login entered?
-                       if (empty($content['login'])) $loginMessage = '{--ADMIN_NO_LOGIN--}';
+                       if (empty($content['login'])) {
+                               $loginMessage = '{--ADMIN_NO_LOGIN--}';
+                       } // END - if
 
                        // An error comes back from registration?
-                       if ((!empty($ret)) && ($ret != 'init')) $loginMessage = $errorMessage;
+                       if ((!empty($ret)) && ($ret != 'init')) {
+                               $loginMessage = $errorMessage;
+                       } // END - if
 
                        // No password 1 entered or to short?
-                       if (!isPostRequestParameterSet('pass1')) $pass1Message = '{--ADMIN_NO_PASS1--}';
-                        elseif (strlen(postRequestParameter('pass1')) < 4) $pass1Message = '{--ADMIN_SHORT_PASS1--}';
+                       if (!isPostRequestParameterSet('pass1')) {
+                               $pass1Message = '{--ADMIN_NO_PASS1--}';
+                       } elseif (strlen(postRequestParameter('pass1')) < 4) {
+                               $pass1Message = '{--ADMIN_SHORT_PASS1--}';
+                       }
 
                        // No password 2 entered or to short?
-                       if (!isPostRequestParameterSet('pass2')) $pass2Message = '{--ADMIN_NO_PASS2--}';
-                        elseif (strlen(postRequestParameter('pass2')) < 4) $pass2Message = '{--ADMIN_SHORT_PASS2--}';
+                       if (!isPostRequestParameterSet('pass2')) {
+                               $pass2Message = '{--ADMIN_NO_PASS2--}';
+                       } elseif (strlen(postRequestParameter('pass2')) < 4) {
+                               $pass2Message = '{--ADMIN_SHORT_PASS2--}';
+                       }
 
                        // Both didn't match?
                        if (postRequestParameter('pass1') != postRequestParameter('pass2')) {
index 7304ac1..1fe4ddc 100644 (file)
@@ -106,7 +106,7 @@ function outputStandardOverview (&$result_tasks) {
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
-       `assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW')
+       `assigned_admin`=%s OR ((`assigned_admin`=0 OR `assigned_admin` IS NULL) AND `status`='NEW')
 ORDER BY
        `userid` DESC,
        `task_type` DESC,
@@ -137,7 +137,7 @@ function outputSeletectedTasks ($postData, $result_tasks) {
 FROM
        `{?_MYSQL_PREFIX?}_task_system`
 WHERE
-       `id`=%s AND (`assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW'))
+       `id`=%s AND (`assigned_admin`=%s OR ((`assigned_admin`=0 OR `assigned_admin` IS NULL) AND `status`='NEW'))
 LIMIT 1",
                                array(
                                        bigintval($taskId),
@@ -151,7 +151,7 @@ LIMIT 1",
 
                                if ($taskData['assigned_admin'] == '0') {
                                        // Assgin current admin to unassgigned task
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s AND `assigned_admin`=0 LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s AND `assigned_admin`=NULL LIMIT 1",
                                                array(
                                                        getCurrentAdminId(),
                                                        bigintval($taskData['id'])
@@ -312,7 +312,7 @@ LIMIT 1",
                                                        logDebugMessage(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction!", $mode));
                                                        $OUT .= '<div class="notice medium">' . getMaskedMessage('ADMIN_UNKNOWN_SUPPORT_MODE', $mode) . '</div>';
                                                        break;
-                                               }
+                                               } // END - switch
                                                break;
 
                                        case 'PAYOUT_REQUEST': // Payout requests
@@ -397,22 +397,22 @@ LIMIT 1",
                        if (!empty($postData['unassign'])) {
                                // Unassign from tasks
                                foreach ($postData['sel'] as $taskId => $sel) {
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
                                                array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
-                               }
+                               } // END - foreach
                        } elseif (isset($postData['delete'])) {
                                // Delete tasks
                                foreach ($postData['sel'] as $taskId => $sel) {
                                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s AND `assigned_admin` IN (%s,0) LIMIT 1",
                                                array(bigintval($taskId), getCurrentAdminId()), __FILE__, __LINE__);
-                               }
+                               } // END - foreach
                        } else {
                                // Unknown action
                                debug_report_bug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, true)));
                        }
 
                        // Update query
-                       $result_tasks = SQL_QUERY_ESC("SELECT `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `assigned_admin`=%s OR (`assigned_admin`=0 AND `status`='NEW') ORDER BY `task_created` DESC",
+                       $result_tasks = SQL_QUERY_ESC("SELECT `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `assigned_admin`=%s OR ((`assigned_admin`=0 OR `assigned_admin` IS NULL) AND `status`='NEW') ORDER BY `task_created` DESC",
                                array(getCurrentAdminId()), __FILE__, __LINE__);
                } // END - if
 
@@ -429,7 +429,7 @@ LIMIT 1",
                                case 'EXTENSION_UPDATE':
                                        $content['infos'] = substr($content['subject'], 1, strpos($content['subject'], ':') - 1);
                                        break;
-                       }
+                       } // END - switch
 
                        // Get task type
                        $content['task_type_msg'] = '{--ADMIN_TASK_IS_' . strtoupper($content['task_type']) . '--}';
index 9acf125..fa00387 100644 (file)
@@ -65,7 +65,7 @@ switch (getRequestParameter('type')) {
                break;
 
        case 'unassigned': // List unassigned (but not deleted) tasks
-               $whereStatement = "`assigned_admin`=0 AND `status` != 'DELETED'";
+               $whereStatement = "(`assigned_admin`=0 OR `assigned_admin` IS NULL) AND `status` != 'DELETED'";
                break;
 
        case 'deleted': // List all deleted
@@ -107,7 +107,7 @@ ORDER BY
                        if (isPostRequestParameterSet('unassign')) {
                                // Unassign from tasks
                                foreach (postRequestParameter('sel') as $id => $sel) {
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=0 WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=NULL WHERE `id`=%s AND `assigned_admin`=%s LIMIT 1",
                                                array(bigintval($id), getCurrentAdminId()), __FILE__, __LINE__);
                                } // END - foreach
                        } elseif (isFormSent('delete')) {
index 743d18f..d2352ee 100644 (file)
@@ -40,9 +40,6 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
 } // END - if
 
-// Add description as navigation point
-// In Opera browsers the menu is being displayed double: addYouAreHereLink('admin', __FILE__);
-
 // Is sql_patches not yet installed?
 if (!isExtensionInstalled('sql_patches')) {
        // Output warning
@@ -52,8 +49,11 @@ if (!isExtensionInstalled('sql_patches')) {
  // Load include file 'overview-inc' (old standard overview page)
 loadIncludeOnce('inc/modules/admin/overview-inc.php');
 
+// Default is that all jobs are done (why?)
 $jobsDone = true;
-$taskExt = false; // Default is that 'task' is not installed
+
+// Default is that 'task' is not installed
+$taskExt = false;
 
 // When the admin is logging in check several things first (new jobs to complete and so on)
 if (getAction() == 'login') {
index b2f6b1f..4a3b1cb 100644 (file)
@@ -841,7 +841,9 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align =
        $M2 = getMonth(time() + $timestamp);
 
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
-       if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02'))  $SWITCH = getOneDay();
+       if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02'))  {
+               $SWITCH = getOneDay();
+       } // END - switch
 
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));