static function Get_like_button($post, $box) { $user_ID = WPAL2Facebook::Get_user_ID($post); if ($user_ID && !WPAL2Facebook::Is_excluded_post_type($post) && !WPAL2Int::social_in_excerpt($user_ID)) { // Get options $layout = get_user_meta($user_ID, c_al2fb_meta_like_layout, true); $faces = get_user_meta($user_ID, c_al2fb_meta_like_faces, true); $share = get_user_meta($user_ID, c_al2fb_meta_like_share, true); if ($box) { $width = get_user_meta($user_ID, c_al2fb_meta_like_box_width, true); $height = get_user_meta($user_ID, c_al2fb_meta_like_box_height, true); } else { $width = get_user_meta($user_ID, c_al2fb_meta_like_width, true); $height = false; } $action = get_user_meta($user_ID, c_al2fb_meta_like_action, true); $font = get_user_meta($user_ID, c_al2fb_meta_like_font, true); $colorscheme = get_user_meta($user_ID, c_al2fb_meta_like_colorscheme, true); $border = get_user_meta($user_ID, c_al2fb_meta_like_box_border, true); $noheader = get_user_meta($user_ID, c_al2fb_meta_like_box_noheader, true); $nostream = get_user_meta($user_ID, c_al2fb_meta_like_box_nostream, true); $link = get_user_meta($user_ID, c_al2fb_meta_like_link, true); if (empty($link)) { if ($box) { // Get page if (WPAL2Facebook::Is_authorized($user_ID) && !get_user_meta($user_ID, c_al2fb_meta_use_groups, true) && get_user_meta($user_ID, c_al2fb_meta_page, true)) { try { $page = WPAL2Int::Get_fb_me_cached($user_ID, false); $link = $page->link; } catch (Exception $e) { } } } else { $link = get_permalink($post->ID); } } $combine = get_user_meta($user_ID, c_al2fb_meta_post_combine_buttons, true); $appid = get_user_meta($user_ID, c_al2fb_meta_client_id, true); $lang = WPAL2Int::Get_locale($user_ID); $txtinfo = empty($action) || $action == 'like' ? __('Like', c_al2fb_text_domain) : __('Recommend', c_al2fb_text_domain); $infolink = get_option(c_al2fb_option_ssp_info); if (empty($infolink)) { $infolink = 'http://yro.slashdot.org/story/11/09/03/0115241/Heises-Two-Clicks-For-More-Privacy-vs-Facebook'; } // Build content if ($appid && !$combine && !$box && get_option(c_al2fb_option_use_ssp)) { $content = '<div id="al2fb_ssp' . $post->ID . '"></div>' . PHP_EOL; $content .= '<script type="text/javascript">' . PHP_EOL; $content .= ' jQuery(document).ready(function($) {' . PHP_EOL; $content .= ' $("#al2fb_ssp' . $post->ID . '").socialSharePrivacy({' . PHP_EOL; $content .= ' services : {' . PHP_EOL; $content .= ' facebook : {' . PHP_EOL; $content .= ' "status" : "on",' . PHP_EOL; $content .= ' "dummy_img" : "' . WPAL2Int::Get_plugin_url() . '/js/socialshareprivacy/images/dummy_facebook.png",' . PHP_EOL; if ($lang != 'de_DE') { $content .= ' "txt_info" : "' . $txtinfo . '",'; $content .= ' "txt_fb_off" : "",'; $content .= ' "txt_fb_on" : "",'; } $content .= ' "perma_option" : "off",' . PHP_EOL; if ($lang != 'de_DE') { $content .= ' "display_name" : "Facebook",' . PHP_EOL; } $content .= ' "referrer_track" : "",' . PHP_EOL; $content .= ' "language" : "' . $lang . '",' . PHP_EOL; $content .= ' "action" : "' . (empty($action) ? 'like' : $action) . '"' . PHP_EOL; $content .= ' },'; $content .= ' twitter : {' . PHP_EOL; $content .= ' "status" : "off",' . PHP_EOL; $content .= ' "dummy_img" : "' . WPAL2Int::Get_plugin_url() . '/js/socialshareprivacy/images/dummy_twitter.png",' . PHP_EOL; $content .= ' "perma_option" : "off"' . PHP_EOL; $content .= ' },' . PHP_EOL; $content .= ' gplus : {' . PHP_EOL; $content .= ' "status" : "off",' . PHP_EOL; $content .= ' "dummy_img" : "' . WPAL2Int::Get_plugin_url() . '/js/socialshareprivacy/images/dummy_gplus.png",' . PHP_EOL; $content .= ' "perma_option" : "off"' . PHP_EOL; $content .= ' },' . PHP_EOL; $content .= ' },'; $content .= ' "info_link" : "' . $infolink . '",'; if ($lang != 'de_DE') { $content .= ' "txt_help" : "' . __('Information', c_al2fb_text_domain) . '",' . PHP_EOL; } $content .= ' "css_path" : "' . WPAL2Int::Get_plugin_url() . '/js/socialshareprivacy/socialshareprivacy.css",' . PHP_EOL; $content .= ' "uri" : "' . $link . '"' . PHP_EOL; $content .= ' });' . PHP_EOL; $content .= ' });' . PHP_EOL; $content .= '</script>' . PHP_EOL; $content = apply_filters('al2fb_heise', $content); } else { $content = $box ? '<div class="al2fb_like_box">' : '<div class="al2fb_like_button">'; $content .= '<div id="fb-root"></div>'; $content .= WPAL2Int::Get_fb_script($user_ID); $content .= $box ? '<fb:like-box' : '<fb:like'; $content .= ' href="' . $link . '"'; if (!$box && $combine) { $content .= ' send="true"'; } if (!$box) { $content .= ' layout="' . (empty($layout) ? 'standard' : $layout) . '"'; } $content .= ' show_faces="' . ($faces ? 'true' : 'false') . '"'; $content .= ' share="' . ($share ? 'true' : 'false') . '"'; $content .= ' width="' . (empty($width) ? $box ? '292' : '450' : $width) . '"'; if ($height) { $content .= ' height="' . $height . '"'; } if (!$box) { $content .= ' action="' . (empty($action) ? 'like' : $action) . '"'; $content .= ' font="' . (empty($font) ? 'arial' : $font) . '"'; } $content .= ' colorscheme="' . (empty($colorscheme) ? 'light' : $colorscheme) . '"'; if (!$box) { $content .= ' ref="AL2FB"'; } if ($box) { $content .= ' border_color="' . $border . '"'; $content .= ' stream="' . ($nostream ? 'false' : 'true') . '"'; $content .= ' header="' . ($noheader ? 'false' : 'true') . '"'; } $content .= $box ? '></fb:like-box>' : '></fb:like>'; $content .= '</div>'; } return $content; } else { return ''; } }