public function getList( $where = '', $order = '', $fieldVals = true, $idField = 'id', $start = false, $limit = false, $prohibitListOptions = false, $appendSelect = null )
{
+ // For testing only
+ /*
+ echo "<p>getList():<br>
+ <table>
+ <tr><td>Where:</td><td>$where</td></tr>
+ <tr><td>Order:</td><td>$order</td></tr>
+ <tr><td>Field Vals:</td><td>$fieldVals</td></tr>
+ <tr><td>ID Field:</td><td>$idField</td></tr>
+ <tr><td>Start:</td><td>$start</td></tr>
+ <tr><td>Limit:</td><td>$limit</td></tr>
+ <tr><td>Prohibit List Options</td><td>$prohibitListOptions</td></tr>
+ <tr><td>Append Select</td><td>$appendSelect</td></tr>
+ </table>
+ </p>
+ ";
+ */
+
$seed = false;
// NOTE: $fieldVals not yet implemented
private function genPseudoRandIdArray ($ids, $start = false, $length = false, $idName = 'id', $seedSessionName = 'GLM_PR_SEED', $seed = false)
{
+ // For testing only
+ /*
+ echo "<p>Parameters supplied to genPseudoRandIdArray():<br>
+ <table>
+ <tr><td>Count of ids array:</td><td>".count($ids)."</td></tr>
+ <tr><td>Start:</td><td>$start</td></tr>
+ <tr><td>Length:</td><td>$length</td></tr>
+ <tr><td>ID Field:</td><td>$idName</td></tr>
+ <tr><td>Seed Session Name:</td><td>$seedSessionName</td></tr>
+ <tr><td>Seed:</td><td>$seed</td></tr>
+ </table>
+ </p>
+ ";
+ */
+
$transientSeed = false; // Indicates if the function was passed a specific seed. These are not stored back into session
// Change $ids array to simple array of ids
}
}
+ // For testing only
+ // echo "idArray for pseudo-random sorting:<br>".str_replace(', ', '<br>', $idString);
+
return array('idString' => $idString, 'idArray' => $ids);
}
$citySearchSelected = false;
$haveFeaturedMembers = false;
$featuredMembers = false;
- $memberSearch = false;
+ $fullTextSearch = false;
$appendSelect = '';
// Paging Parameters
if (isset($_REQUEST['categorySearchMultiple']) && is_array($_REQUEST['categorySearchMultiple'])) {
$actionData['request']['category'] = implode(',', $_REQUEST['categorySearchMultiple']);
$multiSelectCats = true;
- $memberSearch = true;
}
// Check for URL parameter override of shortcode parameters
}
if (isset($_REQUEST['memberType'])) {
$actionData['request']['type'] = $_REQUEST['memberType'];
- $memberSearch = true;
}
if (isset($_REQUEST['categorySearch'])) {
$actionData['request']['category-search'] = $_REQUEST['categorySearch'];
- $memberSearch = true;
}
if (isset($_REQUEST['textSearch'])) {
$actionData['request']['text-search'] = $_REQUEST['textSearch'];
- $memberSearch = true;
}
if (isset($_REQUEST['alpha'])) {
$actionData['request']['alpha'] = $_REQUEST['alpha'];
$appendSelect = " match(member_name) against('$textSearch') as rel_name ";
$whereSep = ' AND ';
$textSearch = stripslashes($textSearch);
- $memberSearch = true;
+ $fullTextSearch = true;
}
// Get regions for possible use in search pick list for regions used in active member info records.
$Regions = new GlmDataRegions($this->wpdb, $this->config);
$regionData = $Regions->getListForSearch(true);
- // Get counties for possible use in search pick list for counties used in active member info records.
- require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCounties.php';
- $Counties = new GlmDataCounties($this->wpdb, $this->config);
- $countyData = $Counties->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);
}
- $counties = array();
- // If we have a county set in shortcode or via URL.
- if ($actionData['request']['county-search']) {
-
- // Convert comma separated list to an array
- $countiesRequested = explode( ',', $actionData['request']['county-search'] );
-
- // Check for numeric ID's only
- while ( list( $k, $v ) = each( $countiesRequested ) ) {
- if ( preg_match( '/^[0-9]*$/', trim( $v ) && $v > 0 ) ) {
- $counties[] = ( $v - 0 );
- }
- }
-
- if ( isset( $counties ) && !empty( $counties ) ) {
- $where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
- $whereSep = ' AND ';
- }
- }
-
- // If there's counties shortcode or url options to restrict this page to certain counties
- if (count($counties) > 0) {
-
- while ( list($k,$v) = each ($countyData) ) {
- if (!in_array($v['id'], $counties)) {
- unset ($countyData[$k]);
- }
- }
-
- }
-
// If we have a city set in shortcode or via URL.
$cities = array();
if ( isset( $actionData['request']['city-search'] )
// Get stats for number of members found matching current selection criteria (includes alpha selection)
$filteredMembersFound = $this->getStats(str_replace('T.', '', $where.$alphaWhere));
- if ( $memberSearch ) {
- // echo '<pre>$memberSearch: ' . print_r( $memberSearch, true ) . '</pre>';
+ // If there's a full text search, handle separately
+ if ( $fullTextSearch ) {
+
+ // echo '<pre>$fullTextSearch: ' . print_r( $fullTextSearch, true ) . '</pre>';
if ( $appendSelect ) {
$order = " rel_name DESC, member_name ASC ";
} else {
'', // prohibitListOptions
$appendSelect
);
+
+ // When not full text search sort according to settings
} else {
+
// Get member list sorted as specified
switch ($this->config['settings']['list_order_list']) {