From: Chuck Scott Date: Thu, 13 Oct 2016 15:42:07 +0000 (-0400) Subject: Added code to support updates - Temporatily commented out code added to index.php... X-Git-Tag: v1.2.0^2~3 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=72d4822451751c2d5825e8d72ba29cc0872b44fb;p=WP-Plugins%2Fglm-member-db-packaging.git Added code to support updates - Temporatily commented out code added to index.php for now. --- diff --git a/defines.php b/defines.php index f1d4f7b..4beabbf 100644 --- a/defines.php +++ b/defines.php @@ -37,6 +37,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_PACKAGING_PLUGIN_SLUG); +define('GLM_MEMBERS_PACKAGING_PLUGIN_PREFIX', $vprefix.'_'); + // URLs define('GLM_MEMBERS_PACKAGING_SITE_BASE_URL', home_url('/') ); define('GLM_MEMBERS_PACKAGING_PLUGIN_URL', plugin_dir_url(__FILE__)); @@ -46,7 +53,7 @@ define('GLM_MEMBERS_PACKAGING_PLUGIN_CURRENT_URL', $urlParts['scheme'].'://'.$ur // WP Options define('GLM_MEMBERS_PLUGIN_OPTION_PACKAGING_LIST_ID', 'packaging_list_id'); - + // Directories define('GLM_MEMBERS_PACKAGING_PLUGIN_PATH', dirname(__FILE__)); define('GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH', GLM_MEMBERS_PACKAGING_PLUGIN_PATH.'/setup'); diff --git a/index.php b/index.php index 5223959..8b33841 100644 --- a/index.php +++ b/index.php @@ -174,7 +174,23 @@ function glmMembersRegisterPackaging($addOns) { } add_filter('glm-member-db-register-addon','glmMembersRegisterPackaging', 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_PACKAGING_PLUGIN_PREFIX."updateChecker"} = new OpenToolsPluginUpdateChecker( + 'http://www.gaslightmedia.com/update_server/?action=get_metadata&slug='.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG, + __FILE__, + GLM_MEMBERS_PACKAGING_PLUGIN_SLUG +); + +${GLM_MEMBERS_PACKAGING_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array( + 'license_key' => __('License Key:') +)); +*/ + +/* * * Activate and Deactivate hooks *