Пример #1
0
    if ($welcome_option == "true") {
        $welcome_active = false;
    }
}
if ($current_tab == "wizard") {
    include ESSB_PLUGIN_ROOT . '/lib/admin/pages/essb-settings-wizard2.php';
}
if ($current_tab == "wizard2") {
    include ESSB_PLUGIN_ROOT . '/lib/admin/pages/essb-settings-wizard.php';
}
// check for cache activated
$current_options = get_option(EasySocialShareButtons::$plugin_settings_name);
$general_cache_active = ESSBOptionsHelper::optionsBoolValue($current_options, 'essb_cache');
$general_cache_active_static = ESSBOptionsHelper::optionsBoolValue($current_options, 'essb_cache_static');
$general_cache_active_static_js = ESSBOptionsHelper::optionsBoolValue($current_options, 'essb_cache_static_js');
$general_cache_mode = ESSBOptionsHelper::optionsValue($current_options, 'essb_cache_mode');
$display_cache_mode = "";
if ($general_cache_active) {
    if ($general_cache_mode == "full") {
        $display_cache_mode = "Cache button render and dynamic resources";
    } else {
        $display_cache_mode = "Cache only dynamic resources";
    }
}
if ($general_cache_active_static || $general_cache_active_static_js) {
    if ($display_cache_mode != '') {
        $display_cache_mode .= ", ";
    }
    $display_cache_mode .= "Combine into sigle file all plugin static CSS files";
}
if ($essb_cache == 'clear') {
Пример #2
0
 function customizer_compile_css($skinedSocial = false)
 {
     global $post;
     $options = get_option(EasySocialShareButtons::$plugin_settings_name);
     $is_active = isset($options['customizer_is_active']) ? $options['customizer_is_active'] : 'false';
     if (isset($post)) {
         $post_activate_customizer = get_post_meta($post->ID, 'essb_activate_customizer', true);
         if ($post_activate_customizer != '') {
             if ($post_activate_customizer == "yes") {
                 $is_active = "true";
             } else {
                 $is_active = "false";
             }
         }
     }
     if ($is_active == "true") {
         $this->custom_css_builder_executed = true;
         $global_bgcolor = isset($options['customizer_bgcolor']) ? $options['customizer_bgcolor'] : '';
         $global_textcolor = isset($options['customizer_textcolor']) ? $options['customizer_textcolor'] : '';
         $global_hovercolor = isset($options['customizer_hovercolor']) ? $options['customizer_hovercolor'] : '';
         $global_hovertextcolor = isset($options['customizer_hovertextcolor']) ? $options['customizer_hovertextcolor'] : '';
         $global_remove_bg_effects = isset($options['customizer_remove_bg_hover_effects']) ? $options['customizer_remove_bg_hover_effects'] : '';
         $css = "";
         // @since 2.0
         $customizer_totalbgcolor = ESSBOptionsHelper::optionsValue($options, 'customizer_totalbgcolor');
         $customizer_totalcolor = ESSBOptionsHelper::optionsValue($options, 'customizer_totalcolor');
         $customizer_totalnobgcolor = ESSBOptionsHelper::optionsValue($options, 'customizer_totalnobgcolor');
         $customizer_totalfontsize = ESSBOptionsHelper::optionsValue($options, 'customizer_totalfontsize');
         $customizer_totalfontsize_after = ESSBOptionsHelper::optionsValue($options, 'customizer_totalfontsize_after');
         if ($customizer_totalbgcolor != '') {
             $this->add_rule('.essb_totalcount { background: ' . $customizer_totalbgcolor . ' !important;} ');
         }
         if ($customizer_totalnobgcolor == "true") {
             $this->add_rule('.essb_totalcount { background: none !important;} ');
         }
         if ($customizer_totalcolor != '') {
             $this->add_rule('.essb_totalcount, .essb_totalcount .essb_t_nb:after { color: ' . $customizer_totalcolor . ' !important;} ');
         }
         if ($customizer_totalfontsize != '') {
             $this->add_rule('.essb_totalcount .essb_t_nb { font-size: ' . $customizer_totalfontsize . '!important; line-height:' . $customizer_totalfontsize . '!important;}');
         }
         if ($customizer_totalfontsize_after != '') {
             $this->add_rule('.essb_totalcount .essb_t_nb:after { font-size: ' . $customizer_totalfontsize_after . '!important; }');
         }
         if ($global_remove_bg_effects == "true") {
             $this->add_rule('.essb_links a:hover, .essb_links a:focus { background: none !important; }');
         }
         $essb_networks = $options['networks'];
         if ($global_bgcolor != '' || $global_textcolor != '' || $global_hovercolor != '' || $global_hovertextcolor != '') {
             foreach ($essb_networks as $k => $v) {
                 if ($v[0] == 1 || $v[0] == 0) {
                     $singleCss = "";
                     if ($global_bgcolor != '' || $global_textcolor != '') {
                         $singleCss .= '.essb_links .essb_link_' . $k . ' a { ';
                         if ($global_bgcolor != '') {
                             $singleCss .= 'background-color:' . $global_bgcolor . '!important;';
                         }
                         if ($global_textcolor != '') {
                             $singleCss .= 'color:' . $global_bgcolor . '!important;';
                         }
                         $singleCss .= '}';
                     }
                     if ($global_hovercolor != '' || $global_hovertextcolor != '') {
                         $singleCss .= '.essb_links .essb_link_' . $k . ' a:hover, .essb_links .essb_link_' . $k . ' a:focus { ';
                         if ($global_hovercolor != '') {
                             $singleCss .= 'background-color:' . $global_hovercolor . '!important;';
                         }
                         if ($global_hovertextcolor != '') {
                             $singleCss .= 'color:' . $global_hovertextcolor . '!important;';
                         }
                         $singleCss .= '}';
                     }
                     $this->add_rule($singleCss);
                 }
             }
         }
         // single network color customization
         foreach ($essb_networks as $k => $v) {
             if ($v[0] == 1) {
                 $network_bgcolor = isset($options['customizer_' . $k . '_bgcolor']) ? $options['customizer_' . $k . '_bgcolor'] : '';
                 $network_textcolor = isset($options['customizer_' . $k . '_textcolor']) ? $options['customizer_' . $k . '_textcolor'] : '';
                 $network_hovercolor = isset($options['customizer_' . $k . '_hovercolor']) ? $options['customizer_' . $k . '_hovercolor'] : '';
                 $network_hovertextcolor = isset($options['customizer_' . $k . '_hovertextcolor']) ? $options['customizer_' . $k . '_hovertextcolor'] : '';
                 $network_icon = isset($options['customizer_' . $k . '_icon']) ? $options['customizer_' . $k . '_icon'] : '';
                 $network_hovericon = isset($options['customizer_' . $k . '_hovericon']) ? $options['customizer_' . $k . '_hovericon'] : '';
                 $network_iconbgsize = isset($options['customizer_' . $k . '_iconbgsize']) ? $options['customizer_' . $k . '_iconbgsize'] : '';
                 $network_hovericonbgsize = isset($options['customizer_' . $k . '_hovericonbgsize']) ? $options['customizer_' . $k . '_hovericonbgsize'] : '';
                 $sigleCss = "";
                 if ($network_bgcolor != '' || $network_textcolor != '') {
                     $sigleCss .= '.essb_links .essb_link_' . $k . ' a { ';
                     if ($network_bgcolor != '') {
                         $sigleCss .= 'background-color:' . $network_bgcolor . '!important;';
                     }
                     if ($network_textcolor != '') {
                         $sigleCss .= 'color:' . $network_textcolor . '!important;';
                     }
                     $sigleCss .= '}';
                 }
                 if ($network_hovercolor != '' || $network_hovertextcolor != '') {
                     $sigleCss .= '.essb_links .essb_link_' . $k . ' a:hover, .essb_links .essb_link_' . $k . ' a:focus { ';
                     if ($network_hovercolor != '') {
                         $sigleCss .= 'background-color:' . $network_hovercolor . '!important;';
                     }
                     if ($network_hovertextcolor != '') {
                         $sigleCss .= 'color:' . $network_hovertextcolor . '!important;';
                     }
                     $sigleCss .= '}';
                 }
                 if ($network_icon != '') {
                     $sigleCss .= '.essb_links .essb_link_' . $k . ' .essb_icon { background: url("' . $network_icon . '") !important; }';
                     if ($network_iconbgsize != '') {
                         $sigleCss .= '.essb_links .essb_link_' . $k . ' .essb_icon { background-size: ' . $network_iconbgsize . '!important; }';
                     }
                 }
                 if ($network_hovericon != '') {
                     $sigleCss .= '.essb_links .essb_link_' . $k . ' a:hover .essb_icon { background: url("' . $network_hovericon . '") !important; }';
                     if ($network_hovericonbgsize != '') {
                         $sigleCss .= '.essb_links .essb_link_' . $k . ' a:hover .essb_icon { background-size: ' . $network_hovericonbgsize . '!important; }';
                     }
                 }
                 $this->add_rule($sigleCss);
             }
         }
     }
     $global_user_defined_css = isset($options['customizer_css']) ? $options['customizer_css'] : '';
     $global_user_defined_css = stripslashes($global_user_defined_css);
     if ($global_user_defined_css != '') {
         //$css .= $global_user_defined_css;
         $this->add_rule($global_user_defined_css);
     }
     if ($skinedSocial) {
         //$css .= ESSB_Skinned_Native_Button::generateStyleCustomizerCSS ( $options );
         $this->add_rule(ESSB_Skinned_Native_Button::generateStyleCustomizerCSS($options), 'essb_native_skin');
     }
 }
Пример #3
0
 public function popupWindowGenerate($html, $force_width = '')
 {
     $popup_width = ESSBOptionsHelper::optionsValue($this->options, 'afterclose_popup_width', '400');
     if (trim($popup_width) == '') {
         $popup_width = '400';
     }
     if ($force_width != '') {
         $popup_width = $force_width;
     }
     echo '<div class="essbasc-popup" data-popup-width="' . $popup_width . '">';
     echo '<div class="essbasc-popup-content">';
     echo $html;
     echo '</div>';
     echo '<a href="#" class="essbasc-popup-close" onclick="essbasc_popup_close(); return false;"></a>';
     echo '</div>';
     echo '<div class="essbasc-popup-shadow"></div>';
 }
Пример #4
0
 $current_options['afterclose_like_fb_follow_url'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_fb_follow_url');
 $current_options['afterclose_like_google_url'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_google_url');
 $current_options['afterclose_like_google_follow_url'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_google_follow_url');
 $current_options['afterclose_like_twitter_profile'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_twitter_profile');
 $current_options['afterclose_like_pin_follow_url'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_pin_follow_url');
 $current_options['afterclose_like_youtube_channel'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_youtube_channel');
 $current_options['afterclose_like_linkedin_company'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_linkedin_company');
 $current_options['afterclose_message_text'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_message_text');
 $current_options['afterclose_code_text'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_code_text');
 $current_options['afterclose_popup_width'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_popup_width');
 $current_options['essb_cache_static_js'] = ESSBOptionsHelper::optionsBoolValueAsText($options, 'essb_cache_static_js');
 $current_options['afterclose_like_cols'] = ESSBOptionsHelper::optionsValue($options, 'afterclose_like_cols');
 $current_options['deactivate_fa'] = ESSBOptionsHelper::optionsBoolValueAsText($options, 'deactivate_fa');
 $current_options['whatsapp_shareshort'] = ESSBOptionsHelper::optionsBoolValueAsText($options, 'whatsapp_shareshort');
 $current_options['whatsapp_shareshort_service'] = ESSBOptionsHelper::optionsBoolValue($options, 'whatsapp_shareshort_service');
 $current_options['fixed_width_align'] = ESSBOptionsHelper::optionsValue($options, 'fixed_width_align');
 //essb_cache_static_js
 $current_options['advanced_share'] = $as;
 update_option(EasySocialShareButtons::$plugin_settings_name, $current_options);
 $msg = __("Settings are saved", ESSB_TEXT_DOMAIN);
 ESSBCache::flush();
 if ($current_options['stats_active'] == 'true') {
     EasySocialShareButtons_Stats_Admin::install();
 }
 // update social fans counter
 if (isset($essb_fans)) {
     $essb_fans->options['social'] = $_POST['social'];
     $essb_fans->options['sort'] = $_POST['sort'];
     $essb_fans->options['cache'] = (int) $_POST['cache'];
     // $essb_fans->options['data'] = '';
     update_option($essb_fans->options_text, $essb_fans->options);
Пример #5
0
 function print_share_links($content)
 {
     global $post;
     $start = microtime(true);
     $execution_trance = "";
     $options = $this->options;
     if (isset($options['display_in_types'])) {
         // write buttons only if administrator checked this type
         $is_all_lists = in_array('all_lists', $options['display_in_types']);
         $singular_options = $options['display_in_types'];
         $float_onsingle_only = ESSBOptionsHelper::optionsBoolValue($options, 'float_onsingle_only');
         $is_set_list = count($singular_options) > 0 ? true : false;
         unset($singular_options['all_lists']);
         $is_lists_authorized = (is_archive() || is_front_page() || is_search() || is_tag() || is_post_type_archive() || is_home()) && $is_all_lists ? true : false;
         $is_singular = is_singular($singular_options);
         if ($is_singular && !$is_set_list) {
             $is_singular = false;
         }
         // since 1.3.9.9 deactivate on home page
         $deactivate_homepage = isset($options['deactivate_homepage']) ? $options['deactivate_homepage'] : 'false';
         if ($deactivate_homepage == 'true') {
             if (is_home() || is_front_page()) {
                 $is_lists_authorized = false;
                 $is_singular = true;
             }
         }
         $serialized_test = serialize($singular_options);
         $excule_from = isset($options['display_exclude_from']) ? $options['display_exclude_from'] : '';
         // @since 1.3.8.2
         if ($excule_from != '') {
             $excule_from = explode(',', $excule_from);
             $excule_from = array_map('trim', $excule_from);
             if (in_array($post->ID, $excule_from, false)) {
                 $is_singular = false;
                 $is_lists_authorized = false;
             }
         }
         // AI1EC fix of exporet
         $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
         $exist_ai1ec_export = strpos($request_uri, 'ai1ec_exporter_controller');
         if ($exist_ai1ec_export !== false) {
             $is_singular = false;
             $is_lists_authorized = false;
         }
         $exist_tribe_cal = strpos($request_uri, 'ical=');
         if ($exist_tribe_cal !== false) {
             $is_singular = false;
             $is_lists_authorized = false;
         }
         //$content .= " is_singular = ".$is_singular. " | is_list = ".$is_lists_authorized . ' | types = '.$serialized_test . ' | '.$post->post_type. ' | '.$_SERVER['REQUEST_URI'];
         if ($is_singular || $is_lists_authorized) {
             $pt_settings = array();
             // @ since 1.3.9.6 - correct state before additioanl display method generation
             $this->set_options_by_bp_activate_state();
             if ($this->options_by_pt_active) {
                 $pt_settings = EasySocialShareButtons_Advanced_Display::get_options_by_pt();
             }
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_counters = isset($pt_settings['counters']) ? $pt_settings['counters'] : '';
                 if ($pt_counters != '') {
                     $options['show_counter'] = intval($pt_counters);
                 }
             }
             $post_counters = get_post_meta($post->ID, 'essb_counter', true);
             if ($post_counters != '') {
                 $options['show_counter'] = $post_counters;
             }
             $need_counters = $options['show_counter'] ? 1 : 0;
             $postfloat_percent = isset($options['postfloat_percent']) ? $options['postfloat_percent'] : '';
             $this->print_links_position = "top";
             $display_where = isset($options['display_where']) ? $options['display_where'] : '';
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_position = isset($pt_settings['position']) ? $pt_settings['position'] : '';
                 if ($pt_position != '') {
                     $display_where = $pt_position;
                 }
             }
             $post_position = get_post_meta($post->ID, 'essb_position', true);
             if ($post_position != '') {
                 $display_where = $post_position;
             }
             // @since 1.3.8.2 - mobile display render in alternative way
             if ($this->isMobile()) {
                 $display_position_mobile = isset($options['display_position_mobile']) ? $options['display_position_mobile'] : '';
                 if ($display_position_mobile != '') {
                     $display_where = $display_position_mobile;
                 }
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break1 '. ($debug_lab - $start) . ' | ';
             // @custom home position
             if (is_home() || is_front_page()) {
                 $display_position_home = ESSBOptionsHelper::optionsValue($options, 'display_position_home');
                 if ($display_position_home != '') {
                     $display_where = $display_position_home;
                 }
             }
             // @since 1.3.1 sidebar is moved to bottom render to avoid pop in excerpts
             $this->print_links_position = "top";
             $sidebar_draw_in_footer = isset($options['sidebar_draw_in_footer']) ? $options['sidebar_draw_in_footer'] : 'false';
             $sidebar_draw_in_footer = 'true';
             if ($sidebar_draw_in_footer == 'true' && $display_where == 'sidebar') {
                 $display_where = 'moved-footer';
             }
             if ($display_where == 'float' && $float_onsingle_only) {
                 if (is_archive() || is_front_page() || is_search() || is_tag() || is_post_type_archive() || is_home()) {
                     $display_where = "top";
                 }
             }
             $cache_key_post = "";
             if (isset($post)) {
                 $cache_key_post = "essb_post_" . $post->ID;
             }
             if ($display_where != 'moved-footer') {
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_' . $display_where;
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->generate_share_snippet(array(), $need_counters);
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $links = $cached_data;
                 } else {
                     $links = $this->generate_share_snippet(array(), $need_counters);
                 }
             }
             if ('sidebar' == $display_where) {
                 $content = '<div class="essb_sidebar_start_scroll"></div>' . $content;
             }
             if ('top' == $display_where || 'both' == $display_where || 'float' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where) {
                 $content = $links . $content;
             }
             if ('bottom' == $display_where || 'both' == $display_where || 'popup' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where || 'sidebar' == $display_where || 'postfloat' == $display_where || 'flyin' == $display_where) {
                 $this->print_links_position = "bottom";
                 if ('both' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where) {
                     if (defined('ESSB_CACHE_ACTIVE')) {
                         $cache_key = $cache_key_post . '_' . $display_where . '_' . $this->print_links_position;
                         $cached_data = ESSBCache::get($cache_key);
                         if ($cached_data == '') {
                             $cached_data = $this->generate_share_snippet(array(), $need_counters);
                             ESSBCache::put($cache_key, $cached_data);
                         }
                         $links = $cached_data;
                     } else {
                         $links = $this->generate_share_snippet(array(), $need_counters);
                     }
                 }
                 $content = $content . $links;
             }
             if ('inline' == $display_where) {
                 $content = str_replace('<!--easy-share-->', $links, $content);
             }
             if ('postfloat' == $display_where && $postfloat_percent != '') {
                 $this->essb_js_builder->include_postfloat_scroll_script($postfloat_percent);
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break2 '. ($debug_lab - $start) . ' | ';
             // @since 1.3.9.1
             if ('sidebar' == $display_where) {
                 $content .= '<div class="essb_sidebar_break_scroll"></div>';
             }
             // @since 1.3.5
             $another_display_sidebar = isset($options['another_display_sidebar']) ? $options['another_display_sidebar'] : 'false';
             $another_display_sidebar_counter = isset($options['another_display_sidebar_counter']) ? $options['another_display_sidebar_counter'] : 'false';
             $another_display_popup = isset($options['another_display_popup']) ? $options['another_display_popup'] : 'false';
             $another_display_flyin = isset($options['another_display_flyin']) ? $options['another_display_flyin'] : 'false';
             $another_display_postfloat = isset($options['another_display_postfloat']) ? $options['another_display_postfloat'] : 'false';
             $another_display_postfloat_counter = isset($options['another_display_postfloat_counter']) ? $options['another_display_postfloat_counter'] : 'false';
             // @since 1.3.9.5 post type options
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_another_display_sidebar = isset($pt_settings['another_display_sidebar']) ? $pt_settings['another_display_sidebar'] : '';
                 if ($pt_another_display_sidebar != '') {
                     $another_display_sidebar = intval($pt_another_display_sidebar) == 1 ? 'true' : 'false';
                 }
                 $pt_another_display_popup = isset($pt_settings['another_display_popup']) ? $pt_settings['another_display_popup'] : '';
                 if ($pt_another_display_popup != '') {
                     $aanother_display_popup = intval($pt_another_display_popup) == 1 ? 'true' : 'false';
                 }
                 $pt_another_display_postfloat = isset($pt_settings['another_display_postfloat']) ? $pt_settings['another_display_postfloat'] : '';
                 if ($pt_another_display_postfloat != '') {
                     $another_display_postfloat = intval($pt_another_display_postfloat) == 1 ? 'true' : 'false';
                 }
             }
             //print ' $another_display_sidebar_counter = '.$another_display_sidebar_counter;
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break3 '. ($debug_lab - $start) . ' | ';
             $post_another_display_sidebar = get_post_meta($post->ID, 'essb_another_display_sidebar', true);
             $post_another_display_popup = get_post_meta($post->ID, 'essb_another_display_popup', true);
             $post_another_display_postfloat = get_post_meta($post->ID, 'essb_another_display_postfloat', true);
             //print "!$post_another_display_postfloat = " . $post_another_display_postfloat;
             $another_display_deactivate_mobile = isset($options['another_display_deactivate_mobile']) ? $options['another_display_deactivate_mobile'] : 'false';
             $post_another_display_flyin = get_post_meta($post->ID, 'essb_another_display_flyin', true);
             if ($post_another_display_sidebar != '') {
                 if ($post_another_display_sidebar == "yes") {
                     $another_display_sidebar = "true";
                 } else {
                     $another_display_sidebar = "false";
                 }
             }
             if ($post_another_display_popup != '') {
                 if ($post_another_display_popup == "yes") {
                     $another_display_popup = "true";
                 } else {
                     $another_display_popup = "false";
                 }
             }
             if ($post_another_display_flyin != '') {
                 if ($post_another_display_flyin == "yes") {
                     $another_display_flyin = "true";
                 } else {
                     $another_display_flyin = "false";
                 }
             }
             if ($post_another_display_postfloat != '') {
                 if ($post_another_display_postfloat == "yes") {
                     $another_display_postfloat = "true";
                 } else {
                     $another_display_postfloat = "false";
                 }
             }
             if ($sidebar_draw_in_footer == "true") {
                 $another_display_sidebar = "false";
             }
             // 				/$debug_lab = microtime(true);
             //$execution_trance .= ' break4 '. ($debug_lab - $start) . ' | ';
             if ($this->isMobile() && $another_display_deactivate_mobile == "true") {
                 $another_display_popup = "false";
                 $another_display_sidebar = "false";
                 // fixed 1.3.9.9
                 $another_display_postfloat = "false";
                 $another_display_flyin = "false";
             }
             if ($another_display_sidebar == "true") {
                 $content = $content . $this->render_sidebar_code($another_display_sidebar_counter);
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break5 '. ($debug_lab - $start) . ' | ';
             if ($another_display_popup == "true") {
                 $popup_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_popup';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_popup_code();
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $popup_content_code = $cached_data;
                 } else {
                     $popup_content_code = $this->render_popup_code();
                 }
                 $content = $content . $popup_content_code;
             }
             if ($another_display_flyin == "true") {
                 $flyin_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_flyin';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_flyin_code();
                         ESSBCache::put($cache_key, $cached_data);
                     } else {
                         $this->register_flyin_assets();
                     }
                     $flyin_content_code = $cached_data;
                 } else {
                     $flyin_content_code = $this->render_flyin_code();
                 }
                 $content = $content . $flyin_content_code;
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break6 '. ($debug_lab - $start) . ' | ';
             if ($another_display_postfloat == "true") {
                 $post_float_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_postfloat';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_postfloat_code($another_display_postfloat_counter);
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $post_float_content_code = $cached_data;
                 } else {
                     $post_float_content_code = $this->render_postfloat_code($another_display_postfloat_counter);
                 }
                 if ($postfloat_percent != '') {
                     $this->essb_js_builder->include_postfloat_scroll_script($postfloat_percent);
                 }
                 //print "activate display as post float";
                 $content = $content . $post_float_content_code;
             }
             $end = microtime(true);
             if ($this->mycred_active) {
                 //$content .= '<div >'.do_shortcode('[mycred_link href="http://google.com" amount="1"][/mycred_link]').'</div>';
             }
             return $content;
             //return "Execution: ".($end-$start). ' secs |'. $execution_trance.$content;
         } else {
             return $content;
         }
     } else {
         return $content;
     }
 }
Пример #6
0
    $current_options['opt_by_mp'] = $opt_by_mp;
    $current_options['activate_opt_by_mp'] = $options['activate_opt_by_mp'];
    $current_options['native_deactivate_mobile'] = $options['native_deactivate_mobile'];
    $current_options['jigoshop_top'] = $options['jigoshop_top'];
    $current_options['jigoshop_bottom'] = $options['jigoshop_bottom'];
    $current_options['mobile_exclude_tablet'] = $options['mobile_exclude_tablet'];
    $current_options['deactivate_homepage'] = $options['deactivate_homepage'];
    $current_options['deactivate_resource_homepage'] = $options['deactivate_resource_homepage'];
    $current_options['active_internal_counters'] = $options['active_internal_counters'];
    $current_options['postfloat_percent'] = $options['postfloat_percent'];
    $current_options['force_hide_icons'] = $options['force_hide_icons'];
    $current_options['button_counter_hidden_till'] = $options['button_counter_hidden_till'];
    $current_options['message_share_before_buttons'] = $options['message_share_before_buttons'];
    $current_options['sidebar_top_message'] = $options['sidebar_top_message'];
    $current_options['sidebar_bottom_message'] = $options['sidebar_bottom_message'];
    $current_options['display_position_home'] = ESSBOptionsHelper::optionsValue($options, 'display_position_home');
    $current_options['popup_user_notshow_onclose_all'] = ESSBOptionsHelper::optionsBoolValueAsText($options, 'popup_user_notshow_onclose_all');
    $current_options['float_onsingle_only'] = ESSBOptionsHelper::optionsBoolValueAsText($options, 'float_onsingle_only');
    $current_options['network_message'] = $mm;
    // @since 1.1.4
    // update network names
    foreach ($nn as $k => $v) {
        $current_options['networks'][$k][1] = $v;
    }
    update_option(EasySocialShareButtons::$plugin_settings_name, $current_options);
    ESSBCache::flush();
    $msg = "Settings are saved.";
    if (function_exists('purge_essb_cache_static_cache')) {
        purge_essb_cache_static_cache();
    }
}