Changeset 1446896
- Timestamp:
- 06/30/2016 11:37:34 PM (8 years ago)
- Location:
- hubspot-tracking-code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
hubspot-tracking-code/trunk/admin/hubspot-tracking-code-admin.php
- Property svn:executable deleted
r1208526 r1446896 1 1 <?php 2 2 3 if ( !defined('HUBSPOT_TRACKING_CODE_PLUGIN_VERSION') ) 3 if ( !defined('HUBSPOT_TRACKING_CODE_PLUGIN_VERSION') ) 4 4 { 5 5 header('HTTP/1.0 403 Forbidden'); … … 23 23 // HubSpotTrackingCodeAdmin Class 24 24 //============================================= 25 class HubSpotTrackingCodeAdmin 25 class HubSpotTrackingCodeAdmin 26 26 { 27 27 /** … … 39 39 if ( $options['hs_version'] != HUBSPOT_TRACKING_CODE_PLUGIN_VERSION ) 40 40 self::hubspot_tracking_code_update_check(); 41 41 42 42 add_action('admin_menu', array(&$this, 'hubspot_add_menu_items')); 43 43 add_action('admin_init', array(&$this, 'hubspot_build_settings_page')); … … 52 52 hubspot_tracking_code_update_option('hs_settings', 'hs_version', HUBSPOT_TRACKING_CODE_PLUGIN_VERSION); 53 53 } 54 54 55 55 //============================================= 56 56 // Menus 57 57 //============================================= 58 58 59 function hubspot_add_menu_items () 59 function hubspot_add_menu_items () 60 60 { 61 61 add_submenu_page('options-general.php', 'HubSpot Settings', 'HubSpot Settings', 'edit_posts', basename(__FILE__), array($this, 'hubspot_plugin_options')); … … 68 68 69 69 /** 70 * Adds setting link for HubSpot to plugins management page 70 * Adds setting link for HubSpot to plugins management page 71 71 * 72 72 * @param array $links … … 85 85 */ 86 86 function hubspot_build_settings_page () 87 { 87 { 88 88 global $pagenow; 89 89 $options = get_option('hs_settings'); … … 94 94 array($this, 'sanitize') 95 95 ); 96 96 97 97 add_settings_section( 98 98 'hubspot_settings_section', … … 101 101 HUBSPOT_TRACKING_CODE_ADMIN_PATH 102 102 ); 103 103 104 104 add_settings_field( 105 105 'hs_portal', … … 146 146 <form method="POST" action="options.php"> 147 147 <div id="dashboard-widgets" class="metabox-holder"> 148 <div class="postbox-container" style="width:60%;"> 148 <div class="postbox-container" style="width:60%;"> 149 149 <div class="meta-box-sortables ui-sortable"> 150 150 <div class="postbox"> … … 152 152 <div class="inside"> 153 153 Enter your Hub ID below to track your WordPress site in HubSpot's analytics system. 154 <?php 154 <?php 155 155 settings_fields('hubspot_settings_options'); 156 156 do_settings_sections(HUBSPOT_TRACKING_CODE_ADMIN_PATH); 157 157 ?> 158 158 </div> 159 159 160 160 </div> 161 161 </div> … … 164 164 165 165 <div class="postbox-container" style="width:40%;"> 166 <div class="meta-box-sortables ui-sortable"> 166 <div class="meta-box-sortables ui-sortable"> 167 167 <div class="postbox"> 168 168 <h3 class="hndle"><span>Where is my HubSpot Hub ID?</span></h3> … … 213 213 $options = get_option('hs_settings'); 214 214 $hs_portal = ( isset($options['hs_portal']) && $options['hs_portal'] ? $options['hs_portal'] : '' ); 215 215 216 216 printf( 217 217 '<input id="hs_portal" type="text" id="title" name="hs_settings[hs_portal]" style="width: 400px;" value="%s"/>', -
hubspot-tracking-code/trunk/hubspot-tracking-code.php
r1208526 r1446896 10 10 */ 11 11 12 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 12 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 13 13 14 14 //============================================= … … 47 47 { 48 48 // Check activation on entire network or one blog 49 if ( is_multisite() && $network_wide ) 50 { 49 if ( is_multisite() && $network_wide ) 50 { 51 51 global $wpdb; 52 52 53 53 // Get this so we can switch back to it later 54 54 $current_blog = $wpdb->blogid; 55 55 56 56 // Get all blogs in the network and activate plugin on each one 57 57 $q = "SELECT blog_id FROM $wpdb->blogs"; 58 58 $blog_ids = $wpdb->get_col($q); 59 foreach ( $blog_ids as $blog_id ) 59 foreach ( $blog_ids as $blog_id ) 60 60 { 61 61 switch_to_blog($blog_id); 62 62 hubspot_tracking_code_setup_plugin(); 63 63 } 64 64 65 65 // Switch back to the current blog 66 66 switch_to_blog($current_blog); … … 93 93 $multisite_prefix = ( is_multisite() ? $wpdb->prefix : '' ); 94 94 $q = $wpdb->prepare(" 95 INSERT INTO " . $multisite_prefix . "options 96 ( option_name, option_value ) 95 INSERT INTO " . $multisite_prefix . "options 96 ( option_name, option_value ) 97 97 VALUES ('hs_settings', %s)", serialize($opt)); 98 98 $wpdb->query($q); … … 121 121 function hubspot_tracking_code_init () 122 122 { 123 if ( is_plugin_active('hubspot/hubspot.php') ) 123 if ( is_plugin_active('hubspot/hubspot.php') ) 124 124 { 125 125 remove_action( 'plugins_loaded', 'hubspot_tracking_code_init' ); … … 135 135 add_action( 'plugins_loaded', 'hubspot_tracking_code_init', 14 ); 136 136 137 if ( is_admin() ) 137 if ( is_admin() ) 138 138 { 139 139 // Activate + install Super Simple Landing Pages … … 144 144 } 145 145 146 function deactivate_hubspot_tracking_code_notice () 146 function deactivate_hubspot_tracking_code_notice () 147 147 { 148 148 ?> 149 149 <div id="message" class="error"> 150 <?php _e( 151 '<p><h3>HubSpot Tracking Code plugin wasn\'t activated because your HubSpot for WordPress plugin is still activated...</h3></p>' . 150 <?php _e( 151 '<p><h3>HubSpot Tracking Code plugin wasn\'t activated because your HubSpot for WordPress plugin is still activated...</h3></p>' . 152 152 '<p>HubSpot Tracking Code and HubSpot for WordPress are like two rival siblings - they don\'t play nice together, but don\'t panic - it\'s an easy fix. Deactivate <b><i>HubSpot for WordPress</i></b> and then try activating <b><i>HubSpot Tracking Code for WordPress</i></b> again, and everything should work fine.</p>' . 153 153 '<p>By the way - make sure you replace all your form and CTA shortcodes with <a href="http://help.hubspot.com/articles/KCS_Article/Integrations/How-to-switch-from-the-HubSpot-for-Wordpress-plugin-to-the-HubSpot-Tracking-code-for-Wordpress-plugin" target="_blank">HubSpot embed codes</a></p>', -
hubspot-tracking-code/trunk/readme.txt
- Property svn:executable deleted
Note: See TracChangeset
for help on using the changeset viewer.