From: Chuck Scott Date: Thu, 5 Oct 2017 20:01:01 +0000 (-0400) Subject: Removing references to "addNotice" function in glmPluginSupport that were causing... X-Git-Tag: v2.10.23^2~50 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5b2b0bbf007338e4384cd466045cf04bf61d74b2;p=WP-Plugins%2Fglm-member-db.git Removing references to "addNotice" function in glmPluginSupport that were causing problems. --- diff --git a/classes/data/dataAmenities.php b/classes/data/dataAmenities.php index 0f86bdc8..e638a4e8 100644 --- a/classes/data/dataAmenities.php +++ b/classes/data/dataAmenities.php @@ -157,10 +157,6 @@ class GlmDataAmenities extends GlmDataAbstract ); - if ( is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) { - glmMembersAdmin::addNotice( $this->fields, 'DataBlock', 'Table Fields: '.$this->table ); - } - } /** @@ -212,7 +208,7 @@ class GlmDataAmenities extends GlmDataAbstract // Check input for sanity - Refernce type first if ( $ref_type === false || ( $ref_type - 0 ) <= 0 - || !in_array( $ref_type, $this->config['ref_type_numb'] ) + || !in_array( $ref_type, $this->config['ref_type_numb'] ) ) { return false; } @@ -250,8 +246,8 @@ class GlmDataAmenities extends GlmDataAbstract public function updateAmenityRef( $ref_type = false, $ref_dest = false, $amenities = false ) { // Check input for sanity - Refernce type first - if ( $ref_type == false - || ( $ref_type - 0 ) <= 0 + if ( $ref_type == false + || ( $ref_type - 0 ) <= 0 || !in_array( $ref_type, $this->config['ref_type_numb'] ) ) { return false; } @@ -263,7 +259,7 @@ class GlmDataAmenities extends GlmDataAbstract // Start by deleting all amenities for this destination $sql = " - DELETE + DELETE FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."amenity_ref WHERE ref_type = $ref_type AND ref_dest = $ref_dest"; diff --git a/classes/data/dataCategories.php b/classes/data/dataCategories.php index 6c73aadb..66d18bf3 100644 --- a/classes/data/dataCategories.php +++ b/classes/data/dataCategories.php @@ -162,10 +162,6 @@ class GlmDataCategories extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } /** @@ -291,10 +287,6 @@ class GlmDataCategories extends GlmDataAbstract } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("Category added: name = $name, parent = $parent, ID = $categoryID", 'DataBlock', "addCategory()"); - } - return $categoryID; } diff --git a/classes/data/dataCategoryMemberInfo.php b/classes/data/dataCategoryMemberInfo.php index ef58c8e0..1e61ed86 100644 --- a/classes/data/dataCategoryMemberInfo.php +++ b/classes/data/dataCategoryMemberInfo.php @@ -143,10 +143,6 @@ class GlmDataCategoryMemberInfo extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } /** @@ -201,11 +197,6 @@ class GlmDataCategoryMemberInfo extends GlmDataAbstract ;"; $list = $this->wpdb->get_results($sql, ARRAY_A); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getListWithParents() query"); - glmMembersAdmin::addNotice($list, 'DataBlock', 'getListWithParents() data'); - } - return $list; } @@ -291,10 +282,6 @@ class GlmDataCategoryMemberInfo extends GlmDataAbstract // Get new list and return it $current = $this->getList($memberInfoID); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($current, 'DataBlock', 'Currently Selected Member Categories'); - } - return $current; } diff --git a/classes/data/dataCities.php b/classes/data/dataCities.php index d9d97f5f..8bf0ee5b 100644 --- a/classes/data/dataCities.php +++ b/classes/data/dataCities.php @@ -126,10 +126,6 @@ class GlmDataCities extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } /** diff --git a/classes/data/dataCounties.php b/classes/data/dataCounties.php index 767b81f6..34cfde97 100644 --- a/classes/data/dataCounties.php +++ b/classes/data/dataCounties.php @@ -141,10 +141,6 @@ class GlmDataCounties extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } diff --git a/classes/data/dataFiles.php b/classes/data/dataFiles.php index 459bdc32..5a90407a 100644 --- a/classes/data/dataFiles.php +++ b/classes/data/dataFiles.php @@ -197,10 +197,6 @@ class GlmDataFiles extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } @@ -226,10 +222,6 @@ class GlmDataFiles extends GlmDataAbstract // Check for a valid reference type if (!isset($this->config['ref_type'][$refType])) { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("dataFiles.php - getFiles()
  Specified reference type ($refType) is invalid.", 'Alert'); - } - return false; } @@ -237,10 +229,6 @@ class GlmDataFiles extends GlmDataAbstract $refID = $refID -0; if ($refID <= 0) { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("dataFiles.php - getFiles()
  Specified reference destination ($refID) is invalid.", 'Alert'); - } - return false; } @@ -283,10 +271,6 @@ class GlmDataFiles extends GlmDataAbstract // Check for and retrieve the order field name if (isset($_REQUEST[$orderField]) && trim($_REQUEST[$orderField]) == '') { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('dataFiles: filePositionOrder() unable to find '.$orderField.' data. Perhaps there\'s no files at this time.', 'Process'); - } - return false; } @@ -296,10 +280,6 @@ class GlmDataFiles extends GlmDataAbstract return false; } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice($order, 'DataBlock', 'File Sort Order'); - } - // Update image entries with new sort order; $pos = 0; foreach($order as $i) { @@ -315,10 +295,6 @@ class GlmDataFiles extends GlmDataAbstract $queryError = $this->wpdb->last_error; if ($queryError) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Error setting position order for files.
$queryError
$sql", 'Alert'); - } - return false; } } diff --git a/classes/data/dataGroups.php b/classes/data/dataGroups.php index ba717894..078c18a5 100644 --- a/classes/data/dataGroups.php +++ b/classes/data/dataGroups.php @@ -123,8 +123,5 @@ class GlmDataGroups extends GlmDataAbstract ), ); - if ( is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) { - glmMembersAdmin::addNotice( $this->fields, 'DataBlock', 'Table Fields: '.$this->table ); - } } } diff --git a/classes/data/dataImages.php b/classes/data/dataImages.php index cd7c3f31..a6aa6425 100644 --- a/classes/data/dataImages.php +++ b/classes/data/dataImages.php @@ -204,10 +204,6 @@ class GlmDataImages extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } @@ -233,10 +229,6 @@ class GlmDataImages extends GlmDataAbstract // Check for a valid reference type if (!isset($this->config['ref_type'][$refType])) { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("dataImages.php - getGallery()
  Specified reference type ($refType) is invalid.", 'Alert'); - } - return false; } @@ -244,10 +236,6 @@ class GlmDataImages extends GlmDataAbstract $refID = $refID -0; if ($refID <= 0) { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("dataImages.php - getGallery()
  Specified reference destination ($refID) is invalid.", 'Alert'); - } - return false; } @@ -290,10 +278,6 @@ class GlmDataImages extends GlmDataAbstract // Check for and retrieve the order field name if (isset($_REQUEST[$orderField]) && trim($_REQUEST[$orderField]) == '') { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('dataImages: galleryPositionOrder() unable to find '.$orderField.' data. Perhaps there\'s no images at this time.', 'Process'); - } - return false; } @@ -303,10 +287,6 @@ class GlmDataImages extends GlmDataAbstract return false; } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice($order, 'DataBlock', 'Image Gallery Sort Order'); - } - // Update image entries with new sort order; $pos = 0; foreach($order as $i) { @@ -322,10 +302,6 @@ class GlmDataImages extends GlmDataAbstract $queryError = $this->wpdb->last_error; if ($queryError) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Error setting position order for images.
$queryError
$sql", 'Alert'); - } - return false; } } @@ -406,10 +382,6 @@ class GlmDataImages extends GlmDataAbstract reset($this->config['imageSizes']); while (list($k, $v) = each($this->config['imageSizes'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice("      Deleting size $k.", 'Process'); - } - // Check if the image actually exists - May not if we're doing development if (is_file(GLM_MEMBERS_PLUGIN_IMAGES_PATH.'/'.$k.'/'.$imgData['file_name'])) { diff --git a/classes/data/dataMemberInfo.php b/classes/data/dataMemberInfo.php index d494db5a..169c5fde 100644 --- a/classes/data/dataMemberInfo.php +++ b/classes/data/dataMemberInfo.php @@ -521,10 +521,6 @@ class GlmDataMemberInfo extends GlmDataAbstract unset($this->fields['county']); } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } /* diff --git a/classes/data/dataMemberTypes.php b/classes/data/dataMemberTypes.php index 5b426f63..72a1e935 100644 --- a/classes/data/dataMemberTypes.php +++ b/classes/data/dataMemberTypes.php @@ -133,9 +133,6 @@ class GlmDataMemberTypes extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } } } diff --git a/classes/data/dataMembers.php b/classes/data/dataMembers.php index 77e1b901..80d8705e 100644 --- a/classes/data/dataMembers.php +++ b/classes/data/dataMembers.php @@ -252,12 +252,8 @@ class GlmDataMembers extends GlmDataAbstract { 'use' => 'gl' ) - - ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } + ); } @@ -306,7 +302,7 @@ class GlmDataMembers extends GlmDataAbstract { } - + /* * Get Alpha list of first characters in member name * for those members that have active info. diff --git a/classes/data/dataRegions.php b/classes/data/dataRegions.php index 6aeb6277..6e645477 100644 --- a/classes/data/dataRegions.php +++ b/classes/data/dataRegions.php @@ -141,10 +141,6 @@ class GlmDataRegions extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } - } diff --git a/classes/data/settings/dataSettingsTerms.php b/classes/data/settings/dataSettingsTerms.php index a2fcf2fc..590e500c 100644 --- a/classes/data/settings/dataSettingsTerms.php +++ b/classes/data/settings/dataSettingsTerms.php @@ -480,9 +480,6 @@ class GlmDataSettingsTerms extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } } } diff --git a/classes/data/settings/dataSettingsTheme.php b/classes/data/settings/dataSettingsTheme.php index 65f495c4..9567fba9 100644 --- a/classes/data/settings/dataSettingsTheme.php +++ b/classes/data/settings/dataSettingsTheme.php @@ -117,9 +117,6 @@ class GlmDataSettingsTheme extends GlmDataAbstract ); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table); - } } } diff --git a/classes/glmMemberImportFromConnections.php b/classes/glmMemberImportFromConnections.php index c89dff80..eb118714 100644 --- a/classes/glmMemberImportFromConnections.php +++ b/classes/glmMemberImportFromConnections.php @@ -178,7 +178,6 @@ class GlmMemberImportFromConnections $membTypeID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when adding the default member type: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); return false; } @@ -204,7 +203,6 @@ class GlmMemberImportFromConnections $regionID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when adding the default region: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); return false; } @@ -220,7 +218,6 @@ class GlmMemberImportFromConnections $rawCats = $this->wpdb->get_results($sql, ARRAY_A); $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when reading cateory data from Connections.
'.$queryError.'

'.$sql.'

', 'AdminError'); return false; } @@ -246,7 +243,6 @@ class GlmMemberImportFromConnections $rawTerms = $this->wpdb->get_results($sql, ARRAY_A); $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when reading cateory terms from Connections.
'.$queryError.'

'.$sql.'

', 'AdminError'); return false; } @@ -278,7 +274,7 @@ class GlmMemberImportFromConnections $catID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating member: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // not doing anything right now } $cats[$k]['new_id'] = $catID; } @@ -299,7 +295,7 @@ class GlmMemberImportFromConnections $this->wpdb->query($sql); $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating member: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // not doing anything right now } } } @@ -312,7 +308,6 @@ class GlmMemberImportFromConnections $memberCats = $this->wpdb->get_results($sql, ARRAY_A); $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when reading term relationships from Connections.
'.$queryError.'

'.$sql.'

', 'AdminError'); return false; } @@ -349,7 +344,7 @@ class GlmMemberImportFromConnections $membID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating member: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // Not doing anything right now } /* @@ -381,7 +376,7 @@ class GlmMemberImportFromConnections $cityID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when adding the default region: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // Not doing anything right now } $cities[$addr['city']] = $cityID; @@ -488,7 +483,7 @@ class GlmMemberImportFromConnections $membID = $this->wpdb->insert_id; $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating member: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // Not doing anything right now } // Scan member/category mapping array for any for this member @@ -514,7 +509,7 @@ class GlmMemberImportFromConnections $this->wpdb->query($sql); $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating member/category entry: Check following message.
'.$queryError.'

'.$sql.'

', 'AdminError'); + // Not doing anything right now } } } diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php index dc93715f..bd3980e2 100644 --- a/classes/glmPluginSupport.php +++ b/classes/glmPluginSupport.php @@ -39,14 +39,14 @@ class GlmPluginSupport * @return void * @access public */ - public static function addNotice ($message, $type = false, $title = false) + public function addNotice ($message, $type = false, $title = false) { // Depreciating debug system - Make sure all notices are cleared // Will delete this method after all references are purged. - + $this->clearNotices(); - + return; } @@ -57,14 +57,9 @@ class GlmPluginSupport * @return void * @access public */ - public static function clearNotices () + function clearNotices () { - delete_option('glmMembersAdminNoticeAlerts'); - delete_option('glmMembersAdminNoticeProcess'); - delete_option('glmMembersAdminNoticeDataBlocks'); - delete_option('glmMembersAdminNotices'); - } /* diff --git a/controllers/admin.php b/controllers/admin.php index 0940f8f8..cdb39baf 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -675,6 +675,7 @@ class glmMembersAdmin extends GlmPluginSupport */ public function controller ($menuItem, $action = false, $actionData = false) { + // Enque admin scripts and css here so that only happens when we're doing something $this->glmMembersAdminScripts(); @@ -700,8 +701,7 @@ class glmMembersAdmin extends GlmPluginSupport // If debug is VERBOSE $consts = get_defined_constants(true); if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - $this->addNotice("
".print_r($_SERVER,1).'
', 'DataBlock', 'Server Defines'); - $this->addNotice('
'.print_r($consts,1).'
', 'DataBlock', 'Defined Parameters'); + // Not doing anything right now // Not verbose } else { $ourConsts = array(); @@ -710,13 +710,10 @@ class glmMembersAdmin extends GlmPluginSupport $ourConsts[$k] = $v; } } - $this->addNotice('
'.print_r($ourConsts,1).'
', 'DataBlock', 'Defined Parameters'); } - $this->addNotice('
'.print_r($this->config,1).'
', 'DataBlock', 'Configuration Settings'); - $this->addNotice("
".print_r($_REQUEST,1)."
", 'DataBlock', "Request Data"); if (isset($_FILES)) { - $this->addNotice("
".print_r($_FILES,1)."
", 'DataBlock', "Request Files Data"); + // Not doing anything right now } } else { $this->clearNotices(); @@ -762,7 +759,6 @@ class glmMembersAdmin extends GlmPluginSupport if (isset($_REQUEST['option'])) { $option = ', Option = '.$_REQUEST['option']; } - $this->addNotice("Requested Action: Menu item = $menuItem, Action = $action".$option, 'Process'); } $modelRedirect = false; @@ -770,12 +766,8 @@ class glmMembersAdmin extends GlmPluginSupport // Verify that we have the requested menu item in the valid actions if (!isset($this->config['validActions']['adminActions'][$menuItem])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - $this->addNotice('Error in Admin Controller: Menu Item not included in validActions.php!', 'Alert'); - } - trigger_error('Error in Admin Controller: Menu Item not included in validActions.php!', E_USER_NOTICE); - + $modelRedirect = true; $menuItem = 'error'; $action = 'index'; @@ -788,12 +780,8 @@ class glmMembersAdmin extends GlmPluginSupport if (! isset($this->config['validActions']['adminActions'][$menuItem]) || ! isset($this->config['validActions']['adminActions'][$menuItem][$action])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - $this->addNotice('Error in Admin Controller: Requested Menu Item is invalid! - '.$menuItem, 'Alert'); - } - trigger_error('Error in Admin Controller: Requested Menu Item is invalid! - '.$menuItem, E_USER_NOTICE); - + $menuItem = 'error'; $action = 'badAction'; @@ -823,12 +811,8 @@ class glmMembersAdmin extends GlmPluginSupport // If model file doesn't exist - we have an error if (!file_exists($modelName)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - $this->addNotice("Error in Admin Controller: Model file doesn't exist - ".$modelName, 'Alert'); - } - trigger_error("Error in Admin Controller: Model file doesn't exist - ".$modelName, E_USER_NOTICE); - + $modelRedirect = true; $menuItem = 'error'; $action = 'index'; @@ -845,12 +829,8 @@ class glmMembersAdmin extends GlmPluginSupport // check for an invalid model class name if (!class_exists($className)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - $this->addNotice("Error in Admin Controller: Invalid Model Class Name - ".$className, 'Alert'); - } - trigger_error("Error in Admin Controller: Invalid Model Class Name - ".$className, E_USER_NOTICE); - + $modelRedirect = true; $menuItem = 'error'; $action = 'index'; @@ -870,8 +850,6 @@ class glmMembersAdmin extends GlmPluginSupport // Check if there's been a model redirect request if ($results['modelRedirect']) { - $this->addNotice('
'.print_r($results,1).'
', 'DataBlock', 'Model Redirect'); - // Set the new model action $action = $results['modelRedirect']; @@ -910,7 +888,7 @@ class glmMembersAdmin extends GlmPluginSupport if (!is_file($viewPath.'/'.$viewFile)) { trigger_error("Bad or missing view file: $viewPath/$view", E_USER_NOTICE); - + // No matching view file found $errorMsg .= "Bad or missing view file: $viewPath/$view"; $badView = true; @@ -924,12 +902,8 @@ class glmMembersAdmin extends GlmPluginSupport // If we don't have a good view file if ($badView) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - $this->addNotice("Error in Admin Controller: Requested View file doesn't exist - ".$viewPath.'/'.$viewFile, 'Alert'); - } - trigger_error("Error in Admin Controller: Requested View file doesn't exist - ".$viewPath.'/'.$viewFile, E_USER_NOTICE); - + $modelRedirect = true; $menuItem = 'error'; $action = 'index'; @@ -943,9 +917,9 @@ class glmMembersAdmin extends GlmPluginSupport // This is just a sanity check on this loop to keep it from getting out of control if (++$loopCheck > 5) { - + trigger_error('Serious failure looping on model load!', E_USER_NOTICE); - + die('

Serious failure looping on model load in "controllers/admin.php".

@@ -963,10 +937,6 @@ class glmMembersAdmin extends GlmPluginSupport ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG && $modelRedirect) { - $this->addNotice('Redirecting...', 'Process'); - } - // Loop again if there's a model redirect } while ($modelRedirect); @@ -1017,15 +987,8 @@ class glmMembersAdmin extends GlmPluginSupport // If view debug has been requested if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("Template Path: $viewPath", 'Process'); - glmMembersAdmin::addNotice("Template File: $viewFile", 'Process'); - $x = $smarty->template->getTemplateVars(); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice($x, 'DataBlock', 'Template Parameters'); - } - } // Update the Smarty view path - *** NEEED TO FIX THIS TO SUPPORT THEME VIEWS SOMEHOW **** diff --git a/controllers/front.php b/controllers/front.php index 6283f683..56a7d3fd 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -366,9 +366,6 @@ class glmMembersFront extends GlmPluginSupport $consts = $consts['user']; } - $this->addNotice("
".print_r($consts,1)."
", 'DataBlock', "Defined Parameters"); - $this->addNotice("
".print_r($_REQUEST,1)."
", 'DataBlock', "Request Data"); - } else { $this->clearNotices(); } @@ -445,10 +442,6 @@ class glmMembersFront extends GlmPluginSupport $loopCheck = 0; do { - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) { - glmMembersFront::addNotice("Requested Action: Menu item = $menuItem, Action = $action", 'Process'); - } - // If the menu item is "error" reset the view path if ($menuItem == 'error') { $viewPath = GLM_MEMBERS_PLUGIN_PATH . '/views'; @@ -488,6 +481,8 @@ class glmMembersFront extends GlmPluginSupport // Otherwise, load and run the model } else { +// trigger_error("Front Controller: Loading ... Model = $modelName, Action = $action, Class = $className"); + // Load the model file, if it hasn't already if (!class_exists($className)) { require_once $modelName; @@ -564,10 +559,6 @@ class glmMembersFront extends GlmPluginSupport die('

Serious failure looping on model load in "controllers/front.php".

'); } - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG && $modelRedirect) { - $this->addNotice('Redirecting...', 'Process'); - } - // Loop again if there's a model redirect } while ($modelRedirect); @@ -633,17 +624,6 @@ Request Data: ".print_r($_REQUEST,1)." } } - // If view debug has been requested - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) { - - glmMembersFront::addNotice("Template Path: $viewPath", 'Process'); - glmMembersFront::addNotice("Template File: $viewFile", 'Process'); - - $x = $smarty->template->getTemplateVars(); - $templateVars = '
' . print_r($x, 1) . '
'; - glmMembersFront::addNotice($templateVars, 'DataBlock', 'Template Parameters'); - } - // Update the Smarty view path $smarty->template->setTemplateDir($viewPath); diff --git a/lib/GlmDataAbstract/DataAbstract.php b/lib/GlmDataAbstract/DataAbstract.php index 22afc4e2..ebde834c 100644 --- a/lib/GlmDataAbstract/DataAbstract.php +++ b/lib/GlmDataAbstract/DataAbstract.php @@ -626,10 +626,6 @@ abstract class GlmDataAbstract "; $res = $this->wpdb->get_row($sql, ARRAY_A); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : '')); - } - return $res['p_sum']; } else { @@ -643,10 +639,6 @@ abstract class GlmDataAbstract "; $p_list = $this->wpdb->get_results($sql, ARRAY_A); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : '')); - } - // Build pick select table $pick_select = false; $selected_name = ''; @@ -716,11 +708,6 @@ abstract class GlmDataAbstract "; $res = $this->wpdb->get_row($sql, ARRAY_A); - - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : '')); - } - return $res[$f['p_field']]; } @@ -922,13 +909,6 @@ abstract class GlmDataAbstract // Check for a list data if (!isset($f['list']) || !is_array($f['list'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "Field '".$f['name']."' is type list but does not have supplied 'list' data.", - 'Alert', - '' - ); - } return false; } @@ -985,13 +965,6 @@ abstract class GlmDataAbstract // Check for a list data if (!isset($f['list']) || !is_array($f['list'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "Field '".$f['name']."' is type list but does not have supplied 'list' data.", - 'Alert', - '' - ); - } return false; } @@ -1096,13 +1069,6 @@ abstract class GlmDataAbstract { // Check for a bitmap data if (!isset($f['bitmap']) || !is_array($f['bitmap'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "Field '".$f['name']."' is type bitmap but does not have supplied 'bitmap' data.", - 'Alert', - '' - ); - } return false; } @@ -1150,13 +1116,6 @@ $forEdit = true; // Check for a bitmap data if (!isset($f['bitmap']) || !is_array($f['bitmap'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "Field '".$f['name']."' is type bitmap but does not have supplied 'bitmap' data.", - 'Alert', - '' - ); - } return false; } @@ -1252,13 +1211,6 @@ $forEdit = true; $filter = FILTER_SANITIZE_STRING; if (isset($f['filter'])) { if (!is_numeric($f['filter'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "

 

ERROR: Supplied value for option 'filter' in fields array not a defined filter for PHP filter_input();", - 'Alert', - '' - ); - } return false; } $filter = $f['filter']; @@ -1267,13 +1219,6 @@ $forEdit = true; $filter_options = 0; //FILTER_FLAG_NO_ENCODE_QUOTES; if (isset($f['filter_options'])) { if (!is_numeric($f['filter_options']) && !is_array($f['filter_options'])) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "

 

ERROR: Supplied value for 'filter_options' is not valid;", - 'Alert', - '' - ); - } return false; } $filter_options = $f['filter_options']; @@ -2510,14 +2455,7 @@ $forEdit = true; $current_img = $newFilename; - } else { - - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($newImage, 'DataBlock', "DataAbstract - imageInput() wp_get_image_editor($tmpFile) Error"); - } - } - } return $current_img; @@ -2969,13 +2907,6 @@ $forEdit = true; // Check that we have a fields list if (!is_array($this->fields) || count($this->fields) == 0) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "ALERT: Empty Fields List in data abstract buildFieldsList()! Likely programming error.", - 'Alert', - 'Member Types Data' - ); - } } // For each possible field @@ -2989,13 +2920,6 @@ $forEdit = true; // Check for good field type if (!in_array($v['type'], $this->knownFieldTypes)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "CONFIGURATION ERROR: Unknown field type - ".$v['type'], - 'Alert', - '' - ); - } return false; } @@ -3040,10 +2964,6 @@ $forEdit = true; } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($this->fieldData, 'DataBlock', "buildFieldsList() data"); - } - return; } @@ -3080,13 +3000,6 @@ $forEdit = true; // Check for good field type if (!in_array($type, $this->knownFieldTypes)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "CONFIGURATION ERROR: Unknown field type - ".$v['type'], - 'Alert', - '' - ); - } return false; } @@ -3164,13 +3077,6 @@ $forEdit = true; // Check for good field type if (!in_array($v['type'], $this->knownFieldTypes)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "CONFIGURATION ERROR: Unknown field type - ".$v['type'], - 'Alert', - '' - ); - } return false; } @@ -3247,11 +3153,6 @@ $forEdit = true; WHERE $where;"; $stats = $this->wpdb->get_row($sql, ARRAY_A); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "DataAbstract - getStats() query"); - $this->addDataAbstractNotice($stats, 'DataBlock', "Stats Data"); - } - return $stats['count']; } @@ -3344,10 +3245,6 @@ $forEdit = true; $paging = true; } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "DataAbstract - getList() query"); - } - $list = $this->wpdb->get_results($sql, ARRAY_A); if (count($list) == 0) { @@ -3367,10 +3264,6 @@ $forEdit = true; $this->pseudoRandDataSort($prList, $newList); } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($newList, 'DataBlock', "getList() data"); - } - // If we're doing paging, return that data along with the list if ($paging) { $c = count($list); @@ -3418,8 +3311,6 @@ $forEdit = true; ;"; $detail = $this->wpdb->get_row($sql, ARRAY_A); - $this->addDataAbstractNotice($sql, 'DataBlock', "DataAbstract - getEntry() query"); - // If nothing was found, simply return false if ($detail == false) { return false; @@ -3428,8 +3319,6 @@ $forEdit = true; // Process individual fields $detail = $this->processOutputData($detail, 'g', $fieldVals); - $this->addDataAbstractNotice($detail, 'DataBlock', "getEntry() data"); - return $detail; } @@ -3445,13 +3334,6 @@ $forEdit = true; { if ($id-0 == 0) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice( - "DataAbstract.php - getEntry() called with invalid ID", - 'Alert', - '' - ); - } return false; } @@ -3601,10 +3483,6 @@ $forEdit = true; // Check if there's a function to do other checks $r = $this->checkOther($r, 'n'); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($r, 'DataBlock', "newEntry() data"); - } - return $r; } @@ -3682,41 +3560,14 @@ $forEdit = true; ( $fields ) VALUES ( $vals ); "; - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "insertEntry() Query"); - } - // Now store the field data $this->wpdb->query($sql); - // Check for query errors - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $queryError = $this->wpdb->last_error; - if (trim($queryError) != '') { - $this->addDataAbstractNotice( - 'insertEntry() Query Failure
' - .'  Error Message: '.$queryError.'
' - .'  Table: '.$this->table, 'Alert'); - } - } - // Get the current ID value and set that in the session $r['fieldData']['id'] = $this->wpdb->insert_id; - } else { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice('  insertEntry() requested to NOT store new entry!', 'Process'); - } - } - - } else { - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice('  checkOther() returned bad status.', 'Process'); } - } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($r, 'DataBlock', "DataAbstract - insertEntry() data"); } return $r; @@ -3738,17 +3589,6 @@ $forEdit = true; ;"; $detail = $this->wpdb->get_row($sql, ARRAY_A); - // Check for Errors - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $queryError = $this->wpdb->last_error; - if (trim($queryError) != '') { - $this->addDataAbstractNotice( - 'editEntry() Query Failure
' - .'  Error Message: '.$queryError.'
' - .'  Table: '.$this->table, 'Alert'); - } - } - // Check for failure retrieving data if (!$detail) { return false; @@ -3757,12 +3597,6 @@ $forEdit = true; // Process individual fields $detail = $this->processOutputData($detail, 'e', true, $id, $idField); - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "DataAbstract - editEntry() query"); - $this->addDataAbstractNotice($detail, 'DataBlock', "editEntry() data"); - } - - return $detail; } @@ -3835,17 +3669,6 @@ $forEdit = true; // Now store the field data $this->wpdb->query($sql, ARRAY_A); - // Check for Errors - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $queryError = $this->wpdb->last_error; - if (trim($queryError) != '') { - $this->addDataAbstractNotice( - 'updateEntry() Query Failure
' - .'  Error Message: '.$queryError.'
' - .'  Table: '.$this->table, 'Alert'); - } - } - // Get the data again for output $r['fieldData'] = $this->getEntry($id, $idField); @@ -3856,10 +3679,6 @@ $forEdit = true; } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($r, 'DataBlock', "updateEntry() data"); - } - return $r; } @@ -3911,10 +3730,6 @@ $forEdit = true; WHERE $idField = $id; "; - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($sql, 'DataBlock', "DataAbstract - deleteEntry() query"); - } - // Assume things will go fine try { $this->wpdb->query($sql, ARRAY_A); @@ -3926,10 +3741,6 @@ $forEdit = true; } } - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) { - $this->addDataAbstractNotice($detail, 'DataBlock', "deleteEntry() data"); - } - return $detail; } @@ -4095,26 +3906,6 @@ $forEdit = true; return $date_list; } - /* - * Send notices to Admin or Front addNotice() - * - * @param (variable) $d1 - * @param (variable) $d2 - * @param (variable) $d3 - * - * @return object Class object - * - */ - private function addDataAbstractNotice ( $d1, $d2 = false, $d3 = false) - { - - if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) { - glmMembersAdmin::addNotice($d1, $d2, $d3); - } elseif (!is_admin() && GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { - glmMembersFront::addNotice($d1, $d2, $d3); - } - } - /** * The following two functions are used to build pseudo-random list results with optional paging */ diff --git a/models/admin/ajax/membersListExport.php b/models/admin/ajax/membersListExport.php index 8470e6a1..6d00eb95 100644 --- a/models/admin/ajax/membersListExport.php +++ b/models/admin/ajax/membersListExport.php @@ -280,10 +280,6 @@ class GlmMembersAdmin_ajax_membersListExport extends GlmDataMemberInfo } } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($list, 'DataBlock', 'Member Data'); - } - // Compile template data $templateData = array( 'category_data' => $category_data, diff --git a/models/admin/management/development.php b/models/admin/management/development.php index 2d6f74a0..c1de9fec 100644 --- a/models/admin/management/development.php +++ b/models/admin/management/development.php @@ -125,15 +125,8 @@ class GlmMembersAdmin_management_development if (isset($_REQUEST['import']) && $_REQUEST['import'] == 'now') { // Reset the database - if (!$this->deleteDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to delete the database tables while resetting the database.
', 'AdminError'); - break; - } - if (!$this->createDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to create the database tables while resetting the database.
', 'AdminError'); - break; - } - glmMembersAdmin::addNotice('Database tables have been reset in preparation importing members.
', 'AdminNotice'); + $this->deleteDataTables($dbVersion); + $this->createDataTables($dbVersion); // Delete Images foreach( new RecursiveIteratorIterator( @@ -151,10 +144,6 @@ class GlmMembersAdmin_management_development // Check if Connections is not installed or not active. If active, gets count of entries. $c = $Connections->checkConnections(); - if ($c === false) { - glmMembersAdmin::addNotice('Connections Business Directory plugin is not installed or not active!
'.print_r($c,1), 'AdminError'); - break; - } $templateData['numbEntries'] = $c; $importNotice .= 'Connections Business Directory plugin is active.
Number of businesses listed: '.$c.'
'; @@ -167,10 +156,6 @@ class GlmMembersAdmin_management_development $templateData['haveMembers'] = true; - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice($templateData['members'], 'DataBlock', 'Base Members Data'); - } - } break; @@ -181,7 +166,6 @@ class GlmMembersAdmin_management_development $del = $this->deleteDataTables($dbVersion); if ($del) { - glmMembersAdmin::addNotice('Database tables for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been deleted.', 'AdminNotice'); } else { break; } @@ -197,9 +181,6 @@ class GlmMembersAdmin_management_development // If there were no errors if ($create) { - // Notify the user that the database has been installed - glmMembersAdmin::addNotice('New database tables installed for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.', 'AdminNotice'); - // Save the version of the installed database update_option('glmMembersDatabaseDbVersion', $dbVersion); @@ -313,7 +294,6 @@ class GlmMembersAdmin_management_development // Read in Database deletion script - assumes the current db version. $dropSQL = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql'; if (!is_file($dropSQL)) { - glmMembersAdmin::addNotice('Error when deleting database: Database deletion SQL script not found:
'.$dropSQL, 'AdminError'); return false; } $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql'; @@ -322,18 +302,12 @@ class GlmMembersAdmin_management_development // Replace {prefix} with table name prefix $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Dropping all database tables', 'Process'); - glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL'); - } - // Removing the tables using the script $this->wpdb->query($sql); // If there's been an error, display in debug Alert $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when deleting database: Database tables may not have existed.
Check following message.
'.$queryError, 'AdminError'); return false; } @@ -355,7 +329,6 @@ class GlmMembersAdmin_management_development // Read in Database creation script $createSQL = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/create_database_V'.$dbVersion.'.sql'; if (!is_file($createSQL)) { - glmMembersAdmin::addNotice('Error when creating database: Database creation SQL script not found:
'.$createSQL, 'AdminError'); return false; } @@ -375,18 +348,12 @@ class GlmMembersAdmin_management_development $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating database: Database tables may already exist.
Check following message.
'.$queryError, 'AdminError'); return false; } $qForDebug .= $queryError.$q; } while ($queryError == '' && next($queries)); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Creating database tables', 'Process'); - glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL'); - } - return true; } diff --git a/models/admin/management/import.php b/models/admin/management/import.php index f2ea68ef..1c2a7d92 100644 --- a/models/admin/management/import.php +++ b/models/admin/management/import.php @@ -213,19 +213,11 @@ class GlmMembersAdmin_management_import // Replace {prefix} with table name prefix $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Dropping all database tables', 'Process'); - glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL'); - } - // Removing the tables using the script $this->wpdb->query($sql); // If there's been an error, display in debug Alert $queryError = $this->wpdb->last_error; - if ($queryError) { - glmMembersAdmin::addNotice('Error when deleting database: Database tables may not have existed.
Check following message.
'.$queryError, 'AdminError'); - } return true; @@ -260,18 +252,12 @@ class GlmMembersAdmin_management_import $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating database: Database tables may already exist.
Check following message.
'.$queryError, 'AdminError'); return false; } $qForDebug .= $queryError.$q; } while ($queryError == '' && next($queries)); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Creating database tables', 'Process'); - glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL'); - } - return true; } diff --git a/models/admin/management/import.php.OLD b/models/admin/management/import.php.OLD index 6cad5c80..9cc4c5ba 100644 --- a/models/admin/management/import.php.OLD +++ b/models/admin/management/import.php.OLD @@ -673,16 +673,12 @@ class GlmMembersAdmin_management_import // Reset the database if (!$this->deleteDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to delete the database tables while resetting the database.
', 'AdminError'); break; } if (!$this->createDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to create the database tables while resetting the database.
', 'AdminError'); break; } - glmMembersAdmin::addNotice('Database tables have been reset in preparation importing members.
', 'AdminNotice'); - // Delete Images foreach( new RecursiveIteratorIterator( @@ -1205,19 +1201,11 @@ class GlmMembersAdmin_management_import // Replace {prefix} with table name prefix $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Dropping all database tables', 'Process'); - glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL'); - } - // Removing the tables using the script $this->wpdb->query($sql); // If there's been an error, display in debug Alert $queryError = $this->wpdb->last_error; - if ($queryError) { - glmMembersAdmin::addNotice('Error when deleting database: Database tables may not have existed.
Check following message.
'.$queryError, 'AdminError'); - } return true; @@ -1252,18 +1240,12 @@ class GlmMembersAdmin_management_import $queryError = $this->wpdb->last_error; if ($queryError) { - glmMembersAdmin::addNotice('Error when creating database: Database tables may already exist.
Check following message.
'.$queryError, 'AdminError'); return false; } $qForDebug .= $queryError.$q; } while ($queryError == '' && next($queries)); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('Creating database tables', 'Process'); - glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL'); - } - return true; } diff --git a/models/admin/management/import/members.php b/models/admin/management/import/members.php index bdb3b911..5190211f 100644 --- a/models/admin/management/import/members.php +++ b/models/admin/management/import/members.php @@ -549,16 +549,8 @@ if (!$failure && isset($_REQUEST['dbReset']) && $_REQUEST['dbReset'] == 'on') { $dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION; // Reset the database - if (!$this->deleteDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to delete the database tables while resetting the database.
', 'AdminError'); - //break; - } - if (!$this->createDataTables($dbVersion)) { - glmMembersAdmin::addNotice('Unable to create the database tables while resetting the database.
', 'AdminError'); - //break; - } - - glmMembersAdmin::addNotice('Database tables have been reset in preparation importing members.
', 'AdminNotice'); + $this->deleteDataTables($dbVersion); + $this->createDataTables($dbVersion); // Delete Images foreach( new RecursiveIteratorIterator( diff --git a/models/admin/management/index.php b/models/admin/management/index.php index 496e3d4f..022bf292 100644 --- a/models/admin/management/index.php +++ b/models/admin/management/index.php @@ -209,13 +209,6 @@ class GlmMembersAdmin_management_index extends GlmDataSettingsGeneral // Try to get the first (should be only) entry for general settings. $generalSettings = $this->editEntry( $id ); - if ( $generalSettings === false ) { - - if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG ) { - glmMembersAdmin::addNotice("  /models/admin/settings/index.php: Unable to load General Settings.", 'Alert'); - } - } - break; } if( $settings_update_error ){ diff --git a/models/admin/management/terms.php b/models/admin/management/terms.php index 32662db7..4d6e9f05 100644 --- a/models/admin/management/terms.php +++ b/models/admin/management/terms.php @@ -128,9 +128,6 @@ class GlmMembersAdmin_management_terms extends GlmDataSettingsTerms // Update the general settings $termsSettings = $this->updateEntry(1); - // Display admin message that the data has been updated - glmMembersAdmin::addNotice('Terms Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice'); - break; // Default is to get the current settings and display the form @@ -142,10 +139,6 @@ class GlmMembersAdmin_management_terms extends GlmDataSettingsTerms // Check that we actually have the terms if ($termsSettings === false) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("/models/admin/settings/terms.php: Unable to load Terms Settings.", 'Alert'); - } - return array( 'status' => false, 'menuItemRedirect' => 'error', diff --git a/models/admin/management/theme.php b/models/admin/management/theme.php index 8eb365c7..e3e9222d 100644 --- a/models/admin/management/theme.php +++ b/models/admin/management/theme.php @@ -128,9 +128,6 @@ class GlmMembersAdmin_management_theme extends GlmDataSettingsTheme // Update the general settings $themeSettings = $this->updateEntry(1); - // Display admin message that the data has been updated - glmMembersAdmin::addNotice('Theme Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice'); - break; // Default is to get the current settings and display the form @@ -142,10 +139,6 @@ class GlmMembersAdmin_management_theme extends GlmDataSettingsTheme // Check that we actually have the theme if ($themeSettings === false) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("/models/admin/settings/theme.php: Unable to load Theme Settings.", 'Alert'); - } - return array( 'status' => false, 'menuItemRedirect' => 'error', diff --git a/models/admin/member/index.php b/models/admin/member/index.php index 0122b769..ded67617 100644 --- a/models/admin/member/index.php +++ b/models/admin/member/index.php @@ -174,18 +174,9 @@ class GlmMembersAdmin_member_index extends GlmDataMembers } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('  Added new member: ID = '.$memberID, 'Process'); - glmMembersAdmin::addNotice($memberData, 'DataBlock', 'Member Data'); - } - // Otherwise setup to get new mmember data } else { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice('  No member ID supplied.', 'Process'); - } - // Setup to add a new member $memberData = $this->newEntry(); $addingMember = true; @@ -201,10 +192,6 @@ class GlmMembersAdmin_member_index extends GlmDataMembers $memberData = $this->updateEntry($memberID); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member Update: $memberID", 'Process'); - } - // If update was successful then use editEntry() to setup for the edit again. if ($memberData['status']) { @@ -232,10 +219,6 @@ class GlmMembersAdmin_member_index extends GlmDataMembers */ } elseif ($memberID > 0) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member ID specified: $memberID", 'Process'); - } - // Try to get existing member data $memberData = $this->editEntry($memberID); if ($memberData) { @@ -244,10 +227,6 @@ class GlmMembersAdmin_member_index extends GlmDataMembers } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($memberData, 'DataBlock', 'Member Data'); - } - /* * * Other actions that may be required diff --git a/models/admin/member/memberEdit.php b/models/admin/member/memberEdit.php index d9b043a0..e5903d18 100644 --- a/models/admin/member/memberEdit.php +++ b/models/admin/member/memberEdit.php @@ -171,10 +171,6 @@ class GlmMembersAdmin_member_memberEdit extends GlmDataMembers // If member ID not supplied and we're not adding a new member - we shouldn't be here, so redirect to an error page if ($this->memberID <= 0 && $option != 'add' && $option != 'addNew') { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member ID expected but no ID was supplied.", 'Alert'); - } - return array( 'status' => true, 'menuItemRedirect' => 'error', @@ -204,10 +200,6 @@ class GlmMembersAdmin_member_memberEdit extends GlmDataMembers $memberData = $this->updateEntry($this->memberID); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member Update: $this->memberID", 'Process'); - } - // If update was successful then use editEntry() to setup for the edit again. if ($memberData['status']) { diff --git a/models/admin/member/memberInfo.php b/models/admin/member/memberInfo.php index c9ed08d7..3a7ae4aa 100644 --- a/models/admin/member/memberInfo.php +++ b/models/admin/member/memberInfo.php @@ -251,10 +251,6 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo // If member ID not supplied or someone is tampering with a member id for a locked member - we shouldn't be here, so redirect to an error page if ($this->memberID <= 0 || ($lockedToMember && $this->memberID != $lockedToMember)) { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member ID expected but no ID was supplied.", 'Alert'); - } - return array( 'status' => true, 'menuItemRedirect' => 'error', @@ -282,10 +278,6 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo $option = 'create'; } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Option specified: $option", 'Process'); - } - /* * Get a sorted list of categories to use for picklists. * These will be sorted so sub-categories fall under their @@ -365,10 +357,6 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo } else { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  No member information exists, assuming this is a new submission.", 'Process'); - } - } glmClearShortcodeCache(); @@ -504,10 +492,6 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo // Otherwise } else { - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - glmMembersAdmin::addNotice("  Member ID is invalid or Status not success: Member ID = $this->memberInfoID", 'Alert'); - } - $this->error = true; } @@ -518,10 +502,6 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($this->memberInfo, 'DataBlock', 'Member Data'); - } - // Compile template data $templateData = array( 'haveMember' => $this->haveMember, diff --git a/models/admin/members/list.php b/models/admin/members/list.php index 545231ef..a13c7ed0 100644 --- a/models/admin/members/list.php +++ b/models/admin/members/list.php @@ -314,10 +314,6 @@ class GlmMembersAdmin_members_list extends GlmDataMembers $nextStart = $start + $limit; } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($list, 'DataBlock', 'Member Data'); - } - // since we're doing paging, we have to break out just the member data $list = $listResult['list']; unset($listResult); diff --git a/models/admin/settings/amenities.php b/models/admin/settings/amenities.php index 0b0d4e78..0cb2183c 100644 --- a/models/admin/settings/amenities.php +++ b/models/admin/settings/amenities.php @@ -219,10 +219,6 @@ class GlmMembersAdmin_settings_amenities extends GlmDataAmenities $amenities = $this->getList(); //echo '
$amenities: ' . print_r($amenities, true) . '
'; - if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) { - glmMembersAdmin::addNotice( $amenities, 'DataBlock', 'Amenities Data' ); - } - // If we have list entries - even if it's an empty list $success = true; $haveAmenities = false; @@ -238,10 +234,6 @@ class GlmMembersAdmin_settings_amenities extends GlmDataAmenities $groups = $groupData->getList(); - if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) { - glmMembersAdmin::addNotice( $groups, 'DataBlock', 'Amenity Groups Data' ); - } - if ( $groups !== false ) { $success = true; @@ -262,10 +254,6 @@ class GlmMembersAdmin_settings_amenities extends GlmDataAmenities ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice( $amenities, 'DataBlock', 'Amenities Data' ); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/admin/settings/categories.php b/models/admin/settings/categories.php index 5a68563a..7c670df8 100644 --- a/models/admin/settings/categories.php +++ b/models/admin/settings/categories.php @@ -147,10 +147,6 @@ class GlmMembersAdmin_settings_categories extends GlmDataCategories // Get a current list of categories $categories = $this->getList(); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($categories, 'DataBlock', 'Category Data'); - } - // If we have list entries - even if it's an empty list $success = true; $haveCategories = false; @@ -178,10 +174,6 @@ class GlmMembersAdmin_settings_categories extends GlmDataCategories // Sort results by higherarchy (Parent/Child and Alpha) $categories = $this->sortParentChild($categories); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($categories, 'DataBlock', 'Categories Data'); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/admin/settings/cities.php b/models/admin/settings/cities.php index 710d0c3b..4751fbe7 100644 --- a/models/admin/settings/cities.php +++ b/models/admin/settings/cities.php @@ -139,10 +139,6 @@ class GlmMembersAdmin_settings_cities extends GlmDataCities // Get a current list of members $cities = $this->getList( '', 'name' ); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($cities, 'DataBlock', 'City Data'); - } - // If we have list entries - even if it's an empty list $success = true; $haveCities = false; @@ -167,10 +163,6 @@ class GlmMembersAdmin_settings_cities extends GlmDataCities ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($cities, 'DataBlock', 'Cities Data'); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/admin/settings/counties.php b/models/admin/settings/counties.php index a13267e6..65430de8 100644 --- a/models/admin/settings/counties.php +++ b/models/admin/settings/counties.php @@ -139,10 +139,6 @@ class GlmMembersAdmin_settings_counties extends GlmDataCounties // Get a current list of members $counties = $this->getList('', 'name'); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($counties, 'DataBlock', 'County Data'); - } - // If we have list entries - even if it's an empty list $success = true; $haveCounties = false; @@ -167,10 +163,6 @@ class GlmMembersAdmin_settings_counties extends GlmDataCounties ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($counties, 'DataBlock', 'Counties Data'); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/admin/settings/index.php b/models/admin/settings/index.php index 8f303a6f..59a93e1f 100644 --- a/models/admin/settings/index.php +++ b/models/admin/settings/index.php @@ -152,10 +152,6 @@ class GlmMembersAdmin_settings_index extends GlmDataMemberTypes // Get a current list of member types $memberTypes = $this->getList(); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($memberTypes, 'DataBlock', 'Member Type Data'); - } - // If we have list entries - even if it's an empty list $success = true; $haveMemberTypes = false; @@ -180,10 +176,6 @@ class GlmMembersAdmin_settings_index extends GlmDataMemberTypes ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($memberTypes, 'DataBlock', 'Member Types Data'); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/admin/settings/regions.php b/models/admin/settings/regions.php index 180f319a..89ecc28a 100644 --- a/models/admin/settings/regions.php +++ b/models/admin/settings/regions.php @@ -139,10 +139,6 @@ class GlmMembersAdmin_settings_regions extends GlmDataRegions // Get a current list of members $regions = $this->getList('', 'name'); - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($regions, 'DataBlock', 'Region Data'); - } - // If we have list entries - even if it's an empty list $success = true; $haveRegions = false; @@ -167,10 +163,6 @@ class GlmMembersAdmin_settings_regions extends GlmDataRegions ); } - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { - glmMembersAdmin::addNotice($regions, 'DataBlock', 'Regions Data'); - } - // Compile template data $templateData = array( 'enable_members' => $enable_members, diff --git a/models/front/members/detail.php b/models/front/members/detail.php index ebd92970..ea3d1e1e 100644 --- a/models/front/members/detail.php +++ b/models/front/members/detail.php @@ -272,10 +272,6 @@ class GlmMembersFront_members_detail extends GlmDataMemberInfo } // Find the active member info record and get it with main member data - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) { - glmMembersFront::addNotice($memberData, 'DataBlock', 'Member Info with Member Data'); - } - // If we did get member Info if ($memberData) { diff --git a/models/front/members/list.php b/models/front/members/list.php index 2d55a7d8..51b6e156 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -731,10 +731,6 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo } - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) { - glmMembersFront::addNotice($list, 'DataBlock', 'Member Data'); - } - } if ($paging) {