From e4bb9dcc763483e7cc6a11d57cad79cf2425cc6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 29 Jan 2011 05:00:53 +0000 Subject: [PATCH] More fixes for broken admin area --- DOCS/TODOs.txt | 12 ++++----- inc/extensions/ext-autopurge.php | 4 +-- inc/libs/admins_functions.php | 2 +- inc/libs/task_functions.php | 40 +++++++++++++++------------- inc/modules/admin.php | 29 +++++++++++++------- inc/modules/admin/overview-inc.php | 18 ++++++------- inc/modules/admin/what-list_task.php | 4 +-- inc/modules/admin/what-overview.php | 8 +++--- inc/template-functions.php | 4 ++- 9 files changed, 69 insertions(+), 52 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 7531723847..12f2211aee 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -185,12 +185,12 @@ ./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 diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index c2d8d5fc9a..22fbfc7016 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -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] ?> diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 354a3f055b..8802c5978f 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -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 diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 1d04801e83..6698aba4a0 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -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&mode=waiting&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&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 = ' '; + if (empty($EXTRAS)) { + $EXTRAS = ' '; + } // 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] ?> diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 65ee5460d6..eef42adeac 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -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')) { diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 7304ac172f..1fe4ddca42 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -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 .= '
' . getMaskedMessage('ADMIN_UNKNOWN_SUPPORT_MODE', $mode) . '
'; 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=
%s
", 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']) . '--}'; diff --git a/inc/modules/admin/what-list_task.php b/inc/modules/admin/what-list_task.php index 9acf125332..fa00387bac 100644 --- a/inc/modules/admin/what-list_task.php +++ b/inc/modules/admin/what-list_task.php @@ -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')) { diff --git a/inc/modules/admin/what-overview.php b/inc/modules/admin/what-overview.php index 743d18ff63..d2352eefc6 100644 --- a/inc/modules/admin/what-overview.php +++ b/inc/modules/admin/what-overview.php @@ -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') { diff --git a/inc/template-functions.php b/inc/template-functions.php index b2f6b1fa00..4a3b1cb7b0 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -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))); -- 2.30.2