From 0ddf8f6c578aa2c1ff1db9fb8eb0b93a1e247b73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 30 Sep 2010 16:52:48 +0000 Subject: [PATCH] More wrapper functions used, removed bigintval() which caused a lot trouble --- inc/extensions/ext-autopurge.php | 2 +- inc/extensions/ext-bonus.php | 2 +- inc/extensions/ext-booking.php | 2 +- inc/extensions/ext-debug.php | 2 +- inc/extensions/ext-doubler.php | 2 +- inc/extensions/ext-holiday.php | 2 +- inc/extensions/ext-newsletter.php | 4 ++-- inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-sql_patches.php | 4 ++-- inc/extensions/ext-surfbar.php | 4 ++-- inc/extensions/ext-transfer.php | 2 +- inc/extensions/ext-user.php | 2 +- inc/filters.php | 2 +- inc/functions.php | 6 +++--- inc/modules/admin/what-add_rallye.php | 2 +- inc/modules/guest/what-rallyes.php | 2 +- inc/modules/member/what-holiday.php | 6 +++--- inc/modules/member/what-rallyes.php | 2 +- inc/template-functions.php | 12 ++++++------ 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/inc/extensions/ext-autopurge.php b/inc/extensions/ext-autopurge.php index 904ab4d5a1..e88c037b25 100644 --- a/inc/extensions/ext-autopurge.php +++ b/inc/extensions/ext-autopurge.php @@ -127,7 +127,7 @@ switch (getExtensionMode()) { case '0.1.9': // SQL queries for v0.1.9 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `autopurge_tasks` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `ap_tasks_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*7)."'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `ap_tasks_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getOneDay()*7)."'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Bereinigung von zu löschenden Aufgaben klappt wieder. Zeitlimit für genanntes kann eingestellt werden (Default = 7 Tage).

Bitte aktualisieren Sie auch die Admin-Templates!"); diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index dd020aaaba..9aa53db213 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -258,7 +258,7 @@ INDEX `userid` (`userid`) break; case '0.4.0': // SQL queries for v0.4.0 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*7).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*7).""); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_lines` BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"); // Update notes (these will be set as task text!) diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 028bf2bddc..7900d6d41a 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -53,7 +53,7 @@ switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) // Configuration entries addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_per_page` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 3).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 3).""); // Drop/create table for user bookings addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`'); diff --git a/inc/extensions/ext-debug.php b/inc/extensions/ext-debug.php index 7096a5e643..e2e7f350af 100644 --- a/inc/extensions/ext-debug.php +++ b/inc/extensions/ext-debug.php @@ -134,7 +134,7 @@ PRIMARY KEY (`id`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_mode` ENUM('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_new_log` ENUM('ACCEPT','FIRST','REG') NOT NULL DEFAULT 'FIRST'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_new_client` ENUM('ACTIVE','NEW','REG') NOT NULL DEFAULT 'NEW'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT " . (getConfig('ONE_DAY') * 30)); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_reject_log` BIGINT(20) UNSIGNED NOT NULL DEFAULT " . (getOneDay() * 30)); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `debug_master_url` VARCHAR(255) NOT NULL DEFAULT '{?SERVER_URL?}'"); break; diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index f4989bf0c1..687eb03739 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -87,7 +87,7 @@ PRIMARY KEY (`id`) // --> This also means who fast the doubled points will be payed out! addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD doubler_send_mode ENUM('DIRECT','RESET') NOT NULL DEFAULT 'DIRECT'"); // Timeout for entries to be purged (default: one week) - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `doubler_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*7).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `doubler_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*7).""); // Number of newest entries to display addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `doubler_display_new` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); // Number of entries which will be payed out soon diff --git a/inc/extensions/ext-holiday.php b/inc/extensions/ext-holiday.php index 8ef1bff761..d901b24de1 100644 --- a/inc/extensions/ext-holiday.php +++ b/inc/extensions/ext-holiday.php @@ -156,7 +156,7 @@ PRIMARY KEY (id) case '0.1.3': // SQL queries for v0.1.3 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD holiday_active ENUM('Y','N') NOT NULL DEFAULT 'N'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*2)."'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getOneDay()*2)."'"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf Urlaub geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!"); diff --git a/inc/extensions/ext-newsletter.php b/inc/extensions/ext-newsletter.php index c86dcc749e..2f880ca872 100644 --- a/inc/extensions/ext-newsletter.php +++ b/inc/extensions/ext-newsletter.php @@ -184,8 +184,8 @@ PRIMARY KEY (`nl_order_id`) ) TYPE={?_TABLE_TYPE?} COMMENT='Newsletter orders'"); // Configuration - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 7).""); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 14).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 7).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive_expire` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 14).""); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_subject` VARCHAR(255) NOT NULL DEFAULT 'Newsletter vom {OPEN_CONFIG}CURRENT_DATE{CLOSE_CONFIG}'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_header` MEDIUMTEXT"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_default_footer` MEDIUMTEXT"); diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index abab5c3624..f70114da9c 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -86,7 +86,7 @@ switch (getExtensionMode()) { `last_change` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00', `status` ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED', `receive_warnings` ENUM('Y','N') NOT NULL DEFAULT 'Y', -`warning_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*7)."', +`warning_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getOneDay()*7)."', `points_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `points_used` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000, `refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index e0f1be082b..fc66df9d3f 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -115,7 +115,7 @@ switch (getExtensionMode()) { break; case '0.0.2': // SQL queries for v0.0.2 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `auto_purge` `auto_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*14).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `auto_purge` `auto_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*14).""); // Update notes (these will be set as task text!) setExtensionUpdateNotes("In der Tabelle {?_MYSQL_PREFIX?}_config musste die Spalte auto_purge (autom. Löschen von Bestätigungsmails angepasst werden (war auf dem Testsystem auf TINYINT(4) gesetzt.)"); @@ -181,7 +181,7 @@ switch (getExtensionMode()) { case '0.1.1': // SQL queries for v0.1.1 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_delay` TINYINT(3) NOT NULL DEFAULT 0"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_cookie` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*365).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_cookie` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*365).""); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Sie können nun hier die Verzögerungszeit in der Eingangsseite einstellen."); diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index 1b4520f31f..e82a6c6da3 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -162,8 +162,8 @@ UNIQUE KEY `status_action` (`actions_status`,`actions_action`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*7).""); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*3).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*7).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*3).""); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index c9c67e0c64..d1db416e82 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -91,7 +91,7 @@ PRIMARY KEY (`id`) // Add config values addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 50"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_age` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*28)); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_age` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*28)); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_balance` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"); diff --git a/inc/extensions/ext-user.php b/inc/extensions/ext-user.php index f4f3bd8a27..ed7dd0570b 100644 --- a/inc/extensions/ext-user.php +++ b/inc/extensions/ext-user.php @@ -345,7 +345,7 @@ INDEX (`stats_type`) case '0.3.5': // SQL queries for v0.3.5 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 30).""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay() * 30).""); addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9); addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`'); addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` ( diff --git a/inc/filters.php b/inc/filters.php index d05ec3d5e1..8ae57cee98 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -1020,7 +1020,7 @@ function FILTER_SET_CURRENT_DATE () { setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3')); // Timestamp for yesterday, today ... all at 00:00 am - setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY'))); + setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getOneDay())); setConfigEntry('START_TDAY', makeTime(0, 0, 0, time())); } diff --git a/inc/functions.php b/inc/functions.php index 7c3470844c..4a8296e18a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -729,7 +729,7 @@ function bigintval ($num, $castValue = true, $abortOnMismatch = true) { // Has the whole value changed? if (('' . $ret . '' != '' . $num . '') && ($abortOnMismatch === true) && (!is_null($num))) { // Log the values - debug_report_bug(__FUNCTION__, __LINE__, 'Problem with number found. ret=' . $ret . ', num='. $num); + debug_report_bug(__FUNCTION__, __LINE__, 'Problem with number found. ret[' . gettype($ret) . ']=' . $ret . ', num[' . gettype($num) . ']='. $num); } // END - if // Return result @@ -747,7 +747,7 @@ function createTimestampFromSelections ($prefix, $postData) { $M1 = getMonth(); // 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') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getConfig('ONE_DAY'); + if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getOneDay(); // First add years... $ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH); @@ -1981,7 +1981,7 @@ function determineReferalId () { } // END - if // Set cookie - setSession('refid', bigintval($GLOBALS['refid'])); + setSession('refid', $GLOBALS['refid']); } // END - if // Return determined refid diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index 0ff22a2c0d..084906f150 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -101,7 +101,7 @@ $content['start_month'] = addSelectionBox('month', getMonth() , 'start' $content['start_year'] = addSelectionBox('year' , getYear() , 'start'); // Ending timestamp -$endingStamp = time() + (getConfig('ONE_DAY') * 7); +$endingStamp = time() + (getOneDay() * 7); // Ending day $content['end_sec'] = addSelectionBox('sec' , 0 , 'end'); diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 95d5550a73..07073603de 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -78,7 +78,7 @@ if (SQL_NUMROWS($result) == 1) { // Rallye is expired $content['extras'] = '{--RALLYE_HAS_EXPIRED--}'; $expired = true; - } elseif (time() >= ($end - getConfig('ONE_DAY'))) { + } elseif (time() >= ($end - getOneDay())) { // Rallye will expire in less one day! $content['extras'] = '{--RALLYE_EXPIRE_ONE_DAY--}'; } else { diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index 43cfb88d2f..edf15eec6c 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -114,7 +114,7 @@ if (isFormSent()) { // Test both values $TEST = $content['holiday_end'] - $START; - if (($TEST < 0) || ($TEST > (getConfig('ONE_DAY') * getConfig('holiday_max'))) || ($START < time()) || ($content['holiday_end'] < time())) { + if (($TEST < 0) || ($TEST > (getOneDay() * getConfig('holiday_max'))) || ($START < time()) || ($content['holiday_end'] < time())) { // Time test failed unsetPostRequestParameter('ok'); } else { @@ -292,8 +292,8 @@ LIMIT 1", array(getMemberId()), __FILE__, __LINE__); case 'N': // Display activation form // Cache timestamps - $startingStamp = time() + getConfig('ONE_DAY'); - $endingStamp = $startingStamp + (getConfig('ONE_DAY') * getConfig('holiday_max')); + $startingStamp = time() + getOneDay(); + $endingStamp = $startingStamp + (getOneDay() * getConfig('holiday_max')); // Starting day $content['start_day'] = addSelectionBox('day' , getDay($startingStamp) , 'start'); diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index cd94ac4fa3..c51412e756 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -77,7 +77,7 @@ if (SQL_NUMROWS($result) == 1) { // Rallye is expired $content['extras'] = '{--RALLYE_HAS_EXPIRED--}'; $expired = true; - } elseif (time() >= ($content['end_time'] - getConfig('ONE_DAY'))) { + } elseif (time() >= ($content['end_time'] - getOneDay())) { // Rallye will expire in less one day! $content['extras'] = '{--RALLYE_EXPIRE_ONE_DAY--}'; } else { diff --git a/inc/template-functions.php b/inc/template-functions.php index 4da8ef31b2..f8e5da36b7 100644 --- a/inc/template-functions.php +++ b/inc/template-functions.php @@ -842,7 +842,7 @@ 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 = getConfig('ONE_DAY'); + if ((floor($TEST) == $TEST) && ($M1 == '02') && ($M2 > '02')) $SWITCH = getOneDay(); // First of all years... $Y = abs(floor($timestamp / (31536000 + $SWITCH))); @@ -851,19 +851,19 @@ function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = $M = abs(floor($timestamp / 2628000 - $Y * 12)); //* DEBUG: */ debugOutput('M=' . $M); // Next weeks - $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getConfig('ONE_DAY')) / 7) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) / 7))); + $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / getOneDay()) / 7) - ($M / 12 * (365 + $SWITCH / getOneDay()) / 7))); //* DEBUG: */ debugOutput('W=' . $W); // Next days... - $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY'))) - $W * 7)); + $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / getOneDay()) - ($M / 12 * (365 + $SWITCH / getOneDay())) - $W * 7)); //* DEBUG: */ debugOutput('D=' . $D); // Next hours... - $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24) - $W * 7 * 24 - $D * 24)); + $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / getOneDay()) * 24 - ($M / 12 * (365 + $SWITCH / getOneDay()) * 24) - $W * 7 * 24 - $D * 24)); //* DEBUG: */ debugOutput('h=' . $h); // Next minutes.. - $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); + $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / getOneDay()) * 24 * 60 - ($M / 12 * (365 + $SWITCH / getOneDay()) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); //* DEBUG: */ debugOutput('m=' . $m); // And at last seconds... - $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getConfig('ONE_DAY')) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); + $s = abs(floor($timestamp - $Y * (365 + $SWITCH / getOneDay()) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / getOneDay()) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); //* DEBUG: */ debugOutput('s=' . $s); // Is seconds zero and time is < 60 seconds? -- 2.30.2