* Plugin Name: GLM Members Database Contacts
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 1.0.21
+ * Version: 1.0.22
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabaseContacts
* @author Gaslight Media <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.21
+ * @version 1.0.22
*/
/*
* version when there's a change in the database!! Use the
* version nunmber of that release for the DB version.
*/
-define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.0.21');
+define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.0.22');
define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.3');
// This is the minimum version of the GLM Members DB plugin require for this plugin.
$haveCounties = false;
$haveFilter = false;
$contactMembers = array();
-
+
$textSearch = '';
$blankStart = false;
$limit = 20; // Set to the number of listings per page
$where = '';
-
-
+
+
if (isset($_REQUEST['textSearch'])) {
$actionData['request']['text-search'] = $_REQUEST['textSearch'];
}
}
// If this is a logged in member user, then show their contacts only
- if (isset($this->config['loggedInUser']['contactUser'])) {
+ //if (isset($this->config['loggedInUser']['contactUser'])) {
// if there's logged in contact user
- $contactUser = $this->config['loggedInUser']['contactUser'];
- if ($contactUser['ref_type'] = $this->config['ref_type_numb']['Member']
- && $contactUser['ref_dest'] ) {
+ //$contactUser = $this->config['loggedInUser']['contactUser'];
+ //if ($contactUser['ref_type'] = $this->config['ref_type_numb']['Member']
+ //&& $contactUser['ref_dest'] ) {
- $loggedInMember = true;
+ //$loggedInMember = true;
// Filter all contact searches to their member contacts
- $where .= " AND ref_type = ".$this->config['ref_type_numb']['Member']."
- AND ref_dest = ".$contactUser['ref_dest'];
+ //$where .= " AND ref_type = ".$this->config['ref_type_numb']['Member']."
+ //AND ref_dest = ".$contactUser['ref_dest'];
// Also set their member as the current one
- $this->memberID = $contactUser['ref_dest'];
- }
+ //$this->memberID = $contactUser['ref_dest'];
+ //}
+
+ //}
- }
-
// Load members data class
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php';
$this->Members = new GlmDataMembers($this->wpdb, $this->config);
}
$where = ' TRUE ';
-
- // Only list member contacts for the selected member
- if ($haveMember) {
- $where .= " AND ref_type = ".$this->config['ref_type_numb']['Member'].' AND ref_dest = '.$this->memberID;
- }
-
+
// Filter by selected county
if (isset($_REQUEST['countySearch'])) {
$countySearch = esc_sql($_REQUEST['countySearch']);
)";
$haveFilter = true;
}
-
+
// Filter by text string supplied
if (isset($_REQUEST['filterText'])) {
$filterText = esc_sql($_REQUEST['filterText']);
)";
$haveFilter = true;
}
-
+
// Get the total number of contacts listed
$numbContacts = $this->getStats($where);
-
+
// If the number of events is less than a page, don't do paging
if ($numbContacts <= $limit) {
$paging = false;
}
-
+
// Setting $paging to false until we figure it out for contacts
//$paging = false;
// Get full list for all other filters, but not filtered by alpha (that would be silly)
$alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected);
- }
-
+ }
+
$order = "lname, fname";
// Get list of contacts
-
+
// Check if we're doing paging
if (isset($_REQUEST['pageSelect'])) {
${$resultParam} = $this->getList($where.$alphaWhere, 'lname', true, 'id', $start, $limit);
}
-
-
-
+
+
+
if ($paging) {
//Get paging results
$numbDisplayed = $listResult['returned'];
// since we're doing paging, we have to break out just the contact data
$list = $listResult['list'];
unset($listResult);
-
+
}
-
-
+
+
// If we have list entries - even if it's an empty list
$success = true;
$haveContacts = false;
if ($countyList) {
$haveCounties = true;
}
-
+
// Compile template data
$templateData = array(
'option' => $option,