Added $optionProhibitListOptions class variable to DataAbstract.php that will completely squash the added lists of data.
Chaged members/list.php from using the by lat/lon method to simlified member data for getting map data - cuts overhead.
Changed dataMemberInfo get simplified to use a fast query for getting map data rather than going through the Data Abstract for that data - Huge improvement.
Updated list.html to use the simplified data for the map objects. Also commented out categories and now useing short descrption.
$this->doPostProcessing = false;
+ $plo = $this->optionProhibitListOptions;
+ $this->optionProhibitListOptions = true;
+
// Save current list of fields
$f = $this->fields;
- // Replace fields list with limited list
- $this->fields = array(
- 'id' => $f['id'],
- 'member' => $f['member'],
- 'member_name' => $f['member_name'],
- 'member_slug' => $f['member_slug'],
- 'member_pointer' => $f['member_pointer'],
- 'reference_name' => $f['reference_name'],
- 'status' => $f['status'],
- 'create_time' => $f['create_time'],
- 'modify_time' => $f['modify_time'],
- 'lat' => $f['lat'],
- 'lon' => $f['lon']
- );
-
+ // If for map items, do a custom query to save time (lots of map items)
if ($forMapItems) {
- $this->fields = array_merge($this->fields, array(
- 'addr1' => $f['addr1'],
- 'addr2' => $f['addr2'],
- 'city' => $f['city'],
- 'state' => $f['state'],
- 'country' => $f['country'],
- 'zip' => $f['zip'],
- 'phone' => $f['phone'],
- 'toll_free' => $f['toll_free'],
- 'email' => $f['email'],
- 'url' => $f['url'],
- 'region' => $f['region'],
- 'country' => $f['country'],
- 'cc_type' => $f['cc_type'],
- 'logo' => $f['logo'],
- 'descr' => $f['descr'],
- 'short_descr' => $f['short_descr']
- ));
- }
- // Get the simplified list
- $list = $this->getList($where);
+ $sql = "
+ SELECT
+ T.id,
+ T.member,
+ T.member_name,
+ M.member_slug,
+ T.lat,
+ T.lon,
+ T.addr1,
+ T.addr2,
+ C.name AS city,
+ T.state,
+ T.country,
+ T.zip,
+ T.phone,
+ T.toll_free,
+ T.email,
+ T.url,
+ R.name AS region,
+ T.logo,
+ T.short_descr
+ FROM
+ glm_glm_members_member_info T,
+ glm_glm_members_members M,
+ glm_glm_members_cities C,
+ glm_glm_members_regions R
+ WHERE
+ M.id = T.member
+ AND C.id = T.city
+ AND R.id = T.region
+ ";
+ if ($where != '') {
+ $sql .= "AND $where";
+ }
+ $list = $this->wpdb->get_results($sql, ARRAY_A);
+
+ // Otherwise get the simplified list normally
+ } else {
+
+ $this->fields = array(
+ 'id' => $f['id'],
+ 'member' => $f['member'],
+ 'member_name' => $f['member_name'],
+ 'member_slug' => $f['member_slug'],
+ 'member_pointer' => $f['member_pointer'],
+ 'reference_name' => $f['reference_name'],
+ 'status' => $f['status'],
+ 'create_time' => $f['create_time'],
+ 'modify_time' => $f['modify_time'],
+ 'lat' => $f['lat'],
+ 'lon' => $f['lon']
+ );
+
+ // Get the simplified list
+ $list = $this->getList($where, false, false);
+
+ }
// Restore full fields list
$this->fields = $f;
+ $this->optionProhibitListOptions = $plo;
+
return $list;
}
* @access public
*/
public $optionIncludeSelectListData = false;
+ /**
+ * This parameter is only temporary till we can get better control of list generation *********
+ */
+ public $optionProhibitListOptions = false;
/**
* Delete Restrictions - Not fully sorted out yet
*
$alwaysList = (isset($f['force_list']) && $f['force_list']);
$pStatic = (isset($f['p_static']) && $f['p_static']);
$pSum = (isset($f['p_sum']) && $f['p_sum']);
- if (($this->optionIncludeSelectListData || $alwaysList || $forEdit || $pSum) && !$pStatic ) {
+ if (($this->optionIncludeSelectListData || $alwaysList || $forEdit || $pSum) && !$pStatic && !$this->optionProhibitListOptions) {
// Get pointer value, ensure it's an integer
$p_value = ($d - 0);
return false;
}
+ // If just returning values
+ if ($this->optionProhibitListOptions) {
+
+ $r = array(
+ 'list' => false,
+ 'value' => $d,
+ 'name' => $f['list'][$d],
+ 'nameEsc' => addslashes($f['list'][$d])
+ );
+
+ return $r;
+ }
+
+
// Build list array
$list = array();
'names' => $bitmapNames
);
+ if ($this->optionProhibitListOptions) {
+ $r['bitmap'] = false;
+ }
+
return $r;
}
* for some period of time. See genPseudoRandIdArray() and pseudoRandDataSort().
* @param boolean $fieldVals Optional flag requesting fields contain array of all possible values.
* @param string $idField Optional name of ID field (primary index) to use for result array keys.
+ * @param integer $start Optional start of list index
+ * @param integer $limit Optional list length limit
+ * @param boolean $prohibitListOptions Prohibit the generation of all options in list or pointer fields
+ * Can only be set - if false will not turn this option off if it's already been seet.
+ *
*
* @return array Array containing results
* @access public
*/
- public function getList($where = '', $order = '', $fieldVals = true, $idField = 'id', $start = false, $limit = false)
+ public function getList($where = '', $order = '', $fieldVals = true, $idField = 'id', $start = false, $limit = false, $prohibitListOptions = false)
{
// NOTE: $fieldVals not yet implemented
+ // Check if we're asked to block all list field options. Only enable this, the parameter does not permit turning it off
+ if ($prohibitListOptions) {
+ $this->$optionProhibitListOptions = true;
+ }
+
// Get field specifications for this instance
$this->buildFieldsList('l');
*/
public function modelAction ($actionData = false)
{
+
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ $membStartTime = microtime(true);
+ }
+
// Enqueue the Marker Clusterer Script
wp_register_script(
'glm-members-admin-google-maps-marker-clusterer',
$actionData['request']['region-search'] = $_REQUEST['regionSearch'];
}
*/
+
$actionData = apply_filters( 'glm-member-db-front-search-request', $actionData );
// Check for "show" shortcode parameter (what elements to show on the page)
$settings = array();
}
}
}
+
// 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 = '';
}
// Get a simplified full list of member data for the map. Limit by selected Alpha is used.
- require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/memberDataByLatLon.php';
- $MapItems = new GlmMembersFront_members_memberDataByLatLon($this->wpdb, $this->config);
- $mapItems = $MapItems->getMembers('all', false, '', $where.$alphaWhere);
-
+// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/memberDataByLatLon.php';
+ // $MapItems = new GlmMembersFront_members_memberDataByLatLon($this->wpdb, $this->config);
+ $mapItems = $this->getSimpleMemberInfoList($where.$alphaWhere, true);
/*
* Get a current list of members - unless this is a blank start
);
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ $membListTime = round(microtime(true) - $membStartTime, 6);
+ trigger_error($membListTime." seconds ---", E_USER_NOTICE);
+ }
+
// Return status, suggested view, and data to controller - also return any modified settings
return array(
'status' => $success,
<!-- Member information displayed in map bubbles -->
{foreach $mapItems as $m}
<div id="map_info_{$m.id}" class="glm-hidden">
- {apply_filters('glm-member-db-front-members-list-mapBubbleTop', '', $m.member)}
{if $m.logo && $settings.list_map_show_logo}
<div class="glm-member-list-image">
<img src="{$glmPluginMediaUrl}/images/{$settings.list_map_logo_size}/{$m.logo}">
{/if}
<div class="glm-map-member-name">
{if $settings.list_map_show_detaillink}
- <a href="{$siteBaseUrl}{$settings.canonical_member_page}/{$m.member_slug}/{if $settings.enable_multiple_profiles}{$m.id}/{/if}">{$m.name}</a>
+ <a href="{$siteBaseUrl}{$settings.canonical_member_page}/{$m.member_slug}/{if $settings.enable_multiple_profiles}{$m.id}/{/if}">{$m.member_name}</a>
{else}
{$m.name}
{/if}
{if $m.city}{$m.city}{if $m.state}, {/if}{/if}{if $m.state}{$m.state}{/if}{if $m.zip} {$m.zip}{/if}
{/if}
{if $m.country && $settings.list_map_show_country}
- <br>{$m.country}
+ {$m.country}
{/if}
</p>
{/if} {*list_map_show_address*}
{if $m.email && $settings.list_map_show_email}<b>E-Mail Address:</b> <a href="mailto:{$m.email}">{$m.email}</a><br>{/if}
{if $m.region && $settings.list_map_show_region}<b>Region:</b> {$m.region}{/if}
</p>
- {if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}<br>{/if}
+ <!-- Not using Description for now - Use short descr for maps {literal}
+ {if $m.descr && $settings.list_map_show_descr}{$m.descr|nl2br}<br>{/if}
+ {/literal} -->
{if $m.short_descr && $settings.list_map_show_short_descr}{$m.short_descr}<br>{/if}
+ <!-- Not using categories for now {literal}
{if $m.categories && $settings.list_map_show_categories}
<div class="glm-member-list-items">
<b>{$terms.term_member_cap} Categories</b>
</ul>
</div>
{/if}
- <!-- Not using credit cards for now
+ {/literal} -->
+ <!-- Not using credit cards for now {literal}
{if $m.cc_type && $settings.list_map_show_creditcards}
<div class="glm-member-list-items">
<b>Credit Cards Accepted:</b>
</ul>
</div>
{/if}
- -->
+ {/literal} -->
{if $settings.list_map_show_amenities}
<div class="glm-member-list-items">
<b>Amenities:</b>