function sfsi_getCounts()
{
    $socialObj = new sfsi_SocialHelper();
    $sfsi_section4_options = unserialize(get_option('sfsi_section4_options', false));
    $sfsi_section2_options = unserialize(get_option('sfsi_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_section4_options['sfsi_rss_manualCounts'])) {
        $scounts['rss_count'] = $sfsi_section4_options['sfsi_rss_manualCounts'];
    }
    /* get email count */
    if ($sfsi_section4_options['sfsi_email_countsFrom'] == "source") {
        $feed_id = get_option('sfsi_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_section4_options['sfsi_email_manualCounts'];
    }
    /* get fb count */
    if ($sfsi_section4_options['sfsi_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_section4_options['sfsi_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 {
            $scounts['fb_count'] = $sfsi_section4_options['sfsi_facebook_manualCounts'];
        }
    }
    /* get twitter counts */
    if ($sfsi_section4_options['sfsi_twitter_countsFrom'] == "source") {
        $twitter_user = $sfsi_section2_options['sfsi_twitter_followUserName'];
        $tw_settings = array('tw_consumer_key' => $sfsi_section4_options['tw_consumer_key'], 'tw_consumer_secret' => $sfsi_section4_options['tw_consumer_secret'], 'tw_oauth_access_token' => $sfsi_section4_options['tw_oauth_access_token'], 'tw_oauth_access_token_secret' => $sfsi_section4_options['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_section4_options['sfsi_twitter_manualCounts'];
    }
    /* get google+ counts */
    if ($sfsi_section4_options['sfsi_google_countsFrom'] == "follower") {
        $url = $sfsi_section2_options['sfsi_google_pageURL'];
        $api_key = $sfsi_section4_options['sfsi_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_section4_options['sfsi_google_countsFrom'] == "likes") {
            $url = home_url();
            $api_key = $sfsi_section4_options['sfsi_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_section4_options['sfsi_google_manualCounts'];
        }
    }
    /* get linkedIn counts */
    if ($sfsi_section4_options['sfsi_linkedIn_countsFrom'] == "follower") {
        $linkedIn_compay = $sfsi_section2_options['sfsi_linkedin_followCompany'];
        $linkedIn_compay = $sfsi_section4_options['ln_company'];
        $ln_settings = array('ln_api_key' => $sfsi_section4_options['ln_api_key'], 'ln_secret_key' => $sfsi_section4_options['ln_secret_key'], 'ln_oAuth_user_token' => $sfsi_section4_options['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_section4_options['sfsi_linkedIn_manualCounts'];
    }
    /* get youtube counts */
    if ($sfsi_section4_options['sfsi_youtube_countsFrom'] == "subscriber") {
        if (isset($sfsi_section4_options['sfsi_youtube_user'])) {
            $youtube_user = $sfsi_section4_options['sfsi_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_section4_options['sfsi_youtube_manualCounts'];
    }
    /* get Pinterest counts */
    if ($sfsi_section4_options['sfsi_pinterest_countsFrom'] == "pins") {
        $url = home_url();
        $pins = $socialObj->sfsi_get_pinterest($url);
        $scounts['pin_count'] = $socialObj->format_num($pins);
    } else {
        $scounts['pin_count'] = $sfsi_section4_options['sfsi_pinterest_manualCounts'];
    }
    /* get addthis share counts */
    if (isset($sfsi_section4_options['sfsi_shares_countsFrom']) && $sfsi_section4_options['sfsi_shares_countsFrom'] == "shares" && isset($sfsi_section4_options['sfsi_share_countsDisplay']) && $sfsi_section4_options['sfsi_share_countsDisplay'] == "yes") {
        $shares = $socialObj->sfsi_get_atthis();
        $scounts['share_count'] = $socialObj->format_num($shares);
    } else {
        $scounts['share_count'] = $sfsi_section4_options['sfsi_shares_manualCounts'];
    }
    /* get instagram count */
    if ($sfsi_section4_options['sfsi_instagram_countsFrom'] == "followers") {
        $iuser_name = $sfsi_section4_options['sfsi_instagram_User'];
        $counts = $socialObj->sfsi_get_instagramFollowers($iuser_name);
        if (empty($counts)) {
            $scounts['instagram_count'] = (string) "0";
        }
    } else {
        $scounts['instagram_count'] = $sfsi_section4_options['sfsi_instagram_manualCounts'];
    }
    return $scounts;
    exit;
}
function sfsi_twitterlike($permalink, $show_count)
{
    global $socialObj;
    $socialObj = new sfsi_SocialHelper();
    $twitter_text = '';
    if (!empty($permalink)) {
        $postid = url_to_postid($permalink);
    }
    if (!empty($postid)) {
        $twitter_text = get_the_title($postid);
    }
    return $socialObj->sfsi_twitterSharewithcount($permalink, $twitter_text, $show_count);
}
Exemple #3
0
function sfsi_prepairIcons($icon_name, $is_front = 0)
{
    global $wpdb;
    global $socialObj;
    $mouse_hover_effect = '';
    $active_theme = 'official';
    $sfsi_shuffle_Firstload = 'no';
    $sfsi_display_counts = "no";
    $icon = '';
    $url = '';
    $alt_text = '';
    $new_window = '';
    $class = '';
    /* access  all saved settings in admin */
    $sfsi_section1_options = unserialize(get_option('sfsi_section1_options', false));
    $sfsi_section2_options = unserialize(get_option('sfsi_section2_options', false));
    $sfsi_section3_options = unserialize(get_option('sfsi_section3_options', false));
    $sfsi_section4_options = unserialize(get_option('sfsi_section4_options', false));
    $sfsi_section5_options = unserialize(get_option('sfsi_section5_options', false));
    $sfsi_section6_options = unserialize(get_option('sfsi_section6_options', false));
    $sfsi_section7_options = unserialize(get_option('sfsi_section7_options', false));
    /* get active theme */
    $border_radius = '';
    $active_theme = $sfsi_section3_options['sfsi_actvite_theme'];
    /* shuffle effect */
    if ($sfsi_section3_options['sfsi_shuffle_icons'] == 'yes') {
        $sfsi_shuffle_Firstload = $sfsi_section3_options["sfsi_shuffle_Firstload"];
        if ($sfsi_section3_options["sfsi_shuffle_interval"] == "yes") {
            $sfsi_shuffle_interval = $sfsi_section3_options["sfsi_shuffle_intervalTime"];
        }
    }
    /* define the main url for icon access */
    $icons_baseUrl = SFSI_PLUGURL . "/images/icons_theme/" . $active_theme . "/";
    $visit_iconsUrl = SFSI_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_section5_options['sfsi_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_SocialHelper();
            /* global object to access 3rd party icon's actions */
            $url = $sfsi_section2_options['sfsi_rss_url'] ? $sfsi_section2_options['sfsi_rss_url'] : 'javascript:void(0);';
            $toolClass = "rss_tool_bdr";
            $hoverdiv = '';
            $arrow_class = "bot_rss_arow";
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_rss_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                $counts = $socialObj->format_num($sfsi_section4_options['sfsi_rss_manualCounts']);
            }
            if (!empty($sfsi_section5_options['sfsi_rss_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_rss_MouseOverText'];
            } else {
                $alt_text = 'RSS';
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("rss_skin")) {
                    $icon = get_option("rss_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_SocialHelper();
            /* global object to access 3rd party icon's actions */
            $hoverdiv = '';
            $sfsi_section2_options['sfsi_email_url'];
            $url = isset($sfsi_section2_options['sfsi_email_url']) ? $sfsi_section2_options['sfsi_email_url'] : 'javascript:void(0);';
            $toolClass = "email_tool_bdr";
            $arrow_class = "bot_eamil_arow";
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_email_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_email_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_email_manualCounts']);
                } else {
                    $counts = $socialObj->SFSI_getFeedSubscriber(get_option('sfsi_feed_id', false));
                }
            }
            if (!empty($sfsi_section5_options['sfsi_email_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_email_MouseOverText'];
            } else {
                $alt_text = 'EMAIL';
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("email_skin")) {
                    $icon = get_option("email_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_PLUGURL . "/images/icons_theme/default/";
                    $icon = $sfsi_section2_options['sfsi_rss_icons'] == "sfsi" ? $icons_baseUrl . $active_theme . "_sf.png" : $icons_baseUrl . $active_theme . "_email.png";
                }
            } else {
                $icon = $sfsi_section2_options['sfsi_rss_icons'] == "sfsi" ? $icons_baseUrl . $active_theme . "_sf.png" : $icons_baseUrl . $active_theme . "_email.png";
            }
            break;
        case "facebook":
            $socialObj = new sfsi_SocialHelper();
            $width = 62;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            $toolClass = "fb_tool_bdr";
            $arrow_class = "bot_fb_arow";
            /* check for the over section */
            if (!empty($sfsi_section5_options['sfsi_facebook_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_facebook_MouseOverText'];
            } else {
                $alt_text = "FACEBOOK";
            }
            $visit_icon = $visit_iconsUrl . "facebook.png";
            $url = $sfsi_section2_options['sfsi_facebookPage_url'] ? $sfsi_section2_options['sfsi_facebookPage_url'] : 'javascript:void(0);';
            if ($sfsi_section2_options['sfsi_facebookLike_option'] == "yes" || $sfsi_section2_options['sfsi_facebookShare_option'] == "yes") {
                $url = $sfsi_section2_options['sfsi_facebookPage_url'] ? $sfsi_section2_options['sfsi_facebookPage_url'] : 'javascript:void(0);';
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_section2_options['sfsi_facebookPage_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_facebookLike_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_FBlike($current_url) . "</div>";
                }
                if ($sfsi_section2_options['sfsi_facebookShare_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon3'>" . $socialObj->sfsiFB_Share($current_url) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_facebook_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_facebook_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_facebook_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_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_section4_options['sfsi_facebook_countsFrom'] == "followers") {
                            $fb_data = $socialObj->sfsi_get_fb($current_url);
                            $counts = $socialObj->format_num($fb_data['share_count']);
                        }
                    }
                }
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("facebook_skin")) {
                    $icon = get_option("facebook_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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";
            $arrow_class = "bot_gpls_arow";
            $socialObj = new sfsi_SocialHelper();
            $width = 76;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            if (!empty($sfsi_section5_options['sfsi_google_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_google_MouseOverText'];
            } else {
                $alt_text = "GOOGLE";
            }
            $visit_icon = $visit_iconsUrl . "google.png";
            $url = $sfsi_section2_options['sfsi_google_pageURL'] ? $sfsi_section2_options['sfsi_google_pageURL'] : 'javascript:void(0);';
            /* check for icons to display */
            if ($sfsi_section2_options['sfsi_googleLike_option'] == "yes" || $sfsi_section2_options['sfsi_googleShare_option'] == "yes") {
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_section2_options['sfsi_google_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_googleLike_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_Googlelike($current_url) . "</div>";
                }
                if ($sfsi_section2_options['sfsi_googleShare_option'] == "yes") {
                    $hoverdiv .= "<div  class='icon3'>" . $socialObj->sfsi_GoogleShare($current_url) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_google_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_google_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_google_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_google_countsFrom'] == "likes") {
                        $api_key = $sfsi_section4_options['sfsi_google_api_key'];
                        $followers = $socialObj->sfsi_getPlus1($current_url);
                        $counts = $socialObj->format_num($followers);
                        if (empty($counts)) {
                            $counts = (string) "0";
                        }
                    } else {
                        if ($sfsi_section4_options['sfsi_google_countsFrom'] == "follower") {
                            $api_key = $sfsi_section4_options['sfsi_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("google_skin")) {
                    $icon = get_option("google_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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";
            $arrow_class = "bot_twt_arow";
            $socialObj = new sfsi_SocialHelper();
            $url = $sfsi_section2_options['sfsi_twitter_pageURL'] ? $sfsi_section2_options['sfsi_twitter_pageURL'] : 'javascript:void(0);';
            $twitter_user = $sfsi_section2_options['sfsi_twitter_followUserName'];
            $twitter_text = $sfsi_section2_options['sfsi_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_section2_options['sfsi_twitter_followme'] == "yes" || $sfsi_section2_options['sfsi_twitter_aboutPage'] == "yes") {
                $hoverSHow = 1;
                //Visit twitter page {Monad}
                if ($sfsi_section2_options['sfsi_twitter_page'] == "yes") {
                    $hoverdiv .= "<div  class='cstmicon1'><a href='" . $url . "' " . sfsi_checkNewWindow($url) . "><img alt='Visit Us' title='Visit Us' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_twitter_followme'] == "yes" && !empty($twitter_user)) {
                    $hoverdiv .= "<div  class='icon1'>" . $socialObj->sfsi_twitterFollow($twitter_user) . "</div>";
                }
                if ($sfsi_section2_options['sfsi_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_section4_options['sfsi_twitter_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_twitter_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_twitter_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_twitter_countsFrom'] == "source") {
                        $tw_settings = array('tw_consumer_key' => $sfsi_section4_options['tw_consumer_key'], 'tw_consumer_secret' => $sfsi_section4_options['tw_consumer_secret'], 'tw_oauth_access_token' => $sfsi_section4_options['tw_oauth_access_token'], 'tw_oauth_access_token_secret' => $sfsi_section4_options['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_section5_options['sfsi_twitter_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_twitter_MouseOverText'];
            } else {
                $alt_text = "TWITTER";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("twitter_skin")) {
                    $icon = get_option("twitter_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_SocialHelper();
            $url = "http://www.addthis.com/bookmark.php?v=250";
            $class = "addthis_button";
            /*fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_shares_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_shares_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_shares_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_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_section5_options['sfsi_share_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_share_MouseOverText'];
            } else {
                $alt_text = "SHARE";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("share_skin")) {
                    $icon = get_option("share_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_SocialHelper();
            $toolClass = "utube_tool_bdr";
            $arrow_class = "bot_utube_arow";
            $socialObj = new sfsi_SocialHelper();
            $width = 96;
            $totwith = $width + 28 + $icons_space;
            $twt_margin = $totwith / 2;
            $youtube_user = isset($sfsi_section4_options['sfsi_youtube_user']) && !empty($sfsi_section4_options['sfsi_youtube_user']) ? $sfsi_section4_options['sfsi_youtube_user'] : '******';
            $visit_icon = $visit_iconsUrl . "youtube.png";
            $url = $sfsi_section2_options['sfsi_youtube_pageUrl'] ? $sfsi_section2_options['sfsi_youtube_pageUrl'] : 'javascript:void(0);';
            //Giving alternative text to image
            if (!empty($sfsi_section5_options['sfsi_youtube_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_youtube_MouseOverText'];
            } else {
                $alt_text = "YOUTUBE";
            }
            /* check for icons to display */
            $hoverdiv = "";
            if ($sfsi_section2_options['sfsi_youtube_follow'] == "yes") {
                $hoverSHow = 1;
                if ($sfsi_section2_options['sfsi_youtube_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "'  " . sfsi_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_youtube_follow'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_YouTubeSub($youtube_user) . "</div>";
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_youtube_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_youtube_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_youtube_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_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("youtube_skin")) {
                    $icon = get_option("youtube_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_SocialHelper();
            $toolClass = "printst_tool_bdr";
            $arrow_class = "bot_pintst_arow";
            $pinterest_user = $sfsi_section4_options['sfsi_pinterest_user'];
            $pinterest_board = $sfsi_section4_options['sfsi_pinterest_board'];
            $visit_icon = $visit_iconsUrl . "pinterest.png";
            $url = isset($sfsi_section2_options['sfsi_pinterest_pageUrl']) ? $sfsi_section2_options['sfsi_pinterest_pageUrl'] : 'javascript:void(0);';
            //Giving alternative text to image
            if (!empty($sfsi_section5_options['sfsi_pinterest_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_pinterest_MouseOverText'];
            } else {
                $alt_text = "PINTEREST";
            }
            /* check for icons to display */
            $hoverdiv = "";
            if ($sfsi_section2_options['sfsi_pinterest_pingBlog'] == "yes") {
                $hoverSHow = 1;
                if ($sfsi_section2_options['sfsi_pinterest_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'><a href='" . $url . "' " . sfsi_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_pinterest_pingBlog'] == "yes") {
                    if ($sfsi_section2_options['sfsi_pinterest_pingBlog'] == "yes") {
                        $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_PinIt($current_url) . "</div>";
                    }
                }
            }
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_pinterest_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_pinterest_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_pinterest_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_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("pintrest_skin")) {
                    $icon = get_option("pintrest_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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";
            $arrow_class = "bot_pintst_arow";
            $socialObj = new sfsi_SocialHelper();
            $url = isset($sfsi_section2_options['sfsi_instagram_pageUrl']) ? $sfsi_section2_options['sfsi_instagram_pageUrl'] : 'javascript:void(0);';
            $instagram_user_name = $sfsi_section4_options['sfsi_instagram_User'];
            //Giving alternative text to image
            if (!empty($sfsi_section5_options['sfsi_instagram_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_instagram_MouseOverText'];
            } else {
                $alt_text = "INSTAGRAM";
            }
            $hoverdiv = "";
            /* fecth no of counts if active in admin section */
            if ($sfsi_section4_options['sfsi_instagram_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_instagram_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_instagram_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_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("instagram_skin")) {
                    $icon = get_option("instagram_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_SocialHelper();
            $toolClass = "linkedin_tool_bdr";
            $arrow_class = "bot_linkedin_arow";
            $linkedIn_compayId = $sfsi_section2_options['sfsi_linkedin_followCompany'];
            $linkedIn_compay = $sfsi_section2_options['sfsi_linkedin_followCompany'];
            $linkedIn_ProductId = $sfsi_section2_options['sfsi_linkedin_recommendProductId'];
            $visit_icon = $visit_iconsUrl . "linkedIn.png";
            /*check for icons to display */
            $url = $sfsi_section2_options['sfsi_linkedin_pageURL'] ? $sfsi_section2_options['sfsi_linkedin_pageURL'] : 'javascript:void(0);';
            if ($sfsi_section2_options['sfsi_linkedin_follow'] == "yes" || $sfsi_section2_options['sfsi_linkedin_SharePage'] == "yes" || $sfsi_section2_options['sfsi_linkedin_recommendBusines'] == "yes") {
                $hoverSHow = 1;
                $hoverdiv = '';
                if ($sfsi_section2_options['sfsi_linkedin_page'] == "yes") {
                    $hoverdiv .= "<div  class='icon4'><a href='" . $url . "' " . sfsi_checkNewWindow($url) . "><img alt='" . $alt_text . "' title='" . $alt_text . "' src='" . $visit_icon . "'  /></a></div>";
                }
                if ($sfsi_section2_options['sfsi_linkedin_follow'] == "yes") {
                    $hoverdiv .= "<div  class='icon1'>" . $socialObj->sfsi_LinkedInFollow($linkedIn_compayId) . "</div>";
                }
                if ($sfsi_section2_options['sfsi_linkedin_SharePage'] == "yes") {
                    $hoverdiv .= "<div  class='icon2'>" . $socialObj->sfsi_LinkedInShare() . "</div>";
                }
                if ($sfsi_section2_options['sfsi_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_section4_options['sfsi_linkedIn_countsDisplay'] == "yes" && $sfsi_section4_options['sfsi_display_counts'] == "yes") {
                if ($sfsi_section4_options['sfsi_linkedIn_countsFrom'] == "manual") {
                    $counts = $socialObj->format_num($sfsi_section4_options['sfsi_linkedIn_manualCounts']);
                } else {
                    if ($sfsi_section4_options['sfsi_linkedIn_countsFrom'] == "follower") {
                        $linkedIn_compay = $sfsi_section4_options['ln_company'];
                        $ln_settings = array('ln_api_key' => $sfsi_section4_options['ln_api_key'], 'ln_secret_key' => $sfsi_section4_options['ln_secret_key'], 'ln_oAuth_user_token' => $sfsi_section4_options['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_section5_options['sfsi_linkedIn_MouseOverText'])) {
                $alt_text = $sfsi_section5_options['sfsi_linkedIn_MouseOverText'];
            } else {
                $alt_text = "LINKEDIN";
            }
            //Custom Skin Support {Monad}
            if ($active_theme == 'custom_support') {
                if (get_option("linkedin_skin")) {
                    $icon = get_option("linkedin_skin");
                } else {
                    $active_theme = 'default';
                    $icons_baseUrl = SFSI_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_section2_options['sfsi_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";
            $arrow_class = "";
            $custom_icons_hoverTxt = unserialize($sfsi_section5_options['sfsi_custom_MouseOverTexts']);
            $icons = unserialize($sfsi_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_section5_options['sfsi_icons_size'];
    } else {
        $icons_size = 51;
    }
    /* spacing and no of icons per row */
    $icons_space = '';
    $icons_space = $sfsi_section5_options['sfsi_icons_spacing'];
    $icon_width = (int) $icons_size;
    /* check for mouse hover effect */
    $icon_opacity = "1";
    if ($sfsi_section3_options['sfsi_mouseOver'] == 'yes') {
        $mouse_hover_effect = $sfsi_section3_options["sfsi_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_checkNewWindow();
        $url = $url;
    } else {
        if ($hoverSHow) {
            $new_window = '';
            $url = "javascript:void(0)";
        } else {
            $new_window = sfsi_checkNewWindow();
            $url = $url;
        }
    }
    $margin_bot = "5px;";
    if ($sfsi_section4_options['sfsi_display_counts'] == "yes") {
        $margin_bot = "30px;";
    }
    $icons .= "<div style='width:" . $icon_width . "px; height:" . $icon_width . "px;margin-left:" . $icons_space . "px;margin-bottom:" . $margin_bot . "' class='sfsi_wicons " . $cmcls . "'>";
    $icons .= "<div class='inerCnt'>";
    $icons .= "<a class='" . $class . " sficn' effect='" . $mouse_hover_effect . "' . {$new_window}.  href='" . $url . "' id='sfsiid_" . $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 (isset($counts) && $counts != '') {
        $icons .= '<span class="bot_no ' . $bt_class . '">' . $counts . '</span>';
    }
    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="sfsiid_' . $icon_name . '">';
        $icons .= '<span class="bot_arow ' . $arrow_class . '"></span>';
        $icons .= '<div class="sfsi_inside">' . $hoverdiv . "</div>";
        $icons .= "</div>";
    }
    $icons .= "</div>";
    $icons .= "</div>";
    return $icons;
}
Exemple #4
0
			url = jQuery('img',html).attr('src');
			tb_remove();
			sfsi_newcustomicon_upload(url);
		}
		return false;
	}
   </script>
   
</div><!-- Custom icon upload  Pop-up-->


<?php 
$active_theme = $option3['sfsi_actvite_theme'];
$icons_baseUrl = SFSI_PLUGURL . "/images/icons_theme/" . $active_theme . "/";
$visit_iconsUrl = SFSI_PLUGURL . "/images/visit_icons/";
$soicalObj = new sfsi_SocialHelper();
$twitetr_share = $option2['sfsi_twitter_followUserName'] != '' ? "https://twitter.com/" . $option2['sfsi_twitter_followUserName'] : '******';
$twitter_text = $option2['sfsi_twitter_followUserName'] != '' ? $option2['sfsi_twitter_aboutPageText'] : 'Create Your Perfect Newspaper for free';
?>
<!-- Facebook  example pop up -->
<div class="fb-overlay read-overlay fbex-s2" >
    <div class="pop_up_box sfsi_pop_up adPopWidth" >
        <img src="<?php 
echo SFSI_PLUGURL;
?>
images/close.jpg" id="close_popup" class="sfsicloseBtn" />
     
    <h4 id="readmore_text">Move over the Facebook-icon… </h4>
    
        <div class="adminTooltip" ><a alt="facebook"  href="<?php 
echo $option2['sfsi_facebookPage_url'] != '' ? $option2['sfsi_facebookPage_url'] : 'https://www.facebook.com/SpecificFeeds';