diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 35c472720..d2b42535b 100755 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -3484,7 +3484,7 @@ class e_admin_controller_ui extends e_admin_controller /** * Handle requested filter dropdown value - * @param string $value + * @param string $filter_value * @return array field -> value */ protected function _parseFilterRequest($filter_value) @@ -3512,6 +3512,11 @@ class e_admin_controller_ui extends e_admin_controller "week" => "1 week ago", "month" => "1 month ago", "year" => "1 year ago", + "nhour" => "now + 1 hour", + "nday" => "now + 24 hours", + "nweek" => "now + 1 week", + "nmonth" => "now + 1 month", + "nyear" => "now + 1 year", ); $ky = $filter[2]; @@ -4027,7 +4032,17 @@ class e_admin_controller_ui extends e_admin_controller case 'integer': if($_fieldType === 'datestamp') // Past Month, Past Year etc. { - $searchQry[] = $this->fields[$filterField]['__tableField']." > ".intval($filterValue); + if($filterValue > time()) + { + $searchQry[] = $this->fields[$filterField]['__tableField']." > ".time(); + $searchQry[] = $this->fields[$filterField]['__tableField']." < ".intval($filterValue); + } + else + { + $searchQry[] = $this->fields[$filterField]['__tableField']." > ".intval($filterValue); + $searchQry[] = $this->fields[$filterField]['__tableField']." < ".time(); + } + } else { @@ -7218,6 +7233,24 @@ class e_admin_form_ui extends e_form "month" => LAN_UI_FILTER_PAST_MONTH, "year" => LAN_UI_FILTER_PAST_YEAR ); + + $dateFiltersFuture = array ( + 'nhour' => LAN_UI_FILTER_NEXT_HOUR, + "nday" => LAN_UI_FILTER_NEXT_24_HOURS, + "nweek" => LAN_UI_FILTER_NEXT_WEEK, + "nmonth" => LAN_UI_FILTER_NEXT_MONTH, + "nyear" => LAN_UI_FILTER_NEXT_YEAR + ); + + if($val['filter'] === 'future' ) + { + $dateFilters = $dateFiltersFuture; + } + + if($val['filter'] === 'both') + { + $dateFilters += $dateFiltersFuture; + } foreach($dateFilters as $k => $name) { diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 7ccd04389..52dbb6445 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -480,7 +480,7 @@ class e_parse extends e_parser /** * Converts the supplied text (presumed to be from user input) to a format suitable for storing in a database table. * - * @param string $data + * @param mixed $data * @param boolean $nostrip [optional] Assumes all data is GPC ($_GET, $_POST, $_COOKIE) unless indicate otherwise by setting this var to TRUE. * If magic quotes is enabled on the server and you do not tell toDB() that the data is non GPC then slashes will be stripped when they should not be. * @param boolean $no_encode [optional] This parameter should nearly always be FALSE. It is used by the save_prefs() function to preserve HTML content within prefs even when diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index db7df76ae..2acdf2817 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -487,6 +487,12 @@ define("LAN_UI_FILTER_PAST_WEEK", "Past Week"); define("LAN_UI_FILTER_PAST_MONTH", "Past Month"); define("LAN_UI_FILTER_PAST_YEAR", "Past Year"); +define("LAN_UI_FILTER_NEXT_HOUR", "Next Hour"); +define("LAN_UI_FILTER_NEXT_24_HOURS", "Next 24 hours"); +define("LAN_UI_FILTER_NEXT_WEEK", "Next Week"); +define("LAN_UI_FILTER_NEXT_MONTH", "Next Month"); +define("LAN_UI_FILTER_NEXT_YEAR", "Next Year"); + define("LAN_USER_MANAGEALL", "Manage all User, Userclass and Extended User-Field settings"); define("LAN_USER_LIST", "User List"); define("LAN_USER_QUICKADD","Quick Add User");