Added code to determine when a member record needs to be re-indexed by the search add-on.
Removed depreciated code from glmMembersAdminNotices() - Function to be removed later.
Removed some temporary debug code from admin controller.
Added glmMembersConfigArraySetup() array to provide easy expansion of config data in glmPluginSupport.php
Finished adding requests for search engine to index, re-index, or remove a member from search results.
Added a comment to the top of the updateRequiredPages function in admin/management/index.php file.
// Save plugin configuration object
$this->config = $config;
- // Check the database - allow installation of tables for a new add-on
-/* if (!$this->checkDatabase('install')) {
- die('Database check failure');
- }
-*/
-
- // Now add any shortcodes from the config 'shortcodes' table
+ // Add any shortcodes from the config 'shortcodes' table
while (list($key, $val) = each($this->config['shortcodes'])) {
add_shortcode($key,
array(
'controller'
)
);
-
}
/*
// Register any front.css files in the css directory of any glm members plugin
foreach ($this->config['addOns'] as $a) {
$cssFile = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.$a['slug'].'/css/front.css';
-
+
if (is_file($cssFile)) {
$cssName = $a['slug'].'-front-css';
wp_register_style(
$cssGridFile = GLM_MEMBERS_PLUGIN_PATH.'/css/glm-grid.css';
if (is_file($cssGridFileOld)) {
-
+
$cssGridNameOld = 'grid-front-css-old';
wp_register_style(
$cssGridNameOld,
<?php
/**
- * Plugin Name: GLM Members Database
+ * Plugin Name: GLM Associate - Members Plugin
* Plugin URI: http://www.gaslightmedia.com/
- * Description: Gaslight Media Members Database.
+ * Description: Gaslight Media GLM Associate core plugin and Members database.
* Version: 2.10.35
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
*/
/**
- * Gaslight Media Members Database
+ * GLM Associate - Members Plugin
* Index
*
* PHP version 5.5
parent::__construct( false, false );
}
- public function updateRequiredPages(){
+
+ /*
+ * SOMEONE NEEDS TO DOCUMENT THIS FUNCTION
+ */
+ public function updateRequiredPages(){
$this->requiredPages = array();
foreach ( $this->config[ 'addOns' ] as $a ) {
if ( isset ( $a[ 'requiredPages' ] ) ) {
glmClearShortcodeCache();
- }
+ // Ask to re-index this member.
+ $url = GLM_MEMBERS_SITE_BASE_URL.$this->config['settings']['canonical_member_page'].'/'.$memberData['fieldData']['member_slug'].'/';
+ $result = apply_filters( 'glm_member_db_common_search_indexurl', $url );
+ }
}
}
}
- // $memberStatusBefore = $this->getDisplayStatus($this->memberID);
+ // Determine member status before operation for check if search engine request needed
+ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php';
+ $MemberInfo = new GlmDataMemberInfo($this->wpdb, $this->config);
+ $memberStatusBefore = $MemberInfo->getActiveInfoIdForMember($this->memberID);
/*
* Perform requested action
glmClearShortcodeCache();
- // Get member display status again and if status goes from true to false, remove it from the search index
-/*
- $memberStatusAfter = $this->getDisplayStatus($this->memberID);
- $url = ''; // ************************* NEED TO PUT URL HERE *************************
+ // Get member display status again to see if there is a search engine request neeeded
+ $memberStatusAfter = $MemberInfo->getActiveInfoIdForMember($this->memberID);
+ $url = GLM_MEMBERS_SITE_BASE_URL.$this->config['settings']['canonical_member_page'].'/'.$memberData['fieldData']['member_slug'].'/';
+
if ($memberStatusBefore && !$memberStatusAfter) {
$result = apply_filters( 'glm_member_db_common_search_removeurl', $url );
}
if (!$memberStatusBefore && $memberStatusAfter) {
$result = apply_filters( 'glm_member_db_common_search_indexurl', $url );
}
-*/
+
break;
- // Add the new member
+ // Add the new member
case 'addNew':
$memberData = $this->insertEntry();
$memberUpdated = true;
$memberUpdateError = false;
}
-
+
} else {
$memberUpdateError = true;
}
$this->memberInfoID = $this->memberInfo['fieldData']['id'];
$this->haveMemberInfo = true;
+ $memberUpdated = true;
// Update submitted amenities
$this->updateAmenities();
}
+ // Check if the member should be indexed, reindexed or be removed from search results
+ $nowActive = $this->isActive();
+ $url = GLM_MEMBERS_SITE_BASE_URL.$this->config['settings']['canonical_member_page'].'/'.$this->memberInfo['fieldData']['member_slug'].'/';
+ if ($nowActive && $memberUpdated) {
+ $result = apply_filters( 'glm_member_db_common_search_indexurl', $url );
+ }
+ if (!$activeTest && $this->isActive) {
+ $result = apply_filters( 'glm_member_db_common_search_removeurl', $url );
+ }
+
+
// If have member then store the current member ID for later reference
if ($this->memberID) {
update_option('glmMembersDatabaseMemberID', $this->memberID);
{
"name": "glm-member-db",
"version": "0.0.0",
- "description": "=== Gaslight Media Member Database === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Members Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html",
+ "description": "=== GLM Associate === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Members Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
-=== Gaslight Media Member Database ===
+=== GLM Assoicate - Members Plugin ===
Contributors: cscott@gaslightmedia.com
Donate link: http://www.gaslightmedia.com
Tags: Gaslight Media,Plugin,Members
The current list of these plugins/add-ons is below. There may be additional add-ons not listed here.
-* Main Plugin with Members Database
+* Core Plugin with Members Database
* Contacts Add-On that provides both informational and log-in contacts with a range of capabilities.
* Events Add-On that is a full function Events calendar
* Packaging Add-On that provide "packaged" offers
</td>
</tr>
</table>
- These settings now enabling "trigger_error()" output where that's available. This is replacing the legacy
- debug output that used a separate debug window. So far only Front Controller has debug tests included.
- <p> </p>
<!-- Required Pages -->