Updates for the notification relay plugin
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 17 Sep 2019 19:18:54 +0000 (15:18 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 17 Sep 2019 19:18:54 +0000 (15:18 -0400)
Updating retrieving by date timestamp.

Update main menu name.

models/admin/ajax/relay.php
setup/adminMenus.php

index e7397a0..1968138 100644 (file)
@@ -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'];
index b31bc41..63e792d 100644 (file)
@@ -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');}