public function widget($args, $instance) { global $essb_available_social_profiles, $essb_options; if (ESSBCoreHelper::is_module_deactivate_on('profiles')) { return ""; } extract($args); $before_widget = $args['before_widget']; $before_title = $args['before_title']; $after_title = $args['after_title']; $after_widget = $args['after_widget']; $show_title = $instance['show_title']; $title = $instance['title']; $sc_button_type = isset($instance['type']) ? $instance['type'] : 'square'; $sc_button_size = isset($instance['size']) ? $instance['size'] : 'small'; $sc_button_fill = isset($instance['style']) ? $instance['style'] : 'fill'; $sc_nospace = $instance['nospace']; if (!empty($sc_nospace) && $sc_nospace != '0') { $sc_nospace = "true"; } else { $sc_nospace = "false"; } $sc_nospace = ESSBOptionValuesHelper::unified_true($sc_nospace); $sc_allowtext = isset($instance['allowtext']) ? $instance['allowtext'] : '0'; if (!empty($sc_allowtext) && $sc_allowtext != '0') { $sc_allowtext = "true"; } else { $sc_allowtext = "false"; } $sc_allowtext = ESSBOptionValuesHelper::unified_true($sc_allowtext); $sc_width = isset($instance['width']) ? $instance['width'] : ''; $profile_networks = array(); $profile_networks = ESSBOptionValuesHelper::advanced_array_to_simple_array($essb_available_social_profiles); $profiles_order = ESSBOptionValuesHelper::options_value($essb_options, 'profiles_order'); if (is_array($profiles_order)) { $profile_networks = $profiles_order; } $sc_network_address = array(); foreach ($profile_networks as $network) { $value = $instance['profile_' . $network]; if (!empty($value)) { $sc_network_address[$network] = $value; } } $sc_network_texts = array(); foreach ($profile_networks as $network) { $value = $instance['profile_text_' . $network]; if (!empty($value)) { $sc_network_texts[$network] = $value; } } if (!empty($show_title)) { echo $before_widget . $before_title . $title . $after_title; } // if module is not activated include the code if (!defined('ESSB3_SOCIALPROFILES_ACTIVE')) { include_once ESSB3_PLUGIN_ROOT . 'lib/modules/social-profiles/essb-social-profiles.php'; define('ESSB3_SOCIALPROFILES_ACTIVE', 'true'); $resource_builder = ESSBResourceBuilder::get_instance(); $template_url = ESSB3_PLUGIN_URL . '/assets/css/essb-profiles.css'; $resource_builder->add_static_footer_css($template_url, 'easy-social-share-buttons-profiles'); } echo ESSBSocialProfiles::generate_social_profile_icons($sc_network_address, $sc_button_type, $sc_button_size, $sc_button_fill, $sc_nospace, '', $sc_allowtext, $sc_network_texts, $sc_width); if (!empty($show_title)) { echo $after_widget; } }
/** * * * @param unknown_type $post * @param unknown_type $global_button_positions * @return multitype:multitype:string boolean multitype:string unknown multitype:string Ambigous <string, boolean> multitype:string multitype:unknown */ public static function get($post, $global_button_positions) { global $essb_options; $essb_post_button_style = get_post_meta($post->ID, 'essb_post_button_style', true); $essb_post_template = get_post_meta($post->ID, 'essb_post_template', true); $essb_post_counters = get_post_meta($post->ID, 'essb_post_counters', true); $essb_post_counter_pos = get_post_meta($post->ID, 'essb_post_counter_pos', true); $essb_post_total_counter_pos = get_post_meta($post->ID, 'essb_post_total_counter_pos', true); $essb_post_animations = get_post_meta($post->ID, 'essb_post_animations', true); $essb_post_optionsbp = get_post_meta($post->ID, 'essb_post_optionsbp', true); $essb_post_content_position = get_post_meta($post->ID, 'essb_post_content_position', true); $essb_post_button_position = array(); foreach (essb_available_button_positions() as $position => $name) { $position_value = get_post_meta($post->ID, 'essb_post_button_position_' . $position, true); if ($position_value != '') { $essb_post_button_position[$position] = $position_value; } } $essb_post_native = get_post_meta($post->ID, 'essb_post_native', true); $essb_post_native_skin = get_post_meta($post->ID, 'essb_post_native_skin', true); // generate array with post modifiers $output_modifier = array(); if (!empty($essb_post_button_style)) { $output_modifier[] = array("type" => "design_options", "param" => "button_style", "value" => $essb_post_button_style); } if (!empty($essb_post_counters)) { $output_modifier[] = array("type" => "button_style", "param" => "show_counter", "value" => ESSBOptionValuesHelper::unified_true($essb_post_counters)); } if (!empty($essb_post_counter_pos)) { $output_modifier[] = array("type" => "button_style", "param" => "counter_pos", "value" => $essb_post_counter_pos); } if (!empty($essb_post_total_counter_pos)) { $output_modifier[] = array("type" => "button_style", "param" => "total_counter_pos", "value" => $essb_post_total_counter_pos); } // native activate or deactivate based on post settings if (!empty($essb_post_native)) { $essb_options['native_active'] = ESSBOptionValuesHelper::unified_true($essb_post_native); if ($essb_options['native_active']) { // manually activate and deactivate native buttons if (!defined('ESSB3_NATIVE_ACTIVE')) { //$resource_builder = ESSBResourceBuilder::get_instance(); include_once ESSB3_PLUGIN_ROOT . 'lib/core/native-buttons/essb-skinned-native-button.php'; include_once ESSB3_PLUGIN_ROOT . 'lib/core/native-buttons/essb-social-privacy.php'; include_once ESSB3_PLUGIN_ROOT . 'lib/core/native-buttons/essb-native-buttons-helper.php'; define('ESSB3_NATIVE_ACTIVE', true); $essb_spb = ESSBSocialPrivacyNativeButtons::get_instance(); ESSBNativeButtonsHelper::$essb_spb = $essb_spb; foreach ($essb_spb->resource_files as $key => $object) { essb_resource_builder()->add_static_resource($object["file"], $object["key"], $object["type"]); } foreach (ESSBSkinnedNativeButtons::get_assets() as $key => $object) { essb_resource_builder()->add_static_resource($object["file"], $object["key"], $object["type"]); } essb_resource_builder()->add_css(ESSBSkinnedNativeButtons::generate_skinned_custom_css(), 'essb-skinned-native-buttons'); // asign instance of native buttons privacy class to helper // register active social network apis foreach (ESSBNativeButtonsHelper::get_list_of_social_apis() as $key => $code) { essb_resource_builder()->add_social_api($key); } } } else { define('ESSB3_NATIVE_DEACTIVE', true); } } // end native buttons loader if (!empty($essb_post_native_skin)) { $essb_options['skin_native'] = ESSBOptionValuesHelper::unified_true($essb_post_native_skin); } // change active button positions $modified_global_button_position = false; $new_button_positions_set = array(); foreach ($essb_post_button_position as $position => $active) { if (ESSBOptionValuesHelper::unified_true($active)) { $new_button_positions_set[] = $position; $modified_global_button_position = true; } } foreach ($global_button_positions as $settings_position) { if (!isset($essb_post_button_position[$settings_position])) { $new_button_positions_set[] = $settings_position; } } if ($modified_global_button_position) { $output_modifier[] = array("type" => "general_options", "param" => "button_position", "value" => $new_button_positions_set); $output_modifier[] = array("type" => "global", "param" => "modified_locations", "value" => true); } if (!empty($essb_post_template)) { $output_modifier[] = array("type" => "global", "param" => "post_template", "value" => $essb_post_template); } if (!empty($essb_post_animations)) { $output_modifier[] = array("type" => "global", "param" => "post_animations", "value" => $essb_post_animations); } if (!empty($essb_post_content_position)) { $output_modifier[] = array("type" => "general_options", "param" => "content_position", "value" => $essb_post_content_position); } return $output_modifier; }
function essb_shortcode_share($atts) { global $essb_networks; $shortcode_extended_options = array(); $shortcode_custom_display_texts = array(); $exist_personalization = false; foreach ($essb_networks as $key => $data) { $text_key = sprintf('%1$s_text', $key); $value = isset($atts[$text_key]) ? $atts[$text_key] : ''; if (!empty($value)) { $shortcode_custom_display_texts[$key] = $value; $exist_personalization = true; } } // add other names from default settings that are not modified if ($exist_personalization) { foreach ($essb_networks as $key => $object) { $search_for = "user_network_name_" . $key; $user_network_name = ESSBOptionValuesHelper::options_value($this->options, $search_for, $object['name']); if (!isset($shortcode_custom_display_texts[$key])) { $shortcode_custom_display_texts[$key] = $user_network_name; } } } // parsing extended shortcode options if (is_array($atts)) { foreach ($atts as $key => $value) { if (strpos($key, "extended_") !== false) { $key = str_replace("extended_", "", $key); $shortcode_extended_options[$key] = $value; } } } $shortcode_automatic_parse_args = array('counters' => 'number', 'current' => 'number', 'text' => 'text', 'title' => 'text', 'url' => 'text', 'native' => 'bool', 'sidebar' => 'bool', 'popup' => 'bool', 'flyin' => 'bool', 'popafter' => 'text', 'message' => 'bool', 'description' => 'text', 'image' => 'text', 'fblike' => 'text', 'plusone' => 'text', 'style' => 'text', 'hide_names' => 'text', 'hide_icons' => 'text', 'counters_pos' => 'text', 'counter_pos' => 'text', 'sidebar_pos' => 'text', 'nostats' => 'bool', 'hide_total' => 'bool', 'total_counter_pos' => 'text', 'fullwidth' => 'bool', 'fullwidth_fix' => 'text', 'fullwidth_first' => 'text', 'fullwidth_second' => 'text', 'fixedwidth' => 'bool', 'fixedwidth_px' => 'text', 'fixedwidth_align' => 'text', 'float' => 'bool', 'postfloat' => 'bool', 'morebutton' => 'text', 'morebutton_icon' => 'text', 'forceurl' => 'bool', 'videoshare' => 'bool', 'template' => 'text', 'query' => 'bool', 'column' => 'bool', 'columns' => 'text', 'topbar' => 'bool', 'bottombar' => 'bool', 'twitter_user' => 'text', 'twitter_hashtags' => 'text', 'twitter_tweet' => 'text', 'nospace' => 'bool', 'post_float' => 'text', 'fullwidth_align' => 'text', 'mobilebar' => 'bool', 'mobilebuttons' => 'bool', 'mobilepoint' => 'bool', 'heroshare' => 'bool', 'animation' => 'string', 'postviews' => 'string'); $shortcode_options = array('buttons' => '', 'counters' => 0, 'current' => 1, 'text' => '', 'url' => '', 'native' => 'no', 'sidebar' => 'no', 'popup' => 'no', 'flyin' => 'no', 'hide_names' => '', 'popafter' => '', 'message' => 'no', 'description' => '', 'image' => '', 'fblike' => '', 'plusone' => '', 'style' => '', 'counters_pos' => '', 'counter_pos' => '', 'sidebar_pos' => '', 'nostats' => 'no', 'hide_total' => 'no', 'total_counter_pos' => '', 'fullwidth' => 'no', 'fullwidth_fix' => '', 'fullwidth_align' => '', 'fullwidth_first' => '', 'fullwidth_second' => '', 'fixedwidth' => 'no', 'fixedwidth_px' => '', 'fixedwidth_align' => '', 'float' => 'no', 'postfloat' => 'no', 'morebutton' => '', 'forceurl' => 'no', 'videoshare' => 'no', 'template' => '', 'hide_mobile' => 'no', 'only_mobile' => 'no', 'query' => 'no', 'column' => 'no', 'columns' => '5', 'morebutton_icon' => '', 'topbar' => 'no', 'bottombar' => 'no', 'twitter_user' => '', 'twitter_hashtags' => '', 'twitter_tweet' => '', 'nospace' => 'false', 'post_float' => '', 'hide_icons' => '', 'mobilebar' => 'no', 'mobilebuttons' => 'no', 'mobilepoint' => 'no', 'heroshare' => 'no', 'animation' => '', 'postviews' => ''); $atts = shortcode_atts($shortcode_options, $atts); $hide_mobile = isset($atts['hide_mobile']) ? $atts['hide_mobile'] : ''; $hide_mobile = ESSBOptionValuesHelper::unified_true($hide_mobile); $only_mobile = isset($atts['only_mobile']) ? $atts['only_mobile'] : ''; $only_mobile = ESSBOptionValuesHelper::unified_true($only_mobile); if ($hide_mobile && essb_is_mobile()) { return ""; } if ($only_mobile && !essb_is_mobile()) { return ""; } // initialize list of availalbe networks if ($atts['buttons'] == '') { $networks = $this->network_options['networks']; } else { $networks = preg_split('#[\\s+,\\s+]#', $atts['buttons']); } $shortcode_parameters = array(); $shortcode_parameters['networks'] = $networks; $shortcode_parameters['customize_texts'] = $exist_personalization; $shortcode_parameters['network_texts'] = $shortcode_custom_display_texts; foreach ($shortcode_automatic_parse_args as $key => $type) { $value = isset($atts[$key]) ? $atts[$key] : ''; if ($type == "number") { $value = intval($value); } if ($type == "bool") { $value = ESSBOptionValuesHelper::unified_true($value); } // @since 3.0.3 - fixed the default button style when used with shortcode if ($key == "style") { if (empty($value)) { $value = $this->design_options['button_style']; } } $shortcode_parameters[$key] = $value; } if (!empty($shortcode_parameters['post_float'])) { $shortcode_parameters['postfloat'] = ESSBOptionValuesHelper::unified_true($shortcode_parameters['post_float']); } if (!empty($shortcode_parameters['animation'])) { if ($shortcode_parameters['animation'] != 'no') { if (!isset($this->activated_resources['animations'])) { $animate_url = ESSB3_PLUGIN_URL . '/assets/css/essb-animations.min.css'; essb_resource_builder()->add_static_resource_footer($animate_url, 'easy-social-share-buttons-animations', 'css'); } } } // @since 3.0 query handling parameters is set as default in shortcode if ($shortcode_parameters['query']) { $query_url = isset($_REQUEST['url']) ? $_REQUEST['url'] : ''; if (!empty($query_url)) { $shortcode_parameters['url'] = $query_url; $url = $query_url; } $query_text = isset($_REQUEST['post_title']) ? $_REQUEST['post_title'] : ''; if (!empty($query_text)) { $shortcode_parameters['text'] = $query_text; $shortcode_parameters['title'] = $query_text; $text = $query_text; } } if ($shortcode_parameters['counters_pos'] == "" && $shortcode_parameters['counter_pos'] != '') { $shortcode_parameters['counters_pos'] = $shortcode_parameters['counter_pos']; } if ($shortcode_parameters['text'] != '' && $shortcode_parameters['title'] == '') { $shortcode_parameters['title'] = $shortcode_parameters['text']; } if (!empty($shortcode_parameters['hide_names'])) { if ($shortcode_parameters['hide_names'] == "yes") { $shortcode_parameters['style'] = "icon_hover"; } if ($shortcode_parameters['hide_names'] == "no") { $shortcode_parameters['style'] = "button"; } if ($shortcode_parameters['hide_names'] == "force") { $shortcode_parameters['style'] = "icon"; } } if (!empty($shortcode_parameters['hide_icons'])) { if ($shortcode_parameters['hide_icons'] == "yes") { $shortcode_parameters['style'] = "button_name"; } } // shortcode extended options foreach ($shortcode_extended_options as $key => $value) { $shortcode_parameters[$key] = $value; } if ($shortcode_parameters['sidebar']) { if ($shortcode_parameters['sidebar_pos'] == "bottom") { $shortcode_parameters['sidebar'] = false; $shortcode_parameters['bottombar'] = true; } if ($shortcode_parameters['sidebar_pos'] == "top") { $shortcode_parameters['sidebar'] = false; $shortcode_parameters['topbar'] = true; } } $use_minifed_css = $this->general_options['use_minified_css'] ? ".min" : ""; $use_minifed_js = $this->general_options['use_minified_js'] ? ".min" : ""; // load mail resource on access if (in_array('mail', $networks)) { if (!isset($this->activated_resources['mail'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-mailform' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-mailform', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-mailform.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-mailform', 'js', true); $this->activated_resources['mail'] = 'true'; } } if (in_array('print', $networks)) { if (!isset($this->activated_resources['print'])) { if (!ESSBOptionValuesHelper::options_bool_value($this->options, 'print_use_printfriendly')) { essb_resource_builder()->add_js(ESSBResourceBuilderSnippets::js_build_window_print_code(), true, 'essb-printing-code'); $this->activated_resources['print'] = 'true'; } } } if ($shortcode_parameters['counters'] == 1) { if (!isset($this->activated_resources['counters'])) { if (!defined('ESSB3_COUNTER_LOADED') && !defined('ESSB3_CACHED_COUNTERS')) { $script_url = ESSB3_PLUGIN_URL . '/assets/js/easy-social-share-buttons' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'easy-social-share-buttons', 'js'); $this->activated_resources['counters'] = 'true'; define('ESSB3_COUNTER_LOADED', true); } } } $display_as_key = "shortcode"; if ($shortcode_parameters['sidebar']) { $display_as_key = "sidebar"; /*if (!isset($this->activated_resources['sidebar'])) { $style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-sidebar'.$use_minifed_css.'.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-sidebar', 'css'); $this->activated_resources['sidebar'] = 'true'; }*/ if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $this->activated_resources['display_positions_style'] = 'true'; } } if ($shortcode_parameters['popup']) { $display_as_key = "popup"; if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $this->activated_resources['display_positions_style'] = 'true'; } if (!isset($this->activated_resources['popup'])) { //$style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-popup'.$use_minifed_css.'.css'; //essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-popup', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-popup' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-popup', 'js', true); $this->activated_resources['popup'] = 'true'; } } if ($shortcode_parameters['heroshare']) { $display_as_key = "heroshare"; if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $this->activated_resources['display_positions_style'] = 'true'; } if (!isset($this->activated_resources['heroshare'])) { //$style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-heroshare'.$use_minifed_css.'.css'; //essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-heroshare', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-heroshare' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-heroshare', 'js', true); $this->activated_resources['heroshare'] = 'true'; } } if ($shortcode_parameters['flyin']) { $display_as_key = "flyin"; if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $this->activated_resources['display_positions_style'] = 'true'; } if (!isset($this->activated_resources['display_positions_style'])) { //$style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-display-methods'.$use_minifed_css.'.css'; //essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-flyin' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-flyin', 'js'); $this->activated_resources['flyin'] = 'true'; } } if ($shortcode_parameters['postfloat']) { $display_as_key = "postfloat"; if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); $this->activated_resources['display_positions_style'] = 'true'; } if (!isset($this->activated_resources['display_positions_script'])) { $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-display-methods' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-display-methods', 'js'); $this->activated_resources['display_positions_script'] = 'true'; //$style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-sidebar'.$use_minifed_css.'.css'; //essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-sidebar', 'css'); } } if ($shortcode_parameters['float']) { $display_as_key = "float"; /*if (!isset($this->activated_resources['float'])) { $script_url = ESSB3_PLUGIN_URL .'/assets/js/essb-float'.$use_minifed_js.'.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-float', 'js'); $this->activated_resources['float'] = 'true'; }*/ if (!isset($this->activated_resources['display_positions_script'])) { $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-display-methods' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-display-methods', 'js'); $this->activated_resources['display_positions_script'] = 'true'; } } if ($shortcode_parameters['topbar']) { $display_as_key = "topbar"; /*if (!isset($this->activated_resources['topbottombar'])) { $style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-topbottom-bar'.$use_minifed_css.'.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-topbottom-bar', 'css'); $this->activated_resources['topbottombar'] = 'true'; }*/ if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); } } if ($shortcode_parameters['bottombar']) { $display_as_key = "bottombar"; /*if (!isset($this->activated_resources['topbottombar'])) { $style_url = ESSB3_PLUGIN_URL .'/assets/css/essb-topbottom-bar'.$use_minifed_css.'.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-topbottom-bar', 'css'); $this->activated_resources['topbottombar'] = 'true'; }*/ if (!isset($this->activated_resources['display_positions_style'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-display-methods' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-display-methods', 'css'); } } if ($shortcode_parameters['mobilebar'] || $shortcode_parameters['mobilebuttons'] || $shortcode_parameters['mobilepoint']) { if (!essb_is_mobile()) { return ""; } } // @since version 3.0.4 if ($shortcode_parameters['mobilebar']) { $display_as_key = "sharebar"; if (!isset($this->activated_resources['mobile'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-mobile' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-mobile', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-mobile' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-mobile', 'js'); $this->activated_resources['mobile'] = 'true'; } } if ($shortcode_parameters['mobilebuttons']) { $display_as_key = "sharebottom"; if (!isset($this->activated_resources['mobile'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-mobile' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-mobile', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-mobile' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-mobile', 'js'); $this->activated_resources['mobile'] = 'true'; } } if ($shortcode_parameters['mobilepoint']) { $display_as_key = "sharepoint"; if (!isset($this->activated_resources['mobile'])) { $style_url = ESSB3_PLUGIN_URL . '/assets/css/essb-mobile' . $use_minifed_css . '.css'; essb_resource_builder()->add_static_resource_footer($style_url, 'easy-social-share-buttons-mobile', 'css'); $script_url = ESSB3_PLUGIN_URL . '/assets/js/essb-mobile' . $use_minifed_js . '.js'; essb_resource_builder()->add_static_resource_footer($script_url, 'essb-mobile', 'js'); $this->activated_resources['mobile'] = 'true'; } } $special_shortcode_options = array(); //print_r($shortcode_parameters); if (!$shortcode_parameters['native']) { $special_shortcode_options['only_share'] = true; } if ($display_as_key == "sidebar") { return $this->display_sidebar(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "popup") { return $this->display_popup(true, $shortcode_parameters['popafter'], $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "heroshare") { return $this->display_heroshare(true, $shortcode_parameters['heroafter'], $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "flyin") { return $this->display_flyin(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "postfloat") { return $this->shortcode_display_postfloat($shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "topbar") { return $this->display_topbar(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "bottombar") { return $this->display_bottombar(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "sharebar") { return $this->display_sharebar(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "sharebottom") { return $this->display_sharebottom(true, $shortcode_parameters, $special_shortcode_options); } else { if ($display_as_key == "sharepoint") { return $this->display_sharepoint(true, $shortcode_parameters, $special_shortcode_options); } else { return $this->generate_share_buttons($display_as_key, 'share', $special_shortcode_options, true, $shortcode_parameters); } } } } } } } } } } }