Skip to content

Commit

Permalink
Added options for showing bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
EnriqueVidal committed Jun 18, 2010
1 parent 951f197 commit 93f7c28
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/sexy_bookmarks_macros_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ def available_social_networks
@available_socials
end

def show_sexy_bookmarks( socials = nil, per_row = 8 )
socials = available_social_networks.keys if socials.nil?
social_items = Array.new
def show_sexy_bookmarks( content, socials = nil, per_row = 8 )
socials = available_social_networks.keys if socials.nil?

list_items = socials.collect do |social|

link_url = available_social_networks[social.to_s]['url'].to_s.gsub( /SHORT_TITLE|TITLE/, content[:title].to_s )
link_url = link_url.gsub( /FETCH_URL|PERMALINK/, content[:permalink].to_s )
link_url = link_url.gsub( /POST_SUMMARY|SEXY_TEASER/, content[:post_summary].to_s ).gsub(/SITE_NAME/, content[:site_name].to_s )
link_url = link_url.gsub( /TWITT_CAT/, content[:twitt_cat].to_s ).gsub( /DEFAULT_TAGS/, content[:default_tags].to_s )
link_url = link_url.gsub( /YAHOOTEASER/, content[:yahooteaser].to_s ).gsub( /YAHOOCATEGORY/, content[:yahoocategory].to_s )
link_url = link_url.gsub( /YAHOOMEDIATYPE/, content[:yahoomediatype].to_s )

link_options = {
:href => available_social_networks[social.to_s]['url'],
:href => link_url,
:rel => :nofollow,
:title => available_social_networks[social.to_s]['message'],
:class => :external
Expand Down

0 comments on commit 93f7c28

Please sign in to comment.