From b545eb0d3e9bf3b948d993dafa749d7b35eae545 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 17 Sep 2019 15:18:54 -0400 Subject: [PATCH] Updates for the notification relay plugin Updating retrieving by date timestamp. Update main menu name. --- models/admin/ajax/relay.php | 15 +++++++++++++++ setup/adminMenus.php | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/models/admin/ajax/relay.php b/models/admin/ajax/relay.php index e7397a0..1968138 100644 --- a/models/admin/ajax/relay.php +++ b/models/admin/ajax/relay.php @@ -96,6 +96,21 @@ class GlmMembersAdmin_ajax_relay extends GlmDataMessages $messages = $this->getList( 'T.status = 10', 'T.updated DESC' ); break; + case 'since': + if ( isset( $_REQUEST['timestamp'] ) ) { + $timestamp = filter_var( $_REQUEST['timestamp'], FILTER_VALIDATE_INT ); + trigger_error( $timestamp, E_USER_NOTICE ); + if ( $timestamp ) { + $updated = date( 'Y-m-d H:i:s', $timestamp ); + $where = "T.status = 10 AND T.updated > '$updated'"; + } else { + $where = "T.status = 10 "; + } + trigger_error( $where, E_USER_NOTICE ); + $messages = $this->getList( $where, 'T.updated DESC' ); + } + break; + default: $list = $this->getList( 'T.status = 10', 'T.updated DESC', null, null, 1, 1 ); $messages = $list['list']; diff --git a/setup/adminMenus.php b/setup/adminMenus.php index b31bc41..63e792d 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -51,8 +51,8 @@ */ add_submenu_page( 'glm-members-admin-menu-members', - 'GLM Info', - 'GLM Info', + 'GLM Notifications', + 'GLM Notifications', 'manage_options', 'glm-members-admin-menu-relay-index', function () {$this->controller('relay');} -- 2.17.1