Added code to support updates - Temporatily commented out code added to index.php...
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 13 Oct 2016 15:44:12 +0000 (11:44 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 13 Oct 2016 15:44:12 +0000 (11:44 -0400)
defines.php
index.php

index 9befeaf..fe5c84c 100644 (file)
@@ -46,6 +46,13 @@ $pageUri = explode('?', $_SERVER['REQUEST_URI']);               // Bust this up
 
 $WPUploadDir = wp_upload_dir();
 
+/*
+ *  Create a copy of the plugin slug that can be used as a variable prefix used to keep
+ *  global instances from clashing with instances in other plugins.
+ */
+$vprefix = str_replace('-', '_', GLM_MEMBERS_SOCIAL_PLUGIN_SLUG);
+define('GLM_MEMBERS_SOCIAL_PLUGIN_PREFIX', $vprefix.'_');
+
 // URLs
 define('GLM_MEMBERS_SOCIAL_SITE_BASE_URL', home_url('/') );
 define('GLM_MEMBERS_SOCIAL_PLUGIN_URL', plugin_dir_url(__FILE__));
index 475a439..e418cfb 100644 (file)
--- a/index.php
+++ b/index.php
@@ -196,7 +196,23 @@ function glmMembersRegisterSocial($addOns) {
 }
 add_filter('glm-member-db-register-addon','glmMembersRegisterSocial', 10, 1);
 
- /*
+/*
+ * Plugin Update Support - uses Gaslight Media update server
+ */
+/* Not functional yet - Need to resolve JavaScript conflicts with this feature in other plugins
+require GLM_MEMBERS_PLUGIN_LIB_PATH.'/opentools-update-checker/opentools-update-checker.php';
+${GLM_MEMBERS_SOCIAL_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker(
+     'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_MEMBERS_SOCIAL_PLUGIN_SLUG,
+    __FILE__,
+    GLM_MEMBERS_SOCIAL_PLUGIN_SLUG
+);
+
+${GLM_MEMBERS_SOCIAL_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
+  'license_key' => __('License Key:')
+));
+*/
+
+/*
   *
   * Activate and Deactivate hooks
   *