function sfsi_plus_getCounts()
{
    $socialObj = new sfsi_plus_SocialHelper();
    $sfsi_plus_section4_options = unserialize(get_option('sfsi_plus_section4_options', false));
    $sfsi_plus_section2_options = unserialize(get_option('sfsi_plus_section2_options', false));
    $scounts = array('rss_count' => '', 'email_count' => '', 'fb_count' => '', 'twitter_count' => '', 'google_count' => '', 'linkedIn_count' => '', 'youtube_count' => '', 'pin_count' => '', 'share_count' => '');
    /* get rss count */
    if (!empty($sfsi_plus_section4_options['sfsi_plus_rss_manualCounts'])) {
        $scounts['rss_count'] = $sfsi_plus_section4_options['sfsi_plus_rss_manualCounts'];
    }
    /* get email count */
    if ($sfsi_plus_section4_options['sfsi_plus_email_countsFrom'] == "source") {
        $feed_id = get_option('sfsi_plus_feed_id', false);
        $feed_data = $socialObj->SFSI_getFeedSubscriber($feed_id);
        $scounts['email_count'] = $socialObj->format_num($feed_data);
        if (empty($scounts['email_count'])) {
            $scounts['email_count'] = (string) "0";
        }
    } else {
        $scounts['email_count'] = $sfsi_plus_section4_options['sfsi_plus_email_manualCounts'];
    }
    /* get fb count */
    if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "likes") {
        $url = home_url();
        $fb_data = $socialObj->sfsi_get_fb($url);
        $scounts['fb_count'] = $socialObj->format_num($fb_data['like_count']);
    } else {
        if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "followers") {
            $url = home_url();
            $fb_data = $socialObj->sfsi_get_fb($url);
            $scounts['fb_count'] = format_num($fb_data['share_count']);
            if (empty($scounts['fb_count'])) {
                $scounts['fb_count'] = (string) "0";
            }
        } else {
            if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "mypage") {
                $url = $sfsi_plus_section4_options['sfsi_plus_facebook_mypageCounts'];
                $fb_data = $socialObj->sfsi_get_fb_pagelike($url);
                $scounts['fb_count'] = $fb_data;
            } else {
                $scounts['fb_count'] = $sfsi_plus_section4_options['sfsi_plus_facebook_manualCounts'];
            }
        }
    }
    /* get twitter counts */
    if ($sfsi_plus_section4_options['sfsi_plus_twitter_countsFrom'] == "source") {
        $twitter_user = $sfsi_plus_section2_options['sfsi_plus_twitter_followUserName'];
        $tw_settings = array('sfsiplus_tw_consumer_key' => $sfsi_plus_section4_options['sfsiplus_tw_consumer_key'], 'sfsiplus_tw_consumer_secret' => $sfsi_plus_section4_options['sfsiplus_tw_consumer_secret'], 'sfsiplus_tw_oauth_access_token' => $sfsi_plus_section4_options['sfsiplus_tw_oauth_access_token'], 'sfsiplus_tw_oauth_access_token_secret' => $sfsi_plus_section4_options['sfsiplus_tw_oauth_access_token_secret']);
        $followers = $socialObj->sfsi_get_tweets($twitter_user, $tw_settings);
        $scounts['twitter_count'] = $socialObj->format_num($followers);
    } else {
        $scounts['twitter_count'] = $sfsi_plus_section4_options['sfsi_plus_twitter_manualCounts'];
    }
    /* get google+ counts */
    if ($sfsi_plus_section4_options['sfsi_plus_google_countsFrom'] == "follower") {
        $url = $sfsi_plus_section2_options['sfsi_plus_google_pageURL'];
        $api_key = $sfsi_plus_section4_options['sfsi_plus_google_api_key'];
        $followers = $socialObj->sfsi_get_google($url, $api_key);
        if (!is_int($followers)) {
            $followers = 0;
        }
        $counts = $followers;
        $scounts['google_count'] = $socialObj->format_num($followers);
    } else {
        if ($sfsi_plus_section4_options['sfsi_plus_google_countsFrom'] == "likes") {
            $url = home_url();
            $api_key = $sfsi_plus_section4_options['sfsi_plus_google_api_key'];
            $followers = $socialObj->sfsi_get_google($url, $api_key);
            if (!is_int($followers)) {
                $followers = 0;
            }
            $counts = $followers;
            $scounts['google_count'] = $socialObj->format_num($followers);
        } else {
            $scounts['google_count'] = $sfsi_plus_section4_options['sfsi_plus_google_manualCounts'];
        }
    }
    /* get linkedIn counts */
    if ($sfsi_plus_section4_options['sfsi_plus_linkedIn_countsFrom'] == "follower") {
        $linkedIn_compay = $sfsi_plus_section2_options['sfsi_plus_linkedin_followCompany'];
        $linkedIn_compay = $sfsi_plus_section4_options['sfsi_plus_ln_company'];
        $ln_settings = array('sfsi_plus_ln_api_key' => $sfsi_plus_section4_options['sfsi_plus_ln_api_key'], 'sfsi_plus_ln_secret_key' => $sfsi_plus_section4_options['sfsi_plus_ln_secret_key'], 'sfsi_plus_ln_oAuth_user_token' => $sfsi_plus_section4_options['sfsi_plus_ln_oAuth_user_token']);
        $followers = $socialObj->sfsi_getlinkedin_follower($linkedIn_compay, $ln_settings);
        $scounts['linkedIn_count'] = $socialObj->format_num($followers);
    } else {
        $scounts['linkedIn_count'] = $sfsi_plus_section4_options['sfsi_plus_linkedIn_manualCounts'];
    }
    /* get youtube counts */
    if ($sfsi_plus_section4_options['sfsi_plus_youtube_countsFrom'] == "subscriber") {
        if (isset($sfsi_plus_section4_options['sfsi_plus_youtube_user'])) {
            $youtube_user = $sfsi_plus_section4_options['sfsi_plus_youtube_user'];
            $followers = $socialObj->sfsi_get_youtube($youtube_user);
            $scounts['youtube_count'] = $socialObj->format_num($followers);
        } else {
            $scounts['youtube_count'] = 01;
        }
    } else {
        $scounts['youtube_count'] = $sfsi_plus_section4_options['sfsi_plus_youtube_manualCounts'];
    }
    /* get Pinterest counts */
    if ($sfsi_plus_section4_options['sfsi_plus_pinterest_countsFrom'] == "pins") {
        $url = home_url();
        $pins = $socialObj->sfsi_get_pinterest($url);
        $scounts['pin_count'] = $socialObj->format_num($pins);
    } else {
        $scounts['pin_count'] = $sfsi_plus_section4_options['sfsi_plus_pinterest_manualCounts'];
    }
    /* get addthis share counts */
    if (isset($sfsi_plus_section4_options['sfsi_plus_shares_countsFrom']) && $sfsi_plus_section4_options['sfsi_plus_shares_countsFrom'] == "shares" && isset($sfsi_plus_section4_options['sfsi_share_countsDisplay']) && $sfsi_plus_section4_options['sfsi_share_countsDisplay'] == "yes") {
        $shares = $socialObj->sfsi_get_atthis();
        $scounts['share_count'] = $socialObj->format_num($shares);
    } else {
        $scounts['share_count'] = $sfsi_plus_section4_options['sfsi_plus_shares_manualCounts'];
    }
    /* get instagram count */
    if ($sfsi_plus_section4_options['sfsi_plus_instagram_countsFrom'] == "followers") {
        $iuser_name = $sfsi_plus_section4_options['sfsi_plus_instagram_User'];
        $counts = $socialObj->sfsi_get_instagramFollowers($iuser_name);
        if (empty($counts)) {
            $scounts['instagram_count'] = (string) "0";
        } else {
            $scounts['instagram_count'] = $counts;
        }
    } else {
        $scounts['instagram_count'] = $sfsi_plus_section4_options['sfsi_plus_instagram_manualCounts'];
    }
    /* get instagram count */
    if (isset($sfsi_plus_section4_options['sfsi_plus_houzz_countsFrom']) && $sfsi_plus_section4_options['sfsi_plus_houzz_countsFrom'] == "manual") {
        if (isset($sfsi_plus_section4_options['sfsi_plus_houzz_manualCounts'])) {
            $scounts['houzz_count'] = $sfsi_plus_section4_options['sfsi_plus_houzz_manualCounts'];
        } else {
            $scounts['houzz_count'] = '20';
        }
    } elseif (!isset($sfsi_plus_section4_options['sfsi_plus_houzz_countsFrom'])) {
        $scounts['houzz_count'] = '20';
    }
    return $scounts;
    exit;
}
Ejemplo n.º 2
0
function sfsi_plus_postsprepairIcons($icon_name, $is_front = 0)
{
    global $wpdb;
    global $socialObj;
    $mouse_hover_effect = '';
    $active_theme = 'official';
    $sfsi_plus_shuffle_Firstload = 'no';
    $sfsi_plus_display_counts = "no";
    $icon = '';
    $url = '';
    $alt_text = '';
    $new_window = '';
    $class = '';
    /* access  all saved settings in admin */
    $sfsi_plus_section1_options = unserialize(get_option('sfsi_plus_section1_options', false));
    $sfsi_plus_section2_options = unserialize(get_option('sfsi_plus_section2_options', false));
    $sfsi_plus_section3_options = unserialize(get_option('sfsi_plus_section3_options', false));
    $sfsi_plus_section4_options = unserialize(get_option('sfsi_plus_section4_options', false));
    $sfsi_plus_section5_options = unserialize(get_option('sfsi_plus_section5_options', false));
    $sfsi_plus_section6_options = unserialize(get_option('sfsi_plus_section6_options', false));
    $sfsi_plus_section7_options = unserialize(get_option('sfsi_plus_section7_options', false));
    $sfsi_plus_section8_options = unserialize(get_option('sfsi_plus_section8_options', false));
    /* get active theme */
    $border_radius = '';
    $active_theme = $sfsi_plus_section3_options['sfsi_plus_actvite_theme'];
    /* shuffle effect */
    if ($sfsi_plus_section3_options['sfsi_plus_shuffle_icons'] == 'yes') {
        $sfsi_plus_shuffle_Firstload = $sfsi_plus_section3_options["sfsi_plus_shuffle_Firstload"];
        if ($sfsi_plus_section3_options["sfsi_plus_shuffle_interval"] == "yes") {
            $sfsi_plus_shuffle_interval = $sfsi_plus_section3_options["sfsi_plus_shuffle_intervalTime"];
        }
    }
    /* define the main url for icon access */
    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/" . $active_theme . "/";
    $visit_iconsUrl = SFSI_PLUS_PLUGURL . "images/visit_icons/";
    $hoverSHow = 0;
    /* check is icon is a custom icon or default icon */
    if (is_numeric($icon_name)) {
        $icon_n = $icon_name;
        $icon_name = "custom";
    }
    $counts = '';
    $twit_tolCls = "";
    $twt_margin = "";
    $icons_space = $sfsi_plus_section5_options['sfsi_plus_icons_spacing'];
    $padding_top = '';
    $scheme = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https" : "http";
    $current_url = $scheme . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    $url = "#";
    $cmcls = '';
    $toolClass = '';
    switch ($icon_name) {
        case "rss":
            $socialObj = new sfsi_plus_SocialHelper();
            /* global object to access 3rd party icon's actions */
            $url = $sfsi_plus_section2_options['sfsi_plus_rss_url'] ? $sfsi_plus_section2_options['sfsi_plus_rss_url'] : 'javascript:void(0);';
            $toolClass = "rss_tool_bdr";
            $hoverdiv = '';
            $arsfsiplus_row_class = "bot_rss_arow";
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_rss_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                //$counts=$socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_rss_manualCounts']);
            }
            if (!empty($sfsi_plus_section5_options['sfsi_plus_rss_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_rss_MouseOverText'];
            } else {
                $alt_text = 'RSS';
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_rss_skin")) {
                    $icon = get_option("plus_rss_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_rss.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_rss.png";
            }
            break;
        case "email":
            $socialObj = new sfsi_plus_SocialHelper();
            /* global object to access 3rd party icon's actions */
            $hoverdiv = '';
            $sfsi_plus_section2_options['sfsi_plus_email_url'];
            $url = isset($sfsi_plus_section2_options['sfsi_plus_email_url']) ? $sfsi_plus_section2_options['sfsi_plus_email_url'] : 'javascript:void(0);';
            $toolClass = "email_tool_bdr";
            $arsfsiplus_row_class = "bot_eamil_arow";
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_email_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_email_countsFrom'] == "manual") {
                    //$counts=$socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_email_manualCounts']);
                } else {
                    //$counts= $socialObj->SFSI_getFeedSubscriber(get_option('sfsi_plus_feed_id',false));
                }
            }
            if (!empty($sfsi_plus_section5_options['sfsi_plus_email_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_email_MouseOverText'];
            } else {
                $alt_text = 'EMAIL';
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_email_skin")) {
                    $icon = get_option("plus_email_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    //$icon=($sfsi_plus_section2_options['sfsi_plus_rss_icons']=="sfsi") ? $icons_baseUrl.$active_theme."_sf.png" : $icons_baseUrl.$active_theme."_email.png";
                    if ($sfsi_plus_section2_options['sfsi_plus_rss_icons'] == "sfsi") {
                        $icon = $icons_baseUrl . $active_theme . "_sf.png";
                    } elseif ($sfsi_plus_section2_options['sfsi_plus_rss_icons'] == "email") {
                        $icon = $icons_baseUrl . $active_theme . "_email.png";
                    } else {
                        $icon = $icons_baseUrl . $active_theme . "_subscribe.png";
                    }
                }
            } else {
                //$icon=($sfsi_plus_section2_options['sfsi_plus_rss_icons']=="sfsi") ? $icons_baseUrl.$active_theme."_sf.png" : $icons_baseUrl.$active_theme."_email.png";
                if ($sfsi_plus_section2_options['sfsi_plus_rss_icons'] == "sfsi") {
                    $icon = $icons_baseUrl . $active_theme . "_sf.png";
                } elseif ($sfsi_plus_section2_options['sfsi_plus_rss_icons'] == "email") {
                    $icon = $icons_baseUrl . $active_theme . "_email.png";
                } else {
                    $icon = $icons_baseUrl . $active_theme . "_subscribe.png";
                }
            }
            break;
        case "facebook":
            $socialObj = new sfsi_plus_SocialHelper();
            $width = 62;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            $toolClass = "fb_tool_bdr";
            $arsfsiplus_row_class = "bot_fb_arow";
            //for post sharing
            if ($sfsi_plus_section8_options["sfsi_plus_display_button_type"] == "normal_button" && $sfsi_plus_section8_options["sfsi_plus_show_item_onposts"] == "yes") {
                if ($sfsi_plus_section8_options["sfsi_plus_display_before_posts"] == "yes" || $sfsi_plus_section8_options["sfsi_plus_display_after_posts"] == "yes" || $sfsi_plus_section8_options["sfsi_plus_display_before_blogposts"] == "yes" || $sfsi_plus_section8_options["sfsi_plus_display_after_blogposts"] == "yes") {
                    $id = get_the_ID();
                    $current_url = get_permalink($id);
                }
            }
            //for post sharing
            /* check for the over section */
            if (!empty($sfsi_plus_section5_options['sfsi_plus_facebook_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_facebook_MouseOverText'];
            } else {
                $alt_text = "FACEBOOK";
            }
            $visit_icon = $visit_iconsUrl . "facebook.png";
            $url = $sfsi_plus_section2_options['sfsi_plus_facebookPage_url'] ? $sfsi_plus_section2_options['sfsi_plus_facebookPage_url'] : 'javascript:void(0);';
            if ($sfsi_plus_section2_options['sfsi_plus_facebookLike_option'] == "yes" || $sfsi_plus_section2_options['sfsi_plus_facebookShare_option'] == "yes") {
                $url = $sfsi_plus_section2_options['sfsi_plus_facebookPage_url'] ? $sfsi_plus_section2_options['sfsi_plus_facebookPage_url'] : 'javascript:void(0);';
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_plus_section2_options['sfsi_plus_facebookPage_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_plus_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_facebookLike_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_plus_FBlike($current_url) . "</div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_facebookShare_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon3'>" . $socialObj->sfsiFB_Share($current_url) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "manual") {
                    //$counts=$socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_facebook_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "likes") {
                        $fb_data = $socialObj->sfsi_get_fb($current_url);
                        //$counts=$socialObj->format_num($fb_data['like_count']);
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    } else {
                        if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "followers") {
                            $fb_data = $socialObj->sfsi_get_fb($current_url);
                            //$counts=$socialObj->format_num($fb_data['share_count']);
                        } else {
                            if ($sfsi_plus_section4_options['sfsi_plus_facebook_countsFrom'] == "mypage") {
                                $current_url = $sfsi_plus_section4_options['sfsi_plus_facebook_mypageCounts'];
                                $fb_data = $socialObj->sfsi_get_fb_pagelike($current_url);
                                //$counts=$socialObj->format_num($fb_data);
                            }
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_facebook_skin")) {
                    $icon = get_option("plus_facebook_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_facebook.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_facebook.png";
            }
            break;
        case "google":
            $toolClass = "gpls_tool_bdr";
            $arsfsiplus_row_class = "bot_gpls_arow";
            $socialObj = new sfsi_plus_SocialHelper();
            $width = 76;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            if (!empty($sfsi_plus_section5_options['sfsi_plus_google_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_google_MouseOverText'];
            } else {
                $alt_text = "GOOGLE";
            }
            $visit_icon = $visit_iconsUrl . "google.png";
            $url = $sfsi_plus_section2_options['sfsi_plus_google_pageURL'] ? $sfsi_plus_section2_options['sfsi_plus_google_pageURL'] : 'javascript:void(0);';
            /* check for icons to display */
            if ($sfsi_plus_section2_options['sfsi_plus_googleLike_option'] == "yes" || $sfsi_plus_section2_options['sfsi_plus_googleShare_option'] == "yes") {
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_plus_section2_options['sfsi_plus_google_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_plus_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_googleLike_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_Googlelike($current_url) . "</div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_googleShare_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon3'>" . $socialObj->sfsi_GoogleShare($current_url) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_google_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_google_countsFrom'] == "manual") {
                    //$counts = $socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_google_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_google_countsFrom'] == "likes") {
                        $api_key = $sfsi_plus_section4_options['sfsi_plus_google_api_key'];
                        $followers = $socialObj->sfsi_getPlus1($current_url);
                        //$counts=$socialObj->format_num($followers);
                        if (empty($counts)) {
                            //$counts = (string) "0";
                        }
                    } else {
                        if ($sfsi_plus_section4_options['sfsi_plus_google_countsFrom'] == "follower") {
                            $api_key = $sfsi_plus_section4_options['sfsi_plus_google_api_key'];
                            $followers = $socialObj->sfsi_get_google($url, $api_key);
                            //$counts=$followers;
                            if (empty($counts)) {
                                //$counts = (string) "0";
                            }
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_google_skin")) {
                    $icon = get_option("plus_google_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_google.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_google.png";
            }
            break;
        case "twitter":
            $toolClass = "twt_tool_bdr";
            $arsfsiplus_row_class = "bot_twt_arow";
            $socialObj = new sfsi_plus_SocialHelper();
            $url = $sfsi_plus_section2_options['sfsi_plus_twitter_pageURL'] ? $sfsi_plus_section2_options['sfsi_plus_twitter_pageURL'] : 'javascript:void(0);';
            $twitter_user = $sfsi_plus_section2_options['sfsi_plus_twitter_followUserName'];
            $twitter_text = $sfsi_plus_section2_options['sfsi_plus_twitter_aboutPageText'];
            $visit_icon = $visit_iconsUrl . "twitter.png";
            $width = 59;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            /* check for icons to display */
            $hoverdiv = '';
            if ($sfsi_plus_section2_options['sfsi_plus_twitter_followme'] == "yes" || $sfsi_plus_section2_options['sfsi_plus_twitter_aboutPage'] == "yes") {
                $hoverSHow = 1;
                //Visit twitter page {Monad}
                if ($sfsi_plus_section2_options['sfsi_plus_twitter_page'] == "yes") {
                    $hoverdiv .= "<div  class='cstmicon1'><a href='" . $url . "' " . sfsi_plus_checkNewWindow($url) . "><img alt='Visit Us' title='Visit Us' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_twitter_followme'] == "yes" && !empty($twitter_user)) {
                    $hoverdiv .= "<div  class='icon1'>" . $socialObj->sfsi_twitterFollow($twitter_user) . "</div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_twitter_aboutPage'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_twitterShare($current_url, $twitter_text) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_twitter_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_twitter_countsFrom'] == "manual") {
                    //$counts=$socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_twitter_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_twitter_countsFrom'] == "source") {
                        $tw_settings = array('sfsiplus_tw_consumer_key' => $sfsi_plus_section4_options['sfsiplus_tw_consumer_key'], 'sfsiplus_tw_consumer_secret' => $sfsi_plus_section4_options['sfsiplus_tw_consumer_secret'], 'sfsiplus_tw_oauth_access_token' => $sfsi_plus_section4_options['sfsiplus_tw_oauth_access_token'], 'sfsiplus_tw_oauth_access_token_secret' => $sfsi_plus_section4_options['sfsiplus_tw_oauth_access_token_secret']);
                        $followers = $socialObj->sfsi_get_tweets($twitter_user, $tw_settings);
                        //$counts=$socialObj->format_num($followers);
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    }
                }
            }
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_twitter_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_twitter_MouseOverText'];
            } else {
                $alt_text = "TWITTER";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_twitter_skin")) {
                    $icon = get_option("plus_twitter_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_twitter.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_twitter.png";
            }
            break;
        case "share":
            $socialObj = new sfsi_plus_SocialHelper();
            $url = "http://www.addthis.com/bookmark.php?v=250";
            $class = "addthis_button";
            /*fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_shares_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_shares_countsFrom'] == "manual") {
                    //$counts = $socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_shares_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_shares_countsFrom'] == "shares") {
                        $shares = $socialObj->sfsi_get_atthis();
                        //$counts=$socialObj->format_num($shares);
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    }
                }
            }
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_share_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_share_MouseOverText'];
            } else {
                $alt_text = "SHARE";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_share_skin")) {
                    $icon = get_option("plus_share_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_share.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_share.png";
            }
            break;
        case "youtube":
            $socialObj = new sfsi_plus_SocialHelper();
            $toolClass = "utube_tool_bdr";
            $arsfsiplus_row_class = "bot_utube_arow";
            $socialObj = new sfsi_plus_SocialHelper();
            $width = 96;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            $youtube_user = isset($sfsi_plus_section4_options['sfsi_plus_youtube_user']) && !empty($sfsi_plus_section4_options['sfsi_plus_youtube_user']) ? $sfsi_plus_section4_options['sfsi_plus_youtube_user'] : '******';
            $visit_icon = $visit_iconsUrl . "youtube.png";
            $url = $sfsi_plus_section2_options['sfsi_plus_youtube_pageUrl'] ? $sfsi_plus_section2_options['sfsi_plus_youtube_pageUrl'] : 'javascript:void(0);';
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_youtube_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_youtube_MouseOverText'];
            } else {
                $alt_text = "YOUTUBE";
            }
            /* check for icons to display */
            $hoverdiv = "";
            if ($sfsi_plus_section2_options['sfsi_plus_youtube_follow'] == "yes") {
                $hoverSHow = 1;
                if ($sfsi_plus_section2_options['sfsi_plus_youtube_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "'  " . sfsi_plus_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_youtube_follow'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_YouTubeSub($youtube_user) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_youtube_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_youtube_countsFrom'] == "manual") {
                    //$counts=$socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_youtube_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_youtube_countsFrom'] == "subscriber") {
                        $followers = $socialObj->sfsi_get_youtube($youtube_user);
                        //$counts=$socialObj->format_num($followers);
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_youtube_skin")) {
                    $icon = get_option("plus_youtube_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_youtube.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_youtube.png";
            }
            break;
        case "pinterest":
            $width = 73;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            $socialObj = new sfsi_plus_SocialHelper();
            $toolClass = "printst_tool_bdr";
            $arsfsiplus_row_class = "bot_pintst_arow";
            $pinterest_user = $sfsi_plus_section4_options['sfsi_plus_pinterest_user'];
            $pinterest_board = $sfsi_plus_section4_options['sfsi_plus_pinterest_board'];
            $visit_icon = $visit_iconsUrl . "pinterest.png";
            $url = isset($sfsi_plus_section2_options['sfsi_plus_pinterest_pageUrl']) ? $sfsi_plus_section2_options['sfsi_plus_pinterest_pageUrl'] : 'javascript:void(0);';
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_pinterest_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_pinterest_MouseOverText'];
            } else {
                $alt_text = "PINTEREST";
            }
            /* check for icons to display */
            $hoverdiv = "";
            if ($sfsi_plus_section2_options['sfsi_plus_pinterest_pingBlog'] == "yes") {
                $hoverSHow = 1;
                if ($sfsi_plus_section2_options['sfsi_plus_pinterest_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_plus_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_pinterest_pingBlog'] == "yes") {
                    if ($sfsi_plus_section2_options['sfsi_plus_pinterest_pingBlog'] == "yes") {
                        $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_PinIt($current_url) . "</div>";
                    }
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_pinterest_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_pinterest_countsFrom'] == "manual") {
                    //$counts = $socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_pinterest_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_pinterest_countsFrom'] == "pins") {
                        $pins = $socialObj->sfsi_get_pinterest($current_url);
                        //$counts=$pins;
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_pintrest_skin")) {
                    $icon = get_option("plus_pintrest_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_pinterest.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_pinterest.png";
            }
            break;
        case "instagram":
            $toolClass = "instagram_tool_bdr";
            $arsfsiplus_row_class = "bot_pintst_arow";
            $socialObj = new sfsi_plus_SocialHelper();
            $url = isset($sfsi_plus_section2_options['sfsi_plus_instagram_pageUrl']) ? $sfsi_plus_section2_options['sfsi_plus_instagram_pageUrl'] : 'javascript:void(0);';
            $instagram_user_name = $sfsi_plus_section4_options['sfsi_plus_instagram_User'];
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_instagram_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_instagram_MouseOverText'];
            } else {
                $alt_text = "INSTAGRAM";
            }
            $hoverdiv = "";
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_instagram_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_instagram_countsFrom'] == "manual") {
                    //$counts = $socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_instagram_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_instagram_countsFrom'] == "followers") {
                        //$counts=$socialObj->sfsi_get_instagramFollowers($instagram_user_name);
                        if (empty($counts)) {
                            //$counts=(string) "0";
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_instagram_skin")) {
                    $icon = get_option("plus_instagram_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_instagram.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_instagram.png";
            }
            break;
        case "linkedin":
            $width = 66;
            $socialObj = new sfsi_plus_SocialHelper();
            $toolClass = "linkedin_tool_bdr";
            $arsfsiplus_row_class = "bot_linkedin_arow";
            $linkedIn_compayId = $sfsi_plus_section2_options['sfsi_plus_linkedin_followCompany'];
            $linkedIn_compay = $sfsi_plus_section2_options['sfsi_plus_linkedin_followCompany'];
            $linkedIn_ProductId = $sfsi_plus_section2_options['sfsi_plus_linkedin_recommendProductId'];
            $visit_icon = $visit_iconsUrl . "linkedIn.png";
            /*check for icons to display */
            $url = $sfsi_plus_section2_options['sfsi_plus_linkedin_pageURL'] ? $sfsi_plus_section2_options['sfsi_plus_linkedin_pageURL'] : 'javascript:void(0);';
            if ($sfsi_plus_section2_options['sfsi_plus_linkedin_follow'] == "yes" || $sfsi_plus_section2_options['sfsi_plus_linkedin_SharePage'] == "yes" || $sfsi_plus_section2_options['sfsi_plus_linkedin_recommendBusines'] == "yes") {
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_plus_section2_options['sfsi_plus_linkedin_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon4'><a href='" . $url . "' " . sfsi_plus_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_linkedin_follow'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'>" . $socialObj->sfsi_LinkedInFollow($linkedIn_compayId) . "</div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_linkedin_SharePage'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_LinkedInShare() . "</div>";
                }
                if ($sfsi_plus_section2_options['sfsi_plus_linkedin_recommendBusines'] == "yes") {
                    $hoverdiv .= "<div  class='icon3'>" . $socialObj->sfsi_LinkedInRecommend($linkedIn_compay, $linkedIn_ProductId) . "</div>";
                    $width = 99;
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_plus_section4_options['sfsi_plus_linkedIn_countsDisplay'] == "yes" && $sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
                if ($sfsi_plus_section4_options['sfsi_plus_linkedIn_countsFrom'] == "manual") {
                    //$counts = $socialObj->format_num($sfsi_plus_section4_options['sfsi_plus_linkedIn_manualCounts']);
                } else {
                    if ($sfsi_plus_section4_options['sfsi_plus_linkedIn_countsFrom'] == "follower") {
                        $linkedIn_compay = $sfsi_plus_section4_options['sfsi_plus_ln_company'];
                        $ln_settings = array('sfsi_plus_ln_api_key' => $sfsi_plus_section4_options['sfsi_plus_ln_api_key'], 'sfsi_plus_ln_secret_key' => $sfsi_plus_section4_options['sfsi_plus_ln_secret_key'], 'sfsi_plus_ln_oAuth_user_token' => $sfsi_plus_section4_options['sfsi_plus_ln_oAuth_user_token']);
                        $followers = $socialObj->sfsi_getlinkedin_follower($linkedIn_compay, $ln_settings);
                        (int) $followers;
                        //$counts=$socialObj->format_num($followers);
                        if (empty($counts)) {
                            //$counts = (string) "0";
                        }
                    }
                }
            }
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            //Giving alternative text to image
            if (!empty($sfsi_plus_section5_options['sfsi_plus_linkedIn_MouseOverText'])) {
                $alt_text = $sfsi_plus_section5_options['sfsi_plus_linkedIn_MouseOverText'];
            } else {
                $alt_text = "LINKEDIN";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("plus_linkedin_skin")) {
                    $icon = get_option("plus_linkedin_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUS_PLUGURL . "images/icons_theme/default/";
                    $icon = $icons_baseUrl . $active_theme . "_linkedin.png";
                }
            } else {
                $icon = $icons_baseUrl . $active_theme . "_linkedin.png";
            }
            break;
        default:
            $border_radius = "";
            //$border_radius =" border-radius:48%;";
            $cmcls = "cmcls";
            $padding_top = "";
            if ($active_theme == "badge") {
                //$border_radius="border-radius: 18%;";
            }
            if ($active_theme == "cute") {
                //$border_radius="border-radius: 38%;";
            }
            $custom_icon_urls = unserialize($sfsi_plus_section2_options['sfsi_plus_CustomIcon_links']);
            $url = isset($custom_icon_urls[$icon_n]) && !empty($custom_icon_urls[$icon_n]) ? $custom_icon_urls[$icon_n] : 'javascript:void(0);';
            $toolClass = "custom_lkn";
            $arsfsiplus_row_class = "";
            $custom_icons_hoverTxt = unserialize($sfsi_plus_section5_options['sfsi_plus_custom_MouseOverTexts']);
            $icons = unserialize($sfsi_plus_section1_options['sfsi_custom_files']);
            $icon = $icons[$icon_n];
            //Giving alternative text to image
            if (!empty($custom_icons_hoverTxt[$icon_n])) {
                $alt_text = $custom_icons_hoverTxt[$icon_n];
            } else {
                $alt_text = "SOCIALICON";
            }
            break;
    }
    $icons = "";
    /* apply size of icon */
    if ($is_front == 0) {
        $icons_size = $sfsi_plus_section5_options['sfsi_plus_icons_size'];
    } else {
        $icons_size = 51;
    }
    /* spacing and no of icons per row */
    $icons_space = '';
    $icons_space = $sfsi_plus_section5_options['sfsi_plus_icons_spacing'];
    $icon_width = (int) $icons_size;
    /* check for mouse hover effect */
    $icon_opacity = "1";
    if ($sfsi_plus_section3_options['sfsi_plus_mouseOver'] == 'yes') {
        $mouse_hover_effect = $sfsi_plus_section3_options["sfsi_plus_mouseOver_effect"];
        if ($mouse_hover_effect == "fade_in" || $mouse_hover_effect == "combo") {
            $icon_opacity = "0.6";
        }
    }
    $toolT_cls = '';
    if ((int) $icon_width <= 49 && (int) $icon_width >= 30) {
        $bt_class = "";
        $toolT_cls = "sfsiTlleft";
    } else {
        if ((int) $icon_width <= 20) {
            $bt_class = "sfsiSmBtn";
            $toolT_cls = "sfsiTlleft";
        } else {
            $bt_class = "";
            $toolT_cls = "sfsiTlleft";
        }
    }
    if ($toolClass == "rss_tool_bdr" || $toolClass == 'email_tool_bdr' || $toolClass == "custom_lkn" || $toolClass == "instagram_tool_bdr") {
        $new_window = sfsi_plus_checkNewWindow();
        $url = $url;
    } else {
        if ($hoverSHow) {
            $new_window = '';
            $url = "javascript:void(0)";
        } else {
            $new_window = sfsi_plus_checkNewWindow();
            $url = $url;
        }
    }
    $margin_bot = "5px;";
    if ($sfsi_plus_section4_options['sfsi_plus_display_counts'] == "yes") {
        $margin_bot = "30px;";
    }
    if (isset($icon) && !empty($icon) && filter_var($icon, FILTER_VALIDATE_URL)) {
        $icons .= "<div style='width:" . $icon_width . "px; height:" . $icon_width . "px;margin-left:" . $icons_space . "px;margin-bottom:" . $margin_bot . "' class='sfsi_plus_wicons " . $cmcls . "'>";
        $icons .= "<div class='sfsiplus_inerCnt'>";
        $icons .= "<a class='" . $class . " sficn' effect='" . $mouse_hover_effect . "' {$new_window}  href='" . $url . "' id='sfsiplusid_" . $icon_name . "' alt='" . $alt_text . "' style='opacity:" . $icon_opacity . "' >";
        $icons .= "<img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $icon . "' width='" . $icons_size . "' style='" . $border_radius . $padding_top . "' class='sfcm sfsi_wicon' effect='" . $mouse_hover_effect . "'   />";
        $icons .= '</a>';
        if ($hoverSHow && !empty($hoverdiv)) {
            $icons .= '<div class="sfsi_tool_tip_2 ' . $toolClass . ' ' . $toolT_cls . '" style="width:' . $width . 'px ;opacity:0;z-index:-1;margin-left:-' . $twt_margin . 'px;" id="sfsiplusid_' . $icon_name . '">';
            $icons .= '<span class="bot_arow ' . $arsfsiplus_row_class . '"></span>';
            $icons .= '<div class="sfsi_inside">' . $hoverdiv . "</div>";
            $icons .= "</div>";
        }
        $icons .= "</div>";
        $icons .= "</div>";
    }
    return $icons;
}