activated = false; return; } essb_resource_builder()->add_static_resource(ESSB3_PLUGIN_URL . '/lib/modules/social-followers-counter/assets/css/essb-followers-counter.min.css', 'essb-social-followers-counter', 'css'); essb_resource_builder()->activate_resource('profiles_css'); } function display_profiles() { if (essb_is_plugin_deactivated_on() || essb_is_module_deactivated_on('profiles')) { return ""; } $profiles_display_position = essb_option_value('profiles_display_position'); $profiles_template = essb_option_value('profiles_template'); $profiles_animation = essb_option_value('profiles_animation'); $profiles_nospace = essb_option_bool_value('profiles_nospace'); $profile_networks = ESSBSocialProfilesHelper::get_active_networks(); if (!is_array($profile_networks)) { $profile_networks = array(); } $profile_networks_order = ESSBSocialProfilesHelper::get_active_networks_order(); if (!is_array($profile_networks_order)) { $profile_networks_order = array(); } $profiles = array(); foreach ($profile_networks_order as $network) { if (in_array($network, $profile_networks)) { $value_address = essb_option_value('profile_'.$network); if (!empty($value_address)) { $profiles[$network] = $value_address; } } } $options = array( 'position' => $profiles_display_position, 'template' => $profiles_template, 'animation' => $profiles_animation, 'nospace' => $profiles_nospace, 'networks' => $profiles ); echo $this->draw_social_profiles($options); } /** * draw_social_profiles * * @param array $options * @since 4.0 */ public static function draw_social_profiles($options) { $instance_position = isset ( $options ['position'] ) ? $options ['position'] : ''; $instance_new_window = 1; $instance_nofollow = 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_networks = isset($options['networks']) ? $options['networks'] : array(); $instance_align = isset($options['align']) ? $options['align'] : ''; $instance_size = isset($options['size']) ? $options['size'] : ''; $instance_class = isset($options['class']) ? $options['class'] : ''; // 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"; } } $names = ESSBSocialProfilesHelper::get_text_of_buttons(); $class_template = (! empty ( $instance_template )) ? " essbfc-template-" . $instance_template : ''; $class_animation = (! empty ( $instance_animation )) ? " essbfc-icon-" . $instance_animation : ''; $class_columns = 'essbfc-col-profiles'; $class_nospace = (intval ( $instance_nospace ) == 1) ? " essbfc-nospace" : ""; $class_position = ($instance_position != '') ? ' essbfc-profiles-bar essbfc-profiles-'.$instance_position : ''; $class_align = !empty($instance_align) ? ' essbfc-profiles-align-'.$instance_align : ''; $class_size = !empty($instance_size) ? ' essbfc-profiles-size-'.$instance_size : ''; if ($instance_class != '') { $class_size .= ' '.$instance_class; } $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' ); } $code = ''; // followers main element $code .= sprintf ( '