$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')) {
+ // 01 2 2 1 1 1 123 4 43 3 32 233 4 43 3 3210
+ if ((floor($TEST) == $TEST) && ($M1 == '02') && (((isset($postData[$prefix . '_mo'])) && ($postData[$prefix . '_mo'] > '02')) || ((isset($postData[$prefix . '_mn'])) && ($postData[$prefix . '_mn'] > '02')))) {
$SWITCH = getOneDay();
} // END - if
$ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH);
// Next months...
- $ret += $postData[$prefix . '_mo'] * 2628000;
+ if (isset($postData[$prefix . '_mo'])) {
+ $ret += $postData[$prefix . '_mo'] * 2628000;
+ } elseif (isset($postData[$prefix . '_mn'])) {
+ $ret += $postData[$prefix . '_mn'] * 2628000;
+ }
// Next weeks
$ret += $postData[$prefix . '_we'] * 604800;
break;
case getCode('URL_TIME_LOCK'):
- // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
- $result = SQL_QUERY_ESC("SELECT `timestamp` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
- array(bigintval(getRequestElement('id'))), __FUNCTION__, __LINE__);
-
// Load timestamp from last order
- $content = SQL_FETCHARRAY($result);
-
- // Free memory
- SQL_FREERESULT($result);
+ $content = getPoolDataFromId(getRequestElement('id'));
// Translate it for templates
$content['timestamp'] = generateDateTime($content['timestamp'], 1);
$test = substr($id, -3);
// Improved way of checking! :-)
- if (in_array($test, array('_ye', '_mo', '_we', '_da', '_ho', '_mi', '_se'))) {
+ if (in_array($test, array('_ye', '_mo', '_mn', '_we', '_da', '_ho', '_mi', '_se'))) {
// Found a multi-selection for timings?
$test = substr($id, 0, -3);
- if ((isset($postData[$test . '_ye'])) && (isset($postData[$test . '_mo'])) && (isset($postData[$test . '_we'])) && (isset($postData[$test . '_da'])) && (isset($postData[$test . '_ho'])) && (isset($postData[$test . '_mi'])) && (isset($postData[$test . '_se'])) && ($test != $test2)) {
+ if ((isset($postData[$test . '_ye'])) && ((isset($postData[$test . '_mo'])) || (isset($postData[$test . '_mn']))) && (isset($postData[$test . '_we'])) && (isset($postData[$test . '_da'])) && (isset($postData[$test . '_ho'])) && (isset($postData[$test . '_mi'])) && (isset($postData[$test . '_se'])) && ($test != $test2)) {
// Generate timestamp
$postData[$test] = createEpocheTimeFromSelections($test, $postData);
array_push($content, sprintf("`%s`='%s'", $test, $postData[$test]));
$GLOBALS['skip_config'][$test] = TRUE;
// Remove data from array
- foreach (array('ye', 'mo', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
+ foreach (array('ye', 'mo', 'mn', 'we', 'da', 'ho', 'mi', 'se') as $rem) {
unset($postData[$test . '_' . $rem]);
} // END - foreach
}
}
-// Enables the reset mode and runs it
-function doReset () {
- // Enable the reset mode
- $GLOBALS['reset_enabled'] = TRUE;
-
- // Run filters
- runFilterChain('reset');
-}
-
-// Enables the reset mode (hourly, weekly and monthly) and runs it
+// Enables the hourly reset mode and runs it
function doHourly () {
// Enable the hourly reset mode
$GLOBALS['hourly_enabled'] = TRUE;
runFilterChain('hourly');
}
+// Enables the daily reset mode and runs it
+function doDaily () {
+ // Enable the reset mode
+ $GLOBALS['daily_enabled'] = TRUE;
+
+ // Run filters
+ runFilterChain('daily');
+}
+
+// Enables the weekly reset mode and runs it
+function doWeekly () {
+ // Enable the reset mode
+ $GLOBALS['weekly_enabled'] = TRUE;
+
+ // Run filters
+ runFilterChain('weekly');
+}
+
+// Enables the monthly reset mode and runs it
+function doMonthly () {
+ // Enable the reset mode
+ $GLOBALS['monthly_enabled'] = TRUE;
+
+ // Run filters
+ runFilterChain('monthly');
+}
+
// Shuts down the mailer (e.g. closing database link, flushing output/filters, etc.)
function doShutdown () {
// Call the filter chain 'shutdown'
return translateGeneric('ADMIN_TASK_TYPE', $taskType);
}
-//-----------------------------------------------------------------------------
-// Automatically re-created functions, all taken from user comments on www.php.net
-//-----------------------------------------------------------------------------
+// "Translates" task status to a human-readable version
+function translateTaskStatus ($taskStatus) {
+ // Return it
+ return translateGeneric('ADMIN_TASK_STATUS', $taskStatus);
+}
+
+/*
+ *-----------------------------------------------------------------------------
+ * Automatically re-created functions, all taken from user comments on
+ * www.php.net
+ *-----------------------------------------------------------------------------
+ */
if (!function_exists('html_entity_decode')) {
// Taken from documentation on www.php.net
function html_entity_decode ($string) {