// Apply any provided text search to name, description, short description, and street address
if (trim($actionData['request']['text-search']) != '') {
$textSearch = addslashes(filter_var($actionData['request']['text-search'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
- $where .= $whereSep." (
- (
- SELECT true
- FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
- WHERE id = T.member
- AND name LIKE '%$textSearch%'
- ) OR
- T.descr LIKE '%$textSearch%' OR
- T.short_descr LIKE '%$textSearch%' OR
- T.addr1 LIKE '%$textSearch%' OR
- T.addr2 LIKE '%$textSearch%'
- )";
+ if ( isset( $_REQUEST['s'] ) ) {
+ $where .= $whereSep." (
+ (
+ SELECT true
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
+ WHERE id = T.member
+ AND name LIKE '%$textSearch%'
+ )
+ )";
+ } else {
+ $where .= $whereSep." (
+ (
+ SELECT true
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
+ WHERE id = T.member
+ AND name LIKE '%$textSearch%'
+ ) OR
+ T.descr LIKE '%$textSearch%' OR
+ T.short_descr LIKE '%$textSearch%' OR
+ T.addr1 LIKE '%$textSearch%' OR
+ T.addr2 LIKE '%$textSearch%'
+ )";
+ }
$whereSep = ' AND ';
$textSearch = stripslashes($textSearch);
}
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataRegions.php';
$Regions = new GlmDataRegions($this->wpdb, $this->config);
$regionData = $Regions->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);
$cityData = $cities->getListForSearch(true); // Get only categories that are used in active member data
-
-
+
+
// If we have a region set in shortcode or via URL.
$regions = array();
if ($actionData['request']['region-search']) {
}
}
-
+
// If we have a city set in shortcode or via URL.
$cities = array();
if ($actionData['request']['city-search']) {
}
}
}
-
+
// Check for user city selection
$categoryCityList = '';
$categoryCitySep = '';