From 8468193585067294f2a629fc7d34ae21f3e648ae Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Wed, 17 Feb 2016 11:11:22 -0500 Subject: [PATCH] Replace SAMPLE with SOCIAL --- activate.php | 16 +-- classes/data/dataSample.php | 16 +-- config/plugin.ini | 2 +- deactivate.php | 14 +-- defines.php | 46 +++---- index.php | 114 +++++++++--------- misc/documentation/CreateNewAddOn.txt | 10 +- models/admin/info/index.php | 2 +- models/admin/members/sample.php | 6 +- models/admin/sample/index.php | 6 +- models/admin/sample/more.php | 6 +- readme.txt | 8 +- setup/adminHooks.php | 4 +- setup/adminMenus.php | 46 +++---- setup/adminTabs.php | 10 +- .../SAMPLE.create_database_V0.0.1.sql | 18 +-- setup/databaseScripts/SAMPLE.dbVersions.php | 8 +- .../SAMPLE.update_database_V0.0.2.php | 28 ++--- setup/frontHooks.php | 6 +- setup/hooksHelp.html | 32 ++--- setup/permissions.php | 6 +- setup/rolesAndCapabilities.php | 6 +- setup/shortcodes.php | 14 +-- setup/validActions.php | 24 ++-- uninstall.php | 8 +- views/admin/members/sample.html | 2 +- views/admin/sample/index.html | 2 +- views/admin/sample/more.html | 2 +- 28 files changed, 231 insertions(+), 231 deletions(-) diff --git a/activate.php b/activate.php index ddff3ba..f660963 100644 --- a/activate.php +++ b/activate.php @@ -1,13 +1,13 @@ * @license http://www.gaslightmedia.com Gaslightmedia * @release activate.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ @@ -15,13 +15,13 @@ */ /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * * This file activates this add-on. Other than replacing the various - * versions of the work "Sample", this code should not need editing. + * versions of the work "Social", this code should not need editing. * * Remove this message before using this file in production! **********************************************************************/ @@ -38,7 +38,7 @@ if (!defined('ABSPATH')) { * Currently the only actions are to add role capability to display and modify * prototypes. */ -class glmMembersSamplePluginActivate +class glmMembersSocialPluginActivate { /** @@ -80,10 +80,10 @@ class glmMembersSamplePluginActivate $this->config = $config; // Set current plugin version - update_option('glmMembersDatabaseSamplePluginVersion', GLM_MEMBERS_SAMPLE_PLUGIN_VERSION); + update_option('glmMembersDatabaseSocialPluginVersion', GLM_MEMBERS_SOCIAL_PLUGIN_VERSION); // Set Roles and Capabilities for this plugin - require_once(GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php'); + require_once(GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH.'/rolesAndCapabilities.php'); } /* diff --git a/classes/data/dataSample.php b/classes/data/dataSample.php index 052a759..2a423fd 100644 --- a/classes/data/dataSample.php +++ b/classes/data/dataSample.php @@ -1,7 +1,7 @@ * @license http://www.gaslightmedia.com Gaslightmedia - * @release SVN: $Id: dataSample.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ + * @release SVN: $Id: dataSocial.php,v 1.0 2011/01/25 19:31:47 cscott Exp $ */ /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * - * Data fields in this file are sample only. + * Data fields in this file are social only. * * Remove this message before using this file in production! **********************************************************************/ @@ -27,7 +27,7 @@ require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'); /** - * GlmDataSample class + * GlmDataSocial class * * PHP version 5 * @@ -38,7 +38,7 @@ require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'); * @release SVN: $Id: dataMembers.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmDataSample extends GlmDataAbstract +class GlmDataSocial extends GlmDataAbstract { /** @@ -121,7 +121,7 @@ class GlmDataSample extends GlmDataAbstract /* * Table Name */ - $this->table = GLM_MEMBERS_SAMPLE_PLUGIN_DB_PREFIX . 'sampletable'; + $this->table = GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX . 'socialtable'; /* * Table Data Fields diff --git a/config/plugin.ini b/config/plugin.ini index 45899fc..2e6cbf4 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -1,6 +1,6 @@ ; ; Main Configuration File -; Gaslight Media Members Database Sample Add-On Plugin +; Gaslight Media Members Database Social Add-On Plugin ; ; Place any static configuration parameters here. ; diff --git a/deactivate.php b/deactivate.php index b7fb800..190a52e 100644 --- a/deactivate.php +++ b/deactivate.php @@ -1,12 +1,12 @@ * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ @@ -14,13 +14,13 @@ */ /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * * This file deactivates this add-on. Other than replacing the various - * versions of the work "Sample", this code should not need editing. + * versions of the work "Social", this code should not need editing. * * Remove this message before using this file in production! **********************************************************************/ @@ -34,7 +34,7 @@ if (!defined('ABSPATH')) { * This class performs all necessary additional work when this * plugin is deactivated. */ -class glmMembersSamplePluginDeactivate +class glmMembersSocialPluginDeactivate { /** @@ -67,7 +67,7 @@ class glmMembersSamplePluginDeactivate $this->config = $config; // Delete our version from WordPress Options - delete_option('glmMembersDatabaseSamplePluginVersion'); + delete_option('glmMembersDatabaseSocialPluginVersion'); } } diff --git a/defines.php b/defines.php index 17fc4f4..89b8a7f 100644 --- a/defines.php +++ b/defines.php @@ -1,14 +1,14 @@ prefix.'glm_membersSample_'); -define('GLM_MEMBERS_SAMPLE_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersSampleDbVersion'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_membersSocial_'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersSocialDbVersion'); // Determine which system we're running on - If not provided, assume PRODUCTION $host = getenv('GLM_HOST_ID'); if (trim($host) == '') { $host = 'PRODUCTION'; } -define('GLM_MEMBER_SAMPLE_PLUGIN_HOST', $host); +define('GLM_MEMBER_SOCIAL_PLUGIN_HOST', $host); // Determine current http/https protocol $pageProtocol = 'http'; if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') { $pageProtocol = 'https'; } -define('GLM_MEMBERS_SAMPLE_PLUGIN_HTTP_PROTOCOL', $pageProtocol); +define('GLM_MEMBERS_SOCIAL_PLUGIN_HTTP_PROTOCOL', $pageProtocol); // Get various pieces of the URL $urlParts = parse_url(get_bloginfo('url')); @@ -47,21 +47,21 @@ $pageUri = explode('?', $_SERVER['REQUEST_URI']); // Bust this up $WPUploadDir = wp_upload_dir(); // URLs -define('GLM_MEMBERS_SAMPLE_SITE_BASE_URL', home_url('/') ); -define('GLM_MEMBERS_SAMPLE_PLUGIN_URL', plugin_dir_url(__FILE__)); -define('GLM_MEMBERS_SAMPLE_PLUGIN_ADMIN_URL', admin_url('admin.php')); -define('GLM_MEMBERS_SAMPLE_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_SAMPLE_PLUGIN_SLUG); -define('GLM_MEMBERS_SAMPLE_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]); +define('GLM_MEMBERS_SOCIAL_SITE_BASE_URL', home_url('/') ); +define('GLM_MEMBERS_SOCIAL_PLUGIN_URL', plugin_dir_url(__FILE__)); +define('GLM_MEMBERS_SOCIAL_PLUGIN_ADMIN_URL', admin_url('admin.php')); +define('GLM_MEMBERS_SOCIAL_PLUGIN_BASE_URL', WP_PLUGIN_URL.'/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG); +define('GLM_MEMBERS_SOCIAL_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$urlParts['host'].$pageUri[0]); // Directories -define('GLM_MEMBERS_SAMPLE_PLUGIN_PATH', dirname(__FILE__)); -define('GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH', GLM_MEMBERS_SAMPLE_PLUGIN_PATH.'/setup'); -define('GLM_MEMBERS_SAMPLE_PLUGIN_DB_SCRIPTS', GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH.'/databaseScripts'); -define('GLM_MEMBERS_SAMPLE_PLUGIN_CLASS_PATH', GLM_MEMBERS_SAMPLE_PLUGIN_PATH.'/classes'); -define('GLM_MEMBERS_SAMPLE_PLUGIN_CONFIG_PATH', GLM_MEMBERS_SAMPLE_PLUGIN_PATH.'/config'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_PATH', dirname(__FILE__)); +define('GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH', GLM_MEMBERS_SOCIAL_PLUGIN_PATH.'/setup'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_SCRIPTS', GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH.'/databaseScripts'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_CLASS_PATH', GLM_MEMBERS_SOCIAL_PLUGIN_PATH.'/classes'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_CONFIG_PATH', GLM_MEMBERS_SOCIAL_PLUGIN_PATH.'/config'); // Parameters related to the Main GLM Member DB plugin - Depending on what's going on these may already defined by the main plugin -$pluginsPath = str_replace(GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, '', GLM_MEMBERS_SAMPLE_PLUGIN_PATH); -define('GLM_MEMBERS_SAMPLE_MAIN_PLUGIN_PATH', $pluginsPath.'/glm-member-db'); -define('GLM_MEMBERS_SAMPLE_PLUGIN_LIB_PATH', GLM_MEMBERS_SAMPLE_MAIN_PLUGIN_PATH.'/lib'); +$pluginsPath = str_replace(GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, '', GLM_MEMBERS_SOCIAL_PLUGIN_PATH); +define('GLM_MEMBERS_SOCIAL_MAIN_PLUGIN_PATH', $pluginsPath.'/glm-member-db'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_LIB_PATH', GLM_MEMBERS_SOCIAL_MAIN_PLUGIN_PATH.'/lib'); diff --git a/index.php b/index.php index fa60ac7..869e66b 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ * @license http://www.gaslightmedia.com Gaslightmedia * @version 1.1.1 @@ -53,15 +53,15 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_SAMPLE_PLUGIN_VERSION', '0.0.6'); -// define('GLM_MEMBERS_SAMPLE_PLUGIN_DB_VERSION', '0.0.1'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_VERSION', '0.0.6'); +// define('GLM_MEMBERS_SOCIAL_PLUGIN_DB_VERSION', '0.0.1'); // This is the minimum version of the GLM Members DB plugin require for this plugin. -define('GLM_MEMBERS_SAMPLE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.57'); +define('GLM_MEMBERS_SOCIAL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.57'); // Check if plugin version is not current in WordPress option and if needed updated it -if (GLM_MEMBERS_SAMPLE_PLUGIN_VERSION != get_option('glmMembersDatabaseSamplePluginVersion')) { - update_option('glmMembersDatabaseSamplePluginVersion', GLM_MEMBERS_SAMPLE_PLUGIN_VERSION); +if (GLM_MEMBERS_SOCIAL_PLUGIN_VERSION != get_option('glmMembersDatabaseSocialPluginVersion')) { + update_option('glmMembersDatabaseSocialPluginVersion', GLM_MEMBERS_SOCIAL_PLUGIN_VERSION); } /* @@ -104,11 +104,11 @@ require_once(ABSPATH . 'wp-includes/pluggable.php'); */ // Function to generate message regarding main GLM Member DB plugin not installed and active -function glmMembersSamplePluginRequired() { +function glmMembersSocialPluginRequired() { echo '
-

The '.GLM_MEMBERS_SAMPLE_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!

-

The '.GLM_MEMBERS_SAMPLE_PLUGIN_NAME.' plugin has been de-activated.

+

The '.GLM_MEMBERS_SOCIAL_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!

+

The '.GLM_MEMBERS_SOCIAL_PLUGIN_NAME.' plugin has been de-activated.

'; } @@ -122,18 +122,18 @@ $is_active = is_plugin_active($plugin_name); // If it's not active, then warn user and deactivate this add-on plugin if ($is_active != '1') { - add_action( 'admin_notices', 'glmMembersSamplePluginRequired' ); - deactivate_plugins('/'.GLM_MEMBERS_SAMPLE_PLUGIN_SLUG.'/'.GLM_MEMBERS_SAMPLE_PLUGIN_SLUG.'.php'); + add_action( 'admin_notices', 'glmMembersSocialPluginRequired' ); + deactivate_plugins('/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'.php'); } // Function to generate message regarding main GLM Member DB plugin version is not receint enought to run this add-on -function glmMembersPluginSampleMinVerRequired() { +function glmMembersPluginSocialMinVerRequired() { echo '
-

The '.GLM_MEMBERS_SAMPLE_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than ' - .GLM_MEMBERS_SAMPLE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!
- '.GLM_MEMBERS_SAMPLE_MIN_VERSION_NOTE.'

-

The '.GLM_MEMBERS_SAMPLE_PLUGIN_NAME.' plugin has been de-activated.

+

The '.GLM_MEMBERS_SOCIAL_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than ' + .GLM_MEMBERS_SOCIAL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!
+ '.GLM_MEMBERS_SOCIAL_MIN_VERSION_NOTE.'

+

The '.GLM_MEMBERS_SOCIAL_PLUGIN_NAME.' plugin has been de-activated.

'; } @@ -142,61 +142,61 @@ function glmMembersPluginSampleMinVerRequired() { * Check for Minimum DB version for main Member DB */ $glmMembersDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion'); -if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_SAMPLE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) { - define('GLM_MEMBERS_SAMPLE_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Sample Requires: ".GLM_MEMBERS_SAMPLE_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION); - add_action( 'admin_notices', 'glmMembersPluginSampleMinVerRequired'); - deactivate_plugins('/'.GLM_MEMBERS_SAMPLE_PLUGIN_SLUG.'/'.GLM_MEMBERS_SAMPLE_PLUGIN_SLUG.'.php'); +if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_SOCIAL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) { + define('GLM_MEMBERS_SOCIAL_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Social Requires: ".GLM_MEMBERS_SOCIAL_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION); + add_action( 'admin_notices', 'glmMembersPluginSocialMinVerRequired'); + deactivate_plugins('/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'/'.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG.'.php'); } /* * Register this add-on with the main GLM Member DB plugin and get information on all add-ons loaded. */ -require_once(GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH.'/validActions.php'); -require_once(GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH.'/shortcodes.php'); +require_once(GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH.'/validActions.php'); +require_once(GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH.'/shortcodes.php'); $havePluginDatabase = false; -if (is_file(GLM_MEMBERS_SAMPLE_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { - require_once(GLM_MEMBERS_SAMPLE_PLUGIN_DB_SCRIPTS.'/dbVersions.php'); +if (is_file(GLM_MEMBERS_SOCIAL_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { + require_once(GLM_MEMBERS_SOCIAL_PLUGIN_DB_SCRIPTS.'/dbVersions.php'); $havePluginDatabase = true; } -// Load Sample Management Settings data +// Load Social Management Settings data /* None - Need to figure out a smooth way to do this. -$sampleManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_SAMPLE_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); -unset($sampleManagementSettings['id']); +$socialManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); +unset($socialManagementSettings['id']); */ -function glmMembersRegisterSample($addOns) { +function glmMembersRegisterSocial($addOns) { // Add this add-on to the add-ons array - $addOns[GLM_MEMBERS_SAMPLE_PLUGIN_SLUG] = array( - 'dir' => GLM_MEMBERS_SAMPLE_PLUGIN_PATH, - 'name' => GLM_MEMBERS_SAMPLE_PLUGIN_NAME, - 'short_name' => GLM_MEMBERS_SAMPLE_PLUGIN_SHORT_NAME, - 'slug' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, - 'actions' => $GLOBALS['glmMembersSampleAddOnValidActions'], + $addOns[GLM_MEMBERS_SOCIAL_PLUGIN_SLUG] = array( + 'dir' => GLM_MEMBERS_SOCIAL_PLUGIN_PATH, + 'name' => GLM_MEMBERS_SOCIAL_PLUGIN_NAME, + 'short_name' => GLM_MEMBERS_SOCIAL_PLUGIN_SHORT_NAME, + 'slug' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, + 'actions' => $GLOBALS['glmMembersSocialAddOnValidActions'], 'config' => array( ), - 'shortcodes' => $GLOBALS['glmMembersSampleShortcodes'], - 'shortcodesDescription' => $GLOBALS['glmMembersSampleShortcodesDescription'] + 'shortcodes' => $GLOBALS['glmMembersSocialShortcodes'], + 'shortcodesDescription' => $GLOBALS['glmMembersSocialShortcodesDescription'] ); // If we have database tables for this plugin/addon, provide that data also if ($GLOBALS['havePluginDatabase']) { - $addOns[GLM_MEMBERS_SAMPLE_PLUGIN_SLUG]['database'] = array( - 'dbPrefix' => GLM_MEMBERS_SAMPLE_PLUGIN_DB_PREFIX, - 'dbCurrentVersion' => GLM_MEMBERS_SAMPLE_PLUGIN_DB_VERSION, - 'dbActiveVersionOption' => GLM_MEMBERS_SAMPLE_PLUGIN_ACTIVE_DB_OPTION, - 'dbScriptPath' => GLM_MEMBERS_SAMPLE_PLUGIN_DB_SCRIPTS, - 'dbVersions' => $GLOBALS['glmMembersSampleDbVersions'] + $addOns[GLM_MEMBERS_SOCIAL_PLUGIN_SLUG]['database'] = array( + 'dbPrefix' => GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX, + 'dbCurrentVersion' => GLM_MEMBERS_SOCIAL_PLUGIN_DB_VERSION, + 'dbActiveVersionOption' => GLM_MEMBERS_SOCIAL_PLUGIN_ACTIVE_DB_OPTION, + 'dbScriptPath' => GLM_MEMBERS_SOCIAL_PLUGIN_DB_SCRIPTS, + 'dbVersions' => $GLOBALS['glmMembersSocialDbVersions'] ); } else { - $addOns[GLM_MEMBERS_SAMPLE_PLUGIN_SLUG]['database'] = false; + $addOns[GLM_MEMBERS_SOCIAL_PLUGIN_SLUG]['database'] = false; } // Return the array with our data added return $addOns; } -add_filter('glm-member-db-register-addon','glmMembersRegisterSample', 10, 1); +add_filter('glm-member-db-register-addon','glmMembersRegisterSocial', 10, 1); /* * @@ -205,26 +205,26 @@ add_filter('glm-member-db-register-addon','glmMembersRegisterSample', 10, 1); */ // Activate - function glmMembersSamplePluginActivate () + function glmMembersSocialPluginActivate () { global $wpdb, $config; - require_once (GLM_MEMBERS_SAMPLE_PLUGIN_PATH . '/activate.php'); - new glmMembersSamplePluginActivate($wpdb, $config); + require_once (GLM_MEMBERS_SOCIAL_PLUGIN_PATH . '/activate.php'); + new glmMembersSocialPluginActivate($wpdb, $config); } - register_activation_hook(__FILE__, 'glmMembersSamplePluginActivate'); + register_activation_hook(__FILE__, 'glmMembersSocialPluginActivate'); // Deactivate - function glmMembersSamplePluginDeactivate () + function glmMembersSocialPluginDeactivate () { global $wpdb, $config; - require_once (GLM_MEMBERS_SAMPLE_PLUGIN_PATH . '/deactivate.php'); - $x = new glmMembersSamplePluginDeactivate($wpdb, $config); + require_once (GLM_MEMBERS_SOCIAL_PLUGIN_PATH . '/deactivate.php'); + $x = new glmMembersSocialPluginDeactivate($wpdb, $config); return false; } - register_deactivation_hook(__FILE__, 'glmMembersSamplePluginDeactivate'); + register_deactivation_hook(__FILE__, 'glmMembersSocialPluginDeactivate'); /* * Hooks for testing capabilities provided by this add-on */ -require_once(GLM_MEMBERS_SAMPLE_PLUGIN_SETUP_PATH.'/permissions.php'); +require_once(GLM_MEMBERS_SOCIAL_PLUGIN_SETUP_PATH.'/permissions.php'); diff --git a/misc/documentation/CreateNewAddOn.txt b/misc/documentation/CreateNewAddOn.txt index ece4624..006a713 100644 --- a/misc/documentation/CreateNewAddOn.txt +++ b/misc/documentation/CreateNewAddOn.txt @@ -1,14 +1,14 @@ Procedure to create a new GLM Members add-on plugin ---------------------------------------------------- -* Checkout glm-member-db-sample and rename directory to glm-member-db-{add-on name} +* Checkout glm-member-db-social and rename directory to glm-member-db-{add-on name} -* Rename glm-member-db-sample.php to glm-member-db-{addon name}.php +* Rename glm-member-db-social.php to glm-member-db-{addon name}.php -* Review all files and change references to "sample" (any case) to the new add-on name. - - Read the information in the "NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED" and +* Review all files and change references to "social" (any case) to the new add-on name. + - Read the information in the "NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED" and do anything recommended there. - - Remove all of the "NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED" blocks. + - Remove all of the "NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED" blocks. * Create new repository named WP-Plugins/glm-member-db-{name of add-on}.git diff --git a/models/admin/info/index.php b/models/admin/info/index.php index 4c61edb..f54525c 100644 --- a/models/admin/info/index.php +++ b/models/admin/info/index.php @@ -104,7 +104,7 @@ class GlmMembersAdmin_info_index // extends GlmDataContacts public function modelAction($actionData = false) { - $displayData = 'This is the Sample Add-On "Info" model talking to you from inside WordPress.'; + $displayData = 'This is the Social Add-On "Info" model talking to you from inside WordPress.'; // Compile template data $templateData = array( diff --git a/models/admin/members/sample.php b/models/admin/members/sample.php index ed2fac9..161e970 100644 --- a/models/admin/members/sample.php +++ b/models/admin/members/sample.php @@ -16,7 +16,7 @@ // Load Contacts data abstract //require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); -class GlmMembersAdmin_members_sample // extends GlmDataContacts +class GlmMembersAdmin_members_social // extends GlmDataContacts { /** @@ -104,7 +104,7 @@ class GlmMembersAdmin_members_sample // extends GlmDataContacts public function modelAction($actionData = false) { - $displayData = 'This is the Sample "Members" "Sample" model talking to you from inside WordPress.'; + $displayData = 'This is the Social "Members" "Social" model talking to you from inside WordPress.'; // Compile template data $templateData = array( @@ -115,7 +115,7 @@ class GlmMembersAdmin_members_sample // extends GlmDataContacts return array( 'status' => true, 'modelRedirect' => false, - 'view' => 'admin/members/sample.html', + 'view' => 'admin/members/social.html', 'data' => $templateData ); diff --git a/models/admin/sample/index.php b/models/admin/sample/index.php index 5c321df..c987445 100644 --- a/models/admin/sample/index.php +++ b/models/admin/sample/index.php @@ -16,7 +16,7 @@ // Load Contacts data abstract //require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); -class GlmMembersAdmin_sample_index // extends GlmDataContacts +class GlmMembersAdmin_social_index // extends GlmDataContacts { /** @@ -104,7 +104,7 @@ class GlmMembersAdmin_sample_index // extends GlmDataContacts public function modelAction($actionData = false) { - $displayData = 'Hello, World! This is the Sample Add-On "sample" model talking to you from inside WordPress.'; + $displayData = 'Hello, World! This is the Social Add-On "social" model talking to you from inside WordPress.'; // Compile template data $templateData = array( @@ -115,7 +115,7 @@ class GlmMembersAdmin_sample_index // extends GlmDataContacts return array( 'status' => true, 'modelRedirect' => false, - 'view' => 'admin/sample/index.html', + 'view' => 'admin/social/index.html', 'data' => $templateData ); diff --git a/models/admin/sample/more.php b/models/admin/sample/more.php index b814759..8a3cd59 100644 --- a/models/admin/sample/more.php +++ b/models/admin/sample/more.php @@ -16,7 +16,7 @@ // Load Contacts data abstract //require_once(GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH.'/data/dataContacts.php'); -class GlmMembersAdmin_sample_more // extends GlmDataContacts +class GlmMembersAdmin_social_more // extends GlmDataContacts { /** @@ -104,7 +104,7 @@ class GlmMembersAdmin_sample_more // extends GlmDataContacts public function modelAction($actionData = false) { - $displayData = 'Welcome to more information!
This is the Sample Add-On "sample" model with action "more" talking to you from inside WordPress.'; + $displayData = 'Welcome to more information!
This is the Social Add-On "social" model with action "more" talking to you from inside WordPress.'; // Compile template data $templateData = array( @@ -115,7 +115,7 @@ class GlmMembersAdmin_sample_more // extends GlmDataContacts return array( 'status' => true, 'modelRedirect' => false, - 'view' => 'admin/sample/more.html', + 'view' => 'admin/social/more.html', 'data' => $templateData ); diff --git a/readme.txt b/readme.txt index 2bbad40..202d5f4 100644 --- a/readme.txt +++ b/readme.txt @@ -1,18 +1,18 @@ -=== Gaslight Media Member Database Sample Child Plugin === +=== Gaslight Media Member Database Social Child Plugin === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com -Tags: Gaslight Media,Plugin,Members Sample +Tags: Gaslight Media,Plugin,Members Social 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 -This is the Gaslight Media Members Database Sample Child Plugin. +This is the Gaslight Media Members Database Social Child Plugin. == Description == -The Gaslight Media Members Database Sample Child Plugin is an add-on to the Gaslight Media Members Database, +The Gaslight Media Members Database Social Child Plugin is an add-on to the Gaslight Media Members Database, which is required to install and run this plugin == Installation == diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 8c36dfc..776ec3e 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -14,9 +14,9 @@ */ /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * * This file is used to create hooks into the main plugin or other diff --git a/setup/adminMenus.php b/setup/adminMenus.php index 6a1932a..c24f313 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -1,7 +1,7 @@ controller('sample');}, // Called function + * 'glm-members-admin-menu-glm-social', // Menu Slug + * function() {$this->controller('social');}, // Called function * false, // Icon URL * '92' // Menu Position * ); * * // Add a sub-menu item * add_submenu_page( - * 'glm-members-admin-menu-sample', // Parent slug - * 'Sample', // Page title - * 'Sample', // Menu Title + * 'glm-members-admin-menu-social', // Parent slug + * 'Social', // Page title + * 'Social', // Menu Title * 'glm_members_edit', // Capability required - * 'glm-members-admin-menu-sample', // Menu slug - * function() {$this->controller('sample');} + * 'glm-members-admin-menu-social', // Menu slug + * function() {$this->controller('social');} * ); * * If creating a main menu item with add_menu_page(), please document @@ -72,29 +72,29 @@ // Add a main menu item add_menu_page( - 'GLM Sample', // Page Title - 'GLM Sample', // Menu Title + 'GLM Social', // Page Title + 'GLM Social', // Menu Title 'glm-members-members', // Capability - 'glm-members-admin-menu-sample', // Menu Slug - function() {$this->controller('sample');}, // Called function + 'glm-members-admin-menu-social', // Menu Slug + function() {$this->controller('social');}, // Called function false, // Icon URL '92' // Menu Position ); add_submenu_page( - 'glm-members-admin-menu-sample', // Parent slug - 'Sample', // Page title - 'Sample', // Menu Title + 'glm-members-admin-menu-social', // Parent slug + 'Social', // Page title + 'Social', // Menu Title 'glm_members_members', // Capability required - 'glm-members-admin-menu-sample-sample', // Menu slug - function() {$this->controller('sample');} + 'glm-members-admin-menu-social-social', // Menu slug + function() {$this->controller('social');} ); add_submenu_page( - 'glm-members-admin-menu-sample', // Parent slug + 'glm-members-admin-menu-social', // Parent slug 'Info', // Page title 'Info', // Menu Title 'glm_members_members', // Capability required - 'glm-members-admin-menu-sample-info', // Menu slug + 'glm-members-admin-menu-social-info', // Menu slug function() {$this->controller('info');} ); diff --git a/setup/adminTabs.php b/setup/adminTabs.php index 9f22164..a26787b 100644 --- a/setup/adminTabs.php +++ b/setup/adminTabs.php @@ -1,7 +1,7 @@ 'Sample', + 'text' => 'Social', 'menu' => 'members', - 'action' => 'sample' + 'action' => 'social' ) ); $addOnTabs = array_merge($addOnTabs, $newTabs); diff --git a/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql b/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql index ae98344..abe65c1 100644 --- a/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql +++ b/setup/databaseScripts/SAMPLE.create_database_V0.0.1.sql @@ -1,4 +1,4 @@ --- Gaslight Media Members Database - Sample +-- Gaslight Media Members Database - Social -- File Created: 12/02/15 15:27:15 -- Database Version: 0.0.1 -- Database Creation Script @@ -13,30 +13,30 @@ -- ********************************************************************** --- NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED +-- NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED -- --- Please change all references to sample, Sample, or SAMPLE to a name +-- Please change all references to social, Social, or SOCIAL to a name -- appropriate for your new Add-On. -- --- Tables and queries in this file are sample only. +-- Tables and queries in this file are social only. -- -- Remove this message before using this file in production! -- **********************************************************************/ --- Sample Management Settings +-- Social Management Settings CREATE TABLE {prefix}management ( id INT NOT NULL AUTO_INCREMENT, - canonical_sample_page TINYTEXT NULL, -- Canonical page slug for detail + canonical_social_page TINYTEXT NULL, -- Canonical page slug for detail PRIMARY KEY (id) ); ---- --- Set default sample management entry +-- Set default social management entry INSERT INTO {prefix}management - ( id, canonical_sample_page ) + ( id, canonical_social_page ) VALUES - ( 1, 'sample data' ) + ( 1, 'social data' ) ; diff --git a/setup/databaseScripts/SAMPLE.dbVersions.php b/setup/databaseScripts/SAMPLE.dbVersions.php index c2b6a9f..c022738 100644 --- a/setup/databaseScripts/SAMPLE.dbVersions.php +++ b/setup/databaseScripts/SAMPLE.dbVersions.php @@ -1,7 +1,7 @@ array('version' => '0.0.1', 'tables' => 2), '0.0.2' => array('version' => '0.0.2', 'tables' => 3) ); diff --git a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php b/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php index c4ac161..958c543 100644 --- a/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php +++ b/setup/databaseScripts/SAMPLE.update_database_V0.0.2.php @@ -1,49 +1,49 @@ wpdb->get_results('SELECT id, title FROM '.GLM_MEMBERS_SAMPLE_PLUGIN_DB_PREFIX.'samples;', ARRAY_A); +// Get all social records +$socialRecords = $this->wpdb->get_results('SELECT id, title FROM '.GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX.'socials;', ARRAY_A); -// If there's any sample records -if ($sampleRecords && count($sampleRecords) > 0) { +// If there's any social records +if ($socialRecords && count($socialRecords) > 0) { - // For each sample record - foreach ($sampleRecords as $p) { + // For each social record + foreach ($socialRecords as $p) { // Create a slug from the title $slug = sanitize_title($p['title']).'-'.$p['id']; // Store this value back into the record $this->wpdb->update( - GLM_MEMBERS_SAMPLE_PLUGIN_DB_PREFIX.'samples', + GLM_MEMBERS_SOCIAL_PLUGIN_DB_PREFIX.'socials', array( - 'sample_slug' => $slug + 'social_slug' => $slug ), array( 'id' => $p['id'] ), array( '%s' ), diff --git a/setup/frontHooks.php b/setup/frontHooks.php index f04d3c3..7af917d 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -1,7 +1,7 @@ + /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * * This file is used to document hooks provided by this add-on. Content @@ -15,56 +15,56 @@ **********************************************************************/ -

Sample Add-On

+

Social Add-On

User Permission Hooks - glm_members_permit_admin_members_sample_tab + glm_members_permit_admin_members_social_tab Filter - Returns boolean answer to "Is current user permitted to see multi-member Sample tab?" + Returns boolean answer to "Is current user permitted to see multi-member Social tab?" - glm_members_permit_admin_members_Sample_add_sample + glm_members_permit_admin_members_Social_add_social Filter - Returns boolean answer to "Is current user permitted to add a new multi-member sample?" + Returns boolean answer to "Is current user permitted to add a new multi-member social?" - glm_members_permit_admin_members_Sample_edit_sample + glm_members_permit_admin_members_Social_edit_social Filter - Returns boolean answer to "Is current user permitted to edit a multi-member sample?" + Returns boolean answer to "Is current user permitted to edit a multi-member social?" - glm_members_permit_admin_member_sample_tab + glm_members_permit_admin_member_social_tab Filter - Returns boolean answer to "Is current user permitted to see the member Sample tab?" + Returns boolean answer to "Is current user permitted to see the member Social tab?" - glm_members_permit_admin_member_Sample_add_sample + glm_members_permit_admin_member_Social_add_social Filter - Returns boolean answer to "Is current user permitted to add a new Member sample?" + Returns boolean answer to "Is current user permitted to add a new Member social?" - glm_members_permit_admin_member_Sample_edit_sample + glm_members_permit_admin_member_Social_edit_social Filter - Returns boolean answer to "Is current user permitted to edit a member sample?" + Returns boolean answer to "Is current user permitted to edit a member social?" diff --git a/setup/permissions.php b/setup/permissions.php index 8647b12..3d7dbd6 100644 --- a/setup/permissions.php +++ b/setup/permissions.php @@ -1,7 +1,7 @@ - * [glm-members-sample-shortcode] + * [glm-members-social-shortcode] *   * *

@@ -106,8 +106,8 @@ * */ -$glmMembersSampleShortcodes = array( +$glmMembersSocialShortcodes = array( ); -$glmMembersSampleShortcodesDescription = ''; +$glmMembersSocialShortcodesDescription = ''; diff --git a/setup/validActions.php b/setup/validActions.php index 658d1d6..7a7b757 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -1,7 +1,7 @@ array( 'members' => array( - 'sample' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, + 'social' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, ), - 'sample' => array( - 'index' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, - 'more' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, + 'social' => array( + 'index' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, + 'more' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, ), 'info' => array( - 'index' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG + 'index' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG ) ), 'frontActions' => array( /* - 'sample' => array( - 'list' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG, - 'detail' => GLM_MEMBERS_SAMPLE_PLUGIN_SLUG + 'social' => array( + 'list' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG, + 'detail' => GLM_MEMBERS_SOCIAL_PLUGIN_SLUG ) */ ) diff --git a/uninstall.php b/uninstall.php index 181a827..7bb1508 100644 --- a/uninstall.php +++ b/uninstall.php @@ -3,13 +3,13 @@ die('uninstall not configured - See plugin uninstall.php script!'); /** - * Gaslight Media Members Database Sample Child Plugin + * Gaslight Media Members Database Social Child Plugin * Uninstall Plugin * * PHP version 5.5 * * @category glmWordPressPlugin - * @package glmMembersDatabaseSample + * @package glmMembersDatabaseSocial * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ @@ -17,9 +17,9 @@ die('uninstall not configured - See plugin uninstall.php script!'); */ /********************************************************************** - * NOTE: THIS IS A SAMPLE FILE - DO NOT USE UNMODIFIED + * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED * - * Please change all references to sample, Sample, or SAMPLE to a name + * Please change all references to social, Social, or SOCIAL to a name * appropriate for your new Add-On. * * Remove this message before using this file in production! diff --git a/views/admin/members/sample.html b/views/admin/members/sample.html index 22f4d71..e3f9e8e 100644 --- a/views/admin/members/sample.html +++ b/views/admin/members/sample.html @@ -1,6 +1,6 @@ {include file='admin/members/header.html'} -

Members Sample Tab

+

Members Social Tab

{$displayData}

{include file='admin/footer.html'} \ No newline at end of file diff --git a/views/admin/sample/index.html b/views/admin/sample/index.html index 4588ef0..665f0f3 100644 --- a/views/admin/sample/index.html +++ b/views/admin/sample/index.html @@ -1,6 +1,6 @@
-

Sample Model

+

Social Model

{$displayData}

Click me to see more!
diff --git a/views/admin/sample/more.html b/views/admin/sample/more.html index 5e1c19a..bd2ae50 100644 --- a/views/admin/sample/more.html +++ b/views/admin/sample/more.html @@ -1,6 +1,6 @@
-

Sample Model - More Information

+

Social Model - More Information

{$displayData}

\ No newline at end of file -- 2.17.1