Permalink
Browse files

Now can custom gravatar host as a proxy url.

  • Loading branch information...
1 parent bf952d5 commit e51eb61a56b6e8b047abf532c475d562d9405a51 @huacnlee huacnlee committed Mar 21, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −2 app/helpers/users_helper.rb
  2. +1 −0 config/config.yml.default
@@ -35,12 +35,12 @@ def user_avatar_tag(user, size = :normal, opts = {})
if user.blank?
hash = Digest::MD5.hexdigest("")
- return image_tag("http://gravatar.com/avatar/#{hash}.png?s=#{width}")
+ return image_tag("#{Setting.gravatar_proxy}/avatar/#{hash}.png?s=#{width}")
end
if user.avatar.blank?
hash = Digest::MD5.hexdigest(user.email || "")
- img_src = "http://gravatar.com/avatar/#{hash}.png?s=#{width}"
+ img_src = "#{Setting.gravatar_proxy}/avatar/#{hash}.png?s=#{width}"
img = image_tag(img_src, :style => "width:#{width}px;height:#{width}px;")
else
img = image_tag(user.avatar.url(size), :style => "width:#{width}px;height:#{width}px;")
@@ -23,6 +23,7 @@ defaults: &defaults
external_feed_url: "http://ruby-taiwan.org/topics/feed"
external_feed_name: "Ruby Taiwan Group"
twitter_id: "ruby_china"
+ gravatar_proxy: "http://gravatar.com"
development:
<<: *defaults

0 comments on commit e51eb61

Please sign in to comment.