コード例 #1
0
ファイル: essb-flattr.php プロジェクト: ajay786singh/emc
 public static function getCategories()
 {
     if (empty(self::$categories)) {
         self::$categories = array('text', 'images', 'audio', 'video', 'software', 'rest');
     }
     return self::$categories;
 }
コード例 #2
0
							<td class="bold" valign="top">Default category for your posts:<br /></td>
							<td class="essb_general_options"><?php 
ESSB_Settings_Helper::drawSelectField('flattr_cat', ESSB_Extension_Flattr::getCategories(), true);
?>
</td>
						</tr>
						<tr class="even table-border-bottom"
							<?php 
if ($active_easy_mode) {
    echo ' style="display:none;"';
}
?>
>
							<td class="bold" valign="top">Default language for your posts:<br /></td>
							<td class="essb_general_options"><?php 
ESSB_Settings_Helper::drawSelectField('flattr_lang', ESSB_Extension_Flattr::getLanguages());
?>
</td>
						</tr>
						<tr class="table-border-bottom">
							<td colspan="2" class="sub2">StumpleUpon Additional Options</td>
						</tr>
						<tr class="odd table-border-bottom" id="essb-submenu-2-7">
							<td class="bold" valign="top">Do not generate shortlinks:<br /></td>
							<td class="essb_general_options"><?php 
ESSB_Settings_Helper::drawCheckboxField('stumble_noshortlink');
?>
</td>
						</tr>
						<tr class="table-border-bottom">
							<td colspan="2" class="sub2">Print additional options</td>
コード例 #3
0
ファイル: essb.php プロジェクト: ajay786singh/emc
    public function generate_share_snippet($networks = array(), $counters = 0, $is_current_page_url = 0, $is_shortcode = 0, $custom_share_text = '', $custom_share_address = '', $shortcode_native = 'yes', $shortcode_sidebar = 'no', $shortcode_messages = 'no', $shortcode_popup = 'no', $shortcode_popafter = '', $shortcode_custom_shareimage = '', $shortcode_custom_sharemessage = '', $shortcode_custom_fblike_url = '', $shortcode_custom_pluson_url = '', $shortcode_native_show_fblike = 'no', $shortcode_native_show_twitter = 'no', $shortcode_native_show_plusone = 'no', $shortcode_native_show_vk = 'no', $shortcode_hide_network_names = 'no', $shortcode_counter_pos = '', $shortcode_sidebar_pos = '', $shortcode_native_show_youtube = 'no', $shortcode_native_show_pinfollow = 'no', $shortcode_force_nostats = 'no', $shortcode_hide_total_count = 'no', $shortcode_total_count_pos = '', $shortcode_full_width = 'no', $shortcode_fullwidth_fix = '', $shortcode_native_show_wpmanaged = 'no', $shortcode_custom_button_texts = array(), $shortcode_float = 'no', $shortcode_fixed_width = 'no', $shortcode_fixed_width_value = '', $shortcode_postfloat = 'no', $shortcode_morebutton = '', $shortcode_force_current = 'no', $shortcode_custom_messages = array(), $shortcode_video_share = 'no', $shortcode_template = '', $shortcode_flyin = 'no', $shortcode_fixed_width_align = '', $shortcode_hide_icons = 'no')
    {
        global $post;
        // get the plugin options
        // start generation of buttons code.
        $options = $this->options;
        $force_wp_query_postid = isset($options['force_wp_query_postid']) ? $options['force_wp_query_postid'] : 'false';
        if ($is_shortcode && $shortcode_force_current == 'yes') {
            $force_wp_query_postid = 'true';
        }
        if ($force_wp_query_postid == "true") {
            $current_query_id = get_queried_object_id();
            $post = get_post($current_query_id);
        }
        $self_count_post_id = isset($post) ? $post->ID : 0;
        //force_wp_query_postid
        $essb_off = get_post_meta($post->ID, 'essb_off', true);
        if ($essb_off == "true") {
            $show_me = false;
        } else {
            $show_me = true;
        }
        //		$show_me =  (get_post_meta($post->ID,'essb_off',true)== 1) ? false : true;
        $show_me = $is_shortcode ? true : $show_me;
        // if dectivated then time saving code escape
        if (!$show_me) {
            return;
        }
        // since 1.3.9.9 - new object for post_handling_options
        $postMetaOptions = ESSBOptionsHelper::getPostMetaOptions($post->ID);
        //print $show_me;
        $post_display_where = $postMetaOptions['essb_position'];
        $post_hide_network_names = $postMetaOptions['essb_names'];
        $bp_set_post_hide_network_names = $post_hide_network_names != '' ? true : false;
        $force_network_hide_from_shortcode = false;
        if ($is_shortcode && $shortcode_hide_network_names == "force") {
            $force_network_hide_from_shortcode = true;
        }
        $pt_settings = array();
        if ($this->options_by_pt_active && isset($post)) {
            $pt_settings = EasySocialShareButtons_Advanced_Display::get_options_by_pt();
            $pt_display_where = isset($pt_settings['position']) ? $pt_settings['position'] : '';
            $pt_hide_network_names = isset($pt_settings['hidenames']) ? $pt_settings['hidenames'] : '';
            if ($pt_display_where != '' && $post_display_where == '') {
                $post_display_where = $pt_display_where;
            }
            if ($pt_hide_network_names != '' && $post_hide_network_names == '') {
                $post_hide_network_names = $pt_hide_network_names;
            }
        }
        $post_hide_fb = $postMetaOptions['essb_hidefb'];
        //get_post_meta($post->ID,'essb_hidefb',true);
        $post_hide_plusone = $postMetaOptions['essb_hideplusone'];
        //get_post_meta($post->ID,'essb_hideplusone',true);
        $post_hide_vk = $postMetaOptions['essb_hidevk'];
        //get_post_meta($post->ID,'essb_hidevk',true);
        $post_hide_twitter = $postMetaOptions['essb_hidetwitter'];
        //get_post_meta($post->ID, 'essb_hidetwitter', true);
        // @since 1.2.3
        $post_hide_youtube = $postMetaOptions['essb_hideyoutube'];
        //get_post_meta($post->ID, 'essb_hideyoutube', true);
        $post_hide_pinfollow = $postMetaOptions['essb_hidepinfollow'];
        //get_post_meta($post->ID, 'essb_hidepinfollow', true);
        $post_hide_wpmanaged = "";
        // @since 1.2.1
        $shortcode_force_fblike = false;
        $shortcode_force_twitter = false;
        $shortcode_force_vk = false;
        $shortcode_force_plusone = false;
        $shortcode_force_youtube = false;
        $shortcode_force_pinfollow = false;
        $shortcode_force_wpamanged = false;
        if ($is_shortcode) {
            if ($shortcode_native_show_fblike == "yes") {
                $post_hide_fb = "no";
                $shortcode_force_fblike = true;
            }
            if ($shortcode_native_show_plusone == "yes") {
                $post_hide_plusone = "no";
                $shortcode_force_plusone = true;
            }
            if ($shortcode_native_show_twitter == "yes") {
                $post_hide_twitter = "no";
                $shortcode_force_twitter = true;
            }
            if ($shortcode_native_show_vk == "yes") {
                $post_hide_vk = "no";
                $shortcode_force_vk = true;
            }
            // @since 1.2.3
            if ($shortcode_native_show_youtube == "yes") {
                $post_hide_youtube = "no";
                $shortcode_force_youtube = true;
            }
            if ($shortcode_native_show_pinfollow == "yes") {
                $post_hide_pinfollow = "no";
                $shortcode_force_pinfollow = true;
            }
            if ($shortcode_native_show_wpmanaged == "yes") {
                $post_hide_wpmanaged = "no";
                $shortcode_force_wpamanged = true;
            }
            if ($shortcode_hide_network_names == "yes") {
                $post_hide_network_names = '1';
            }
        }
        $post_sidebar_pos = $postMetaOptions['essb_sidebar_pos'];
        //get_post_meta($post->ID, 'essb_sidebar_pos', true);
        $post_counter_pos = $postMetaOptions['essb_counter_pos'];
        //get_post_meta($post->ID, 'essb_counter_pos', true);
        $post_total_counter_pos = $postMetaOptions['essb_total_counter_pos'];
        //get_post_meta($post->ID, 'essb_total_counter_pos', true);
        $bp_set_post_counter_pos = $post_counter_pos != '' ? true : false;
        $bp_set_post_total_counter_pos = $post_total_counter_pos != '' ? true : false;
        if ($this->options_by_pt_active && isset($post)) {
            $pt_sidebar_pos = isset($pt_settings['sidebar_pos']) ? $pt_settings['sidebar_pos'] : '';
            $pt_counter_pos = isset($pt_settings['counters_pos']) ? $pt_settings['counters_pos'] : '';
            $pt_total_counter_pos = isset($pt_settings['total_counters_pos']) ? $pt_settings['total_counters_pos'] : '';
            if ($pt_sidebar_pos != '' && $post_sidebar_pos == '') {
                $post_sidebar_pos = $pt_sidebar_pos;
            }
            if ($pt_counter_pos != '' && $post_counter_pos == '') {
                $post_counter_pos = $pt_counter_pos;
            }
            if ($pt_total_counter_pos != '' && $post_total_counter_pos == '') {
                $post_total_counter_pos = $pt_total_counter_pos;
            }
        }
        if ($is_shortcode && $shortcode_total_count_pos != '') {
            $post_total_counter_pos = $shortcode_total_count_pos;
        }
        // @since 1.2.1
        if ($is_shortcode && $shortcode_counter_pos != '') {
            $post_counter_pos = $shortcode_counter_pos;
        }
        if ($is_shortcode && $shortcode_sidebar_pos != '') {
            $post_sidebar_pos = $shortcode_sidebar_pos;
        }
        $cookie_loved_page = isset($_COOKIE['essb_love_' . $post->ID]) ? true : false;
        // custom_share_message_address
        $post_essb_post_share_message = $postMetaOptions['essb_post_share_message'];
        //get_post_meta($post->ID, 'essb_post_share_message', true);
        $post_essb_post_share_url = $postMetaOptions['essb_post_share_url'];
        //get_post_meta($post->ID, 'essb_post_share_url', true);
        $post_essb_post_share_image = $postMetaOptions['essb_post_share_image'];
        //get_post_meta($post->ID, 'essb_post_share_image', true);
        $post_essb_post_share_text = $postMetaOptions['essb_post_share_text'];
        //get_post_meta($post->ID, 'essb_post_share_text', true);
        $post_essb_post_fb_url = $postMetaOptions['essb_post_fb_url'];
        //get_post_meta($post->ID, 'essb_post_fb_url', true);
        $post_essb_post_plusone_url = $postMetaOptions['essb_post_plusone_url'];
        //get_post_meta($post->ID, 'essb_sidebar_pos', true);
        $post_essb_twitter_username = $postMetaOptions['essb_post_twitter_username'];
        //get_post_meta($post->ID, 'essb_post_twitter_username', true);
        $post_essb_twitter_hastags = $postMetaOptions['essb_post_twitter_hashtags'];
        //get_post_meta($post->ID, 'essb_post_twitter_hashtags', true);
        $post_essb_twitter_tweet = $postMetaOptions['essb_post_twitter_tweet'];
        //get_post_meta($post->ID, 'essb_post_twitter_tweet', true);
        $post_essb_as = $postMetaOptions['essb_as'];
        //get_post_meta($post->ID, 'essb_as', true);
        $salt = mt_rand();
        // show buttons only if post meta don't ask to hide it, and if it's not a shortcode.
        if ($show_me) {
            // @since 1.3.9.6 - check if it is shortcode then options by bp will not be executed otherwise we correct state with possible values from settings
            if ($is_shortcode) {
                $this->options_by_bp_active = false;
            } else {
                $this->set_options_by_bp_activate_state();
            }
            // texts, URL and image to share
            $text = esc_attr(urlencode($post->post_title));
            $url = $post ? get_permalink() : ESSBOptionsHelper::get_current_url('raw');
            if ($this->avoid_next_page) {
                $url = $post ? get_permalink($post->ID) : ESSBOptionsHelper::get_current_url('raw');
            }
            //$url = urlencode(get_permalink());
            if ($is_current_page_url) {
                $url = ESSBOptionsHelper::get_current_url('raw');
            }
            if (!$is_shortcode) {
                $force_wp_fullurl = isset($options['force_wp_fullurl']) ? $options['force_wp_fullurl'] : 'false';
                if ($force_wp_fullurl == 'true') {
                    //if (ESSBOptionsHelper::exsitQueryString()) {
                    $url = ESSBOptionsHelper::curPageURL();
                    //}
                }
            }
            $ga_tracking_url = $url;
            // @since 2.0 attaching Google Campaign Tracking
            $activate_ga_campaign_tracking = isset($options['activate_ga_campaign_tracking']) ? $options['activate_ga_campaign_tracking'] : '';
            if ($activate_ga_campaign_tracking != '') {
                $url = ESSBOptionsHelper::attachGoogleCampaignTrackingCode($url, $activate_ga_campaign_tracking);
            }
            // filter for the share permalink
            $url = apply_filters('essb_the_shared_permalink', $url);
            $image = has_post_thumbnail($post->ID) ? wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail') : '';
            $pinterest_image = $image != '' ? $image[0] : '';
            $pinterest_desc = $post->post_excerpt;
            $post_image = $image != '' ? $image[0] : '';
            $post_desc = $post->post_excerpt;
            // some markup filters
            $before_the_list = apply_filters('eesb_before_the_list', '');
            $after_the_list = apply_filters('eesb_after_the_list', '');
            $container_classes = apply_filters('eesb_container_classes', '');
            $rel_nofollow = apply_filters('eesb_links_nofollow', 'rel="nofollow"');
            // markup filters
            $div = 'div';
            //apply_filters('eesb_container_tag', 'div');
            $p = 'p';
            //apply_filters('eesb_phrase_tag', 'p');
            $ul = 'ul';
            //apply_filters('eesb_list_container_tag', 'ul');
            $li = 'li';
            //apply_filters('eesb_list_of_item_tag', 'li');
            // @since 1.2.6
            $stats_active = isset($options['stats_active']) ? $options['stats_active'] : 'false';
            if ($is_shortcode && $shortcode_force_nostats == 'yes') {
                $stats_active = 'false';
            }
            // classes and attributes options
            $target_link = isset($options['target_link']) && $options['target_link'] == 1 ? ' target="_blank"' : '';
            $hidden_name_class = isset($options['hide_social_name']) && $options['hide_social_name'] == 1 ? ' essb_hide_name' : '';
            if ($is_shortcode && $shortcode_hide_network_names == "show") {
                $hidden_name_class = "";
            }
            //@since 1.3.9.2
            $always_hide_names_mobile = isset($options['always_hide_names_mobile']) ? $options['always_hide_names_mobile'] : 'false';
            if ($always_hide_names_mobile == 'true' && $this->isMobile()) {
                $hidden_name_class = ' essb_hide_name';
            }
            $container_classes .= intval($counters) == 1 ? ' essb_counters' : '';
            $counter_pos = isset($options['counter_pos']) ? $options['counter_pos'] : '';
            $total_counter_pos = isset($options['total_counter_pos']) ? $options['total_counter_pos'] : '';
            // @since 1.3.9.6
            $total_counter_hidden_till = isset($options['total_counter_hidden_till']) ? $options['total_counter_hidden_till'] : '';
            $total_counter_hidden_till = trim($total_counter_hidden_till);
            $button_counter_hidden_till = isset($options['button_counter_hidden_till']) ? $options['button_counter_hidden_till'] : '';
            $button_counter_hidden_till = trim($button_counter_hidden_till);
            if ($button_counter_hidden_till != '') {
                $button_counter_hidden_till = ' data-essb-button-hidden="' . $button_counter_hidden_till . '"';
            }
            $css_hide_total_counter = "";
            if ($total_counter_hidden_till != '') {
                $css_hide_total_counter = ' style="display: none;" data-essb-hide-till="' . $total_counter_hidden_till . '"';
            }
            if ($post_counter_pos != '') {
                $counter_pos = $post_counter_pos;
            }
            if ($post_total_counter_pos != '') {
                $total_counter_pos = $post_total_counter_pos;
            }
            $stumble_noshortlink = isset($options['stumble_noshortlink']) ? $options['stumble_noshortlink'] : 'false';
            $url_short_native = isset($options['url_short_native']) ? $options['url_short_native'] : 'false';
            $url_short_google = isset($options['url_short_google']) ? $options['url_short_google'] : 'false';
            $url_short_bitly = isset($options['url_short_bitly']) ? $options['url_short_bitly'] : 'false';
            $url_short_bitly_user = isset($options['url_short_bitly_user']) ? $options['url_short_bitly_user'] : '';
            $url_short_bitly_api = isset($options['url_short_bitly_api']) ? $options['url_short_bitly_api'] : '';
            $url_short_bitly_jmp = isset($options['url_short_bitly_jmp']) ? $options['url_short_bitly_jmp'] : 'false';
            $facebook_simplesharing = 'true';
            //isset($options['facebooksimple']) ? $options['facebooksimple'] : 'false';
            $facebook_totalcount = isset($options['facebooktotal']) ? $options['facebooktotal'] : 'false';
            // @ from 1.2.9
            $facebook_advanced_sharing = isset($options['facebookadvanced']) ? $options['facebookadvanced'] : 'false';
            $facebook_advanced_sharing_appid = isset($options['facebookadvancedappid']) ? $options['facebookadvancedappid'] : '';
            $custom_like_url_active = isset($options['custom_url_like']) ? $options['custom_url_like'] : 'false';
            $custom_like_url = isset($options['custom_url_like_address']) ? $options['custom_url_like_address'] : '';
            $custom_plusone_address = isset($options['custom_url_plusone_address']) ? $options['custom_url_plusone_address'] : '';
            //custom_url_plusone_address
            $native_counters = isset($options['native_social_counters']) ? $options['native_social_counters'] : 'false';
            $native_counters_fb = isset($options['native_social_counters_fb']) ? $options['native_social_counters_fb'] : 'false';
            $native_fb_width = isset($options['facebook_like_button_width']) ? $options['facebook_like_button_width'] : '';
            $native_counters_g = isset($options['native_social_counters_g']) ? $options['native_social_counters_g'] : 'false';
            $native_counters_t = isset($options['native_social_counters_t']) ? $options['native_social_counters_t'] : 'false';
            $native_counters_big = isset($options['native_social_counters_boxes']) ? $options['native_social_counters_boxes'] : 'false';
            $native_counters_youtube = isset($options['native_social_counters_youtube']) ? $options['native_social_counters_youtube'] : 'false';
            // @since 1.3.9.8 - moved to general counter option
            $allnative_counters = isset($options['allnative_counters']) ? $options['allnative_counters'] : 'false';
            $native_counters_fb = $allnative_counters;
            $native_counters_g = $allnative_counters;
            $native_counters_t = $allnative_counters;
            $native_counters_youtube = $allnative_counters;
            $more_button_func = isset($options['more_button_func']) ? $options['more_button_func'] : '';
            if ($is_shortcode && $shortcode_morebutton != '') {
                $more_button_func = $shortcode_morebutton;
            }
            $force_hide_total_count = isset($options['force_hide_total_count']) ? $options['force_hide_total_count'] : 'false';
            // @since 1.3.1
            $force_counter_adminajax = isset($options['force_counters_admin']) ? $options['force_counters_admin'] : 'false';
            if ($post_total_counter_pos == "hidden") {
                $force_hide_total_count = "true";
            }
            if ($is_shortcode && $shortcode_hide_total_count == 'yes') {
                $force_hide_total_count = 'true';
            }
            $native_lang = isset($options['native_social_language']) ? $options['native_social_language'] : "en";
            // @since 1.1.5 popup
            $popup_window_title = isset($options['popup_window_title']) ? $options['popup_window_title'] : '';
            $popup_window_close = isset($options['popup_window_close_after']) ? $options['popup_window_close_after'] : '';
            $flyin_window_title = isset($options['flyin_window_title']) ? $options['flyin_window_title'] : '';
            $flyin_window_close = isset($options['flyin_window_close_after']) ? $options['flyin_window_close_after'] : '';
            // @since 1.1.7
            $custom_sidebar_pos = isset($options['sidebar_pos']) ? $options['sidebar_pos'] : '';
            if ($post_sidebar_pos != '') {
                $custom_sidebar_pos = $post_sidebar_pos;
            }
            if ($custom_sidebar_pos == "left") {
                $custom_sidebar_pos = "";
            }
            // @since 1.3.9.6
            $sidebar_bottom_align = isset($options['sidebar_bottom_align']) ? $options['sidebar_bottom_align'] : '';
            // @since 1.1.6 popafter
            $popup_popafter = isset($options['popup_window_popafter']) ? $options['popup_window_popafter'] : '';
            if ($is_shortcode && $shortcode_popafter != '') {
                $popup_popafter = $shortcode_popafter;
            }
            $flyin_popafter = isset($options['flyin_window_popafter']) ? $options['flyin_window_popafter'] : '';
            // @since 1.2.1
            if ($post_essb_post_fb_url != '' || $post_essb_post_plusone_url != '') {
                $custom_like_url_active = "true";
                if ($post_essb_post_fb_url != '') {
                    $custom_like_url = $post_essb_post_fb_url;
                }
                if ($post_essb_post_plusone_url != '') {
                    $custom_plusone_address = $post_essb_post_plusone_url;
                }
            }
            if ($is_shortcode && ($shortcode_custom_fblike_url != '' || $shortcode_custom_pluson_url != '')) {
                $custom_like_url_active = "true";
            }
            if ($is_shortcode && $shortcode_custom_fblike_url != '') {
                $custom_like_url = $shortcode_custom_fblike_url;
            }
            if ($is_shortcode && $shortcode_custom_pluson_url != '') {
                $custom_plusone_address = $shortcode_custom_pluson_url;
            }
            if ($custom_like_url_active == 'false') {
                $custom_like_url = "";
                $custom_plusone_address = "";
            }
            $stumble_fullurl = $url;
            $twitter_fullurl = $url;
            $is_active_shorturl = false;
            $is_set_twitter_counturl = false;
            if ($url_short_native == 'true') {
                $short_url = wp_get_shortlink();
                if ($short_url != '') {
                    $url = $short_url;
                    $is_active_shorturl = true;
                }
            }
            if ($url_short_google == 'true') {
                $short_url = $postMetaOptions['essb_shorturl_googl'];
                if ($short_url == '') {
                    $short_url = EasySocialShareButtons_ShortUrl::google_shorten($url, $post->ID);
                }
                if ($short_url != '') {
                    $is_active_shorturl = true;
                    $url = $short_url;
                }
            }
            if ($url_short_bitly == "true") {
                $short_url = $postMetaOptions['essb_shorturl_bitly'];
                if ($short_url == '') {
                    $short_url = EasySocialShareButtons_ShortUrl::bitly_shorten($url, $url_short_bitly_user, $url_short_bitly_api, $url_short_bitly_jmp, $post - ID);
                }
                if ($short_url != '') {
                    $is_active_shorturl = true;
                    $url = $short_url;
                }
            }
            // custom share message
            $active_custom_message = isset($options['customshare']) ? $options['customshare'] : 'false';
            $is_from_customshare = false;
            $is_set_customshare_message = false;
            if ($facebook_advanced_sharing == 'true') {
                $is_from_customshare = true;
            }
            $custom_share_imageurl = isset($options['customshare_imageurl']) ? $options['customshare_imageurl'] : '';
            $custom_share_description = isset($options['customshare_description']) ? $options['customshare_description'] : '';
            // @since 1.2.1
            if ($post_essb_post_share_image != '' || $post_essb_post_share_message != '' || $post_essb_post_share_text != '' || $post_essb_post_share_url != '') {
                $active_custom_message = "true";
                if ($post_essb_post_share_image != '') {
                    $custom_share_imageurl = $post_essb_post_share_image;
                }
                if ($post_essb_post_share_message != '') {
                    $custom_share_text = $post_essb_post_share_message;
                }
                if ($post_essb_post_share_text != '') {
                    $custom_share_description = $post_essb_post_share_text;
                }
                if ($post_essb_post_share_url != '') {
                    $custom_share_address = $post_essb_post_share_url;
                }
            }
            if ($is_shortcode && $shortcode_custom_sharemessage != '') {
                $custom_share_description = $shortcode_custom_sharemessage;
            }
            if ($is_shortcode && $shortcode_custom_shareimage != '') {
                $custom_share_imageurl = $shortcode_custom_shareimage;
            }
            if ($is_shortcode && $shortcode_custom_sharemessage != '') {
            }
            $pinterest_sniff_disable = isset($options['pinterest_sniff_disable']) ? $options['pinterest_sniff_disable'] : 'false';
            $include_twitter = isset($options['twitterfollow']) ? $options['twitterfollow'] : 'false';
            $include_twitter_user = isset($options['twitterfollowuser']) ? $options['twitterfollowuser'] : '';
            $include_twitter_type = isset($options['twitter_tweet']) ? $options['twitter_tweet'] : '';
            // @since 1.3.9.8
            $include_facebook_type = isset($options['facebook_like_type']) ? $options['facebook_like_type'] : '';
            $include_facebook_follow_profile = isset($options['facebook_follow_profile']) ? $options['facebook_follow_profile'] : '';
            $include_google_type = isset($options['google_like_type']) ? $options['google_like_type'] : '';
            $include_google_follow_profile = isset($options['google_follow_profile']) ? $options['google_follow_profile'] : '';
            // @since 1.2.3
            $include_youtube = isset($options['youtubesub']) ? $options['youtubesub'] : 'false';
            $include_youtube_channel = isset($options['youtubechannel']) ? $options['youtubechannel'] : '';
            $include_pinfollow = isset($options['pinterestfollow']) ? $options['pinterestfollow'] : 'false';
            $include_pinfollow_disp = isset($options['pinterestfollow_disp']) ? $options['pinterestfollow_disp'] : '';
            $include_pinfollow_url = isset($options['pinterestfollow_url']) ? $options['pinterestfollow_url'] : '';
            $include_pintype = isset($options['pinterest_native_type']) ? $options['pinterest_native_type'] : '';
            // @since 1.3.9.8
            $linkedin_follow = isset($options['linkedin_follow']) ? $options['linkedin_follow'] : 'false';
            $linkedin_follow_id = isset($options['linkedin_follow_id']) ? $options['linkedin_follow_id'] : '';
            $native_deactivate_mobile = isset($options['native_deactivate_mobile']) ? $options['native_deactivate_mobile'] : 'false';
            $include_managedwp = isset($options['managedwp_button']) ? $options['managedwp_button'] : 'false';
            $append_twitter_user_to_message = isset($options['twitteruser']) ? $options['twitteruser'] : '';
            $append_twitter_hashtags = isset($options['twitterhashtags']) ? $options['twitterhashtags'] : '';
            $twitter_nojspop = isset($options['twitter_nojspop']) ? $options['twitter_nojspop'] : 'false';
            $using_yoast_ga = isset($options['using_yoast_ga']) ? $options['using_yoast_ga'] : 'false';
            $append_twitter_user_to_buffer = isset($options['buffer_twitter_user']) ? $options['buffer_twitter_user'] : '******';
            // @since 1.3.9.5
            $encode_url_nonlatin = isset($options['encode_url_nonlatin']) ? $options['encode_url_nonlatin'] : 'false';
            $mail_funcion = isset($options['mail_funcion']) ? $options['mail_funcion'] : '';
            if ($post_essb_twitter_username != '') {
                $append_twitter_user_to_message = $post_essb_twitter_username;
            }
            if ($post_essb_twitter_hastags != '') {
                $append_twitter_hashtags = $post_essb_twitter_hastags;
            }
            $twitter_shareshort = isset($options['twitter_shareshort']) ? $options['twitter_shareshort'] : 'false';
            $twitter_shareshort_service = isset($options['twitter_shareshort_service']) ? $options['twitter_shareshort_service'] : '';
            $twitter_always_count_full = isset($options['twitter_always_count_full']) ? $options['twitter_always_count_full'] : 'false';
            //$append_facebook_hashtags = isset($options['facebookhashtags']) ? $options['facebookhashtags'] : '';
            $append_facebook_hashtags = "";
            // @since 1.1.1
            $otherbuttons_sameline = isset($options['otherbuttons_sameline']) ? $options['otherbuttons_sameline'] : 'false';
            if ($custom_share_text == '' && $active_custom_message == 'true') {
                $custom_share_text = isset($options['customshare_text']) ? $options['customshare_text'] : '';
            }
            if ($custom_share_text != '') {
                $text = $custom_share_text;
                $is_from_customshare = true;
                $is_set_customshare_message = true;
            }
            if ($custom_share_address == '' && $active_custom_message == 'true') {
                $custom_share_address = isset($options['customshare_url']) ? $options['customshare_url'] : '';
            }
            if ($custom_share_address != '') {
                $url = $custom_share_address;
                $stumble_fullurl = $url;
            }
            if ($custom_share_description != '' && $active_custom_message == 'true') {
                $pinterest_desc = $custom_share_description;
            }
            if ($custom_share_imageurl != '' && $active_custom_message == 'true') {
                $pinterest_image = $custom_share_imageurl;
            }
            // other options
            $display_where = isset($options['display_where']) ? $options['display_where'] : '';
            if ($post_display_where != '') {
                $display_where = $post_display_where;
            }
            // @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;
                    // @since 1.3.9.6
                    if ($display_position_mobile == 'sidebar') {
                        $display_position_mobile_sidebar = isset($options['display_position_mobile_sidebar']) ? $options['display_position_mobile_sidebar'] : '';
                        if ($display_position_mobile_sidebar != '') {
                            $custom_sidebar_pos = $display_position_mobile_sidebar;
                        }
                    }
                }
            }
            if ($post_hide_network_names == '1') {
                $hidden_name_class = ' essb_hide_name';
            }
            // @since 1.1.3
            if ($is_shortcode) {
                $display_where = "shortcode";
            }
            if ($is_shortcode && $shortcode_sidebar == 'yes') {
                $display_where = "sidebar";
            }
            if ($is_shortcode && $shortcode_popup == 'yes') {
                $display_where = "popup";
            }
            if ($is_shortcode && $shortcode_flyin == 'yes') {
                $display_where = "flyin";
            }
            if ($is_shortcode && $shortcode_postfloat == "yes") {
                $display_where = "postfloat";
            }
            // @since 1.3.9.3
            if ($is_shortcode && $shortcode_float == "yes") {
                $display_where = "float";
            }
            if ($display_where == "popup" || $display_where == "flyin") {
                $container_classes = "essb_popup_counters";
            }
            if ($display_where != "sidebar") {
                $custom_sidebar_pos = "";
                $sidebar_bottom_align = "";
            } else {
                if ($custom_sidebar_pos != '') {
                    $custom_sidebar_pos = "_" . $custom_sidebar_pos;
                }
                if ($sidebar_bottom_align != '') {
                    switch ($sidebar_bottom_align) {
                        case "left":
                            $sidebar_bottom_align = " sbal";
                            break;
                        case "right":
                            $sidebar_bottom_align = " sbar";
                            break;
                        case "center":
                            $sidebar_bottom_align = "";
                            break;
                        default:
                            $sidebar_bottom_align = "";
                            break;
                    }
                }
            }
            //print "display where = " . $display_where;
            //print $native_counters_g;
            $force_pinterest_snif = 1;
            if ($pinterest_sniff_disable == 'true') {
                $force_pinterest_snif = 0;
            }
            if ($custom_like_url == "") {
                $custom_like_url = $url;
            }
            if ($custom_plusone_address == "") {
                $custom_plusone_address = $url;
            }
            $user_network_messages = isset($options['network_message']) ? $options['network_message'] : '';
            $user_advanced_share = isset($options['advanced_share']) ? $options['advanced_share'] : '';
            if ($post_essb_as != '') {
                $user_advanced_share = $post_essb_as;
            }
            $message_above_share = isset($options['message_share_buttons']) ? $options['message_share_buttons'] : '';
            $message_above_like = isset($options['message_like_buttons']) ? $options['message_like_buttons'] : '';
            $message_share_before_buttons = isset($options['message_share_before_buttons']) ? $options['message_share_before_buttons'] : '';
            $message_above_share = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $message_above_share);
            $message_above_like = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $message_above_like);
            $message_share_before_buttons = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $message_share_before_buttons);
            // @since 1.2.2 where are available likeshare and sharelike display methods
            $is_forced_hidden_networks = false;
            $like_share_display_position = "";
            if (!$is_shortcode) {
                //print $display_where;
                if ($display_where == "likeshare" && $this->print_links_position == "top") {
                    $networks = array("no");
                    $is_forced_hidden_networks = true;
                    $like_share_display_position = " essb-like-buttons";
                }
                if ($display_where == "likeshare" && $this->print_links_position == "bottom") {
                    $shortcode_native = "no";
                    $like_share_display_position = " essb-share-buttons";
                }
                if ($display_where == "sharelike" && $this->print_links_position == "bottom") {
                    $networks = array("no");
                    $is_forced_hidden_networks = true;
                    $like_share_display_position = " essb-like-buttons";
                }
                if ($display_where == "sharelike" && $this->print_links_position == "top") {
                    $shortcode_native = "no";
                    $like_share_display_position = " essb-share-buttons";
                }
            }
            if ($message_above_share != "" && !$is_shortcode && !$is_forced_hidden_networks) {
                $before_the_list .= '<div class="essb_message_above_share">' . stripslashes($message_above_share) . "</div>";
            }
            if ($message_above_share != "" && $is_shortcode && $shortcode_messages == "yes") {
                $before_the_list .= '<div class="essb_message_above_share">' . stripslashes($message_above_share) . "</div>";
            }
            // @developer fix to attach class for template
            $loaded_template_id = isset($options['style']) ? $options['style'] : '';
            $post_theme = $postMetaOptions['essb_theme'];
            //get_post_meta($post->ID,'essb_theme',true);
            if ($post_theme != "" && is_numeric($post_theme)) {
                $loaded_template_id = intval($post_theme);
            }
            $loaded_template_id = intval($loaded_template_id);
            $loaded_template = ESSBOptionsHelper::templateFolder($loaded_template_id);
            //"default";
            if ($is_shortcode && $shortcode_template != '') {
                $loaded_template = $shortcode_template;
            }
            if ($loaded_template != $this->loaded_template_slug) {
                //print $loaded_template .  "| ".$this->loaded_template_slug;
                if ($this->css_minifier) {
                    wp_enqueue_style('easy-social-share-buttons-' . $loaded_template, ESSB_PLUGIN_URL . '/assets/css/' . $loaded_template . '/' . 'easy-social-share-buttons.min.css', false, $this->version, 'all');
                } else {
                    wp_enqueue_style('easy-social-share-buttons-' . $loaded_template, ESSB_PLUGIN_URL . '/assets/css/' . $loaded_template . '/' . 'easy-social-share-buttons.css', false, $this->version, 'all');
                }
            }
            // networks to display
            // 2 differents results by :
            // -- using hook (options from admin panel)
            // -- using shortcode/template-function (the array $networks in parameter of this function)
            $essb_networks = array();
            if (count($networks) > 0) {
                $essb_networks = array();
                /*foreach($options['networks'] as $k => $v) {
                			if(in_array($k, $networks)) {
                				$essb_networks[$k]=$v;
                				$essb_networks[$k][0]=1; //set its visible value to 1 (visible)
                			}
                		}*/
                $current_networks = $options['networks'];
                foreach ($networks as $single) {
                    if ($single != 'no') {
                        $essb_networks[$single] = $current_networks[$single];
                        $essb_networks[$single][0] = 1;
                    }
                }
            } else {
                $essb_networks = $options['networks'];
            }
            // full width fix starts here;
            $is_fullwidth_mode = false;
            $css_fullwidth_container = "";
            $css_fullwidth_list = "";
            $css_fullwidth_item = "";
            $css_fullwidth_item_link = "";
            $fullwidth_share_buttons_container = isset($options['fullwidth_share_buttons_container']) ? $options['fullwidth_share_buttons_container'] : '';
            $fullwidth_share_buttons_container = intval($fullwidth_share_buttons_container);
            if ($fullwidth_share_buttons_container == 0) {
                $fullwidth_share_buttons_container = 100;
            }
            if ($is_shortcode && $shortcode_full_width == "yes") {
                $is_fullwidth_mode = true;
                $css_fullwidth_container = ' style="width: 100% !important;"';
                $css_fullwidth_list = ' style="width: 100% !important;"';
                $cnt = 0;
                foreach ($essb_networks as $k => $v) {
                    if ($v[0] == 1) {
                        $cnt++;
                    }
                }
                // @since 1.3.9.3
                if ($cnt > 0) {
                    $item_width = $fullwidth_share_buttons_container / $cnt;
                } else {
                    $item_width = $fullwidth_share_buttons_container;
                }
                if ($shortcode_fullwidth_fix == '') {
                    $shortcode_fullwidth_fix = "80";
                }
                $css_fullwidth_item = ' style="width: ' . intval($item_width) . '% !important;"';
                $css_fullwidth_item_link = ' style="width: ' . $shortcode_fullwidth_fix . '% !important; text-align: center;"';
            }
            // full width from settings
            $fullwidth_share_buttons = isset($options['fullwidth_share_buttons']) ? $options['fullwidth_share_buttons'] : '';
            $fullwidth_share_buttons_correction = isset($options['fullwidth_share_buttons_correction']) ? $options['fullwidth_share_buttons_correction'] : '';
            $fullwidth_share_buttons_correction_mobile = isset($options['fullwidth_share_buttons_correction_mobile']) ? $options['fullwidth_share_buttons_correction_mobile'] : '';
            // @since 1.3.9.5 get custom settings by button position
            $bp_settings = array();
            //if (!$is_shortcode) {
            $bp_display_where = $display_where;
            if ($display_where == "both") {
                if ($this->print_links_position == "top") {
                    $bp_display_where = "top";
                }
                if ($this->print_links_position == "bottom") {
                    $bp_display_where = "bottom";
                }
            }
            if ($this->mobile_options_active && $this->isMobile() && !$is_shortcode) {
                $this->options_by_bp_active = true;
            }
            if ($this->options_by_bp_active) {
                $bp_settings = EasySocialShareButtons_Advanced_Display::get_options_by_bp($bp_display_where);
                // @since 1.3.9.8 - separate mobile options included
                if ($this->mobile_options_active && $this->isMobile() && !$is_shortcode) {
                    $bp_settings = EasySocialShareButtons_Advanced_Display::get_options_by_mp('mobile');
                }
                if ($bp_settings['active']) {
                    // @since 1.3.9.8 - loading different template based on button position
                    if (isset($bp_settings['template'])) {
                        $bp_template = $bp_settings['template'];
                        if ($bp_template != '' && $bp_template != $this->loaded_template_slug) {
                            if ($this->css_minifier) {
                                wp_enqueue_style('easy-social-share-buttons-' . $bp_template, ESSB_PLUGIN_URL . '/assets/css/' . $bp_template . '/' . 'easy-social-share-buttons.min.css', false, $this->version, 'all');
                            } else {
                                wp_enqueue_style('easy-social-share-buttons-' . $bp_template, ESSB_PLUGIN_URL . '/assets/css/' . $bp_template . '/' . 'easy-social-share-buttons.css', false, $this->version, 'all');
                            }
                            $loaded_template = $bp_template;
                        }
                    }
                    if (isset($bp_settings['fullwidth'])) {
                        $bp_fullwidth = isset($bp_settings['fullwidth']) ? $bp_settings['fullwidth'] : false;
                        $bp_fullwidth_value = isset($bp_settings['fullwidth_value']) ? $bp_settings['fullwidth_value'] : '';
                        if ($bp_fullwidth) {
                            $fullwidth_share_buttons = "true";
                        } else {
                            $fullwidth_share_buttons = "false";
                        }
                        if ($bp_fullwidth_value != '') {
                            $fullwidth_share_buttons_correction = $bp_fullwidth_value;
                        }
                    }
                    $bp_hidenames = isset($bp_settings['hidenames']) ? $bp_settings['hidenames'] : '';
                    $bp_counters_pos = isset($bp_settings['counters_pos']) ? $bp_settings['counters_pos'] : '';
                    $bp_total_counters_pos = isset($bp_settings['total_counters_pos']) ? $bp_settings['total_counters_pos'] : '';
                    if (!$is_shortcode) {
                        if ($bp_hidenames != '' && !$bp_set_post_hide_network_names) {
                            $hidden_name_class = $bp_hidenames == '1' ? ' essb_hide_name' : '';
                        }
                        if ($bp_counters_pos != '' && !$bp_set_post_counter_pos) {
                            $counter_pos = $bp_counters_pos;
                        }
                        if ($bp_total_counters_pos != '' && !$bp_set_post_total_counter_pos) {
                            $total_counter_pos = $bp_total_counters_pos;
                        }
                    }
                }
            }
            $bp_networks = array();
            $bp_networks_names = array();
            //if (!$is_shortcode) {
            if ($this->options_by_bp_active) {
                if ($bp_settings['active']) {
                    if (!$is_shortcode) {
                        $bp_networks = isset($bp_settings['networks']) ? $bp_settings['networks'] : array();
                    }
                    $bp_networks_names = isset($bp_settings['names']) ? $bp_settings['names'] : array();
                    if (count($bp_networks_names) > 0) {
                        $user_network_messages = $bp_networks_names;
                    }
                }
            }
            $post_fullwidth_share_buttons = get_post_meta($post->ID, 'essb_activate_fullwidth', true);
            if ($post_fullwidth_share_buttons != '') {
                if ($post_fullwidth_share_buttons == "yes") {
                    $fullwidth_share_buttons = "true";
                } else {
                    $fullwidth_share_buttons = "false";
                }
            }
            if (!$is_shortcode && $fullwidth_share_buttons == "true" && $display_where != "sidebar" && $display_where != "popup" && $display_where != 'flyin') {
                $is_fullwidth_mode = true;
                $css_fullwidth_container = ' style="width: 100% !important;"';
                $css_fullwidth_list = ' style="width: 100% !important;"';
                $cnt = 0;
                foreach ($essb_networks as $k => $v) {
                    if (!$is_shortcode) {
                        if ($this->options_by_bp_active && count($bp_networks) > 0) {
                            $v[0] = in_array($k, $bp_networks, true) ? 1 : 0;
                        }
                    }
                    if ($v[0] == 1) {
                        $cnt++;
                    }
                }
                if ($cnt > 0) {
                    $item_width = $fullwidth_share_buttons_container / $cnt;
                } else {
                    $item_width = $fullwidth_share_buttons_container;
                }
                if ($fullwidth_share_buttons_correction == '') {
                    $fullwidth_share_buttons_correction = "80";
                }
                if ($this->isMobile() && $fullwidth_share_buttons_correction_mobile != '') {
                    $fullwidth_share_buttons_correction = $fullwidth_share_buttons_correction_mobile;
                }
                $css_fullwidth_item = ' style="width: ' . intval($item_width) . '% !important;"';
                $css_fullwidth_item_link = ' style="width: ' . $fullwidth_share_buttons_correction . '% !important; text-align: center;"';
            }
            // @since 1.3.9.3
            $fixed_width_active = isset($options['fixed_width_active']) ? $options['fixed_width_active'] : '';
            $fixed_width_value = isset($options['fixed_width_value']) ? $options['fixed_width_value'] : '';
            $fixed_width_align = isset($options['fixed_width_align']) ? $options['fixed_width_align'] : '';
            $fixed_width_class = "";
            if ($is_shortcode && $shortcode_fixed_width == 'yes') {
                $fixed_width_align = $shortcode_fixed_width_align;
                $width_value = $shortcode_fixed_width_value != '' ? $shortcode_fixed_width_value : '80';
                $css_fullwidth_item_link = ' style="width: ' . $width_value . 'px !important; text-align: center;"';
                $css_fullwidth_item_link = ' style="width: ' . $width_value . 'px !important; text-align: center;"';
                if ($fixed_width_align == "left" || $fixed_width_align == "right") {
                    $css_fullwidth_item_link = ' style="width: ' . $width_value . 'px !important;"';
                }
                $fixed_width_class = 'essb_fw_' . $fixed_width_align;
                if ($fixed_width_align == "right") {
                    $this->essb_css_builder->add_rule('.essb_fw_right .essb_network_name { float: right; }', 'essb_fw_right');
                }
            }
            if (!$is_shortcode && $fixed_width_active == 'true') {
                $width_value = $fixed_width_value != '' ? $fixed_width_value : '80';
                $css_fullwidth_item_link = ' style="width: ' . $width_value . 'px !important; text-align: center;"';
                if ($fixed_width_align == "left" || $fixed_width_align == "right") {
                    $css_fullwidth_item_link = ' style="width: ' . $width_value . 'px !important;"';
                }
                $fixed_width_class = 'essb_fw_' . $fixed_width_align;
                if ($fixed_width_align == "right") {
                    $this->essb_css_builder->add_rule('.essb_fw_right .essb_network_name { float: right; }', 'essb_fw_right');
                }
            }
            $essb_css_modern_counter_class = "";
            if ($counter_pos == 'leftm') {
                $counter_pos = 'left';
                $essb_css_modern_counter_class = ' essb_counter_modern_left';
            }
            if ($counter_pos == 'rightm') {
                $counter_pos = 'right';
                $essb_css_modern_counter_class = ' essb_counter_modern_right';
            }
            if ($counter_pos == 'top') {
                $counter_pos = 'left';
                $essb_css_modern_counter_class = ' essb_counter_modern_top';
            }
            if ($counter_pos == 'topm') {
                $counter_pos = 'left';
                $essb_css_modern_counter_class = ' essb_counter_modern_top_mini';
            }
            if ($counter_pos == "bottom") {
                $essb_css_modern_counter_class = ' essb_counter_modern_bottom';
            }
            // beginning markup
            $is_hidden_content = $display_where == "popup" || $display_where == 'flyin' ? ' display: none;"' : '';
            if ($css_fullwidth_container != '' && $is_hidden_content != '') {
                $css_fullwidth_container = str_replace(';', ';display:none;', $css_fullwidth_container);
                $is_hidden_content = "";
            }
            if ($force_network_hide_from_shortcode) {
                $hidden_name_class = " essb_force_hide";
            }
            // @since 2.0 parsing message before buttons in sidebar
            if (!$is_shortcode) {
                if ($display_where == 'sidebar') {
                    $message_share_before_buttons = '';
                    if ($custom_sidebar_pos == "_top") {
                        $message_share_before_buttons = isset($options['sidebar_top_message']) ? $options['sidebar_top_message'] : '';
                    }
                    if ($custom_sidebar_pos == "_bottom") {
                        $message_share_before_buttons = isset($options['sidebar_bottom_message']) ? $options['sidebar_bottom_message'] : '';
                    }
                }
            }
            // @since 2.0
            if (!$is_shortcode) {
                if (is_home() || is_front_page()) {
                    $like_share_display_position .= ' essb_hp';
                }
            }
            //$block_content = $before_the_sps_content;
            $block_content = '';
            if ($is_shortcode && $shortcode_hide_icons == 'yes') {
                echo '<style type="text/css">#essb_displayed_' . $display_where . $salt . ' .essb_icon { display: none !important; }</style>';
            }
            $block_content .= "\n" . '<' . $div . ' class="essb_links ' . $container_classes . $essb_css_modern_counter_class . ' essb_displayed_' . $display_where . $custom_sidebar_pos . $like_share_display_position . $sidebar_bottom_align . ' essb_template_' . $loaded_template . ' essb_' . $salt . ' print-no ' . $fixed_width_class . '" id="essb_displayed_' . $display_where . $salt . '" ' . $css_fullwidth_container . $is_hidden_content . '>';
            //$block_content .= $hide_intro_phrase ? '' : "\n".'<'.$p.' class="screen-reader-text essb_maybe_hidden_text">'.$share_the_post_sentence.' "'.get_the_title().'"</'.$p.'>'."\n";
            $block_content .= $before_the_list;
            $block_content .= "\n\t" . '<' . $ul . ' class="essb_links_list' . $hidden_name_class . '" ' . $css_fullwidth_list . '>';
            //$block_content .= $before_first_i;
            if (!$is_shortcode && $message_share_before_buttons != '') {
                $block_content .= '<li class="essb_message_before">' . stripslashes($message_share_before_buttons) . '</li>';
            }
            // @since 1.3.0
            $general_counters = isset($options['show_counter']) && $options['show_counter'] == 1 ? 1 : 0;
            if ($is_forced_hidden_networks) {
                $general_counters = 0;
                $counters = 0;
            }
            if ($general_counters == 1 && intval($counters) == 1 || $general_counters == 0 && intval($counters) == 1) {
                if ($total_counter_pos == 'left' || $total_counter_pos == "leftbig") {
                    if ($total_counter_pos == "leftbig") {
                        $block_content .= '<li class="essb_item essb_totalcount_item" ' . ($force_hide_total_count == 'true' ? 'style="display: none !important;"' : '') . $css_hide_total_counter . ' data-counter-pos="' . $counter_pos . '"><span class="essb_totalcount essb_t_l_big" title=""><span class="essb_t_nb"></span></span></li>';
                    } else {
                        $block_content .= '<li class="essb_item essb_totalcount_item" ' . ($force_hide_total_count == 'true' ? 'style="display: none !important;"' : '') . $css_hide_total_counter . ' data-counter-pos="' . $counter_pos . '"><span class="essb_totalcount essb_t_l"  title="' . __('Total: ', ESSB_TEXT_DOMAIN) . '"><span class="essb_t_nb"></span></span></li>';
                    }
                }
            }
            $active_fb = false;
            $active_pinsniff = false;
            $active_mail = false;
            $message_body = "";
            $message_subject = "";
            $used_twitter_url = "";
            if ($this->options_by_pt_active && isset($post)) {
                $pt_networks = isset($pt_settings['networks']) ? $pt_settings['networks'] : array();
            }
            $is_set_external_print = false;
            $is_active_more_button = false;
            // each links (come from options or manual array)
            foreach ($essb_networks as $k => $v) {
                if (!$is_shortcode) {
                    if ($this->options_by_pt_active && isset($post)) {
                        if (count($pt_networks) > 0) {
                            $v[0] = in_array($k, $pt_networks, true) ? 1 : 0;
                        }
                    }
                }
                if (!$is_shortcode) {
                    if ($this->options_by_bp_active && count($bp_networks) > 0) {
                        $v[0] = in_array($k, $bp_networks, true) ? 1 : 0;
                    }
                }
                if ($v[0] == 1) {
                    $api_link = $api_text = '';
                    $api_link_click = "";
                    //$url = apply_filters('essb_the_shared_permalink_for_'.$k, $url);
                    $twitter_user = '';
                    if ($append_twitter_user_to_message != '') {
                        $twitter_user .= '&amp;related=' . $append_twitter_user_to_message . '&amp;via=' . $append_twitter_user_to_message;
                    }
                    //$twitter_user .= '&amp;hashtags=demo,demo1,demo2';
                    if ($append_twitter_hashtags != '') {
                        $twitter_user .= '&amp;hashtags=' . $append_twitter_hashtags;
                    }
                    switch ($k) {
                        case "twitter":
                            //$api_link = 'https://twitter.com/intent/tweet?source=webclient&amp;original_referer='.$url.'&amp;text='.$text.'&amp;url='.$url.$twitter_user;
                            // @since 1.3.9.3 to allow usage of # in message
                            $twitter_message = $text;
                            // @since 1.3.9.8 on post Twitter Tweet customization
                            if ($post_essb_twitter_tweet != '') {
                                $twitter_message = $post_essb_twitter_tweet;
                            }
                            $twitter_message = str_replace('#', '%23', $twitter_message);
                            if ($is_shortcode && is_array($shortcode_custom_messages)) {
                                $custom_network_message = isset($shortcode_custom_messages[$k]) ? $shortcode_custom_messages[$k] : '';
                                if ($custom_network_message != '') {
                                    $twitter_message = $custom_network_message;
                                }
                            }
                            $twitter_url = $url;
                            $used_twitter_url = $url;
                            // @since 1.3.9.5
                            //if ($encode_url_nonlatin == "true") {
                            //$url = rawurlencode($url);
                            //	$twitter_url = urlencode_deep($twitter_url);
                            //}
                            // @since 1.3.9.6
                            //$api_link = 'https://twitter.com/intent/tweet?source=webclient&amp;original_referer='.$twitter_url.'&amp;text='.$twitter_message.'&amp;url='.$twitter_url.$twitter_user;
                            $api_link = 'https://twitter.com/intent/tweet?text=' . $twitter_message . '&amp;url=' . $twitter_url . $twitter_user;
                            // since 1.3.9.8.3
                            $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $api_link);
                            if ($is_active_shorturl && $twitter_always_count_full == 'true') {
                                $api_link = 'https://twitter.com/intent/tweet?text=' . $twitter_message . '&amp;url=' . $twitter_url . '&amp;counturl=' . $twitter_fullurl . $twitter_user;
                                $is_set_twitter_counturl = true;
                            }
                            if ($twitter_shareshort == 'true' && !$is_set_customshare_message) {
                                $short_twitter = wp_get_shortlink();
                                if ($twitter_shareshort_service == 'goo.gl') {
                                    $short_twitter = $postMetaOptions['essb_shorturl_googl'];
                                    if ($short_twitter == '') {
                                        $short_twitter = EasySocialShareButtons_ShortUrl::google_shorten($twitter_url, $post->ID);
                                    }
                                }
                                if ($twitter_shareshort_service == "bit.ly") {
                                    $short_twitter = $postMetaOptions['essb_shorturl_bitly'];
                                    if ($short_twitter == '') {
                                        $short_twitter = EasySocialShareButtons_ShortUrl::bitly_shorten($twitter_url, $url_short_bitly_user, $url_short_bitly_api, $url_short_bitly_jmp, $post->ID);
                                    }
                                }
                                $used_twitter_url = $short_twitter;
                                //$api_link = 'https://twitter.com/intent/tweet?source=webclient&amp;original_referer='.$url.'&amp;text='.$text.'&amp;url='.$short_twitter.'&amp;counturl='.$url.$twitter_user;
                                $api_link = 'https://twitter.com/intent/tweet?text=' . $twitter_message . '&amp;url=' . $short_twitter . '&amp;counturl=' . $url . $twitter_user;
                                $is_set_twitter_counturl = false;
                            }
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Twitter', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_image_pass = isset($user_advanced_share[$k . '_i']) ? $user_advanced_share[$k . '_i'] : '';
                                $user_advanced_share_desc_pass = isset($user_advanced_share[$k . '_d']) ? $user_advanced_share[$k . '_d'] : '';
                                if ($user_advanced_share_message_pass != '' || $user_advanced_share_url_pass != '') {
                                    if ($user_advanced_share_url_pass == '') {
                                        $user_advanced_share_url_pass = $url;
                                    }
                                    if ($user_advanced_share_message_pass == '') {
                                        $user_advanced_share_message_pass = $text;
                                    }
                                    // @since 1.3.9.5
                                    //if ($encode_url_nonlatin == "true") {
                                    //	$user_advanced_share_url_pass = urlencode_deep($user_advanced_share_url_pass);
                                    //}
                                    $used_twitter_url = $user_advanced_share_url_pass;
                                    //$api_link = 'https://twitter.com/intent/tweet?source=webclient&amp;original_referer='.$user_advanced_share_url_pass.'&amp;text='.$user_advanced_share_message_pass.'&amp;url='.$user_advanced_share_url_pass.$twitter_user;
                                    $api_link = 'https://twitter.com/intent/tweet?text=' . $user_advanced_share_message_pass . '&amp;url=' . $user_advanced_share_url_pass . $twitter_user;
                                    $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $api_link);
                                    $is_set_twitter_counturl = false;
                                }
                            }
                            break;
                        case "facebook":
                            //https://www.facebook.com/dialog/feed?app_id=145634995501895&display=popup&caption=An%20example%20caption&link=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fdialogs%2F&redirect_uri=https://developers.facebook.com/tools/explorer&description=
                            $api_link = 'https://www.facebook.com/dialog/feed?app_id=' . $facebook_advanced_sharing_appid . '&amp;display=popup&amp;name=' . $text . '&amp;link=' . urlencode($url) . '&amp;redirect_uri=https://www.facebook.com';
                            //'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='.$url.'&p&#91;title]='.$text.$append_facebook_hashtags;
                            if ($post_image != '') {
                                $api_link .= '&picture=' . $post_image;
                            }
                            if (!$post_desc != '') {
                                $api_link .= '&description=' . urlencode($post_desc);
                            }
                            if ($facebook_simplesharing == 'true') {
                                $api_link = 'http://www.facebook.com/sharer/sharer.php?u=' . $url;
                            }
                            if ($is_from_customshare) {
                                //$api_link = 'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='.$url.'&p&#91;title]='.$text.$append_facebook_hashtags;
                                $api_link = 'https://www.facebook.com/dialog/feed?app_id=' . $facebook_advanced_sharing_appid . '&amp;display=popup&amp;name=' . $text . '&amp;link=' . urlencode($url) . '&amp;redirect_uri=https://www.facebook.com';
                                //'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='.$url.'&p&#91;title]='.$text.$append_facebook_hashtags;
                                if ($custom_share_description != '') {
                                    //$api_link .= '&p&#91;summary]='.$custom_share_description;
                                    $api_link .= '&amp;description=' . urlencode($custom_share_description);
                                }
                                // @ fix in 1.0.8
                                if ($custom_share_imageurl != '') {
                                    //$api_link .= '&p&#91;images][0]='.$custom_share_imageurl;
                                    $api_link .= '&amp;picture=' . $custom_share_imageurl;
                                }
                                $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $api_link);
                                // if there is no applicatio when cannot use custom share
                                if ($facebook_advanced_sharing_appid == "") {
                                    $api_link = 'http://www.facebook.com/sharer/sharer.php?u=' . $url;
                                }
                            }
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Facebook', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_image_pass = isset($user_advanced_share[$k . '_i']) ? $user_advanced_share[$k . '_i'] : '';
                                $user_advanced_share_desc_pass = isset($user_advanced_share[$k . '_d']) ? $user_advanced_share[$k . '_d'] : '';
                                if ($user_advanced_share_message_pass != '' || $user_advanced_share_url_pass != '') {
                                    if ($user_advanced_share_url_pass == '') {
                                        $user_advanced_share_url_pass = $url;
                                    }
                                    if ($user_advanced_share_message_pass == '') {
                                        $user_advanced_share_message_pass = $text;
                                    }
                                    if ($user_advanced_share_image_pass == '') {
                                        $user_advanced_share_image_pass = $custom_share_imageurl;
                                    }
                                    if ($user_advanced_share_desc_pass == '') {
                                        $user_advanced_share_desc_pass = $custom_share_description;
                                    }
                                    if ($facebook_simplesharing == 'true') {
                                        $api_link = 'http://www.facebook.com/sharer/sharer.php?u=' . $user_advanced_share_url_pass;
                                    } else {
                                        $api_link = 'https://www.facebook.com/dialog/feed?app_id=' . $facebook_advanced_sharing_appid . '&display=popup&name=' . urlencode($user_advanced_share_message_pass) . '&link=' . urlencode($user_advanced_share_url_pass) . '&redirect_uri=https://www.facebook.com';
                                        //'https://www.facebook.com/sharer/sharer.php?s=100&p[url]='.$url.'&p&#91;title]='.$text.$append_facebook_hashtags;
                                        if ($user_advanced_share_desc_pass != '') {
                                            $api_link .= '&description=' . urlencode($user_advanced_share_desc_pass);
                                        }
                                        if ($user_advanced_share_image_pass != '') {
                                            //$api_link .= '&p&#91;images][0]='.$custom_share_imageurl;
                                            $api_link .= '&picture=' . $user_advanced_share_image_pass;
                                        }
                                        $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $api_link);
                                    }
                                }
                            }
                            break;
                        case "google":
                            $google_url = $url;
                            if ($encode_url_nonlatin == "true") {
                                //$google_url = rawurlencode($google_url);
                            }
                            $api_link = 'https://plus.google.com/share?url=' . $google_url;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Google+', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = 'https://plus.google.com/share?url=' . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case "pinterest":
                            if ($pinterest_image != '' && $force_pinterest_snif == 0) {
                                $api_link = 'http://pinterest.com/pin/create/bookmarklet/?media=' . $pinterest_image . '&amp;url=' . $url . '&amp;title=' . $text . '&amp;description=' . $pinterest_desc;
                                $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#'), array(get_the_title(), get_site_url(), get_permalink()), $api_link);
                            } else {
                                //$api_link = "javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)})());";
                                $api_link = "javascript:void(0);";
                                $target_link = "";
                                $active_pinsniff = true;
                            }
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share an image of this article on Pinterest', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_image_pass = isset($user_advanced_share[$k . '_i']) ? $user_advanced_share[$k . '_i'] : '';
                                $user_advanced_share_desc_pass = isset($user_advanced_share[$k . '_d']) ? $user_advanced_share[$k . '_d'] : '';
                                if ($user_advanced_share_message_pass != '' || $user_advanced_share_url_pass != '' || $user_advanced_share_image_pass != '') {
                                    if ($user_advanced_share_url_pass == '') {
                                        $user_advanced_share_url_pass = $url;
                                    }
                                    if ($user_advanced_share_message_pass == '') {
                                        $user_advanced_share_message_pass = $text;
                                    }
                                    if ($user_advanced_share_image_pass == '') {
                                        $user_advanced_share_image_pass = $pinterest_image;
                                    }
                                    if ($user_advanced_share_desc_pass == '') {
                                        $user_advanced_share_desc_pass = $pinterest_desc;
                                    }
                                    $api_link = 'http://pinterest.com/pin/create/bookmarklet/?media=' . $user_advanced_share_image_pass . '&amp;url=' . $user_advanced_share_url_pass . '&amp;title=' . $user_advanced_share_message_pass . '&amp;description=' . $user_advanced_share_desc_pass;
                                }
                            }
                            break;
                        case 'linkedin':
                            $api_link = "http://www.linkedin.com/shareArticle?mini=true&amp;ro=true&amp;trk=EasySocialShareButtons&amp;title=" . $text . "&amp;url=" . $url;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on LinkedIn', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://www.linkedin.com/shareArticle?mini=true&amp;ro=true&amp;trk=EasySocialShareButtons&amp;title=" . $user_advanced_share_message_pass . "&amp;url=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'digg':
                            $api_link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $text;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Digg', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://digg.com/submit?phase=2%20&amp;url=" . $user_advanced_share_url_pass . "&amp;title=" . $user_advanced_share_message_pass;
                                }
                            }
                            break;
                        case 'reddit':
                            $api_link = "http://reddit.com/submit?url=" . $url . "&amp;title=" . $text;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Reddit', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://reddit.com/submit?url=" . $user_advanced_share_url_pass . "&amp;title=" . $user_advanced_share_message_pass;
                                }
                            }
                            break;
                        case 'del':
                            $api_link = "https://delicious.com/save?v=5&noui&jump=close&url=" . $url . "&title=" . $text;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Delicious', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "https://delicious.com/save?v=5&noui&jump=close&url=" . $user_advanced_share_url_pass . "&amp;title=" . $user_advanced_share_message_pass;
                                }
                            }
                            break;
                        case 'buffer':
                            $buffer_via_user = '';
                            if ($append_twitter_user_to_buffer == 'true' && $append_twitter_user_to_message != '') {
                                $buffer_via_user = $append_twitter_user_to_message;
                            }
                            $api_link = "https://bufferapp.com/add?url=" . $url . "&text=" . $text . "&via=" . $buffer_via_user . "&picture=&count=horizontal&source=button";
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Buffer', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "https://bufferapp.com/add?url=" . $user_advanced_share_url_pass . "&text=" . $user_advanced_share_message_pass . "&via=&picture=&count=horizontal&source=button";
                                }
                            }
                            break;
                        case 'love':
                            $api_link = "javascript:void(0);";
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Love This!', ESSB_TEXT_DOMAIN));
                            break;
                        case 'stumbleupon':
                            $share_stumble_url = $url;
                            if ($stumble_noshortlink == 'true') {
                                $share_stumble_url = $stumble_fullurl;
                            }
                            $api_link = "http://www.stumbleupon.com/badge/?url=" . $share_stumble_url;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on StumbleUpon', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://www.stumbleupon.com/badge/?url=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'tumblr':
                            $api_link = "http://tumblr.com/share?s=&v=3&t=" . $text . "&u=" . urlencode($url);
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Tumblr', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://tumblr.com/share?s=&v=3&t=" . $user_advanced_share_message_pass . "&u=" . urlencode($user_advanced_share_url_pass);
                                }
                            }
                            break;
                        case 'vk':
                            $api_link = "http://vkontakte.ru/share.php?url=" . $url;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on VKontakte', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://vkontakte.ru/share.php?url=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'ok':
                            $api_link = "http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=" . $url;
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Odnoklassniki', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'weibo':
                            $api_link = "http://service.weibo.com/share/share.php?url=" . $url;
                            $api_text = apply_filters('juiz_sps_share_text_for_' . $k, __('Share this article on Weibo', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://service.weibo.com/share/share.php?url=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'xing':
                            $api_link = "https://www.xing.com/social_plugins/share?h=1;url=" . $url;
                            $api_text = apply_filters('juiz_sps_share_text_for_' . $k, __('Share this article on Xing', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "https://www.xing.com/social_plugins/share?h=1;url=" . $user_advanced_share_url_pass;
                                }
                            }
                            break;
                        case 'pocket':
                            $api_link = "https://getpocket.com/save?title=" . $text . "&url=" . urlencode($url);
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on Pocket', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "https://getpocket.com/save?title=" . $user_advanced_share_message_pass . "&url=" . urlencode($user_advanced_share_url_pass);
                                }
                            }
                            break;
                        case 'mwp':
                            $api_link = "http://managewp.org/share/form?url=" . urlencode($url);
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article on ManageWP.org', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://managewp.org/share/form?url=" . urlencode($user_advanced_share_url_pass);
                                }
                            }
                            break;
                        case 'whatsapp':
                            //$api_link = "whatsapp://send?text=".rawurlencode($text.' '.$url);
                            $whatsapp_url = $url;
                            $whatsapp_shareshort = ESSBOptionsHelper::optionsBoolValueAsText($options, 'whatsapp_shareshort');
                            $whatsapp_shareshort_service = ESSBOptionsHelper::optionsValue($options, 'whatsapp_shareshort_service');
                            if ($whatsapp_shareshort == 'true' && !$is_set_customshare_message) {
                                $short_whatsapp = wp_get_shortlink();
                                if ($whatsapp_shareshort_service == 'goo.gl') {
                                    $short_whatsapp = $postMetaOptions['essb_shorturl_googl'];
                                    if ($short_whatsapp == '') {
                                        $short_whatsapp = EasySocialShareButtons_ShortUrl::google_shorten($whatsapp_url, $post->ID);
                                    }
                                }
                                if ($whatsapp_shareshort_service == "bit.ly") {
                                    $short_whatsapp = $postMetaOptions['essb_shorturl_bitly'];
                                    if ($short_whatsapp == '') {
                                        $short_whatsapp = EasySocialShareButtons_ShortUrl::bitly_shorten($whatsapp_url, $url_short_bitly_user, $url_short_bitly_api, $url_short_bitly_jmp, $post->ID);
                                    }
                                }
                                $whatsapp_url = $short_whatsapp;
                            }
                            $whatsapp_text = $text;
                            $whatsapp_text = rawurlencode($whatsapp_text);
                            $whatsapp_text = str_replace("+", "%20", $whatsapp_text);
                            $whatsapp_text = str_replace("%2B", "%20", $whatsapp_text);
                            $api_link = "whatsapp://send?text=" . $whatsapp_text . '%20' . rawurlencode($whatsapp_url);
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article via WhatsApp', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    //$api_link = "whatsapp://send?text=".rawurlencode($user_advanced_share_message_pass.' '.$user_advanced_share_url_pass);
                                    $whatsapp_text = $user_advanced_share_message_pass;
                                    $whatsapp_text = rawurlencode($whatsapp_text);
                                    $whatsapp_text = str_replace("+", "%20", $whatsapp_text);
                                    $whatsapp_text = str_replace("%2B", "%20", $whatsapp_text);
                                    $api_link = "whatsapp://send?text=" . $whatsapp_text . '%20' . rawurlencode($user_advanced_share_url_pass);
                                }
                            }
                            break;
                        case 'meneame':
                            $api_link = "http://www.meneame.net/submit.php?url=" . urlencode($url);
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article via Meneame', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            // @since 1.3.2
                            if ($user_advanced_share != '') {
                                $user_advanced_share_url_pass = isset($user_advanced_share[$k . '_u']) ? $user_advanced_share[$k . '_u'] : '';
                                $user_advanced_share_message_pass = isset($user_advanced_share[$k . '_t']) ? $user_advanced_share[$k . '_t'] : '';
                                if ($user_advanced_share_message_pass == '') {
                                    $user_advanced_share_message_pass = $text;
                                }
                                if ($user_advanced_share_url_pass != '') {
                                    $api_link = "http://www.meneame.net/submit.php?url=" . urlencode($user_advanced_share_url_pass);
                                }
                            }
                            break;
                        case 'print':
                            $api_link = "window.print(); essb_self_postcount(&#39;print&#39;, &#39;" . $self_count_post_id . "&#39;);";
                            if ($stats_active == 'true') {
                                $api_link .= " essb_handle_stats(&#39;print&#39;, &#39;" . $self_count_post_id . "&#39;);";
                            }
                            $api_link .= ' return false;';
                            $print_use_printfriendly = isset($options['print_use_printfriendly']) ? $options['print_use_printfriendly'] : 'false';
                            if ($print_use_printfriendly == 'true') {
                                $api_link = 'http://www.printfriendly.com/print/?url=' . $url;
                                $is_set_external_print = true;
                            }
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Print this article', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            break;
                        case 'flattr':
                            // currently Flattr does not support cusomize of share options
                            $api_link = ESSB_Extension_Flattr::getStaticFlattrUrl();
                            break;
                        case 'mail':
                            if (strpos($options['mail_body'], '%%') || strpos($options['mail_subject'], '%%')) {
                                $api_link = esc_attr('mailto:?subject=' . $options['mail_subject'] . '&amp;body=' . $options['mail_body']);
                                $api_link = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%image%%#'), array(get_the_title(), get_site_url(), get_permalink(), $post_image), $api_link);
                                $message_subject = $options['mail_subject'];
                                $message_body = $options['mail_body'];
                                $message_subject = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%image%%#', '#%%shorturl%%#'), array(get_the_title(), get_site_url(), get_permalink(), $post_image, $url), $message_subject);
                                $message_body = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%image%%#', '#%%shorturl%%#'), array(get_the_title(), get_site_url(), get_permalink(), $post_image, $url), $message_body);
                                $message_subject = rawurlencode($message_subject);
                                $message_body = rawurlencode($message_body);
                                $api_link = 'mailto:?subject=' . $message_subject . '&amp;body=' . $message_body;
                            } else {
                                $api_link = 'mailto:?subject=' . $options['mail_subject'] . '&amp;body=' . $options['mail_body'] . " : " . $url;
                            }
                            $message_subject = $options['mail_subject'];
                            $message_body = $options['mail_body'];
                            $message_subject = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%image%%#', '#%%shorturl%%#'), array(get_the_title(), get_site_url(), get_permalink(), $post_image, $url), $message_subject);
                            $message_body = preg_replace(array('#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%image%%#', '#%%shorturl%%#'), array(get_the_title(), get_site_url(), get_permalink(), $post_image, $url), $message_body);
                            if ($mail_funcion != 'link') {
                                //$api_link = "javascript:void(0);";
                                $api_link_click = 'essb_mailform_' . $salt . '();';
                                $api_link = "#";
                            }
                            $api_text = apply_filters('essb_share_text_for_' . $k, __('Share this article with a friend (email)', ESSB_TEXT_DOMAIN));
                            if ($user_network_messages != '') {
                                $custom_text = isset($user_network_messages[$k]) ? $user_network_messages[$k] : '';
                                if ($custom_text != "") {
                                    $api_text = $custom_text;
                                }
                            }
                            $active_mail = true;
                            break;
                        case "more":
                            $api_link = "essb_toggle_more(&#39;" . $salt . "&#39;); return false;";
                            $network_name = "";
                            $is_active_more_button = true;
                            break;
                    }
                    $network_name = isset($v[1]) ? $v[1] : $k;
                    if ($is_shortcode && is_array($shortcode_custom_button_texts)) {
                        $custom_shortcode_netowrk_name = isset($shortcode_custom_button_texts[$k]) ? $shortcode_custom_button_texts[$k] : '';
                        if ($custom_shortcode_netowrk_name != '') {
                            $network_name = $custom_shortcode_netowrk_name;
                        }
                    }
                    if (!$is_shortcode && $this->options_by_bp_active) {
                        if (count($bp_networks_names) > 0) {
                            $custom_name = isset($bp_networks_names[$k]) ? $bp_networks_names[$k] : '';
                            if ($custom_name != '') {
                                $network_name = $custom_name;
                            }
                        }
                    }
                    $network_name = trim($network_name);
                    $network_name = esc_attr(stripslashes($network_name));
                    if ($network_name == 'blank') {
                        $network_name = '';
                    }
                    // @since 1.3.9.2 - fix problem with ' in share text
                    $api_link = str_replace("'", "\\'", $api_link);
                    if ($encode_url_nonlatin == "true" && $k != 'more' && $k != 'whatsapp') {
                        $api_link = essb_base64url_encode($api_link);
                    }
                    if (intval($counters) == 1) {
                        if ($counter_pos == "inside" || $counter_pos == "bottom") {
                            $network_name = "";
                        }
                    }
                    $force_hide_social_name = isset($options['force_hide_social_name']) ? $options['force_hide_social_name'] : 'false';
                    if ($force_hide_social_name == 'true' && $this->always_hidden_names) {
                        $network_name = '';
                    }
                    // @ since 1.3.9.7 - added for usage with Easy Social Video Share Addon
                    if ($is_shortcode && $shortcode_video_share == "yes") {
                        $api_text = "";
                    }
                    if ($force_network_hide_from_shortcode) {
                        $network_name = "";
                    }
                    if ($k == "more") {
                        $network_name = "";
                    }
                    if ($k == 'more') {
                        $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox"><a href="#" onclick="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                    } else {
                        if ($k != 'mail' && $k != 'pinterest') {
                            if ($k == "print" && !$is_set_external_print) {
                                $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="#" onclick="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                            } else {
                                if ($k == "love") {
                                    // @since 1.3.7 - love button handle stats
                                    if ($stats_active == "true") {
                                        // essb_handle_stats('love');
                                        $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" onclick="essb_handle_loveyou(\'' . $cookie_loved_page . '\', &#39;' . $self_count_post_id . '&#39;, this); essb_handle_stats(\'love\', &#39;' . $self_count_post_id . '&#39;); return false;" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . ' ' . ($cookie_loved_page ? 'disabled="disabled"' : '') . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                    } else {
                                        $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" onclick="essb_handle_loveyou(\'' . $cookie_loved_page . '\', &#39;' . $self_count_post_id . '&#39;, this); return false;" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . ' ' . ($cookie_loved_page ? 'disabled="disabled"' : '') . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                    }
                                } else {
                                    if ($k == "twitter") {
                                        if ($twitter_nojspop == 'true') {
                                            $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                        } else {
                                            if ($using_yoast_ga == "true") {
                                                $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . '#' . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(&#39;' . $api_link . '&#39;, &#39;' . $k . '&#39;); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                            } else {
                                                $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . '#' . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(\'' . $api_link . '\', \'' . $k . '\'); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                            }
                                        }
                                    } else {
                                        if ($using_yoast_ga == "true") {
                                            $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(&#39;' . $api_link . '&#39;, &#39;' . $k . '&#39;); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                        } else {
                                            $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(\'' . $api_link . '\', \'' . $k . '\'); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                        }
                                    }
                                }
                            }
                        } else {
                            if ($k == 'pinterest') {
                                if (!$active_pinsniff) {
                                    if ($using_yoast_ga == "true") {
                                        $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(&#39;' . $api_link . '&#39;, &#39;' . $k . '&#39;); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                    } else {
                                        $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' onclick="essb_window' . $salt . '(\'' . $api_link . '\', \'' . $k . '\'); return false;" ' . $css_fullwidth_item_link . '' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                    }
                                } else {
                                    $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . ' onclick="essb_pinterenst' . $salt . '(); return false;"' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                                }
                            } else {
                                $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a id="essb-mailform' . $salt . '" href="' . $api_link . '" onclick="' . $api_link_click . ' return false;" ' . $rel_nofollow . ' title="' . $api_text . '" ' . $css_fullwidth_item_link . ' class="essb-mail-link"' . ($this->mycred_active ? ESSBOptionsHelper::generate_mycred_datatoken($this->mycred_group, $this->mycred_points) : '') . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
                            }
                        }
                    }
                }
            }
            if ($is_active_more_button) {
                $k = 'less';
                $api_link = "essb_toggle_less(&#39;" . $salt . "&#39;); return false;";
                $network_name = "";
                $block_content .= '<' . $li . ' class="essb_item essb_link_' . $k . ' nolightbox' . ($is_active_more_button ? ' essb_after_more' : '') . '" ' . $css_fullwidth_item . '><a href="#" onclick="' . $api_link . '" ' . $rel_nofollow . ' title="' . $api_text . '"' . $target_link . ' ' . $css_fullwidth_item_link . '><span class="essb_icon"></span><span class="essb_network_name">' . $network_name . '</span></a></' . $li . '>';
            }
            $post_counters = get_post_meta($post->ID, 'essb_counter', true);
            if ($post_counters != '') {
                $options['show_counter'] = $post_counters;
            }
            $include_plusone_button = isset($options['googleplus']) ? $options['googleplus'] : 'false';
            $include_fb_likebutton = isset($options['facebook_like_button']) ? $options['facebook_like_button'] : '';
            $include_vklike = isset($options['vklike']) ? $options['vklike'] : '';
            // @since 1.2.1
            if ($shortcode_force_fblike) {
                $include_fb_likebutton = "true";
            }
            if ($shortcode_force_plusone) {
                $include_plusone_button = "true";
            }
            if ($shortcode_force_twitter) {
                $include_twitter = "true";
            }
            if ($shortcode_force_vk) {
                $include_vklike = "true";
            }
            if ($shortcode_force_youtube) {
                $include_youtube = "true";
            }
            if ($shortcode_force_pinfollow) {
                $include_pinfollow = "true";
            }
            if ($shortcode_force_wpamanged) {
                $include_managedwp = "true";
            }
            if ($post_hide_fb == 'yes') {
                $include_fb_likebutton = 'false';
            }
            if ($post_hide_plusone == 'yes') {
                $include_plusone_button = 'false';
            }
            if ($post_hide_vk == 'yes') {
                $include_vklike = 'false';
            }
            if ($post_hide_twitter == 'yes') {
                $include_twitter = 'false';
                $include_twitter_user = '';
            }
            if ($post_hide_youtube == "yes") {
                $include_youtube = 'false';
                $include_youtube_channel = '';
            }
            if ($post_hide_pinfollow == "yes") {
                $include_pinfollow = 'false';
                $include_pinfollow_disp = "";
                $include_pinfollow_url = "";
            }
            if ($post_hide_wpmanaged == "yes") {
                $include_managedwp = "false";
            }
            if ($shortcode_native == 'no') {
                $include_fb_likebutton = 'false';
                $include_plusone_button = 'false';
                $include_vklike = 'false';
                $include_twitter = 'false';
                $include_twitter_user = '';
                $include_youtube = 'false';
                $include_youtube_channel = '';
                $include_pinfollow = 'false';
                $include_pinfollow_disp = "";
                $include_pinfollow_url = "";
                $include_managedwp = 'false';
                $linkedin_follow = 'false';
                $linkedin_follow_id = '';
            }
            if (!$is_shortcode && $this->isMobile() && $native_deactivate_mobile == 'true') {
                $include_fb_likebutton = 'false';
                $include_plusone_button = 'false';
                $include_vklike = 'false';
                $include_twitter = 'false';
                $include_twitter_user = '';
                $include_youtube = 'false';
                $include_youtube_channel = '';
                $include_pinfollow = 'false';
                $include_pinfollow_disp = "";
                $include_pinfollow_url = "";
                $include_managedwp = 'false';
                $linkedin_follow = 'false';
                $linkedin_follow_id = '';
            }
            if ($shortcode_native == "selected") {
                if (!$shortcode_force_fblike) {
                    $include_fb_likebutton = 'false';
                }
                if (!$shortcode_force_plusone) {
                    $include_plusone_button = 'false';
                }
                if (!$shortcode_force_vk) {
                    $include_vklike = 'false';
                }
                if (!$shortcode_force_twitter) {
                    $include_twitter = 'false';
                    $include_twitter_user = '';
                }
                if (!$shortcode_force_youtube) {
                    $include_youtube = 'false';
                    $include_youtube_channel = '';
                }
                if (!$shortcode_force_pinfollow) {
                    $include_pinfollow = 'false';
                    $include_pinfollow_disp = "";
                    $include_pinfollow_url = "";
                }
                if (!$shortcode_force_wpamanged) {
                    $include_managedwp = "false";
                }
            }
            $twitter_count_url = $url;
            if (!$is_shortcode) {
                if ($is_set_twitter_counturl) {
                    $twitter_count_url = $twitter_fullurl;
                }
            }
            $general_counters = isset($options['show_counter']) && $options['show_counter'] == 1 ? 1 : 0;
            $active_internal_counters = isset($options['active_internal_counters']) ? $options['active_internal_counters'] : 'false';
            if ($is_forced_hidden_networks) {
                $general_counters = 0;
                $counters = 0;
            }
            $hidden_info = '<input type="hidden" class="essb_info_plugin_url" value="' . ESSB_PLUGIN_URL . '" /><input type="hidden" class="essb_info_permalink" value="' . $url . '" /><input type="hidden" class="essb_info_post_id" value="' . $self_count_post_id . '" data-internal-counters="' . $active_internal_counters . '" ' . $button_counter_hidden_till . ' /><input type="hidden" class="essb_info_permalink_twitter" value="' . $twitter_count_url . '" />';
            $hidden_info .= '<input type="hidden" class="essb_fb_total_count" value="' . $facebook_totalcount . '" />';
            $hidden_info .= '<input type="hidden" class="essb_counter_ajax" value="' . $force_counter_adminajax . '"/>';
            // counter_pos
            if ($general_counters == 1 && intval($counters) == 1 || $general_counters == 0 && intval($counters) == 1) {
                $hidden_info .= '<input type="hidden" class="essb_info_counter_pos" value="' . $counter_pos . '" />';
                //$hidden_info .= '<div class="essb_hidden_counter" style="display:none;visibility:hidden;" data-counter-pos="'.$counter_pos.'" data-counter-ajax="'.$force_counter_adminajax.'" data-fb-total="'.$facebook_totalcount.'"></div>';
            }
            //$block_content .= $after_last_i;
            if ($general_counters == 1 && intval($counters) == 1 || $general_counters == 0 && intval($counters) == 1) {
                if ($total_counter_pos == 'right' || $total_counter_pos == "rightbig" || $total_counter_pos == "") {
                    if ($total_counter_pos == "rightbig") {
                        $block_content .= '<li class="essb_item essb_totalcount_item" ' . ($force_hide_total_count == 'true' ? 'style="display: none !important;"' : '') . $css_hide_total_counter . ' data-counter-pos="' . $counter_pos . '"><span class="essb_totalcount essb_t_r_big" title="" ><span class="essb_t_nb"></span></span></li>';
                    } else {
                        $block_content .= '<li class="essb_item essb_totalcount_item" ' . ($force_hide_total_count == 'true' ? 'style="display: none !important;"' : '') . $css_hide_total_counter . ' data-counter-pos="' . $counter_pos . '"><span class="essb_totalcount" title="' . __('Total: ', ESSB_TEXT_DOMAIN) . '"><span class="essb_t_nb"></span></span></li>';
                    }
                }
            }
            // @since 1.3.9.6
            if ($used_twitter_url == '') {
                $used_twitter_url = $url;
                if ($twitter_shareshort == 'true' && !$is_from_customshare) {
                    $short_twitter = wp_get_shortlink();
                    if ($twitter_shareshort_service == 'goo.gl') {
                        $short_twitter = EasySocialShareButtons_ShortUrl::google_shorten($url, $post->ID);
                    }
                    if ($twitter_shareshort_service == "bit.ly") {
                        $short_twitter = EasySocialShareButtons_ShortUrl::bitly_shorten($url, $url_short_bitly_user, $url_short_bitly_api, $url_short_bitly_jmp, $post->ID);
                    }
                    $used_twitter_url = $short_twitter;
                }
            }
            $print_vk_js = false;
            // @since 1.1.1
            if ($otherbuttons_sameline == 'true') {
                $network_ordered_list = $this->prepare_native_list_order();
                foreach ($network_ordered_list as $native_button) {
                    if ($native_button == "google") {
                        if ($include_plusone_button == 'true') {
                            if ($include_google_type == "follow") {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_plusone_item"><div>' . $this->print_plusfollow_button($include_google_follow_profile, $native_counters_g, $native_lang) . '</div></li>';
                            } else {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_plusone_item"><div>' . $this->print_plusone_button($custom_plusone_address, $native_counters_g, $native_lang) . '</div></li>';
                            }
                        }
                    }
                    if ($native_button == "twitter") {
                        if ($include_twitter == 'true') {
                            if ($include_twitter_type == 'tweet') {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_twitter_item"><div>' . $this->print_twitter_tweet_button($include_twitter_user, $native_counters_t, $native_lang, '', '', '', $used_twitter_url) . '</div></li>';
                            } else {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_twitter_item"><div>' . $this->print_twitter_follow_button($include_twitter_user, $native_counters_t, $native_lang) . '</div></li>';
                            }
                        }
                    }
                    if ($native_button == "facebook") {
                        if ($include_fb_likebutton == 'true') {
                            if ($include_facebook_type == 'follow') {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_facebook_item"><div>' . $this->print_fb_followbutton($include_facebook_follow_profile, $native_counters_fb, $native_fb_width) . '</div></li>';
                            } else {
                                $block_content .= '<li class="essb_item essb_native_item essb_native_facebook_item"><div>' . $this->print_fb_likebutton($custom_like_url, $native_counters_fb, $native_fb_width) . '</div></li>';
                            }
                        }
                    }
                    if ($native_button == "linkedin") {
                        if ($linkedin_follow == 'true') {
                            $block_content .= '<li class="essb_item essb_native_item essb_native_linkedin_item"><div>' . $this->print_linkedin_button($linkedin_follow_id, $allnative_counters) . '</div></li>';
                        }
                    }
                    if ($native_button == "youtube") {
                        if ($include_youtube == 'true') {
                            $block_content .= '<li class="essb_item essb_native_item essb_native_youtube_item"><div>' . $this->print_youtube_button($include_youtube_channel, $native_counters_youtube) . '</div></li>';
                        }
                    }
                    if ($native_button == "pinterest") {
                        if ($include_pinfollow == 'true') {
                            $block_content .= '<li class="essb_item essb_native_item essb_native_pinfollow_item"><div>' . $this->print_pinterest_follow($include_pinfollow_disp, $include_pinfollow_url, $include_pintype) . '</div></li>';
                        }
                    }
                    if ($native_button == "managewp") {
                        if ($include_managedwp == "true") {
                            $block_content .= '<li class="essb_item essb_native_item essb_native_managedwp_item"><div>' . $this->print_managedwp_button($url, $text) . '</div></li>';
                        }
                    }
                    if ($native_button == "vk") {
                        if ($include_vklike == 'true') {
                            $block_content .= '<li class="essb_item essb_native_item essb_native_vk_item"><div>' . $this->print_vklike_button($salt, $native_counters) . '</div></li>';
                            $print_vk_js = true;
                        }
                    }
                }
            }
            $block_content .= '</' . $ul . '>' . "\n\t";
            $block_content .= $after_the_list;
            $block_content .= $general_counters == 1 && intval($counters) == 1 || $general_counters == 0 && intval($counters) == 1 ? $hidden_info : '';
            if ($otherbuttons_sameline != 'true') {
                if ($include_fb_likebutton == 'true' || $include_plusone_button == 'true' || $include_vklike == 'true' || $include_twitter == 'true' || $linkedin_follow == 'true') {
                    if ($message_above_like != "" && !$is_shortcode) {
                        $block_content .= '<div class="essb_message_above_like">' . stripslashes($message_above_like) . "</div>";
                    }
                    if ($message_above_like != "" && $is_shortcode && $shortcode_messages == "yes") {
                        $block_content .= '<div class="essb_message_above_share">' . stripslashes($message_above_like) . "</div>";
                    }
                    if ($this->skinned_social) {
                        $block_content .= '<div style="display: inline-block; width: 100%; padding-top: 3px !important;" class="essb_native_skinned">';
                    } else {
                        $block_content .= '<div style="display: inline-block; width: 100%; padding-top: 3px !important; overflow: hidden; padding-right: 10px;" class="essb_native">';
                    }
                }
                $network_ordered_list = $this->prepare_native_list_order();
                foreach ($network_ordered_list as $native_button) {
                    if ($native_button == "google") {
                        if ($include_plusone_button == 'true') {
                            // $block_content .= '<'.$div.' class=""
                            // style="position: relative; float:
                            // left;">'.$this->print_plusone_button($url).'</'.$div.'>';
                            if ($include_google_type == "follow") {
                                $block_content .= $this->print_plusfollow_button($include_google_follow_profile, $native_counters_g, $native_lang);
                            } else {
                                $block_content .= $this->print_plusone_button($custom_plusone_address, $native_counters_g, $native_lang);
                            }
                        }
                    }
                    if ($native_button == "twitter") {
                        if ($include_twitter == 'true') {
                            if ($include_twitter_type == 'tweet') {
                                $block_content .= $this->print_twitter_tweet_button($include_twitter_user, $native_counters_t, $native_lang, '', '', '', $used_twitter_url);
                            } else {
                                $block_content .= $this->print_twitter_follow_button($include_twitter_user, $native_counters_t, $native_lang);
                            }
                        }
                    }
                    if ($native_button == "facebook") {
                        if ($include_fb_likebutton == 'true') {
                            // $block_content .= '<'.$div.' class=""
                            // style="postion: relative; float: left;
                            // padding-top:3px
                            // !important;">'.$this->print_fb_likebutton($url).'</'.$div.'>';
                            if ($include_facebook_type == 'follow') {
                                $block_content .= $this->print_fb_followbutton($include_facebook_follow_profile, $native_counters_fb, $native_fb_width);
                            } else {
                                $block_content .= $this->print_fb_likebutton($custom_like_url, $native_counters_fb, $native_fb_width);
                            }
                        }
                    }
                    if ($native_button == "linkedin") {
                        if ($linkedin_follow == 'true') {
                            $block_content .= $this->print_linkedin_button($linkedin_follow_id, $allnative_counters);
                        }
                    }
                    if ($native_button == "youtube") {
                        if ($include_youtube == 'true') {
                            $block_content .= $this->print_youtube_button($include_youtube_channel, $native_counters_youtube);
                        }
                    }
                    if ($native_button == "pinterest") {
                        if ($include_pinfollow == 'true') {
                            $block_content .= $this->print_pinterest_follow($include_pinfollow_disp, $include_pinfollow_url, $include_pintype);
                        }
                    }
                    if ($native_button == "managewp") {
                        if ($include_managedwp == "true") {
                            $block_content .= '' . $this->print_managedwp_button($url, $text) . '';
                        }
                    }
                    if ($native_button == "vk") {
                        if ($include_vklike == 'true') {
                            $block_content .= $this->print_vklike_button($salt, $native_counters);
                            $print_vk_js = true;
                        }
                    }
                }
                // @since 1.1.1 added vklike
                if ($include_fb_likebutton == 'true' || $include_plusone_button == 'true' || $include_vklike == 'true' || $include_twitter == 'true' || $include_youtube == 'true' || $include_pinfollow == 'true' || $include_managedwp == "true" || $linkedin_follow == 'true') {
                    $block_content .= '</div>';
                }
            }
            $block_content .= '</' . $div . '>' . "\n\n";
            //$block_content .= $after_the_sps_content;
            $js_encode_url = "";
            if ($encode_url_nonlatin == "true") {
                $post_pase_permalink = get_permalink();
                $js_encode_url = ' oUrl = "' . $post_pase_permalink . '?easy-share="+(oUrl); ';
            }
            // @since 1.3.9.8 main window code is moved to js_builder class
            $this->essb_js_builder->include_share_window_script();
            $js_gatracking_callback = "";
            $js_gatracking_pinterest = "";
            if ($this->ga_tracking) {
                $js_gatracking_callback = 'essb_ga_tracking(oService, "' . $display_where . $custom_sidebar_pos . '", "' . $ga_tracking_url . '");';
                $js_gatracking_pinterest = 'essb_ga_tracking("pinterest", "' . $display_where . $custom_sidebar_pos . '", "' . $ga_tracking_url . '");';
            }
            $block_content .= '<script type="text/javascript">';
            if ($stats_active == 'true') {
                $block_content .= 'function essb_window' . $salt . '(oUrl, oService) { ' . $js_encode_url . ' essb_window_stat(oUrl, oService, ' . $self_count_post_id . '); ' . $js_gatracking_callback . ' }; ';
                $block_content .= "function essb_pinterenst" . $salt . "() {" . $js_gatracking_pinterest . "  essb_pinterenst_stat(" . $self_count_post_id . "); };";
            } else {
                //$block_content .= 'function essb_window'.$salt.'(oUrl, oService) { '.$js_encode_url.' if (oService == "twitter") { window.open( oUrl, "essb_share_window", "height=300,width=500,resizable=1,scrollbars=yes" ); }  else { window.open( oUrl, "essb_share_window", "height=500,width=800,resizable=1,scrollbars=yes" ); }  }; ';
                $block_content .= 'function essb_window' . $salt . '(oUrl, oService) { ' . $js_encode_url . ' essb_window(oUrl, oService, ' . $self_count_post_id . '); ' . $js_gatracking_callback . ' }; ';
                $block_content .= "function essb_pinterenst" . $salt . "() {" . $js_gatracking_pinterest . " essb_pinterenst(); }";
            }
            if ($is_active_more_button && !$this->more_button_code_inserted) {
                //$block_content .= $this->generate_more_button_js($more_button_func);
                //$this->footer_scripts[] = '<script type="text/javascript">'.$this->generate_more_button_js($more_button_func).'</script>';
                $this->essb_js_builder->add_js_code($this->generate_more_button_js($more_button_func), true, 'essb_jsinline_more');
            }
            $sidebar_sticky = isset($options['sidebar_sticky']) ? $options['sidebar_sticky'] : 'false';
            if ($display_where == "sidebar" && $sidebar_sticky == 'true') {
                $this->essb_js_builder->add_js_code('jQuery(document).ready(function() {
				jQuery(\'#essb_displayed_sidebar\').stickySidebar({				
				footerThreshold: 100
			});});');
            }
            // @since 1.3.1 - moved to option for admin-ajax call
            $block_content .= '</script>';
            if ($active_mail) {
                //$block_content .= $this->print_popup_mailform($message_subject, $message_body, $salt, $stats_active, $self_count_post_id);
                if ($mail_funcion != 'link') {
                    $short_url_mailer = '';
                    $mail_shorturl = isset($options['mail_shorturl']) ? $options['mail_shorturl'] : 'false';
                    if ($mail_shorturl == 'true') {
                        $short_url_mailer = $url;
                    }
                    $this->essb_js_builder->generate_popup_mailform();
                    $this->essb_js_builder->add_js_code($this->print_mailer_code($message_subject, $message_body, $salt, $stats_active, $self_count_post_id, $display_where . $custom_sidebar_pos, $short_url_mailer), true);
                }
            }
            // @since 1.3.9.1 - popup information is rendered only when popup method is really active
            if ($display_where == "popup") {
                $popup_user_message = isset($options['popup_user_message']) ? $options['popup_user_message'] : '';
                $popup_user_width = isset($options['popup_user_width']) ? $options['popup_user_width'] : '';
                $popup_user_close = isset($options['popup_user_close']) ? $options['popup_user_close'] : '';
                $popup_user_autoclose = isset($options['popup_user_autoclose']) ? $options['popup_user_autoclose'] : '';
                $popup_user_notshow_onclose = isset($options['popup_user_notshow_onclose']) ? $options['popup_user_notshow_onclose'] : 'false';
                $popup_user_manual_show = isset($options['popup_user_manual_show']) ? $options['popup_user_manual_show'] : 'false';
                $popup_user_percent = isset($options['popup_user_percent']) ? $options['popup_user_percent'] : '';
                $popup_user_percent = str_replace('%', '', $popup_user_percent);
                $popup_user_notshow_onclose_all = ESSBOptionsHelper::optionsValue($options, 'popup_user_notshow_onclose_all', 'false');
                $block_content .= '<input type="hidden" name="essb_settings_popup_title" id="essb_settings_popup_title" value="' . stripslashes($popup_window_title) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_message" id="essb_settings_popup_message" value="' . stripslashes($popup_user_message) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_width" id="essb_settings_popup_width" value="' . stripslashes($popup_user_width) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_close" id="essb_settings_popup_close" value="' . $popup_window_close . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_template" id="essb_settings_popup_template" value="' . $loaded_template . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_close" id="essb_settings_popup_user_close" value="' . stripslashes($popup_user_close) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_autoclose" id="essb_settings_popup_user_autoclose" value="' . stripslashes($popup_user_autoclose) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_notshow_onclose" id="essb_settings_popup_user_notshow_onclose" value="' . stripslashes($popup_user_notshow_onclose) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_manual_show" id="essb_settings_popup_user_manual_show" value="' . stripslashes($popup_user_manual_show) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_notshow_onclose_id" id="essb_settings_popup_user_notshow_onclose_id" value="' . $post->ID . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_percent" id="essb_settings_popup_user_percent" value="' . $popup_user_percent . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_popup_user_notshow_onclose_all" id="essb_settings_popup_user_notshow_onclose" value="' . stripslashes($popup_user_notshow_onclose_all) . '"/>';
                if ($popup_popafter != "") {
                    $block_content .= '<input type="hidden" name="essb_settings_popup_popafter" id="essb_settings_popup_popafter" value="' . $popup_popafter . '"/>';
                    $block_content .= '<div style="display: none;" id="essb_settings_popafter_counter"></div>';
                }
                if (intval($counters) == 1 && $display_where == "popup") {
                    $block_content .= '<input type="hidden" name="essb_settings_popup_counters" id="essb_settings_popup_counters" value="yes"/>';
                }
            }
            if ($display_where == "flyin") {
                $flyin_user_message = isset($options['flyin_user_message']) ? $options['flyin_user_message'] : '';
                $flyin_user_width = isset($options['flyin_user_width']) ? $options['flyin_user_width'] : '';
                $flyin_user_close = isset($options['flyin_user_close']) ? $options['flyin_user_close'] : '';
                $flyin_user_autoclose = isset($options['flyin_user_autoclose']) ? $options['flyin_user_autoclose'] : '';
                $flyin_user_notshow_onclose = isset($options['flyin_user_notshow_onclose']) ? $options['flyin_user_notshow_onclose'] : 'false';
                $flyin_user_manual_show = isset($options['flyin_user_manual_show']) ? $options['flyin_user_manual_show'] : 'false';
                $flyin_user_percent = isset($options['flyin_user_percent']) ? $options['flyin_user_percent'] : '';
                $flyin_user_percent = str_replace('%', '', $flyin_user_percent);
                $block_content .= '<input type="hidden" name="essb_settings_flyin_title" id="essb_settings_flyin_title" value="' . stripslashes($flyin_window_title) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_message" id="essb_settings_flyin_message" value="' . stripslashes($flyin_user_message) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_width" id="essb_settings_flyin_width" value="' . stripslashes($flyin_user_width) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_close" id="essb_settings_flyin_close" value="' . $flyin_window_close . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_template" id="essb_settings_flyin_template" value="' . $loaded_template . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_close" id="essb_settings_flyin_user_close" value="' . stripslashes($flyin_user_close) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_autoclose" id="essb_settings_flyin_user_autoclose" value="' . stripslashes($flyin_user_autoclose) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_notshow_onclose" id="essb_settings_flyin_user_notshow_onclose" value="' . stripslashes($flyin_user_notshow_onclose) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_manual_show" id="essb_settings_flyin_user_manual_show" value="' . stripslashes($flyin_user_manual_show) . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_notshow_onclose_id" id="essb_settings_flyin_user_notshow_onclose_id" value="' . $post->ID . '"/>';
                $block_content .= '<input type="hidden" name="essb_settings_flyin_user_percent" id="essb_settings_flyin_user_percent" value="' . $flyin_user_percent . '"/>';
                if ($flyin_popafter != "") {
                    $block_content .= '<input type="hidden" name="essb_settings_flyin_popafter" id="essb_settings_flyin_popafter" value="' . $flyin_popafter . '"/>';
                    $block_content .= '<div style="display: none;" id="essb_settings_popafter_counter"></div>';
                }
                if (intval($counters) == 1 && $display_where == "flyin") {
                    $block_content .= '<input type="hidden" name="essb_settings_flyin_counters" id="essb_settings_flyin_counters" value="yes"/>';
                }
            }
            if ($is_active_more_button && !$this->more_button_code_inserted && ($more_button_func == "2" || $more_button_func == '3')) {
                $essb_networks = $options['networks'];
                $buttons = "";
                foreach ($essb_networks as $k => $v) {
                    if ($k != 'more') {
                        if ($more_button_func == "3") {
                            if (!$v[0] == 1) {
                                continue;
                            }
                        }
                        if ($buttons != '') {
                            $buttons .= ",";
                        }
                        $buttons .= $k;
                    }
                }
                $links = do_shortcode('[easy-share buttons="' . $buttons . '" counters=0 native="no" fixedwidth="yes" fixedwidth_px="140" hide_names="show"]');
                $block_content .= '<div class="essb_displayed_more_popup" style="display:none;">' . $links . '</div>';
            }
            if ($is_active_more_button && !$this->more_button_code_inserted) {
                $this->more_button_code_inserted = true;
            }
            if ($print_vk_js && $this->vk_application_id != '') {
                //$block_content .= '<script type="text/javascript" src="//vk.com/js/api/openapi.js?105"></script><script type="text/javascript">window.onload = function () { VK.init({apiId: '.$this->vk_application_id.', onlyWidgets: true}); VK.Widgets.Like("vk_like'.$salt.'", {type: "button", height: 20});}</script>';
            }
            return $block_content;
        }
        // end of if post meta hide sharing buttons
    }