From: Steve Sutton Date: Fri, 2 Feb 2018 19:58:38 +0000 (-0500) Subject: Bring in members and events to the search page. X-Git-Tag: v1.0.0^2~33 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=3f36fdb0e74b0ebf4126b6fcb9f9def6b92c2bf3;p=WP-Themes%2Fwmta.git Bring in members and events to the search page. Adding member and events. --- diff --git a/glm-member-db/views/front/members/list.html b/glm-member-db/views/front/members/list.html index 8a63671..cbfa84f 100644 --- a/glm-member-db/views/front/members/list.html +++ b/glm-member-db/views/front/members/list.html @@ -17,6 +17,9 @@
Close
+ {if $smarty.request.s} + + {/if}
{apply_filters('glm-member-db-front-members-list-searchFormTop', '')}
@@ -97,7 +100,7 @@
{/if} - + {if $settings.list_show_search_text}
@@ -220,17 +223,17 @@
{if $settings.list_show_search_alpha} {/if} {if $paging}
- Previous page - Next page + Previous page + Next page
showing {$start} through {$lastDisplayed} of {$filteredMembersFound} {/if} @@ -305,7 +308,7 @@
{/if} - +
@@ -479,8 +482,8 @@ {if $paging}
- Previous page - Next page + Previous page + Next page
showing {$start} through {$lastDisplayed} of {$filteredMembersFound} {/if} @@ -661,4 +664,4 @@
{include file='front/footer.html'} - \ No newline at end of file + diff --git a/inc/custom.php b/inc/custom.php index 9b6e086..d034c46 100644 --- a/inc/custom.php +++ b/inc/custom.php @@ -126,6 +126,9 @@ add_filter('pre_get_posts', 'change_wp_search_size'); // Hook our custom functio function display_memberfindme_directory() { // Show MemberFindMe shortcode from Directory page + $_REQUEST['textSearch'] = $_REQUEST['s']; + $_REQUEST['action'] = 'list'; + $_REQUEST['event_name'] = $_REQUEST['s']; $my_postid = 30722;//This is page id or post id $content_post = get_post($my_postid); $content = $content_post->post_content; @@ -591,7 +594,14 @@ function remove_events_metaboxes() { remove_meta_box( 'wpseo_meta' , 'event' , 'normal' ); } add_action( 'admin_menu' , 'remove_events_metaboxes' ); - +add_filter('glm-member-db-fields-front-list-query-params', function( $query ){ + $queryParams = array(); + if ( isset( $_REQUEST['textSearch'] ) ) { + $textSearch = filter_var($_REQUEST['textSearch']); + $queryParams[] = "textSearch={$textSearch}"; + } + return ( !empty( $queryParams ) ? $query . '&'.implode( '&', $queryParams): $query); +},10, 1); // Filter to change the order of taxonomy terms in GF request form function custom_lead_member_cat_order($args) { diff --git a/template-parts/search-overlay.php b/template-parts/search-overlay.php index b22b89c..2193853 100644 --- a/template-parts/search-overlay.php +++ b/template-parts/search-overlay.php @@ -141,7 +141,8 @@ var myEl = document.getElementById('overlay_search'); - myEl.addEventListener('click', function() {window.location = '' + encodeURI(document.getElementById('tag').value) + '#!directory/map/ord=rnd/tag=' + encodeURI(document.getElementById('tag').value) + '/lbl=' + encodeURI(document.getElementById('lbl').value) + '/xlo=' + encodeURI(document.getElementById('xlo').value) + '/xre=' + encodeURI(document.getElementById('xre').value) ; + myEl.addEventListener('click', function() {window.location = '' + encodeURI(document.getElementById('tag').value) + '&textSearch='+ encodeURI(document.getElementById('tag').value) +'&glm_action=list'; + //'#!directory/map/ord=rnd/tag=' + encodeURI(document.getElementById('tag').value) + '/lbl=' + encodeURI(document.getElementById('lbl').value) + '/xlo=' + encodeURI(document.getElementById('xlo').value) + '/xre=' + encodeURI(document.getElementById('xre').value) ; }, false); @@ -152,4 +153,4 @@ - \ No newline at end of file +