From: Laury GvR Date: Thu, 12 Jan 2017 18:39:58 +0000 (-0500) Subject: Fixed the county search hidden on contact list X-Git-Tag: v1.0.17^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=25fa28d0a01c3709aadee5954570cef208b1039a;p=WP-Plugins%2Fglm-member-db-contacts.git Fixed the county search hidden on contact list The county search was not being properly hidden when there were no counties. --- diff --git a/models/front/contacts/list.php b/models/front/contacts/list.php index 65c4ce2..17f1544 100644 --- a/models/front/contacts/list.php +++ b/models/front/contacts/list.php @@ -130,6 +130,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts $filterText = false; $countySearch = false; $countyList = array(); + $haveCounties = false; $haveFilter = false; $userDeleted = false; $wpUserDeleted = false; @@ -302,6 +303,10 @@ class GlmMembersFront_contacts_list extends GlmDataContacts // Get a list of counties $countyList = $this->wpdb->get_col("SELECT DISTINCT county FROM ".GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts WHERE active = true;"); + if ($countyList[0]) { + echo "
" . print_r($countyList, true) . "
"; + $haveCounties = true; + } // // // @@ -324,7 +329,6 @@ class GlmMembersFront_contacts_list extends GlmDataContacts } - //echo "
" . print_r($countyList, true) . "
"; // Compile template data $templateData = array( @@ -353,6 +357,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts 'filterArchived' => $filterArchived, 'filterText' => $filterText, 'countyList' => $countyList, + 'haveCounties' => $haveCounties, 'countySearch' => $countySearch, 'haveFilter' => $haveFilter, 'userDeleted' => $userDeleted, diff --git a/views/front/contacts/list.html b/views/front/contacts/list.html index 90bfa98..a1b4ed0 100644 --- a/views/front/contacts/list.html +++ b/views/front/contacts/list.html @@ -23,7 +23,7 @@ and open the template in the editor.
Text Search:
- {if $countyList} + {if $haveCounties}
County Search: