// 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);
- $cityData = $cities->getListForSearch(true, $actionData); // Get only categories that are used in active member data
+ $cityData = $cities->getListForSearch( true, $actionData ); // Get only categories that are used in active member data
// If we have a region set in shortcode or via URL.
$regions = array();
}
}
- $counties = array();
+ $counties = array();
+ $countyList = '';
// If we have a county set in shortcode or via URL.
if ( isset( $actionData['request']['county-search'] ) && $actionData['request']['county-search']) {
if ( isset( $counties ) && !empty( $counties ) ) {
$where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
$whereSep = ' AND ';
+ $countyList = implode( ',', $counties );
}
}
}
}
- $typeSelected = implode(',', $types);
+ $typeSelected = implode( ',', $types );
$typeSelectedForQuery = $typeSelected;
// Get category data for possible use in search pick list for categories used in active member info records.
- require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCategories.php';
- $Categories = new GlmDataCategories($this->wpdb, $this->config);
- $categoryData = $Categories->getListSortedParentChild(false, true, $categoryRegionList); // Get only categories that are used in active member data
+ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataCategories.php';
+ $Categories = new GlmDataCategories( $this->wpdb, $this->config );
+ $categoryData = $Categories->getListSortedParentChild( false, true, $categoryRegionList, $countyList ); // Get only categories that are used in active member data
// Get any numeric categories selected in the submitted shortcode and add to $cats array.
// This sets categories that are available for selection by the user
$catSelected = '';
$cats = array();
- if (isset($actionData['request']['category'])) {
+ if ( isset( $actionData['request']['category'] ) ) {
// Convert comma separated list to an array
$catsRequested = explode(',', $actionData['request']['category']);
foreach ( $catsRequested as $k => $v ) {
// If it's just numeric - note Explode returns an array element with value = 0 if no string.
- if (preg_match('/^[0-9]*$/', trim($v)) && $v > 0) {
+ if ( preg_match( '/^[0-9]*$/', trim( $v ) ) && $v > 0 ) {
// Clean up the category number and add to cats array
$cats[] = ($v-0);
// Get any text categories selected in the submitted shortcode and add to $cats array
// This sets categories that are available for selection by the user.
- if (isset($actionData['request']['category-name'])) {
+ if ( isset($actionData['request']['category-name'] ) ) {
// Break up shortcode categories into an array to make searching easy
$catsRequested = explode('|', $actionData['request']['category-name']);
// Check for numeric or text selection of categories
foreach ( $catsRequested as $k => $v ) {
- $vStripped = html_entity_decode(stripslashes(trim($v)));
+ $vStripped = html_entity_decode( stripslashes( trim( $v ) ) );
if ( isset( $categoryData ) && is_array( $categoryData ) ) {
- reset($categoryData);
+ reset( $categoryData );
foreach ($categoryData as $c) {
- $x = html_entity_decode(stripslashes(trim($c['name'])));
+ $x = html_entity_decode( stripslashes( trim( $c['name'] ) ) );
// If this entry matches - apply html entity decode in case string is encoded
- if ($x == $vStripped) {
+ if ( $x == $vStripped ) {
// Update the $cats array with the ID rather than the name and mark as found
$cats[] = $c['id'];