* Plugin Name: GLM Members Database
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 2.3.0
+ * Version: 2.3.1
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabase
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 2.3.0
+ * @version 2.3.1
*/
/*
*
*/
-define('GLM_MEMBERS_PLUGIN_VERSION', '2.3.0');
+define('GLM_MEMBERS_PLUGIN_VERSION', '2.3.1');
define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.11');
// Check if plugin version is not current in WordPress option and if needed updated it
$blankStart = false;
$membersFound = false;
+ // Check for URL parameter override of shortcode parameters
+ if (isset($_REQUEST['categorySearch'])) {
+ $actionData['request']['category-search'] = $_REQUEST['categorySearch'];
+ }
+ if (isset($_REQUEST['textSearch'])) {
+ $actionData['request']['text-search'] = $_REQUEST['textSearch'];
+ }
+ if (isset($_REQUEST['alpha'])) {
+ $actionData['request']['alpha'] = $_REQUEST['alpha'];
+ }
+ if (isset($_REQUEST['amenitySearch'])) {
+ $actionData['request']['amenity-search'] = $_REQUEST['amenitySearch'];
+ }
+
// Check for "show" shortcode parameter (what elements to show on the page)
$settings = array();
$showList = $actionData['request']['show'];
);
// Apply any provided text search to name, description, short description, and street address
- if (isset($_REQUEST['textSearch']) && $_REQUEST['textSearch'] != '') {
- $textSearch = addslashes(filter_input(INPUT_POST, 'textSearch', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
+ 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
}
// Check if a category has been submitted
- if (isset($_REQUEST['categorySearch'])) {
- $c = $_REQUEST['categorySearch'] - 0;
+ if ($actionData['request']['category-search']) {
+ $c = $actionData['request']['category-search'] - 0;
// Since we have one category selected by the user, make that default
if ($c && isset($categoryData[$c])) {
}
// Check if an amenity has been submitted
- if (isset($_REQUEST['amenitySearch'])) {
- $amenSelected = $_REQUEST['amenitySearch'];
+ if ($actionData['request']['amenity-search']) {
+ $amenSelected = $actionData['request']['amenity-search'];
$amenSelected = array_filter( $amenSelected, function($var){
return is_numeric( $var ) && $var > 0;
} );
$alphaSelected = false;
// Check for alpha selected
- if (isset($_REQUEST['alpha']) && strlen($_REQUEST['alpha']) == 1) {
- $alphaSelected = $_REQUEST['alpha'];
+ if ($actionData['request']['alpha'] && strlen($actionData['request']['alpha']) == 1) {
+ $alphaSelected = strtoupper($actionData['request']['alpha']);
$alphaWhere .= " AND T.member_name LIKE '$alphaSelected%'";
}
'attributes' => array(
'category' => false,
'category-name' => false,
+ 'category-search' => false,
+ 'text-search' => false,
+ 'amenity-search' => false,
+ 'alpha' => false,
'blank-start' => false,
'show' => false,
'view' => false,
category="{ category ID(s) }"
</th>
<td>
- The "category" attribute is used display only members in a specific category or
- categories. To select multiple categories, separate the categories with a ",".
+ The "category" attribute is used to set the default display of members
+ to only those mnembers 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.
+ shown in the Member Categories list. The selection of which members
+ to display may be overridded 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>
</tr>
<tr>
category-name="{ category name(s) }"
</th>
<td>
- The "category-name" attribute is used display only members in a specific category or
- categories by specifying the category names. To select multiple categories,
- separate the category names with a ",". Category names must match the name of a
+ The "category-name" attribute is used to set the default display of members
+ to only those mnembers in a specific category or categories by specifying
+ the category names. To select multiple categories, separate the category
+ names with a ",". Category names must match the name of a
category exactly to be selected. Category names must be enclosed in quotes.
+ The selection of which members to display may be overridded 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>
+ </tr>
+ <tr>
+ <td> </td>
+ <th>
+ category-search="{ a single category ID }"
+ </th>
+ <td>
+ The "category-search" attribute is used display only members in a specific category.
+ The ID for each category is
+ shown in the Member Categories list. This may be overridden by a "categorySearch"
+ URL parameter. This parameter does not override the categories that show in the
+ category selection list of the search filter form set by either "category" or
+ "category-name" above.
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <th>
+ text-search="{ text to search for }"
+ </th>
+ <td>
+ The "text-search" attribute is used to filter results by a specified text
+ string. If a string is provided, the results will only include members with
+ this text in their name, description, short description or street address.
+ This may be overridden by a "testSearch" URL parameter.
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <th>
+ amenity-search="{ amenity ID }"
+ </th>
+ <td>
+ The "amenity-search" attribute selects members who have the specified amenity.
+ The amenity is specified by ID rather than name. This may be overridden by an
+ "amenitySearch" URL parameter.
+ </td>
+ </tr>
+ <tr>
+ <td> </td>
+ <th>
+ alpha="{ initial letter of members }"
+ </th>
+ <td>
+ The "alpha" attribute selects members with names that start with that letter/number
+ to be listed. This only affects the selection of what is currently displayed, not
+ the overall results so the full list of all letters for which there are results are
+ still displayed. This may be overridden by an "alpha" URL parameter.
</td>
</tr>
<tr>