You are here

function theme_facebookshare_button in Facebook Share 7

Same name and namespace in other branches
  1. 6.3 facebookshare.module \theme_facebookshare_button()
  2. 6 facebookshare.module \theme_facebookshare_button()

Themes facebook share button

1 theme call to theme_facebookshare_button()
theme_facebookshare in ./facebookshare.module
Themes facebook share button box

File

./facebookshare.module, line 138
Adds a button to a node to share on a user's Facebook stream

Code

function theme_facebookshare_button($variables) {
  $url = $variables['url'];
  $size = $variables['size'];
  $text = $variables['text'];
  $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http';
  $script_url = $protocol == 'https' ? 'https://s-static.ak.fbcdn.net/connect.php/js/FB.Share' : 'http://static.ak.fbcdn.net/connect.php/js/FB.Share';
  $output = '<a name="fb_share" ' . 'type="' . $size . '" share_url="' . $url . '">' . $text . '</a>' . '<script src="' . $script_url . '" type="text/javascript"></script>';
  return $output;
}