public static function activate($cache_mode) { $upload_dir = wp_upload_dir(); $base_path = $upload_dir['basedir'] . '/essb_cache/'; $base_url = $upload_dir['baseurl'] . '/essb_cache/'; if (is_ssl()) { $base_url = str_replace('http://', 'https://', $base_url); } if (!is_dir($base_path)) { if (!mkdir($base_path, 0777)) { return false; } } self::$cacheFolder = $base_path; self::$cacheURL = $base_url; if ($cache_mode != 'resource') { define('ESSB_CACHE_ACTIVE', true); define('ESSB_CACHE_ACTIVE_RESOURCE', true); } else { define('ESSB_CACHE_ACTIVE_RESOURCE', true); } self::$isActive = true; return true; }
public function generate_custom_css() { global $post; // caching will work only if post is provided if (isset($post)) { if (defined('ESSB_CACHE_ACTIVE_RESOURCE')) { $cache_key = "essb_inline_styles_" . $post->ID; $cached_data = ESSBCache::get_resource($cache_key, 'css'); if ($cached_data != '') { echo "<link rel='stylesheet' id='essb-cache-css' href='" . $cached_data . "' type='text/css' media='all' />"; return; } } } $this->fix_css_float_from_top(); $this->generate_essb_more_popup_css(); // $custom_css_builder_executed $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) { $this->customizer_compile_css_second(); } if (count($this->css) > 0) { //echo '<!-- ESSB v. '.$this->version.' CSS Builder -->'; $output_css = ""; foreach ($this->css as $cssRule) { //$cssRule = str_replace(array("\n","\r\n"), '', $cssRule); $cssRule = trim(preg_replace('/\\s+/', ' ', $cssRule)); $output_css .= $cssRule; } if (isset($post)) { if (defined('ESSB_CACHE_ACTIVE_RESOURCE')) { $cache_key = "essb_inline_styles_" . $post->ID; ESSBCache::put_resource($cache_key, $output_css, 'css'); $cached_data = ESSBCache::get_resource($cache_key, 'css'); if ($cached_data != '') { echo "<link rel='stylesheet' id='essb-cache-css' href='" . $cached_data . "' type='text/css' media='all' />"; return; } } } echo '<style type="text/css">'; echo $output_css; echo '</style>'; } }
$current_options['more_button_func'] = get_options_field_value($options, 'more_button_func', ''); $current_options['twitter_shareshort_service'] = get_options_field_value($options, 'twitter_shareshort_service', ''); $current_options['display_excerpt_pos'] = get_options_field_value($options, 'display_excerpt_pos', ''); $current_options['display_excerpt'] = get_options_field_value($options, 'display_excerpt', 'false'); $current_options['display_position_mobile_sidebar'] = get_options_field_value($options, 'display_position_mobile_sidebar', ''); $current_options['force_hide_buttons_on_all_mobile'] = get_options_field_value($options, 'force_hide_buttons_on_all_mobile', 'false'); $current_options['always_hide_names_mobile'] = get_options_field_value($options, 'always_hide_names_mobile', 'false'); $current_options['admin_ajax_cache'] = get_options_field_value($options, 'admin_ajax_cache', ''); $current_options['activate_total_counter_text'] = get_options_field_value($options, 'activate_total_counter_text', 'false'); $current_options['total_counter_hidden_till'] = get_options_field_value($options, 'total_counter_hidden_till', ''); //$current_options['use_minified_css'] = get_options_field_value($options, 'use_minified_css', 'true'); //$current_options['use_minified_js'] = get_options_field_value($options, 'use_minified_js', 'true'); $current_options['using_yoast_ga'] = get_options_field_value($options, 'using_yoast_ga', 'true'); //$current_options['apply_clean_buttons'] = get_options_field_value($options, 'apply_clean_buttons', 'true'); update_option(EasySocialShareButtons::$plugin_settings_name, $current_options); ESSBCache::flush(); if (function_exists('purge_essb_cache_static_cache')) { purge_essb_cache_static_cache(); } echo "<script type='text/javascript'>window.location='" . admin_url() . "admin.php?page=essb_settings&tab=general#wizard';</script>"; } function get_options_field_value($options, $key, $default) { $value = ''; if (!isset($options[$key])) { $value = $default; } else { $value = $options[$key]; } return $value; }
function generate_essb_fans_count($style = 'flat', $cols = '2', $width = '', $border = '', $small = '') { $cache_key = 'essb_fans_' . $style . '_' . $cols . '_' . $width; wp_register_style('essb-fans-count-style', ESSB_PLUGIN_URL . '/assets/css/essb-fanscount.min.css', array(), $this->version . "" . $this->module_version); wp_enqueue_style('essb-fans-count-style'); if (defined('ESSB_CACHE_ACTIVE')) { $cached_data = ESSBCache::get($cache_key); if ($cached_data != '') { return $cached_data; } } $layout = ""; if ($style == "") { $style = "flat"; } if ($style == "mutted") { if ($cols == "1") { $layout = " outer onecol"; } if ($cols == "2") { $layout = " outer twocols"; } if ($cols == "3") { $layout = " outer threecols"; } if ($cols == "4") { $layout = " outer fourcols"; } if ($cols == "") { $layout = " outer"; } } if ($style == "colored") { if ($cols == "1") { $layout = " outer colored onecol"; } if ($cols == "2") { $layout = " outer colored twocols"; } if ($cols == "3") { $layout = " outer colored threecols"; } if ($cols == "4") { $layout = " outer colored fourcols"; } if ($cols == "") { $layout = " outer colored"; } } if ($style == "flat") { if ($cols == "1") { $layout = " flat onecol"; } if ($cols == "2") { $layout = " flat twocols"; } if ($cols == "3") { $layout = " flat threecols"; } if ($cols == "4") { $layout = " flat fourcols"; } if ($cols == "") { $layout = " flat"; } } if ($style == "metro") { if ($cols == "1") { $layout = " metro onecol"; } if ($cols == "2") { $layout = " metro twocols"; } if ($cols == "3") { $layout = " metro threecols"; } if ($cols == "4") { $layout = " metro fourcols"; } if ($cols == "") { $layout = " metro"; } } if ($style == "tiny") { $layout .= ' tiny onecol'; } if ($border == "yes" && $style != 'flat' && $style != 'metro' && $style != 'tiny') { $layout .= " bordered"; } if ($small == "yes") { $layout .= " tiny2"; } $this->update_all_counts(); if (empty($width) && $style == 'tiny') { $width = "70"; } if (!empty($width)) { $pos_percent = strpos($width, '%'); if ($pos_percent !== false) { $width = ' style="width:' . $width . '%;"'; } else { $width = ' style="width:' . $width . 'px;"'; } } if (!empty($this->options['sort'])) { $network_sort_items = $this->options['sort']; } if (empty($this->options['sort']) || !is_array($network_sort_items) || $this->essb_supported_items != array_intersect($this->essb_supported_items, $network_sort_items)) { $network_sort_items = $this->essb_supported_items; } $widget = ""; $widget .= '<div class="essb-fans' . $layout . '">'; $widget .= '<ul>'; foreach ($network_sort_items as $network) { switch ($network) { case 'facebook': if (!empty($this->options['social']['facebook']['id'])) { $text = __('Fans', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['facebook']['text'])) { $text = $this->options['social']['facebook']['text']; } $widget .= '<li class="essb-fans-facebook"' . $width . '> <a href="http://www.facebook.com/' . $this->options['social']['facebook']['id'] . '" target="_blank"> <i class="essb-fans-icon-facebook"></i> <span>' . $this->prettyPrintNumber($this->options['data']['facebook']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'twitter': if (!empty($this->options['social']['twitter']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['twitter']['text'])) { $text = $this->options['social']['twitter']['text']; } $widget .= '<li class="essb-fans-twitter"' . $width . '> <a href="http://twitter.com/' . $this->options['social']['twitter']['id'] . '" target="_blank"> <i class="essb-fans-icon-twitter"></i> <span>' . $this->prettyPrintNumber($this->options['data']['twitter']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'google': if (!empty($this->options['social']['google']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['google']['text'])) { $text = $this->options['social']['google']['text']; } $widget .= '<li class="essb-fans-google"' . $width . '> <a href="http://plus.google.com/' . $this->options['social']['google']['id'] . '" target="_blank"> <i class="essb-fans-icon-gplus"></i> <span>' . $this->prettyPrintNumber($this->options['data']['google']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'youtube': if (!empty($this->options['social']['youtube']['id'])) { $text = __('Subscribers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['youtube']['text'])) { $text = $this->options['social']['youtube']['text']; } $type = 'user'; if (!empty($this->options['social']['youtube']['type']) && $this->options['social']['youtube']['type'] == 'Channel') { $type = 'channel'; } $widget .= '<li class="essb-fans-youtube"' . $width . '> <a href="http://youtube.com/' . $type . '/' . $this->options['social']['youtube']['id'] . '" target="_blank"> <i class="essb-fans-icon-youtube"></i> <span>' . $this->prettyPrintNumber($this->options['data']['youtube']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'vimeo': if (!empty($this->options['social']['vimeo']['id'])) { $text = __('Subscribers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['vimeo']['text'])) { $text = $this->options['social']['vimeo']['text']; } $widget .= '<li class="essb-fans-vimeo"' . $width . '> <a href="https://vimeo.com/channels/' . $this->options['social']['vimeo']['id'] . '" target="_blank"> <i class="essb-fans-icon-vimeo"></i> <span>' . $this->prettyPrintNumber($this->options['data']['vimeo']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'github': if (!empty($this->options['social']['github']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['github']['text'])) { $text = $this->options['social']['github']['text']; } $widget .= '<li class="essb-fans-github"' . $width . '> <a href="https://github.com/' . $this->options['social']['github']['id'] . '" target="_blank"> <i class="essb-fans-icon-github-circled"></i> <span>' . $this->prettyPrintNumber($this->options['data']['github']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'dribbble': if (!empty($this->options['social']['dribbble']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['dribbble']['text'])) { $text = $this->options['social']['dribbble']['text']; } $widget .= '<li class="essb-fans-dribbble"' . $width . '> <a href="http://dribbble.com/' . $this->options['social']['dribbble']['id'] . '" target="_blank"> <i class="essb-fans-icon-dribbble"></i> <span>' . $this->prettyPrintNumber($this->options['data']['dribbble']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'envato': if (!empty($this->options['social']['envato']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['envato']['text'])) { $text = $this->options['social']['envato']['text']; } $widget .= '<li class="essb-fans-envato"' . $width . '> <a href="http://' . $this->options['social']['envato']['site'] . '.net/user/' . $this->options['social']['envato']['id'] . '" target="_blank"> <i class="essb-fans-icon-envato"></i> <span>' . $this->prettyPrintNumber($this->options['data']['envato']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'soundcloud': if (!empty($this->options['social']['soundcloud']['id']) && !empty($this->options['social']['soundcloud']['api'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['soundcloud']['text'])) { $text = $this->options['social']['soundcloud']['text']; } $widget .= ' <li class="essb-fans-soundcloud"' . $width . '> <a href="http://soundcloud.com/' . $this->options['social']['soundcloud']['id'] . '" target="_blank"> <i class="essb-fans-icon-soundcloud"></i> <span>' . $this->prettyPrintNumber($this->options['data']['soundcloud']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'behance': if (!empty($this->options['social']['behance']['id']) && !empty($this->options['social']['behance']['api'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['behance']['text'])) { $text = $this->options['social']['behance']['text']; } $widget .= '<li class="essb-fans-behance"' . $width . '> <a href="http://www.behance.net/' . $this->options['social']['behance']['id'] . '" target="_blank"> <i class="essb-fans-icon-behance"></i> <span>' . $this->prettyPrintNumber($this->options['data']['behance']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'delicious': if (!empty($this->options['social']['delicious']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['delicious']['text'])) { $text = $this->options['social']['delicious']['text']; } $widget .= '<li class="essb-fans-delicious"' . $width . '> <a href="http://delicious.com/' . $this->options['social']['delicious']['id'] . '" target="_blank"> <i class="essb-fans-icon-delicious"></i> <span>' . $this->prettyPrintNumber($this->options['data']['delicious']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'instagram': if (!empty($this->options['social']['instagram']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['instagram']['text'])) { $text = $this->options['social']['instagram']['text']; } $id = $this->options['social']['instagram']['id']; $id = explode(".", $id); $widget .= '<li class="essb-fans-instagram"' . $width . '> <a href="http://instagram.com/' . $id[1] . '" target="_blank"> <i class="essb-fans-icon-instagram-filled"></i> <span>' . $this->prettyPrintNumber($this->options['data']['instagram']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'pinterest': if (!empty($this->options['social']['pinterest']['id'])) { $text = __('Friends', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['pinterest']['text'])) { $text = $this->options['social']['pinterest']['text']; } $widget .= '<li class="essb-fans-pinterest"' . $width . '> <a href="http://pinterest.com/' . $this->options['social']['pinterest']['id'] . '" target="_blank"> <i class="essb-fans-icon2-pinterest"></i> <span>' . $this->prettyPrintNumber($this->options['data']['pinterest']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'love': if (!empty($this->options['social']['love']['id'])) { if ($this->options['social']['love']['id'] == "Yes") { $text = __('Loves', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['love']['text'])) { $text = $this->options['social']['love']['text']; } $widget .= '<li class="essb-fans-love"' . $width . '> <a href="#"> <i class="essb-fans-icon2-love"></i> <span>' . $this->prettyPrintNumber($this->options['data']['love']) . '</span> <small>' . $text . '</small> </a> </li>'; } } break; case 'vk': if (!empty($this->options['social']['vk']['id'])) { $text = __('Members', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['vk']['text'])) { $text = $this->options['social']['vk']['text']; } $widget .= '<li class="essb-fans-vk"' . $width . '> <a href="http://vk.com/' . $this->options['social']['vk']['id'] . '" target="_blank"> <i class="essb-fans-icon2-vk"></i> <span>' . $this->prettyPrintNumber($this->options['data']['vk']) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'rss': if (!empty($this->options['social']['rss']['id'])) { $rss_cnt = isset($this->options['data']['rss']) ? $this->options['data']['rss'] : 0; if (intval($rss_cnt) == 0) { $rss_cnt = ""; } else { $rss_cnt = $this->prettyPrintNumber($rss_cnt); } $text = __('Subscribers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['rss']['text'])) { $text = $this->options['social']['rss']['text']; } $widget .= '<li class="essb-fans-rss"' . $width . '> <a href="' . $this->options['social']['rss']['id'] . '" target="_blank"> <i class="essb-fans-icon2-rss"></i> <span>' . $rss_cnt . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'users': if (!empty($this->options['social']['users']['id'])) { $member_address = isset($this->options['social']['users']['url']) ? $this->options['social']['users']['url'] : '#'; if ($this->options['social']['users']['id'] == "Yes") { $text = __('Users', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['users']['text'])) { $text = $this->options['social']['users']['text']; } $widget .= '<li class="essb-fans-users"' . $width . '> <a href="' . $member_address . '"> <i class="essb-fans-icon2-users"></i> <span>' . $this->prettyPrintNumber($this->get_members_count()) . '</span> <small>' . $text . '</small> </a> </li>'; } } break; case 'posts': if (!empty($this->options['social']['posts']['id'])) { $member_address = isset($this->options['social']['posts']['url']) ? $this->options['social']['posts']['url'] : '#'; if ($this->options['social']['posts']['id'] == "Yes") { $text = __('Posts', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['posts']['text'])) { $text = $this->options['social']['posts']['text']; } $widget .= '<li class="essb-fans-posts"' . $width . '> <a href="' . $member_address . '"> <i class="essb-fans-icon2-posts"></i> <span>' . $this->prettyPrintNumber($this->get_posts_count()) . '</span> <small>' . $text . '</small> </a> </li>'; } } break; case 'comments': if (!empty($this->options['social']['comments']['id'])) { $member_address = isset($this->options['social']['comments']['url']) ? $this->options['social']['comments']['url'] : '#'; if ($this->options['social']['comments']['id'] == "Yes") { $text = __('Comments', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['comments']['text'])) { $text = $this->options['social']['comments']['text']; } $widget .= '<li class="essb-fans-comments"' . $width . '> <a href="' . $member_address . '"> <i class="essb-fans-icon2-comments"></i> <span>' . $this->prettyPrintNumber($this->get_comments_count()) . '</span> <small>' . $text . '</small> </a> </li>'; } } break; case 'mailchimp': if (!empty($this->options['social']['mailchimp']['id'])) { $text = __('Subscribers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['mailchimp']['text'])) { $text = $this->options['social']['mailchimp']['text']; } $widget .= '<li class="essb-fans-mailchimp"' . $width . '> <a href="' . $this->options['social']['mailchimp']['url'] . '" target="_blank"> <i class="essb-fans-icon-mail-alt"></i> <span>' . $this->prettyPrintNumber(isset($this->options['data']['mailchimp']) ? $this->options['data']['mailchimp'] : 0) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'linkedin': if (!empty($this->options['social']['linkedin']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['linkedin']['text'])) { $text = $this->options['social']['linkedin']['text']; } $widget .= '<li class="essb-fans-linkedin"' . $width . '> <a href="http://linkedin.com/company/' . $this->options['social']['linkedin']['id'] . '" target="_blank"> <i class="essb-fans-icon2-linkedin"></i> <span>' . $this->prettyPrintNumber(isset($this->options['data']['linkedin']) ? $this->options['data']['linkedin'] : 0) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'tumblr': if (!empty($this->options['social']['tumblr']['id'])) { $text = __('Followers', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['tumblr']['text'])) { $text = $this->options['social']['tumblr']['text']; } $widget .= '<li class="essb-fans-tumblr"' . $width . '> <a href="' . esc_url($this->options['social']['tumblr']['id']) . '" target="_blank"> <i class="essb-fans-icon2-tumblr"></i> <span>' . $this->prettyPrintNumber(isset($this->options['data']['tumblr']) ? $this->options['data']['tumblr'] : 0) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'steam': if (!empty($this->options['social']['steam']['id'])) { $text = __('Members', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['steam']['text'])) { $text = $this->options['social']['steam']['text']; } $widget .= '<li class="essb-fans-steam"' . $width . '> <a href="http://steamcommunity.com/groups/' . $this->options['social']['steam']['id'] . '" target="_blank"> <i class="essb-fans-icon-steam"></i> <span>' . $this->prettyPrintNumber(isset($this->options['data']['steam']) ? $this->options['data']['steam'] : 0) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'flickr': if (!empty($this->options['social']['flickr']['id'])) { $text = __('Members', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['steam']['text'])) { $text = $this->options['social']['steam']['text']; } $widget .= '<li class="essb-fans-steam"' . $width . '> <a href="https://www.flickr.com/groups/' . $this->options['social']['flickr']['id'] . '" target="_blank"> <i class="essb-fans-icon-flickr"></i> <span>' . $this->prettyPrintNumber(isset($this->options['data']['flickr']) ? $this->options['data']['flickr'] : 0) . '</span> <small>' . $text . '</small> </a> </li>'; } break; case 'total': if (!empty($this->options['social']['total']['id'])) { $member_address = isset($this->options['social']['total']['url']) ? $this->options['social']['total']['url'] : '#'; if ($this->options['social']['total']['id'] == "Yes") { $text = __('Fans Love Us', ESSB_TEXT_DOMAIN); if (!empty($this->options['social']['total']['text'])) { $text = $this->options['social']['total']['text']; } $widget .= '<li class="essb-fans-total"' . $width . '> <a href="' . $member_address . '"> <i class="essb-fans-icon2-love"></i> <span>' . $this->prettyPrintNumber($this->update_total_count()) . '</span> <small>' . $text . '</small> </a> </li>'; } } break; } } $widget .= '</ul>'; $widget .= '</div>'; $widget .= $this->color_customizer_compiler(); if (defined('ESSB_CACHE_ACTIVE')) { ESSBCache::put($cache_key, $widget); } return $widget; }
public function handle_essb_save_metabox() { global $post, $post_id; if (!$post) { return $post_id; } if (!$post_id) { $post_id = $post->ID; } // if (! wp_verify_nonce ( @$_POST ['essb_nonce'], // 'essb_metabox_handler' )) // return $post_id; // if (defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE) // return $post_id; // "essb_off" if (isset($_POST['essb_off'])) { if ($_POST['essb_off'] != '') { update_post_meta($post_id, 'essb_off', $_POST['essb_off']); } else { delete_post_meta($post_id, 'essb_off'); } } if (isset($_POST['essb_position'])) { if ($_POST['essb_position'] != '') { update_post_meta($post_id, 'essb_position', $_POST['essb_position']); } else { delete_post_meta($post_id, 'essb_position'); } } if (isset($_POST['essb_theme'])) { if ($_POST['essb_theme'] != '') { update_post_meta($post_id, 'essb_theme', $_POST['essb_theme']); } else { delete_post_meta($post_id, 'essb_theme'); } } if (isset($_POST['essb_names'])) { if ($_POST['essb_names'] != '') { update_post_meta($post_id, 'essb_names', $_POST['essb_names']); } else { delete_post_meta($post_id, 'essb_names'); } } if (isset($_POST['essb_counter'])) { if ($_POST['essb_counter'] != '') { update_post_meta($post_id, 'essb_counter', $_POST['essb_counter']); } else { delete_post_meta($post_id, 'essb_counter'); } } if (isset($_POST['essb_hidefb'])) { if ($_POST['essb_hidefb'] != '') { update_post_meta($post_id, 'essb_hidefb', $_POST['essb_hidefb']); } else { delete_post_meta($post_id, 'essb_hidefb'); } } if (isset($_POST['essb_hideplusone'])) { if ($_POST['essb_hideplusone'] != '') { update_post_meta($post_id, 'essb_hideplusone', $_POST['essb_hideplusone']); } else { delete_post_meta($post_id, 'essb_hideplusone'); } } if (isset($_POST['essb_hidevk'])) { if ($_POST['essb_hidevk'] != '') { update_post_meta($post_id, 'essb_hidevk', $_POST['essb_hidevk']); } else { delete_post_meta($post_id, 'essb_hidevk'); } } if (isset($_POST['essb_hidetwitter'])) { if ($_POST['essb_hidetwitter'] != '') { update_post_meta($post_id, 'essb_hidetwitter', $_POST['essb_hidetwitter']); } else { delete_post_meta($post_id, 'essb_hidetwitter'); } } if (isset($_POST['essb_counter_pos'])) { if ($_POST['essb_counter_pos'] != '') { update_post_meta($post_id, 'essb_counter_pos', $_POST['essb_counter_pos']); } else { delete_post_meta($post_id, 'essb_counter_pos'); } } if (isset($_POST['essb_sidebar_pos'])) { if ($_POST['essb_sidebar_pos'] != '') { update_post_meta($post_id, 'essb_sidebar_pos', $_POST['essb_sidebar_pos']); } else { delete_post_meta($post_id, 'essb_sidebar_pos'); } } if (isset($_POST['essb_post_share_message'])) { if ($_POST['essb_post_share_message'] != '') { update_post_meta($post_id, 'essb_post_share_message', $_POST['essb_post_share_message']); } else { delete_post_meta($post_id, 'essb_post_share_message'); } } if (isset($_POST['essb_post_share_url'])) { if ($_POST['essb_post_share_url'] != '') { update_post_meta($post_id, 'essb_post_share_url', $_POST['essb_post_share_url']); } else { delete_post_meta($post_id, 'essb_post_share_url'); } } if (isset($_POST['essb_post_share_image'])) { if ($_POST['essb_post_share_image'] != '') { update_post_meta($post_id, 'essb_post_share_image', $_POST['essb_post_share_image']); } else { delete_post_meta($post_id, 'essb_post_share_image'); } } if (isset($_POST['essb_post_share_text'])) { if ($_POST['essb_post_share_text'] != '') { update_post_meta($post_id, 'essb_post_share_text', $_POST['essb_post_share_text']); } else { delete_post_meta($post_id, 'essb_post_share_text'); } } if (isset($_POST['essb_post_fb_url'])) { if ($_POST['essb_post_fb_url'] != '') { update_post_meta($post_id, 'essb_post_fb_url', $_POST['essb_post_fb_url']); } else { delete_post_meta($post_id, 'essb_post_fb_url'); } } if (isset($_POST['essb_post_plusone_url'])) { if ($_POST['essb_post_plusone_url'] != '') { update_post_meta($post_id, 'essb_post_plusone_url', $_POST['essb_post_plusone_url']); } else { delete_post_meta($post_id, 'essb_post_plusone_url'); } } if (isset($_POST['essb_hideyoutube'])) { if ($_POST['essb_hideyoutube'] != '') { update_post_meta($post_id, 'essb_hideyoutube', $_POST['essb_hideyoutube']); } else { delete_post_meta($post_id, 'essb_hideyoutube'); } } if (isset($_POST['essb_hidepinfollow'])) { if ($_POST['essb_hidepinfollow'] != '') { update_post_meta($post_id, 'essb_hidepinfollow', $_POST['essb_hidepinfollow']); } else { delete_post_meta($post_id, 'essb_hidepinfollow'); } } if (isset($_POST['essb_post_og_desc'])) { if ($_POST['essb_post_og_desc'] != '') { update_post_meta($post_id, 'essb_post_og_desc', $_POST['essb_post_og_desc']); } else { delete_post_meta($post_id, 'essb_post_og_desc'); } } if (isset($_POST['essb_post_og_title'])) { if ($_POST['essb_post_og_title'] != '') { update_post_meta($post_id, 'essb_post_og_title', $_POST['essb_post_og_title']); } else { delete_post_meta($post_id, 'essb_post_og_title'); } } if (isset($_POST['essb_post_og_image'])) { if ($_POST['essb_post_og_image'] != '') { update_post_meta($post_id, 'essb_post_og_image', $_POST['essb_post_og_image']); } else { delete_post_meta($post_id, 'essb_post_og_image'); } } if (isset($_POST['essb_post_og_video'])) { if ($_POST['essb_post_og_video'] != '') { update_post_meta($post_id, 'essb_post_og_video', $_POST['essb_post_og_video']); } else { delete_post_meta($post_id, 'essb_post_og_video'); } } if (isset($_POST['essb_post_og_video_w'])) { if ($_POST['essb_post_og_video_w'] != '') { update_post_meta($post_id, 'essb_post_og_video_w', $_POST['essb_post_og_video_w']); } else { delete_post_meta($post_id, 'essb_post_og_video_w'); } } if (isset($_POST['essb_post_og_video_h'])) { if ($_POST['essb_post_og_video_h'] != '') { update_post_meta($post_id, 'essb_post_og_video_h', $_POST['essb_post_og_video_h']); } else { delete_post_meta($post_id, 'essb_post_og_video_h'); } } if (isset($_POST['essb_total_counter_pos'])) { if ($_POST['essb_total_counter_pos'] != '') { update_post_meta($post_id, 'essb_total_counter_pos', $_POST['essb_total_counter_pos']); } else { delete_post_meta($post_id, 'essb_total_counter_pos'); } } if (isset($_POST['essb_post_twitter_hashtags'])) { if ($_POST['essb_post_twitter_hashtags'] != '') { update_post_meta($post_id, 'essb_post_twitter_hashtags', $_POST['essb_post_twitter_hashtags']); } else { delete_post_meta($post_id, 'essb_post_twitter_hashtags'); } } if (isset($_POST['essb_post_twitter_username'])) { if ($_POST['essb_post_twitter_username'] != '') { update_post_meta($post_id, 'essb_post_twitter_username', $_POST['essb_post_twitter_username']); } else { delete_post_meta($post_id, 'essb_post_twitter_username'); } } if (isset($_POST['essb_as'])) { $value = $_POST['essb_as']; $value = array_filter($value); if (count($value) != 0) { update_post_meta($post_id, 'essb_as', $value); } else { delete_post_meta($post_id, 'essb_as'); } } if (isset($_POST['essb_post_twitter_desc'])) { if ($_POST['essb_post_twitter_desc'] != '') { update_post_meta($post_id, 'essb_post_twitter_desc', $_POST['essb_post_twitter_desc']); } else { delete_post_meta($post_id, 'essb_post_twitter_desc'); } } if (isset($_POST['essb_post_twitter_title'])) { if ($_POST['essb_post_twitter_title'] != '') { update_post_meta($post_id, 'essb_post_twitter_title', $_POST['essb_post_twitter_title']); } else { delete_post_meta($post_id, 'essb_post_twitter_title'); } } if (isset($_POST['essb_post_twitter_image'])) { if ($_POST['essb_post_twitter_image'] != '') { update_post_meta($post_id, 'essb_post_twitter_image', $_POST['essb_post_twitter_image']); } else { delete_post_meta($post_id, 'essb_post_twitter_image'); } } if (isset($_POST['essb_post_google_desc'])) { if ($_POST['essb_post_google_desc'] != '') { update_post_meta($post_id, 'essb_post_google_desc', $_POST['essb_post_google_desc']); } else { delete_post_meta($post_id, 'essb_post_google_desc'); } } if (isset($_POST['essb_post_google_title'])) { if ($_POST['essb_post_google_title'] != '') { update_post_meta($post_id, 'essb_post_google_title', $_POST['essb_post_google_title']); } else { delete_post_meta($post_id, 'essb_post_google_title'); } } if (isset($_POST['essb_post_google_image'])) { if ($_POST['essb_post_google_image'] != '') { update_post_meta($post_id, 'essb_post_google_image', $_POST['essb_post_google_image']); } else { delete_post_meta($post_id, 'essb_post_google_image'); } } if (isset($_POST['essb_post_twitter_tweet'])) { if ($_POST['essb_post_twitter_tweet'] != '') { update_post_meta($post_id, 'essb_post_twitter_tweet', $_POST['essb_post_twitter_tweet']); } else { delete_post_meta($post_id, 'essb_post_twitter_tweet'); } } if (isset($_POST['essb_another_display_popup'])) { if ($_POST['essb_another_display_popup'] != '') { update_post_meta($post_id, 'essb_another_display_popup', $_POST['essb_another_display_popup']); } else { delete_post_meta($post_id, 'essb_another_display_popup'); } } if (isset($_POST['essb_another_display_flyin'])) { if ($_POST['essb_another_display_flyin'] != '') { update_post_meta($post_id, 'essb_another_display_flyin', $_POST['essb_another_display_flyin']); } else { delete_post_meta($post_id, 'essb_another_display_flyin'); } } if (isset($_POST['essb_another_display_sidebar'])) { if ($_POST['essb_another_display_sidebar'] != '') { update_post_meta($post_id, 'essb_another_display_sidebar', $_POST['essb_another_display_sidebar']); } else { delete_post_meta($post_id, 'essb_another_display_sidebar'); } } if (isset($_POST['essb_another_display_postfloat'])) { if ($_POST['essb_another_display_postfloat'] != '') { update_post_meta($post_id, 'essb_another_display_postfloat', $_POST['essb_another_display_postfloat']); } else { delete_post_meta($post_id, 'essb_another_display_postfloat'); } } if (isset($_POST['essb_activate_customizer'])) { if ($_POST['essb_activate_customizer'] != '') { update_post_meta($post_id, 'essb_activate_customizer', $_POST['essb_activate_customizer']); } else { delete_post_meta($post_id, 'essb_activate_customizer'); } } if (isset($_POST['essb_activate_fullwidth'])) { if ($_POST['essb_activate_fullwidth'] != '') { update_post_meta($post_id, 'essb_activate_fullwidth', $_POST['essb_activate_fullwidth']); } else { delete_post_meta($post_id, 'essb_activate_fullwidth'); } } if (isset($_POST['essb_activate_nativeskinned'])) { if ($_POST['essb_activate_nativeskinned'] != '') { update_post_meta($post_id, 'essb_activate_nativeskinned', $_POST['essb_activate_nativeskinned']); } else { delete_post_meta($post_id, 'essb_activate_nativeskinned'); } } if (isset($_POST['essb_opt_by_bp'])) { if ($_POST['essb_opt_by_bp'] != '') { update_post_meta($post_id, 'essb_opt_by_bp', $_POST['essb_opt_by_bp']); } else { delete_post_meta($post_id, 'essb_opt_by_bp'); } } if (isset($_POST['essb_animation'])) { if ($_POST['essb_animation'] != '') { update_post_meta($post_id, 'essb_animation', $_POST['essb_animation']); } else { delete_post_meta($post_id, 'essb_animation'); } } // @since 2.0 cache if (defined('ESSB_CACHE_ACTIVE')) { $cache_key = "essb_ogtags_" . $post_id; ESSBCache::flush_single($cache_key); } // @ since 1.3.9.6 - self hosted values if (ESSB_SELF_ENABLED) { $options = get_option(EasySocialShareButtons::$plugin_settings_name); if (is_array($options)) { foreach ($options['networks'] as $k => $v) { if (isset($_POST['essb_self_' . $k])) { if ($_POST['essb_self_' . $k] != '') { update_post_meta($post_id, 'essb_self_' . $k, $_POST['essb_self_' . $k]); } else { delete_post_meta($post_id, 'essb_self_' . $k); } } } } } }
public function outputMeta() { global $post; $cache_key = ""; if (isset($post)) { $cache_key = "essb_ogtags_" . $post->ID; if (defined('ESSB_CACHE_ACTIVE')) { $cached_data = ESSBCache::get($cache_key); if ($cached_data != '') { echo "\r\n"; echo $cached_data; echo "\r\n"; return; } } } $this->loadPostSettings(); if ($this->ogtags_active) { $this->buildFacebookMeta(); } if ($this->twitter_cards_active) { $this->buildTwitterMeta(); } if ($this->google_authorship || $this->google_markup) { $this->buildGoogleMeta(); } $output_meta = ""; echo "\r\n"; foreach ($this->meta as $single) { $output_meta .= $single . "\r\n"; } echo $output_meta; echo "\r\n"; if (defined('ESSB_CACHE_ACTIVE')) { if ($cache_key != '') { ESSBCache::put($cache_key, $output_meta); } } }
public function outputMeta() { global $post; if (ESSBCoreHelper::is_module_deactivate_on('sso')) { return ""; } $cache_key = ""; if (isset($post)) { $cache_key = "essb_ogtags_" . $post->ID; if (defined('ESSB_CACHE_ACTIVE')) { $cached_data = ESSBCache::get($cache_key); if ($cached_data != '') { echo "\r\n"; echo $cached_data; echo "\r\n"; return; } } } $this->loadPostSettings(); // @since 3.3 front page optimization tags $this->loadFrontpageTags(); if ($this->ogtags_active) { $this->buildFacebookMeta(); } if ($this->twitter_cards_active) { $this->buildTwitterMeta(); } if ($this->google_authorship || $this->google_markup) { $this->buildGoogleMeta(); } $output_meta = ""; echo "\r\n"; foreach ($this->meta as $single) { $output_meta .= $single . "\r\n"; } echo $output_meta; echo "\r\n"; if (defined('ESSB_CACHE_ACTIVE')) { if ($cache_key != '') { ESSBCache::put($cache_key, $output_meta); } } }
/** * Custom Javascript injection function into page footer * @since 1.3.9.8 * @update 2.0 added support for cache include */ public function generate_custom_js() { global $post; if (count($this->js_lazyload) > 0) { //echo '<!-- easy-async-scripts-ver-'.ESSB_VERSION. '-->'; echo '<script type="text/javascript">'; $list = array_unique($this->js_lazyload); foreach ($list as $script) { if ($this->load_defer) { echo ' (function() { var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.defer = true; po.src = \'' . $script . '\'; var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s); })();'; } else { echo ' (function() { var po = document.createElement(\'script\'); po.type = \'text/javascript\'; po.async = true; po.src = \'' . $script . '\'; var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(po, s); })();'; } } echo '</script>'; } // social scripts are loaded at the end if (count($this->js_socialscripts) > 0) { //echo '<!-- easy-social-scripts-ver-'.ESSB_VERSION. '-->'; foreach ($this->js_socialscripts as $key => $code) { echo $code; } } if (count($this->js_builder) > 0) { //echo '<!-- easy-inline-scripts-ver-'.ESSB_VERSION. '-->'; if (isset($post)) { if (defined('ESSB_CACHE_ACTIVE_RESOURCE')) { $cache_key = "essb_inline_scripts_" . $post->ID; $cached_data = ESSBCache::get_resource($cache_key, 'js'); if ($cached_data != '') { echo "<script type='text/javascript' src='" . $cached_data . "' defer></script>"; return; } } } $inline_scritps = ""; foreach ($this->js_builder as $singleCode) { //$singleCode = trim(preg_replace('/\s+/', ' ', $singleCode)); $inline_scritps .= $singleCode; } if (isset($post)) { if (defined('ESSB_CACHE_ACTIVE_RESOURCE')) { $cache_key = "essb_inline_scripts_" . $post->ID; ESSBCache::put_resource($cache_key, $inline_scritps, 'js'); $cached_data = ESSBCache::get_resource($cache_key, 'js'); if ($cached_data != '') { echo "<script type='text/javascript' src='" . $cached_data . "' defer></script>"; return; } } } echo '<script type="text/javascript">'; echo $inline_scritps; echo '</script>'; } }
include_once ESSB_PLUGIN_ROOT . 'lib/modules/essb-after-share-close.php'; register_activation_hook(__FILE__, array('EasySocialShareButtons', 'activate')); register_deactivation_hook(__FILE__, array('EasySocialShareButtons', 'deactivate')); add_action('init', 'essb_load_translations'); function essb_load_translations() { load_plugin_textdomain(ESSB_TEXT_DOMAIN, false, ESSB_PLUGIN_ROOT . '/languages'); } $essb_options = EasySocialShareButtons_Options::get_instance(); $option = $essb_options->options; $module_off_sfc = isset($option['module_off_sfc']) ? $option['module_off_sfc'] : 'false'; $module_off_lv = isset($option['module_off_lv']) ? $option['module_off_lv'] : 'false'; $essb_cache = isset($option['essb_cache']) ? $option['essb_cache'] : 'false'; $essb_cache_mode = isset($option['essb_cache_mode']) ? $option['essb_cache_mode'] : ''; if ($essb_cache == 'true') { ESSBCache::activate($essb_cache_mode); } global $essb_fans; if ($module_off_sfc != 'true') { $essb_fans = EasySocialFansCounter::get_instance(); $essb_fans->version = ESSB_VERSION; $remove_ver_resource = isset($option['remove_ver_resource']) ? $option['remove_ver_resource'] : 'false'; if ($remove_ver_resource == 'true') { $essb_fans->version = ''; } } // static resources cache $essb_cache_static = isset($option['essb_cache_static']) ? $option['essb_cache_static'] : 'false'; $essb_cache_static_js = isset($option['essb_cache_static_js']) ? $option['essb_cache_static_js'] : 'false'; if ($essb_cache_static == 'true' || $essb_cache_static_js == 'true') { include_once ESSB_PLUGIN_ROOT . 'lib/helpers/essb-cache-static-css.php';
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; } }