$Regions = new GlmDataRegions($this->wpdb, $this->config);
$regionData = $Regions->getListForSearch(true);
+ // Get counties for possible use in search pick list for counties used in active member info records.
+ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCounties.php';
+ $Counties = new GlmDataCounties($this->wpdb, $this->config);
+ $countyData = $Counties->getListForSearch(true);
+
// Get cities for possible use in search pick list for cities used in active member info records.
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCities.php';
$cities = new GlmDataCities($this->wpdb, $this->config);
}
+ $counties = array();
+ // If we have a county set in shortcode or via URL.
+ if ($actionData['request']['county-search']) {
+
+ // Convert comma separated list to an array
+ $countiesRequested = explode( ',', $actionData['request']['county-search'] );
+
+ // Check for numeric ID's only
+ while ( list( $k, $v ) = each( $countiesRequested ) ) {
+ if ( preg_match( '/^[0-9]*$/', trim( $v ) && $v > 0 ) ) {
+ $counties[] = ( $v - 0 );
+ }
+ }
+
+ if ( isset( $counties ) && !empty( $counties ) ) {
+ $where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
+ $whereSep = ' AND ';
+ }
+ }
+
+ // If there's counties shortcode or url options to restrict this page to certain counties
+ if (count($counties) > 0) {
+
+ while ( list($k,$v) = each ($countyData) ) {
+ if (!in_array($v['id'], $counties)) {
+ unset ($countyData[$k]);
+ }
+ }
+
+ }
+
// If we have a city set in shortcode or via URL.
$cities = array();
if ( isset( $actionData['request']['city-search'] )
'text-search' => false,
'amenity-search' => false,
'region-search' => false,
+ 'county-search' => false,
'alpha' => false,
'blank-start' => false,
'show' => false,
region. The region is specified by ID rather than name. This may be overridden by
a "regionSearch" URL parameter.
</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <th>
+ county-search="{ county ID }"
+ </th>
+ <td>
+ The "county-search" attribute selects members who are listed in the specified
+ county. The county is specified by ID rather than name. This may be overridden by
+ a "countySearch" URL parameter.
+ </td>
</tr>
<tr>
<td> </td>