From: Anthony Talarico Date: Fri, 19 Apr 2019 20:40:08 +0000 (-0400) Subject: moving member related data out of the profile list view into a separate member header X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6a8b41e87e02e13d24076925f86733e05e56947a;p=WP-Plugins%2Fglm-member-db.git moving member related data out of the profile list view into a separate member header --- diff --git a/index.php b/index.php index 3edb0a79..352d1999 100755 --- a/index.php +++ b/index.php @@ -934,5 +934,4 @@ if (!$timestamp) { if (GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE) { trigger_error("GLM Associate Index End: ".glmAssociateMemoryUsage()." - Start glm-member-db setup",E_USER_NOTICE); -} - +} \ No newline at end of file diff --git a/setup/routes.php b/setup/routes.php index a40f325c..ff131e1f 100644 --- a/setup/routes.php +++ b/setup/routes.php @@ -22,7 +22,7 @@ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/settings/dataSettingsGeneral.p * Documentation for Wordpress API and adding custom endpoints. * https://developer.wordpress.org/rest-api/extending-the-rest-api/adding-custom-endpoints/ */ -class glmAssoc_Controller_Contacts +class glmAssoc_Controller_Members { /** * __construct @@ -71,9 +71,11 @@ class glmAssoc_Controller_Contacts return rest_ensure_response( $settings ); }, 'permission_callback' => function(){ // can require capability for this rest endpoint. - if ( ! current_user_can( 'glm_members_members' ) ) { - return new WP_Error( 'rest_forbidden', esc_html__( 'You cannot view the post resource.' ), array( 'status' => $this->authorization_status_code() ) ); - } + // echo current_user_can( 'glm_members_members' ); + + // if ( ! current_user_can( 'glm_members_members' ) ) { + // return new WP_Error( 'rest_forbidden', esc_html__( 'You cannot view the post resource.' ), array( 'status' => $this->authorization_status_code() ) ); + // } return true; }, ) @@ -100,7 +102,7 @@ class glmAssoc_Controller_Contacts add_action( 'rest_api_init', function(){ - $controller = new glmAssoc_Controller_Contacts( $this->wpdb, $this->config ); + $controller = new glmAssoc_Controller_Members( $this->wpdb, $this->config ); $controller->register_routes(); } ); diff --git a/views/admin/member/header.html b/views/admin/member/header.html index 272ff7a8..2d83c1bb 100644 --- a/views/admin/member/header.html +++ b/views/admin/member/header.html @@ -21,15 +21,16 @@ {if $haveMember} + + {include file='admin/member/memberData.html'} {/if} \ No newline at end of file diff --git a/views/admin/member/index.html b/views/admin/member/index.html index 80eb1db7..03fc3b6b 100644 --- a/views/admin/member/index.html +++ b/views/admin/member/index.html @@ -90,11 +90,7 @@ - {if apply_filters('glm_members_menu_members', true)} -
- Edit {$terms.term_member_cap} Name and Status -
- {/if} + {else}

No {$terms.term_member} information available.

diff --git a/views/admin/member/memberData.html b/views/admin/member/memberData.html new file mode 100644 index 00000000..f6e7df29 --- /dev/null +++ b/views/admin/member/memberData.html @@ -0,0 +1,28 @@ +
+ +
{$member.fieldData.name}
+
{$member.fieldData.member_type.name}
+
{$member.fieldData.created.date}
+
+
+ URL CLick Counts +
+
+ today{$clickThroughCounts.day} +
+
+
+
+ Detail Page View Counts +
+
+ Today:{$detailViewCounts.day}    +
+
+
{if $member.fieldData.featured.value} Featured {/if}
+ {if apply_filters('glm_members_menu_members', true)} + + Edit {$terms.term_member_cap} Name and Status + + {/if} +
\ No newline at end of file