Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Now can custom gravatar host as a proxy url.

  • Loading branch information...
commit e51eb61a56b6e8b047abf532c475d562d9405a51 1 parent bf952d5
Jason Lee authored March 21, 2012
4  app/helpers/users_helper.rb
@@ -35,12 +35,12 @@ def user_avatar_tag(user, size = :normal, opts = {})
35 35
     
36 36
     if user.blank?
37 37
       hash = Digest::MD5.hexdigest("")
38  
-      return image_tag("http://gravatar.com/avatar/#{hash}.png?s=#{width}")
  38
+      return image_tag("#{Setting.gravatar_proxy}/avatar/#{hash}.png?s=#{width}")
39 39
     end
40 40
 
41 41
     if user.avatar.blank?
42 42
       hash = Digest::MD5.hexdigest(user.email || "")
43  
-      img_src = "http://gravatar.com/avatar/#{hash}.png?s=#{width}"
  43
+      img_src = "#{Setting.gravatar_proxy}/avatar/#{hash}.png?s=#{width}"
44 44
       img = image_tag(img_src, :style => "width:#{width}px;height:#{width}px;")
45 45
     else
46 46
       img = image_tag(user.avatar.url(size), :style => "width:#{width}px;height:#{width}px;")
1  config/config.yml.default
@@ -23,6 +23,7 @@ defaults: &defaults
23 23
   external_feed_url: "http://ruby-taiwan.org/topics/feed"
24 24
   external_feed_name: "Ruby Taiwan Group"
25 25
   twitter_id: "ruby_china"
  26
+  gravatar_proxy: "http://gravatar.com"
26 27
 
27 28
 development:
28 29
   <<: *defaults

0 notes on commit e51eb61

Please sign in to comment.
Something went wrong with that request. Please try again.