module SocialIcons::ViewHelpers

Public Instance Methods

facebook_like_button(opts = {}) click to toggle source
# File lib/social_icons/view_helpers.rb, line 30
def facebook_like_button(opts = {})
  url = opts[:link]
  out = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + url + '&layout=standard&show_faces=true&width=272&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:272px; height:80px;" allowTransparency="true"></iframe>'
  out
end
print_social_icons(opts = {}) click to toggle source
social_icon_digg(opts) click to toggle source

<a title=“Digg this post” href=“digg.com/submit?phase=2&url=http%3A%2F%2Fwww.weddingbee.com%2F2009%2F03%2F11%2Fadd-share-icons-for-social-media%2F” rel=“nofollow” target=“_blank”><img alt=“Digg this post” src=“” style=“border: medium none ;”></a>

# File lib/social_icons/view_helpers.rb, line 63
def social_icon_digg(opts)
  icon_label = t("social_icons.digg")
  default_opts = {:title => "", :desc => "", :link => ""}
  opts = default_opts.merge(opts)
  out = '<a title="' + 
    icon_label + 
    '" href="http://digg.com/submit?phase=2&url=' +
    opts[:link] +
    '&title=' + 
    opts[:title] +
    '" rel="nofollow" target="_blank">' +
    image_tag("#{opts[:icon_path]}/digg.png", :alt => icon_label, :title => icon_label) +
    '</a>'
end
social_icon_facebook(opts = {}) click to toggle source

<a name=“fb_share” type=“button_count” share_url=“google.com” href=“Sharewww.facebook.com/sharer.php”>Share src=“static.ak.fbcdn.net/connect.php/js/FB.Share” type=“text/javascript”></script>

# File lib/social_icons/view_helpers.rb, line 46
def social_icon_facebook(opts = {})
  default_opts = {:title => "", :desc => "", :link => ""}
  opts = default_opts.merge(opts)
  link = "http://www.facebook.com/sharer.php?u=" + 
    CGI.unescape(opts[:link]) + 
    "&t=#{opts[:title]}"
  out = "<a onclick=\"window.open('#{link}'" + 
    ",'sharer','toolbar=0,status=0,width=626,height=436');return false;\"" + 
    '" href="' + link + '">' + 
    image_tag("#{opts[:icon_path]}/facebook.png", 
              :alt => t("social_icons.facebook"), 
              :title => t("social_icons.facebook")) +
    '</a>'
  out
end
social_icon_twitter(opts = {}) click to toggle source

<a title=“Click to share this post on Twitter”

href="http://twitter.com/home?status=Currently reading &lt;?php the_permalink(); ?&gt;" target="_blank" class="twitter">Share on Twitter</a>
# File lib/social_icons/view_helpers.rb, line 39
def social_icon_twitter(opts = {})
  url = "http://twitter.com/home?status=#{opts[:title]}+#{opts[:link]}"
  out = link_to(image_tag("#{opts[:icon_path]}/twitter.png", :alt => t('social_icons.twitter')), url, :title => t('social_icons.twitter'), :target => "_blank")
  out
end