Ejemplo n.º 1
0
    function generate_essb_fans_count($style = 'flat', $cols = '2', $width = '', $border = '', $small = '')
    {
        $cache_key = 'essb_fans_' . $style . '_' . $cols . '_' . $width;
        wp_register_style('essb-fans-count-style', ESSB_PLUGIN_URL . '/assets/css/essb-fanscount.min.css', array(), $this->version . "" . $this->module_version);
        wp_enqueue_style('essb-fans-count-style');
        if (defined('ESSB_CACHE_ACTIVE')) {
            $cached_data = ESSBCache::get($cache_key);
            if ($cached_data != '') {
                return $cached_data;
            }
        }
        $layout = "";
        if ($style == "") {
            $style = "flat";
        }
        if ($style == "mutted") {
            if ($cols == "1") {
                $layout = " outer onecol";
            }
            if ($cols == "2") {
                $layout = " outer twocols";
            }
            if ($cols == "3") {
                $layout = " outer threecols";
            }
            if ($cols == "4") {
                $layout = " outer fourcols";
            }
            if ($cols == "") {
                $layout = " outer";
            }
        }
        if ($style == "colored") {
            if ($cols == "1") {
                $layout = " outer colored onecol";
            }
            if ($cols == "2") {
                $layout = " outer colored twocols";
            }
            if ($cols == "3") {
                $layout = " outer colored threecols";
            }
            if ($cols == "4") {
                $layout = " outer colored fourcols";
            }
            if ($cols == "") {
                $layout = " outer colored";
            }
        }
        if ($style == "flat") {
            if ($cols == "1") {
                $layout = " flat onecol";
            }
            if ($cols == "2") {
                $layout = " flat twocols";
            }
            if ($cols == "3") {
                $layout = " flat threecols";
            }
            if ($cols == "4") {
                $layout = " flat fourcols";
            }
            if ($cols == "") {
                $layout = " flat";
            }
        }
        if ($style == "metro") {
            if ($cols == "1") {
                $layout = " metro onecol";
            }
            if ($cols == "2") {
                $layout = " metro twocols";
            }
            if ($cols == "3") {
                $layout = " metro threecols";
            }
            if ($cols == "4") {
                $layout = " metro fourcols";
            }
            if ($cols == "") {
                $layout = " metro";
            }
        }
        if ($style == "tiny") {
            $layout .= ' tiny onecol';
        }
        if ($border == "yes" && $style != 'flat' && $style != 'metro' && $style != 'tiny') {
            $layout .= " bordered";
        }
        if ($small == "yes") {
            $layout .= " tiny2";
        }
        $this->update_all_counts();
        if (empty($width) && $style == 'tiny') {
            $width = "70";
        }
        if (!empty($width)) {
            $pos_percent = strpos($width, '%');
            if ($pos_percent !== false) {
                $width = ' style="width:' . $width . '%;"';
            } else {
                $width = ' style="width:' . $width . 'px;"';
            }
        }
        if (!empty($this->options['sort'])) {
            $network_sort_items = $this->options['sort'];
        }
        if (empty($this->options['sort']) || !is_array($network_sort_items) || $this->essb_supported_items != array_intersect($this->essb_supported_items, $network_sort_items)) {
            $network_sort_items = $this->essb_supported_items;
        }
        $widget = "";
        $widget .= '<div class="essb-fans' . $layout . '">';
        $widget .= '<ul>';
        foreach ($network_sort_items as $network) {
            switch ($network) {
                case 'facebook':
                    if (!empty($this->options['social']['facebook']['id'])) {
                        $text = __('Fans', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['facebook']['text'])) {
                            $text = $this->options['social']['facebook']['text'];
                        }
                        $widget .= '<li class="essb-fans-facebook"' . $width . '>
						<a href="http://www.facebook.com/' . $this->options['social']['facebook']['id'] . '" target="_blank">
							<i class="essb-fans-icon-facebook"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['facebook']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'twitter':
                    if (!empty($this->options['social']['twitter']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['twitter']['text'])) {
                            $text = $this->options['social']['twitter']['text'];
                        }
                        $widget .= '<li class="essb-fans-twitter"' . $width . '>
						<a href="http://twitter.com/' . $this->options['social']['twitter']['id'] . '" target="_blank">
							<i class="essb-fans-icon-twitter"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['twitter']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'google':
                    if (!empty($this->options['social']['google']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['google']['text'])) {
                            $text = $this->options['social']['google']['text'];
                        }
                        $widget .= '<li class="essb-fans-google"' . $width . '>
						<a href="http://plus.google.com/' . $this->options['social']['google']['id'] . '" target="_blank">
							<i class="essb-fans-icon-gplus"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['google']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'youtube':
                    if (!empty($this->options['social']['youtube']['id'])) {
                        $text = __('Subscribers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['youtube']['text'])) {
                            $text = $this->options['social']['youtube']['text'];
                        }
                        $type = 'user';
                        if (!empty($this->options['social']['youtube']['type']) && $this->options['social']['youtube']['type'] == 'Channel') {
                            $type = 'channel';
                        }
                        $widget .= '<li class="essb-fans-youtube"' . $width . '>
						<a href="http://youtube.com/' . $type . '/' . $this->options['social']['youtube']['id'] . '" target="_blank">
							<i class="essb-fans-icon-youtube"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['youtube']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'vimeo':
                    if (!empty($this->options['social']['vimeo']['id'])) {
                        $text = __('Subscribers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['vimeo']['text'])) {
                            $text = $this->options['social']['vimeo']['text'];
                        }
                        $widget .= '<li class="essb-fans-vimeo"' . $width . '>
						<a href="https://vimeo.com/channels/' . $this->options['social']['vimeo']['id'] . '" target="_blank">
							<i class="essb-fans-icon-vimeo"></i> 
							<span>' . $this->prettyPrintNumber($this->options['data']['vimeo']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'github':
                    if (!empty($this->options['social']['github']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['github']['text'])) {
                            $text = $this->options['social']['github']['text'];
                        }
                        $widget .= '<li class="essb-fans-github"' . $width . '>
						<a href="https://github.com/' . $this->options['social']['github']['id'] . '" target="_blank">
							<i class="essb-fans-icon-github-circled"></i> 
							<span>' . $this->prettyPrintNumber($this->options['data']['github']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'dribbble':
                    if (!empty($this->options['social']['dribbble']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['dribbble']['text'])) {
                            $text = $this->options['social']['dribbble']['text'];
                        }
                        $widget .= '<li class="essb-fans-dribbble"' . $width . '>
						<a href="http://dribbble.com/' . $this->options['social']['dribbble']['id'] . '" target="_blank">
							<i class="essb-fans-icon-dribbble"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['dribbble']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'envato':
                    if (!empty($this->options['social']['envato']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['envato']['text'])) {
                            $text = $this->options['social']['envato']['text'];
                        }
                        $widget .= '<li class="essb-fans-envato"' . $width . '>
						<a href="http://' . $this->options['social']['envato']['site'] . '.net/user/' . $this->options['social']['envato']['id'] . '" target="_blank">
							<i class="essb-fans-icon-envato"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['envato']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'soundcloud':
                    if (!empty($this->options['social']['soundcloud']['id']) && !empty($this->options['social']['soundcloud']['api'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['soundcloud']['text'])) {
                            $text = $this->options['social']['soundcloud']['text'];
                        }
                        $widget .= '
					<li class="essb-fans-soundcloud"' . $width . '>
						<a href="http://soundcloud.com/' . $this->options['social']['soundcloud']['id'] . '" target="_blank">
							<i class="essb-fans-icon-soundcloud"></i> 
							<span>' . $this->prettyPrintNumber($this->options['data']['soundcloud']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'behance':
                    if (!empty($this->options['social']['behance']['id']) && !empty($this->options['social']['behance']['api'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['behance']['text'])) {
                            $text = $this->options['social']['behance']['text'];
                        }
                        $widget .= '<li class="essb-fans-behance"' . $width . '>
						<a href="http://www.behance.net/' . $this->options['social']['behance']['id'] . '" target="_blank">
							<i class="essb-fans-icon-behance"></i> 
							<span>' . $this->prettyPrintNumber($this->options['data']['behance']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'delicious':
                    if (!empty($this->options['social']['delicious']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['delicious']['text'])) {
                            $text = $this->options['social']['delicious']['text'];
                        }
                        $widget .= '<li class="essb-fans-delicious"' . $width . '>
						<a href="http://delicious.com/' . $this->options['social']['delicious']['id'] . '" target="_blank">
							<i class="essb-fans-icon-delicious"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['delicious']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'instagram':
                    if (!empty($this->options['social']['instagram']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['instagram']['text'])) {
                            $text = $this->options['social']['instagram']['text'];
                        }
                        $id = $this->options['social']['instagram']['id'];
                        $id = explode(".", $id);
                        $widget .= '<li class="essb-fans-instagram"' . $width . '>
						<a href="http://instagram.com/' . $id[1] . '" target="_blank">
							<i class="essb-fans-icon-instagram-filled"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['instagram']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'pinterest':
                    if (!empty($this->options['social']['pinterest']['id'])) {
                        $text = __('Friends', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['pinterest']['text'])) {
                            $text = $this->options['social']['pinterest']['text'];
                        }
                        $widget .= '<li class="essb-fans-pinterest"' . $width . '>
						<a href="http://pinterest.com/' . $this->options['social']['pinterest']['id'] . '" target="_blank">
							<i class="essb-fans-icon2-pinterest"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['pinterest']) . '</span>
							<small>' . $text . '</small>
						</a>
					</li>';
                    }
                    break;
                case 'love':
                    if (!empty($this->options['social']['love']['id'])) {
                        if ($this->options['social']['love']['id'] == "Yes") {
                            $text = __('Loves', ESSB_TEXT_DOMAIN);
                            if (!empty($this->options['social']['love']['text'])) {
                                $text = $this->options['social']['love']['text'];
                            }
                            $widget .= '<li class="essb-fans-love"' . $width . '>
							<a href="#">
							<i class="essb-fans-icon2-love"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['love']) . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                        }
                    }
                    break;
                case 'vk':
                    if (!empty($this->options['social']['vk']['id'])) {
                        $text = __('Members', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['vk']['text'])) {
                            $text = $this->options['social']['vk']['text'];
                        }
                        $widget .= '<li class="essb-fans-vk"' . $width . '>
					<a href="http://vk.com/' . $this->options['social']['vk']['id'] . '" target="_blank">
							<i class="essb-fans-icon2-vk"></i>
							<span>' . $this->prettyPrintNumber($this->options['data']['vk']) . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                    }
                    break;
                case 'rss':
                    if (!empty($this->options['social']['rss']['id'])) {
                        $rss_cnt = isset($this->options['data']['rss']) ? $this->options['data']['rss'] : 0;
                        if (intval($rss_cnt) == 0) {
                            $rss_cnt = "";
                        } else {
                            $rss_cnt = $this->prettyPrintNumber($rss_cnt);
                        }
                        $text = __('Subscribers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['rss']['text'])) {
                            $text = $this->options['social']['rss']['text'];
                        }
                        $widget .= '<li class="essb-fans-rss"' . $width . '>
						<a href="' . $this->options['social']['rss']['id'] . '" target="_blank">
							
							<i class="essb-fans-icon2-rss"></i>
							<span>' . $rss_cnt . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                    }
                    break;
                case 'users':
                    if (!empty($this->options['social']['users']['id'])) {
                        $member_address = isset($this->options['social']['users']['url']) ? $this->options['social']['users']['url'] : '#';
                        if ($this->options['social']['users']['id'] == "Yes") {
                            $text = __('Users', ESSB_TEXT_DOMAIN);
                            if (!empty($this->options['social']['users']['text'])) {
                                $text = $this->options['social']['users']['text'];
                            }
                            $widget .= '<li class="essb-fans-users"' . $width . '>
							<a href="' . $member_address . '">
							<i class="essb-fans-icon2-users"></i>
							<span>' . $this->prettyPrintNumber($this->get_members_count()) . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                        }
                    }
                    break;
                case 'posts':
                    if (!empty($this->options['social']['posts']['id'])) {
                        $member_address = isset($this->options['social']['posts']['url']) ? $this->options['social']['posts']['url'] : '#';
                        if ($this->options['social']['posts']['id'] == "Yes") {
                            $text = __('Posts', ESSB_TEXT_DOMAIN);
                            if (!empty($this->options['social']['posts']['text'])) {
                                $text = $this->options['social']['posts']['text'];
                            }
                            $widget .= '<li class="essb-fans-posts"' . $width . '>
							<a href="' . $member_address . '">
							<i class="essb-fans-icon2-posts"></i>
							<span>' . $this->prettyPrintNumber($this->get_posts_count()) . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                        }
                    }
                    break;
                case 'comments':
                    if (!empty($this->options['social']['comments']['id'])) {
                        $member_address = isset($this->options['social']['comments']['url']) ? $this->options['social']['comments']['url'] : '#';
                        if ($this->options['social']['comments']['id'] == "Yes") {
                            $text = __('Comments', ESSB_TEXT_DOMAIN);
                            if (!empty($this->options['social']['comments']['text'])) {
                                $text = $this->options['social']['comments']['text'];
                            }
                            $widget .= '<li class="essb-fans-comments"' . $width . '>
									<a href="' . $member_address . '">
									<i class="essb-fans-icon2-comments"></i>
									<span>' . $this->prettyPrintNumber($this->get_comments_count()) . '</span>
									<small>' . $text . '</small>
									</a>
									</li>';
                        }
                    }
                    break;
                case 'mailchimp':
                    if (!empty($this->options['social']['mailchimp']['id'])) {
                        $text = __('Subscribers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['mailchimp']['text'])) {
                            $text = $this->options['social']['mailchimp']['text'];
                        }
                        $widget .= '<li class="essb-fans-mailchimp"' . $width . '>
						<a href="' . $this->options['social']['mailchimp']['url'] . '" target="_blank">
									<i class="essb-fans-icon-mail-alt"></i>
									<span>' . $this->prettyPrintNumber(isset($this->options['data']['mailchimp']) ? $this->options['data']['mailchimp'] : 0) . '</span>
									<small>' . $text . '</small>
									</a>
									</li>';
                    }
                    break;
                case 'linkedin':
                    if (!empty($this->options['social']['linkedin']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['linkedin']['text'])) {
                            $text = $this->options['social']['linkedin']['text'];
                        }
                        $widget .= '<li class="essb-fans-linkedin"' . $width . '>
						<a href="http://linkedin.com/company/' . $this->options['social']['linkedin']['id'] . '" target="_blank">
									<i class="essb-fans-icon2-linkedin"></i>
									<span>' . $this->prettyPrintNumber(isset($this->options['data']['linkedin']) ? $this->options['data']['linkedin'] : 0) . '</span>
									<small>' . $text . '</small>
									</a>
									</li>';
                    }
                    break;
                case 'tumblr':
                    if (!empty($this->options['social']['tumblr']['id'])) {
                        $text = __('Followers', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['tumblr']['text'])) {
                            $text = $this->options['social']['tumblr']['text'];
                        }
                        $widget .= '<li class="essb-fans-tumblr"' . $width . '>
										<a href="' . esc_url($this->options['social']['tumblr']['id']) . '" target="_blank">
										<i class="essb-fans-icon2-tumblr"></i>
										<span>' . $this->prettyPrintNumber(isset($this->options['data']['tumblr']) ? $this->options['data']['tumblr'] : 0) . '</span>
										<small>' . $text . '</small>
										</a>
										</li>';
                    }
                    break;
                case 'steam':
                    if (!empty($this->options['social']['steam']['id'])) {
                        $text = __('Members', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['steam']['text'])) {
                            $text = $this->options['social']['steam']['text'];
                        }
                        $widget .= '<li class="essb-fans-steam"' . $width . '>
										<a href="http://steamcommunity.com/groups/' . $this->options['social']['steam']['id'] . '" target="_blank">
										<i class="essb-fans-icon-steam"></i>
										<span>' . $this->prettyPrintNumber(isset($this->options['data']['steam']) ? $this->options['data']['steam'] : 0) . '</span>
										<small>' . $text . '</small>
										</a>
										</li>';
                    }
                    break;
                case 'flickr':
                    if (!empty($this->options['social']['flickr']['id'])) {
                        $text = __('Members', ESSB_TEXT_DOMAIN);
                        if (!empty($this->options['social']['steam']['text'])) {
                            $text = $this->options['social']['steam']['text'];
                        }
                        $widget .= '<li class="essb-fans-steam"' . $width . '>
							<a href="https://www.flickr.com/groups/' . $this->options['social']['flickr']['id'] . '" target="_blank">
							<i class="essb-fans-icon-flickr"></i>
							<span>' . $this->prettyPrintNumber(isset($this->options['data']['flickr']) ? $this->options['data']['flickr'] : 0) . '</span>
							<small>' . $text . '</small>
							</a>
							</li>';
                    }
                    break;
                case 'total':
                    if (!empty($this->options['social']['total']['id'])) {
                        $member_address = isset($this->options['social']['total']['url']) ? $this->options['social']['total']['url'] : '#';
                        if ($this->options['social']['total']['id'] == "Yes") {
                            $text = __('Fans Love Us', ESSB_TEXT_DOMAIN);
                            if (!empty($this->options['social']['total']['text'])) {
                                $text = $this->options['social']['total']['text'];
                            }
                            $widget .= '<li class="essb-fans-total"' . $width . '>
									<a href="' . $member_address . '">
									<i class="essb-fans-icon2-love"></i>
									<span>' . $this->prettyPrintNumber($this->update_total_count()) . '</span>
									<small>' . $text . '</small>
									</a>
									</li>';
                        }
                    }
                    break;
            }
        }
        $widget .= '</ul>';
        $widget .= '</div>';
        $widget .= $this->color_customizer_compiler();
        if (defined('ESSB_CACHE_ACTIVE')) {
            ESSBCache::put($cache_key, $widget);
        }
        return $widget;
    }
 public function outputMeta()
 {
     global $post;
     if (ESSBCoreHelper::is_module_deactivate_on('sso')) {
         return "";
     }
     $cache_key = "";
     if (isset($post)) {
         $cache_key = "essb_ogtags_" . $post->ID;
         if (defined('ESSB_CACHE_ACTIVE')) {
             $cached_data = ESSBCache::get($cache_key);
             if ($cached_data != '') {
                 echo "\r\n";
                 echo $cached_data;
                 echo "\r\n";
                 return;
             }
         }
     }
     $this->loadPostSettings();
     // @since 3.3 front page optimization tags
     $this->loadFrontpageTags();
     if ($this->ogtags_active) {
         $this->buildFacebookMeta();
     }
     if ($this->twitter_cards_active) {
         $this->buildTwitterMeta();
     }
     if ($this->google_authorship || $this->google_markup) {
         $this->buildGoogleMeta();
     }
     $output_meta = "";
     echo "\r\n";
     foreach ($this->meta as $single) {
         $output_meta .= $single . "\r\n";
     }
     echo $output_meta;
     echo "\r\n";
     if (defined('ESSB_CACHE_ACTIVE')) {
         if ($cache_key != '') {
             ESSBCache::put($cache_key, $output_meta);
         }
     }
 }
 public function outputMeta()
 {
     global $post;
     $cache_key = "";
     if (isset($post)) {
         $cache_key = "essb_ogtags_" . $post->ID;
         if (defined('ESSB_CACHE_ACTIVE')) {
             $cached_data = ESSBCache::get($cache_key);
             if ($cached_data != '') {
                 echo "\r\n";
                 echo $cached_data;
                 echo "\r\n";
                 return;
             }
         }
     }
     $this->loadPostSettings();
     if ($this->ogtags_active) {
         $this->buildFacebookMeta();
     }
     if ($this->twitter_cards_active) {
         $this->buildTwitterMeta();
     }
     if ($this->google_authorship || $this->google_markup) {
         $this->buildGoogleMeta();
     }
     $output_meta = "";
     echo "\r\n";
     foreach ($this->meta as $single) {
         $output_meta .= $single . "\r\n";
     }
     echo $output_meta;
     echo "\r\n";
     if (defined('ESSB_CACHE_ACTIVE')) {
         if ($cache_key != '') {
             ESSBCache::put($cache_key, $output_meta);
         }
     }
 }
Ejemplo n.º 4
0
 function print_share_links($content)
 {
     global $post;
     $start = microtime(true);
     $execution_trance = "";
     $options = $this->options;
     if (isset($options['display_in_types'])) {
         // write buttons only if administrator checked this type
         $is_all_lists = in_array('all_lists', $options['display_in_types']);
         $singular_options = $options['display_in_types'];
         $float_onsingle_only = ESSBOptionsHelper::optionsBoolValue($options, 'float_onsingle_only');
         $is_set_list = count($singular_options) > 0 ? true : false;
         unset($singular_options['all_lists']);
         $is_lists_authorized = (is_archive() || is_front_page() || is_search() || is_tag() || is_post_type_archive() || is_home()) && $is_all_lists ? true : false;
         $is_singular = is_singular($singular_options);
         if ($is_singular && !$is_set_list) {
             $is_singular = false;
         }
         // since 1.3.9.9 deactivate on home page
         $deactivate_homepage = isset($options['deactivate_homepage']) ? $options['deactivate_homepage'] : 'false';
         if ($deactivate_homepage == 'true') {
             if (is_home() || is_front_page()) {
                 $is_lists_authorized = false;
                 $is_singular = true;
             }
         }
         $serialized_test = serialize($singular_options);
         $excule_from = isset($options['display_exclude_from']) ? $options['display_exclude_from'] : '';
         // @since 1.3.8.2
         if ($excule_from != '') {
             $excule_from = explode(',', $excule_from);
             $excule_from = array_map('trim', $excule_from);
             if (in_array($post->ID, $excule_from, false)) {
                 $is_singular = false;
                 $is_lists_authorized = false;
             }
         }
         // AI1EC fix of exporet
         $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
         $exist_ai1ec_export = strpos($request_uri, 'ai1ec_exporter_controller');
         if ($exist_ai1ec_export !== false) {
             $is_singular = false;
             $is_lists_authorized = false;
         }
         $exist_tribe_cal = strpos($request_uri, 'ical=');
         if ($exist_tribe_cal !== false) {
             $is_singular = false;
             $is_lists_authorized = false;
         }
         //$content .= " is_singular = ".$is_singular. " | is_list = ".$is_lists_authorized . ' | types = '.$serialized_test . ' | '.$post->post_type. ' | '.$_SERVER['REQUEST_URI'];
         if ($is_singular || $is_lists_authorized) {
             $pt_settings = array();
             // @ since 1.3.9.6 - correct state before additioanl display method generation
             $this->set_options_by_bp_activate_state();
             if ($this->options_by_pt_active) {
                 $pt_settings = EasySocialShareButtons_Advanced_Display::get_options_by_pt();
             }
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_counters = isset($pt_settings['counters']) ? $pt_settings['counters'] : '';
                 if ($pt_counters != '') {
                     $options['show_counter'] = intval($pt_counters);
                 }
             }
             $post_counters = get_post_meta($post->ID, 'essb_counter', true);
             if ($post_counters != '') {
                 $options['show_counter'] = $post_counters;
             }
             $need_counters = $options['show_counter'] ? 1 : 0;
             $postfloat_percent = isset($options['postfloat_percent']) ? $options['postfloat_percent'] : '';
             $this->print_links_position = "top";
             $display_where = isset($options['display_where']) ? $options['display_where'] : '';
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_position = isset($pt_settings['position']) ? $pt_settings['position'] : '';
                 if ($pt_position != '') {
                     $display_where = $pt_position;
                 }
             }
             $post_position = get_post_meta($post->ID, 'essb_position', true);
             if ($post_position != '') {
                 $display_where = $post_position;
             }
             // @since 1.3.8.2 - mobile display render in alternative way
             if ($this->isMobile()) {
                 $display_position_mobile = isset($options['display_position_mobile']) ? $options['display_position_mobile'] : '';
                 if ($display_position_mobile != '') {
                     $display_where = $display_position_mobile;
                 }
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break1 '. ($debug_lab - $start) . ' | ';
             // @custom home position
             if (is_home() || is_front_page()) {
                 $display_position_home = ESSBOptionsHelper::optionsValue($options, 'display_position_home');
                 if ($display_position_home != '') {
                     $display_where = $display_position_home;
                 }
             }
             // @since 1.3.1 sidebar is moved to bottom render to avoid pop in excerpts
             $this->print_links_position = "top";
             $sidebar_draw_in_footer = isset($options['sidebar_draw_in_footer']) ? $options['sidebar_draw_in_footer'] : 'false';
             $sidebar_draw_in_footer = 'true';
             if ($sidebar_draw_in_footer == 'true' && $display_where == 'sidebar') {
                 $display_where = 'moved-footer';
             }
             if ($display_where == 'float' && $float_onsingle_only) {
                 if (is_archive() || is_front_page() || is_search() || is_tag() || is_post_type_archive() || is_home()) {
                     $display_where = "top";
                 }
             }
             $cache_key_post = "";
             if (isset($post)) {
                 $cache_key_post = "essb_post_" . $post->ID;
             }
             if ($display_where != 'moved-footer') {
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_' . $display_where;
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->generate_share_snippet(array(), $need_counters);
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $links = $cached_data;
                 } else {
                     $links = $this->generate_share_snippet(array(), $need_counters);
                 }
             }
             if ('sidebar' == $display_where) {
                 $content = '<div class="essb_sidebar_start_scroll"></div>' . $content;
             }
             if ('top' == $display_where || 'both' == $display_where || 'float' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where) {
                 $content = $links . $content;
             }
             if ('bottom' == $display_where || 'both' == $display_where || 'popup' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where || 'sidebar' == $display_where || 'postfloat' == $display_where || 'flyin' == $display_where) {
                 $this->print_links_position = "bottom";
                 if ('both' == $display_where || 'likeshare' == $display_where || 'sharelike' == $display_where) {
                     if (defined('ESSB_CACHE_ACTIVE')) {
                         $cache_key = $cache_key_post . '_' . $display_where . '_' . $this->print_links_position;
                         $cached_data = ESSBCache::get($cache_key);
                         if ($cached_data == '') {
                             $cached_data = $this->generate_share_snippet(array(), $need_counters);
                             ESSBCache::put($cache_key, $cached_data);
                         }
                         $links = $cached_data;
                     } else {
                         $links = $this->generate_share_snippet(array(), $need_counters);
                     }
                 }
                 $content = $content . $links;
             }
             if ('inline' == $display_where) {
                 $content = str_replace('<!--easy-share-->', $links, $content);
             }
             if ('postfloat' == $display_where && $postfloat_percent != '') {
                 $this->essb_js_builder->include_postfloat_scroll_script($postfloat_percent);
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break2 '. ($debug_lab - $start) . ' | ';
             // @since 1.3.9.1
             if ('sidebar' == $display_where) {
                 $content .= '<div class="essb_sidebar_break_scroll"></div>';
             }
             // @since 1.3.5
             $another_display_sidebar = isset($options['another_display_sidebar']) ? $options['another_display_sidebar'] : 'false';
             $another_display_sidebar_counter = isset($options['another_display_sidebar_counter']) ? $options['another_display_sidebar_counter'] : 'false';
             $another_display_popup = isset($options['another_display_popup']) ? $options['another_display_popup'] : 'false';
             $another_display_flyin = isset($options['another_display_flyin']) ? $options['another_display_flyin'] : 'false';
             $another_display_postfloat = isset($options['another_display_postfloat']) ? $options['another_display_postfloat'] : 'false';
             $another_display_postfloat_counter = isset($options['another_display_postfloat_counter']) ? $options['another_display_postfloat_counter'] : 'false';
             // @since 1.3.9.5 post type options
             if ($this->options_by_pt_active && isset($post)) {
                 $pt_another_display_sidebar = isset($pt_settings['another_display_sidebar']) ? $pt_settings['another_display_sidebar'] : '';
                 if ($pt_another_display_sidebar != '') {
                     $another_display_sidebar = intval($pt_another_display_sidebar) == 1 ? 'true' : 'false';
                 }
                 $pt_another_display_popup = isset($pt_settings['another_display_popup']) ? $pt_settings['another_display_popup'] : '';
                 if ($pt_another_display_popup != '') {
                     $aanother_display_popup = intval($pt_another_display_popup) == 1 ? 'true' : 'false';
                 }
                 $pt_another_display_postfloat = isset($pt_settings['another_display_postfloat']) ? $pt_settings['another_display_postfloat'] : '';
                 if ($pt_another_display_postfloat != '') {
                     $another_display_postfloat = intval($pt_another_display_postfloat) == 1 ? 'true' : 'false';
                 }
             }
             //print ' $another_display_sidebar_counter = '.$another_display_sidebar_counter;
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break3 '. ($debug_lab - $start) . ' | ';
             $post_another_display_sidebar = get_post_meta($post->ID, 'essb_another_display_sidebar', true);
             $post_another_display_popup = get_post_meta($post->ID, 'essb_another_display_popup', true);
             $post_another_display_postfloat = get_post_meta($post->ID, 'essb_another_display_postfloat', true);
             //print "!$post_another_display_postfloat = " . $post_another_display_postfloat;
             $another_display_deactivate_mobile = isset($options['another_display_deactivate_mobile']) ? $options['another_display_deactivate_mobile'] : 'false';
             $post_another_display_flyin = get_post_meta($post->ID, 'essb_another_display_flyin', true);
             if ($post_another_display_sidebar != '') {
                 if ($post_another_display_sidebar == "yes") {
                     $another_display_sidebar = "true";
                 } else {
                     $another_display_sidebar = "false";
                 }
             }
             if ($post_another_display_popup != '') {
                 if ($post_another_display_popup == "yes") {
                     $another_display_popup = "true";
                 } else {
                     $another_display_popup = "false";
                 }
             }
             if ($post_another_display_flyin != '') {
                 if ($post_another_display_flyin == "yes") {
                     $another_display_flyin = "true";
                 } else {
                     $another_display_flyin = "false";
                 }
             }
             if ($post_another_display_postfloat != '') {
                 if ($post_another_display_postfloat == "yes") {
                     $another_display_postfloat = "true";
                 } else {
                     $another_display_postfloat = "false";
                 }
             }
             if ($sidebar_draw_in_footer == "true") {
                 $another_display_sidebar = "false";
             }
             // 				/$debug_lab = microtime(true);
             //$execution_trance .= ' break4 '. ($debug_lab - $start) . ' | ';
             if ($this->isMobile() && $another_display_deactivate_mobile == "true") {
                 $another_display_popup = "false";
                 $another_display_sidebar = "false";
                 // fixed 1.3.9.9
                 $another_display_postfloat = "false";
                 $another_display_flyin = "false";
             }
             if ($another_display_sidebar == "true") {
                 $content = $content . $this->render_sidebar_code($another_display_sidebar_counter);
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break5 '. ($debug_lab - $start) . ' | ';
             if ($another_display_popup == "true") {
                 $popup_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_popup';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_popup_code();
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $popup_content_code = $cached_data;
                 } else {
                     $popup_content_code = $this->render_popup_code();
                 }
                 $content = $content . $popup_content_code;
             }
             if ($another_display_flyin == "true") {
                 $flyin_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_flyin';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_flyin_code();
                         ESSBCache::put($cache_key, $cached_data);
                     } else {
                         $this->register_flyin_assets();
                     }
                     $flyin_content_code = $cached_data;
                 } else {
                     $flyin_content_code = $this->render_flyin_code();
                 }
                 $content = $content . $flyin_content_code;
             }
             //$debug_lab = microtime(true);
             //$execution_trance .= ' break6 '. ($debug_lab - $start) . ' | ';
             if ($another_display_postfloat == "true") {
                 $post_float_content_code = "";
                 if (defined('ESSB_CACHE_ACTIVE')) {
                     $cache_key = $cache_key_post . '_another_postfloat';
                     $cached_data = ESSBCache::get($cache_key);
                     if ($cached_data == '') {
                         $cached_data = $this->render_postfloat_code($another_display_postfloat_counter);
                         ESSBCache::put($cache_key, $cached_data);
                     }
                     $post_float_content_code = $cached_data;
                 } else {
                     $post_float_content_code = $this->render_postfloat_code($another_display_postfloat_counter);
                 }
                 if ($postfloat_percent != '') {
                     $this->essb_js_builder->include_postfloat_scroll_script($postfloat_percent);
                 }
                 //print "activate display as post float";
                 $content = $content . $post_float_content_code;
             }
             $end = microtime(true);
             if ($this->mycred_active) {
                 //$content .= '<div >'.do_shortcode('[mycred_link href="http://google.com" amount="1"][/mycred_link]').'</div>';
             }
             return $content;
             //return "Execution: ".($end-$start). ' secs |'. $execution_trance.$content;
         } else {
             return $content;
         }
     } else {
         return $content;
     }
 }