Update config.php
This commit is contained in:
parent
3790b69a3e
commit
65ba89198f
|
@ -89,7 +89,27 @@ if(!check_function_exists("get_current_timestamp")) {
|
|||
|
||||
// adjust time
|
||||
if(!array_key_empty("adjust", $options)) {
|
||||
$timestamp = strtotime($options['adjust'], $timestamp);
|
||||
$units = array(
|
||||
"s" => array( 1, "second", "seconds"),
|
||||
"m" => array( 60, "minute", "minutes"),
|
||||
"h" => array( 120, "hour", "hours" ),
|
||||
"d" => array(86400, "day", "days" )
|
||||
);
|
||||
$adjust = trim($options['adjust']);
|
||||
$_adjust = "";
|
||||
if(strlen($adjust) > 0) {
|
||||
$_L = intval(substr($adjust, 0, -1));
|
||||
$_R = substr($adjust, -1);
|
||||
if(array_key_exists($_R, $units)) {
|
||||
if(abs($_L) > 1) {
|
||||
$_adjust = sprintf("%s %s", $_L, $units[$_R][2]);
|
||||
} else {
|
||||
$_adjust = sprintf("%s %s", $_L, $units[$_R][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$timestamp = strtotime($_adjust, $timestamp);
|
||||
}
|
||||
|
||||
return $timestamp;
|
||||
|
|
Loading…
Reference in New Issue
Block a user