--- /dev/null
+<?php
+/**
+ * Gaslight Media Members Database Plugin
+ *
+ * Get plugin configuration
+ */
+
+// Get plugin configuration
+$configData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/plugin.ini', true);
+$config = $configData['common'];
+
+// Override parameters according to GLM_HOST_ID
+$hostSection = strtolower(GLM_MEMBER_PLUGIN_HOST).':common';
+if (isset($configData[$hostSection])) {
+ $config = array_replace($config, $configData[strtolower(GLM_MEMBER_PLUGIN_HOST).':common']);
+} else {
+ $startupNotices .=
+ '<p><b>Bad configuration file section name or section not found:</b> '. $hostSection
+ .'<br>See plugin '.GLM_MEMBERS_PLUGIN_PATH.'config/plugin.ini file.'
+ .'<br>Also check that the server "GLM_HOST_ID" environment parameter exists and matches a section in the above ini file.</p>'
+ ;
+}
+
+// Add Debug defines - These can't go into the defines.php file - Guess why.
+define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG', $config['admin_debug']);
+define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', $config['admin_debug_verbose']);
+define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG', $config['front_debug']);
+define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE', $config['front_debug_verbose']);
+
+// Also get image sizes array from the plugin.ini - uses separate ini section.
+$config['imageSizes'] = $configData['imageSizes'];
+
+// Get States and Countries arrays
+$stateData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/states.ini');
+$config['states'] = $stateData['states'];
+$countryData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/countries.ini');
+$config['countries'] = $countryData['countries'];
+
+// Read in Settings and Terms from database
+$settings = $wpdb->get_row("SELECT * FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX . "settings_general WHERE id = 1;", ARRAY_A);
+unset($settings['id']);
+$terms = $wpdb->get_row("SELECT * FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX . "settings_terms WHERE id = 1;", ARRAY_A);
+unset($terms['id']);
+$config = array_merge($config, $settings, $terms);
+
+echo "<pre>".print_r($config,1)."</pre>";
+exit;
+
+
+// Check for config value replacements in the current theme
+$currentThemeDirectory = get_template_directory();
+if (file_exists($currentThemeDirectory.'/glm-member-db/plugin.ini')) {
+
+ // Read in the ini file from the theme
+ $themeIni = parse_ini_file($currentThemeDirectory.'/glm-member-db/plugin.ini');
+
+ // Replace parameters that are in the theme ini file
+ $config = array_replace($config, $themeIni);
+
+}
+
+?>
* Plugin Name: GLM Members Database
* Plugin URI: http://www.gaslightmedia.com/
* Description: Gaslight Media Members Database.
- * Version: 1.0.10
+ * Version: 1.0.20
* Author: Chuck Scott
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersDatabase
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.10
+ * @version 1.0.20
*/
/*
// Get standard defined parameters
require_once('defines.php');
-// Get plugin configuration
-$configData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/plugin.ini', true);
-$config = $configData['common'];
-
-// Override parameters according to GLM_HOST_ID
-$hostSection = strtolower(GLM_MEMBER_PLUGIN_HOST).':common';
-if (isset($configData[$hostSection])) {
- $config = array_replace($config, $configData[strtolower(GLM_MEMBER_PLUGIN_HOST).':common']);
-} else {
- $startupNotices .=
- '<p><b>Bad configuration file section name or section not found:</b> '. $hostSection
- .'<br>See plugin '.GLM_MEMBERS_PLUGIN_PATH.'config/plugin.ini file.'
- .'<br>Also check that the server "GLM_HOST_ID" environment parameter exists and matches a section in the above ini file.</p>'
- ;
-}
-
-// Add Debug defines - These can't go into the defines.php file - Guess why.
-define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG', $config['admin_debug']);
-define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', $config['admin_debug_verbose']);
-define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG', $config['front_debug']);
-define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE', $config['front_debug_verbose']);
-
-// Also get image sizes array from the plugin.ini - uses separate ini section.
-$config['imageSizes'] = $configData['imageSizes'];
-
-// Get additional configuration data
-$stateData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/states.ini');
-$config['states'] = $stateData['states'];
-$countryData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/countries.ini');
-$config['countries'] = $countryData['countries'];
-
-// Check for config value replacements in the current theme
-$currentThemeDirectory = get_template_directory();
-if (file_exists($currentThemeDirectory.'/glm-member-db/plugin.ini')) {
-
- // Read in the ini file from the theme
- $themeIni = parse_ini_file($currentThemeDirectory.'/glm-member-db/plugin.ini');
-
- // Replace parameters that are in the theme ini file
- $config = array_replace($config, $themeIni);
-
-}
-
-// Add General Settings and Terms from the database to $config
-$setGeneral = $wpdb->get_row(
- 'SELECT * FROM '.GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_general WHERE id = 1;',
- ARRAY_A
-);
-unset($setGeneral['id']);
-$setTerms = $wpdb->get_row(
- 'SELECT * FROM '.GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_terms WHERE id = 1;',
- ARRAY_A
-);
-unset($setTerms['id']);
-$config = array_merge($config, $setGeneral, $setTerms);
+// Get configuration
+require_once('config.php');
// Try to set the DB version option to false (new plugin) - If it's already set this won't do anything.
add_option('glmMembersDatabaseDbVersion', false);
-// Custom plugin post type (for wp_post entries)
-// define('GLM_MEMBERS_PLUGIN_POST_TYPE', '');
-
/**
* *******************************************************************************
*
// Uninstall - Not using. Using "uninstall.php" in the root directory of this plugin.
+/*
+ *
+ * Load any other common files needed
+ *
+ */
+
+// Load data abstract
+require_once(GLM_MEMBERS_PLUGIN_LIB_PATH.'/GlmDataAbstract/DataAbstract.php');
+
/*
*
* Determine which controller to load