= 1000000) { return round ( ($count / 1000) / 1000, 1 ) . "M"; } elseif ($count >= 100000) { return round ( $count / 1000, 0 ) . "k"; } else if ($count >= 1000) { return round ( $count / 1000, 1 ) . "k"; } else { return @number_format ( $count ); } } /** * draw_followers_sidebar * * Display social followers sidebar * * @param $options array * @since 4.0 */ public static function draw_followers_sidebar($options) { $instance_position = isset ( $options ['position'] ) ? $options ['position'] : ''; $instance_new_window = 1; $instance_nofollow = 1; $instance_show_total = 0; $instance_columns = 1; $instance_template = isset ( $options ['template'] ) ? $options ['template'] : 'flat'; $instance_animation = isset ( $options ['animation'] ) ? $options ['animation'] : ''; $instance_nospace = isset ( $options ['nospace'] ) ? $options ['nospace'] : 0; $instance_button = isset($options['button']) ? $options['button'] : 'h'; $instance_width = isset($options['width']) ? $options['width'] : '0'; $width_style = ''; if (intval($instance_width) > 0) { $width_style = ' style="width:'.$instance_width.'px !important;"'; } $instance_hide_value = isset($options['hide_value']) ? $options['hide_value'] : 0; $instance_hide_text = isset($options['hide_text']) ? $options['hide_text'] : 0; // compatibility with previous template slugs if (!empty($instance_template)) { if ($instance_template == "lite") { $instance_template = "light"; } if ($instance_template == "grey-transparent") { $instance_template = "grey"; } if ($instance_template == "color-transparent") { $instance_template = "color"; } } $class_template = (! empty ( $instance_template )) ? " essbfc-template-" . $instance_template : ''; $class_animation = (! empty ( $instance_animation )) ? " essbfc-icon-" . $instance_animation : ''; $class_columns = (! empty ( $instance_columns )) ? " essbfc-col-" . $instance_columns : ''; $class_nospace = (intval ( $instance_nospace ) == 1) ? " essbfc-nospace" : ""; $class_nospace .= ' essbfc-sidebar-btn'.$instance_button; if (intval($instance_hide_value) == 1) { $class_nospace .= ' essbfc-novalue'; } if (intval($instance_hide_text) == 1) { $class_nospace .= ' essbfc-notextvalue'; } $class_position = $instance_position == "right" ? " essbfc-sidebar-right" : " essbfc-sidebar-left"; $link_nofollow = (intval ( $instance_nofollow ) == 1) ? ' rel="nofollow"' : ''; $link_newwindow = (intval ( $instance_new_window ) == 1) ? ' target="_blank"' : ''; // loading animations if (! empty ( $class_animation )) { essb_resource_builder ()->add_static_footer_css ( ESSB3_PLUGIN_URL . '/lib/modules/social-followers-counter/assets/css/hover.css', 'essb-social-followers-counter-animations', 'css' ); } // followers main element printf ( '
'; echo ' '; // followers: end } /** * draw_followers * * Display instance of generated followers counter * * @param $options array * @param $draw_title boolean * @since 3.4 */ public static function draw_followers($options, $draw_title = false, $layout_builder = false) { $hide_title = isset ( $options ['hide_title'] ) ? $options ['hide_title'] : 0; if (intval ( $hide_title ) == 1) { $draw_title = false; } $instance_title = isset ( $options ['title'] ) ? $options ['title'] : ''; $instance_new_window = isset ( $options ['new_window'] ) ? $options ['new_window'] : 0; $instance_nofollow = isset ( $options ['nofollow'] ) ? $options ['nofollow'] : 0; $instance_show_total = isset ( $options ['show_total'] ) ? $options ['show_total'] : 0; $instance_total_type = isset ( $options ['total_type'] ) ? $options ['total_type'] : 'button_single'; $instance_columns = isset ( $options ['columns'] ) ? $options ['columns'] : 3; $instance_template = isset ( $options ['template'] ) ? $options ['template'] : 'flat'; $instance_animation = isset ( $options ['animation'] ) ? $options ['animation'] : ''; $instance_bgcolor = isset ( $options ['bgcolor'] ) ? $options ['bgcolor'] : ''; $instance_nospace = isset ( $options ['nospace'] ) ? $options ['nospace'] : 0; $instance_hide_value = isset($options['hide_value']) ? $options['hide_value'] : 0; $instance_hide_text = isset($options['hide_text']) ? $options['hide_text'] : 0; if ($layout_builder) { $instance_columns = ESSBSocialFollowersCounterHelper::get_option('layout_cols'); } // compatibility with previous template slugs if (!empty($instance_template)) { if ($instance_template == "lite") { $instance_template = "light"; } if ($instance_template == "grey-transparent") { $instance_template = "grey"; } if ($instance_template == "color-transparent") { $instance_template = "color"; } } $class_template = (! empty ( $instance_template )) ? " essbfc-template-" . $instance_template : ''; $class_animation = (! empty ( $instance_animation )) ? " essbfc-icon-" . $instance_animation : ''; $class_columns = (! empty ( $instance_columns )) ? " essbfc-col-" . $instance_columns : ''; $class_nospace = (intval ( $instance_nospace ) == 1) ? " essbfc-nospace" : ""; $style_bgcolor = (! empty ( $instance_bgcolor )) ? ' style="background-color:' . $instance_bgcolor . ';"' : ''; $link_nofollow = (intval ( $instance_nofollow ) == 1) ? ' rel="nofollow"' : ''; $link_newwindow = (intval ( $instance_new_window ) == 1) ? ' target="_blank"' : ''; if (intval($instance_hide_value) == 1) { $class_nospace .= ' essbfc-novalue'; } if (intval($instance_hide_text) == 1) { $class_nospace .= ' essbfc-notextvalue'; } // loading animations if (! empty ( $class_animation )) { essb_resource_builder ()->add_static_footer_css ( ESSB3_PLUGIN_URL . '/lib/modules/social-followers-counter/assets/css/hover.css', 'essb-social-followers-counter-animations', 'css' ); } // followers main element printf ( '