}
}
+ // Get any numeric member types selected in the submitted shortcode and add to $types array.
+ // We are currently only doing type selection by ID in the shortcode. No search parameters.
+ $typesSelected = '';
+ $types = array();
+ if (isset($actionData['request']['type'])) {
+
+ // Convert comma separated list to an array
+ $typesRequested = explode(',', $actionData['request']['type']);
+
+ // Check for numeric IDs only
+ while (list($k, $v) = each($typesRequested)) {
+
+ // 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) {
+
+ // Clean up the type ID number and add to types array
+ $types[] = ($v-0);
+
+ }
+
+ }
+
+ }
+ $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);
}
- // If we have a category ID or IDs
- if ($catSelectedForQuery != '') {
+ // If we have a member type IDs - Add that to the where clause
+ if ($typeSelectedForQuery != '') {
+ $where .= $whereSep." T.member in (
+ SELECT DISTINCT(id)
+ FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."members
+ WHERE member_type in ($typeSelectedForQuery)
+ )";
+ $whereSep = ' AND ';
+ }
+ // If we have a category ID or IDs - Add that to the where clause
+ if ($catSelectedForQuery != '') {
$where .= $whereSep." T.id in (
SELECT DISTINCT(member_info)
FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info M,
OR (C.parent in($catSelectedForQuery) AND M.category = C.id)
)";
$whereSep = ' AND ';
-
}
// Get amenity filter data
'action' => 'list',
'table' => GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_general',
'attributes' => array(
+ 'type' => false,
'category' => false,
'category-name' => false,
'category-search' => false,
the attributes below may used to modify the display of this page.
</td>
</tr>
+ <tr>
+ <td> </td>
+ <th>
+ type="{ member type ID(s) }"
+ </th>
+ <td>
+ The "type" attribute is used to set the default display of members
+ to only one or more member types by specifying the category IDs.
+ To select multiple types, separate the IDs with a ",".
+ The ID for each member type is shown in the "Member Types" list in the
+ admin "Settings" menu.
+ </td>
+ </tr>
<tr>
<td> </td>
<th>
</th>
<td>
The "category" attribute is used to set the default display of members
- to only those mnembers in a specific category or categories by specifying
+ to only those members in a specific category or categories by specifying
the category IDs. To select multiple categories, separate the categories with a ",".
Categories are specified by ID number. The ID for each category is
shown in the Member Categories list. The selection of which members
- to display may be overridded by the "category-search" parameter although
+ to display may be overridden by the "category-search" parameter although
these categories will always show in the list of categories that may be
selected in the search filter form.
</td>