function sfsi_plus_beforeafterblogposts($content)
{
    if (is_home()) {
        $icons_before = '';
        $icons_after = '';
        $sfsi_section8 = unserialize(get_option('sfsi_plus_section8_options', false));
        $lineheight = $sfsi_section8['sfsi_plus_post_icons_size'];
        $lineheight = sfsi_plus_getlinhght($lineheight);
        global $id, $post;
        $sfsi_plus_display_button_type = $sfsi_section8['sfsi_plus_display_button_type'];
        $sfsi_plus_show_item_onposts = $sfsi_section8['sfsi_plus_show_item_onposts'];
        $permalink = get_permalink($post->ID);
        $post_title = $post->post_title;
        $sfsiLikeWith = "45px;";
        if ($sfsi_section8['sfsi_plus_icons_DisplayCounts'] == "yes") {
            $show_count = 1;
            $sfsiLikeWith = "75px;";
        } else {
            $show_count = 0;
        }
        //checking for standard icons
        if (!isset($sfsi_section8['sfsi_plus_rectsub'])) {
            $sfsi_section8['sfsi_plus_rectsub'] = 'no';
        }
        if (!isset($sfsi_section8['sfsi_plus_rectfb'])) {
            $sfsi_section8['sfsi_plus_rectfb'] = 'yes';
        }
        if (!isset($sfsi_section8['sfsi_plus_rectgp'])) {
            $sfsi_section8['sfsi_plus_rectgp'] = 'yes';
        }
        if (!isset($sfsi_section8['sfsi_plus_rectshr'])) {
            $sfsi_section8['sfsi_plus_rectshr'] = 'yes';
        }
        if (!isset($sfsi_section8['sfsi_plus_recttwtr'])) {
            $sfsi_section8['sfsi_plus_recttwtr'] = 'no';
        }
        //checking for standard icons
        $txt = isset($sfsi_section8['sfsi_plus_textBefor_icons']) ? $sfsi_section8['sfsi_plus_textBefor_icons'] : "Please follow and like us:";
        $float = $sfsi_section8['sfsi_plus_icons_alignment'];
        if ($float == "center") {
            $style_parent = 'text-align: center;';
            $style = 'float:none; display: inline-block;';
        } else {
            $style_parent = '';
            $style = 'float:' . $float;
        }
        if ($sfsi_section8['sfsi_plus_display_before_blogposts'] == "yes" && $sfsi_section8['sfsi_plus_show_item_onposts'] == "yes") {
            //icon selection
            $icons_before .= "<div class='sfsibeforpstwpr' style='" . $style_parent . "'>";
            $icons_before .= "<div class='sfsi_Sicons " . $float . "' style='" . $style . "'>";
            if ($sfsi_plus_display_button_type == 'standard_buttons') {
                if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes' || $sfsi_section8['sfsi_plus_rectfb'] == 'yes' || $sfsi_section8['sfsi_plus_rectgp'] == 'yes' || $sfsi_section8['sfsi_plus_rectshr'] == 'yes' || $sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
                    $icons_before .= "<div style='float:left;margin:0px 8px 0px 0px; line-height:24px'><span>" . $txt . "</span></div>";
                }
                if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes') {
                    if ($show_count) {
                        $sfsiLikeWithsub = "93px";
                    } else {
                        $sfsiLikeWithsub = "64px";
                    }
                    if (!isset($sfsiLikeWithsub)) {
                        $sfsiLikeWithsub = $sfsiLikeWith;
                    }
                    $icons_before .= "<div class='sf_subscrbe' style='float:left;width:" . $sfsiLikeWithsub . "'>" . sfsi_plus_Subscribelike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectfb'] == 'yes') {
                    if ($show_count) {
                    } else {
                        $sfsiLikeWithfb = "48px";
                    }
                    if (!isset($sfsiLikeWithfb)) {
                        $sfsiLikeWithfb = $sfsiLikeWith;
                    }
                    $icons_before .= "<div class='sf_fb' style='float:left;width:" . $sfsiLikeWithfb . "'>" . sfsi_plus_FBlike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectgp'] == 'yes') {
                    $icons_before .= "<div class='sf_google'  style='float:left;max-width:62px;min-width:35px;'>" . sfsi_plus_googlePlus($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
                    if ($show_count) {
                        $sfsiLikeWithtwtr = "77px";
                    } else {
                        $sfsiLikeWithtwtr = "56px";
                    }
                    if (!isset($sfsiLikeWithtwtr)) {
                        $sfsiLikeWithtwtr = $sfsiLikeWith;
                    }
                    $icons_before .= "<div class='sf_twiter' style='float:left;width:" . $sfsiLikeWithtwtr . "'>" . sfsi_plus_twitterlike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectshr'] == 'yes') {
                    $icons_before .= "<div class='sf_addthis'  style='float:left;'>" . sfsi_plus_Addthis_blogpost($show_count, $permalink, $post_title) . "</div>";
                }
            } else {
                $icons_before .= "<div style='float:left;margin:0 0px; line-height:" . $lineheight . "px'><span>" . $txt . "</span></div>";
                $icons_before .= sfsi_plus_check_posts_visiblity(0);
            }
            $icons_before .= "</div>";
            $icons_before .= "</div>";
            //icon selection
            if ($id && $post && $post->post_type == 'post') {
                $content = $icons_before . $content;
            } else {
                $contnet = $content;
            }
        }
        if ($sfsi_section8['sfsi_plus_display_after_blogposts'] == "yes" && $sfsi_section8['sfsi_plus_show_item_onposts'] == "yes") {
            //icon selection
            $icons_after .= "<div class='sfsiaftrpstwpr' style='" . $style_parent . "'>";
            $icons_after .= "<div class='sfsi_Sicons " . $float . "' style='" . $style . "'>";
            if ($sfsi_plus_display_button_type == 'standard_buttons') {
                if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes' || $sfsi_section8['sfsi_plus_rectfb'] == 'yes' || $sfsi_section8['sfsi_plus_rectgp'] == 'yes' || $sfsi_section8['sfsi_plus_rectshr'] == 'yes' || $sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
                    $icons_after .= "<div style='float:left;margin:0px 8px 0px 0px; line-height:24px'><span>" . $txt . "</span></div>";
                }
                if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes') {
                    if ($show_count) {
                        $sfsiLikeWithsub = "93px";
                    } else {
                        $sfsiLikeWithsub = "64px";
                    }
                    if (!isset($sfsiLikeWithsub)) {
                        $sfsiLikeWithsub = $sfsiLikeWith;
                    }
                    $icons_after .= "<div class='sf_subscrbe' style='float:left;width:" . $sfsiLikeWithsub . "'>" . sfsi_plus_Subscribelike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectfb'] == 'yes') {
                    if ($show_count) {
                    } else {
                        $sfsiLikeWithfb = "48px";
                    }
                    if (!isset($sfsiLikeWithfb)) {
                        $sfsiLikeWithfb = $sfsiLikeWith;
                    }
                    $icons_after .= "<div class='sf_fb' style='float:left;width:" . $sfsiLikeWithfb . "'>" . sfsi_plus_FBlike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectgp'] == 'yes') {
                    $icons_after .= "<div class='sf_google'  style='float:left;max-width:62px;min-width:35px;'>" . sfsi_plus_googlePlus($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
                    if ($show_count) {
                        $sfsiLikeWithtwtr = "77px";
                    } else {
                        $sfsiLikeWithtwtr = "56px";
                    }
                    if (!isset($sfsiLikeWithtwtr)) {
                        $sfsiLikeWithtwtr = $sfsiLikeWith;
                    }
                    $icons_after .= "<div class='sf_twiter' style='float:left;width:" . $sfsiLikeWithtwtr . "'>" . sfsi_plus_twitterlike($permalink, $show_count) . "</div>";
                }
                if ($sfsi_section8['sfsi_plus_rectshr'] == 'yes') {
                    $icons_after .= "<div class='sf_addthis'  style='float:left;'>" . sfsi_plus_Addthis_blogpost($show_count, $permalink, $post_title) . "</div>";
                }
            } else {
                $icons_after .= "<div style='float:left;margin:0 0px; line-height:" . $lineheight . "px'><span>" . $txt . "</span></div>";
                $icons_after .= sfsi_plus_check_posts_visiblity(0);
            }
            $icons_after .= "</div>";
            $icons_after .= "</div>";
            //icon selection
            $content = $content . $icons_after;
        }
    }
    return $content;
}
예제 #2
0
function sfsi_plus_social_buttons_below($content)
{
    global $post;
    $sfsi_section6 = unserialize(get_option('sfsi_plus_section6_options', false));
    //new options that are added on the third questions
    //so in this function we are replacing all the past options
    //that were saved under option6 by new settings saved under option8
    $sfsi_section8 = unserialize(get_option('sfsi_plus_section8_options', false));
    $sfsi_plus_show_item_onposts = $sfsi_section8['sfsi_plus_show_item_onposts'];
    //new options that are added on the third questions
    //checking for standard icons
    if (!isset($sfsi_section8['sfsi_plus_rectsub'])) {
        $sfsi_section8['sfsi_plus_rectsub'] = 'no';
    }
    if (!isset($sfsi_section8['sfsi_plus_rectfb'])) {
        $sfsi_section8['sfsi_plus_rectfb'] = 'yes';
    }
    if (!isset($sfsi_section8['sfsi_plus_rectgp'])) {
        $sfsi_section8['sfsi_plus_rectgp'] = 'yes';
    }
    if (!isset($sfsi_section8['sfsi_plus_rectshr'])) {
        $sfsi_section8['sfsi_plus_rectshr'] = 'yes';
    }
    if (!isset($sfsi_section8['sfsi_plus_recttwtr'])) {
        $sfsi_section8['sfsi_plus_recttwtr'] = 'no';
    }
    //checking for standard icons
    /* check if option activated in admin or not */
    //if($sfsi_section6['sfsi_plus_show_Onposts']=="yes")
    //removing following condition for now
    /*if($sfsi_section8['sfsi_plus_show_Onposts']=="yes")
    	{*/
    $permalink = get_permalink($post->ID);
    $title = get_the_title();
    $sfsiLikeWith = "45px;";
    /* check for counter display */
    //if($sfsi_section6['sfsi_plus_icons_DisplayCounts']=="yes")
    if ($sfsi_section8['sfsi_plus_icons_DisplayCounts'] == "yes") {
        $show_count = 1;
        $sfsiLikeWith = "75px;";
    } else {
        $show_count = 0;
    }
    //$txt=(isset($sfsi_section6['sfsi_plus_textBefor_icons']))? $sfsi_section6['sfsi_plus_textBefor_icons'] : "Share this Post with :" ;
    $txt = isset($sfsi_section8['sfsi_plus_textBefor_icons']) ? $sfsi_section8['sfsi_plus_textBefor_icons'] : "Please follow and like us:";
    //$float= $sfsi_section6['sfsi_plus_icons_alignment'];
    $float = $sfsi_section8['sfsi_plus_icons_alignment'];
    if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes' || $sfsi_section8['sfsi_plus_rectfb'] == 'yes' || $sfsi_section8['sfsi_plus_rectgp'] == 'yes' || $sfsi_section8['sfsi_plus_rectshr'] == 'yes' || $sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
        $icons = "<div class='sfsi_Sicons " . $float . "' style='float:" . $float . "'><div style='display: inline-block;margin-bottom: 0; margin-left: 0; margin-right: 8px; margin-top: 0; vertical-align: middle;width: auto;'><span>" . $txt . "</span></div>";
    }
    if ($sfsi_section8['sfsi_plus_rectsub'] == 'yes') {
        if ($show_count) {
            $sfsiLikeWithsub = "93px";
        } else {
            $sfsiLikeWithsub = "64px";
        }
        if (!isset($sfsiLikeWithsub)) {
            $sfsiLikeWithsub = $sfsiLikeWith;
        }
        $icons .= "<div class='sf_subscrbe' style='display: inline-block;vertical-align: middle;width: auto;'>" . sfsi_plus_Subscribelike($permalink, $show_count) . "</div>";
    }
    if ($sfsi_section8['sfsi_plus_rectfb'] == 'yes') {
        if ($show_count) {
        } else {
            $sfsiLikeWithfb = "48px";
        }
        if (!isset($sfsiLikeWithfb)) {
            $sfsiLikeWithfb = $sfsiLikeWith;
        }
        $icons .= "<div class='sf_fb' style='display: inline-block;vertical-align: middle;width: auto;'>" . sfsi_plus_FBlike($permalink, $show_count) . "</div>";
    }
    if ($sfsi_section8['sfsi_plus_rectgp'] == 'yes') {
        $icons .= "<div class='sf_google' style='display: inline-block;vertical-align: middle; width:auto;'>" . sfsi_plus_googlePlus($permalink, $show_count) . "</div>";
    }
    if ($sfsi_section8['sfsi_plus_recttwtr'] == 'yes') {
        if ($show_count) {
            $sfsiLikeWithtwtr = "77px";
        } else {
            $sfsiLikeWithtwtr = "56px";
        }
        if (!isset($sfsiLikeWithtwtr)) {
            $sfsiLikeWithtwtr = $sfsiLikeWith;
        }
        $icons .= "<div class='sf_twiter' style='display: inline-block;vertical-align: middle;width: auto;'>" . sfsi_plus_twitterlike($permalink, $show_count) . "</div>";
    }
    if ($sfsi_section8['sfsi_plus_rectshr'] == 'yes') {
        $icons .= "<div class='sf_addthis'  style='display: inline-block;vertical-align: middle;width: auto;margin-top: 6px;'>" . sfsi_plus_Addthis($show_count, $permalink, $title) . "</div>";
    }
    $icons .= "</div>";
    if (!is_feed() && !is_home() && !is_page()) {
        $content = $content . $icons;
    }
    //}
    return $content;
}