* @access public
*/
- public function getListForSearch($forActiveMembers = false) {
+ public function getListForSearch( $forActiveMembers = false, $actionData = false ) {
$where = '';
".$this->config['access_numb']['NoAccess'].",
".$this->config['access_numb']['Moderated'].",
".$this->config['access_numb']['Full']."
- )
- )
+ )";
+ if ( $actionData ) {
+ if ( isset( $actionData['request']['category'] ) && $actionData['request']['category'] ) {
+ $where .= " AND MI.id IN (
+ SELECT member_info
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info
+ WHERE category IN (" . $actionData['request']['category'] .")
+ ) ";
+ }
+ }
+ $where .= ")
";
}
* @access public
*/
- public function getListForSearch($forActiveMembers = false) {
+ public function getListForSearch( $forActiveMembers = false, $actionData = false ) {
$where = '';
".$this->config['access_numb']['NoAccess'].",
".$this->config['access_numb']['Moderated'].",
".$this->config['access_numb']['Full']."
- )
- )
+ )";
+ if ( $actionData ) {
+ if ( isset( $actionData['request']['category'] ) && $actionData['request']['category'] ) {
+ $where .= " AND MI.id IN (
+ SELECT member_info
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info
+ WHERE category IN (" . $actionData['request']['category'] .")
+ ) ";
+ }
+ }
+ $where .= ")
";
}
}
-?>
\ No newline at end of file
+?>
// Get regions for possible use in search pick list for regions used in active member info records.
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataRegions.php';
$Regions = new GlmDataRegions($this->wpdb, $this->config);
- $regionData = $Regions->getListForSearch(true);
+ $regionData = $Regions->getListForSearch(true, $actionData);
// 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
+ $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.