Changeset 205753
- Timestamp:
- 02/14/2010 11:24:57 PM (16 years ago)
- Location:
- gravatarlocalcache/trunk
- Files:
-
- 2 edited
-
GravatarLocalCache.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gravatarlocalcache/trunk/GravatarLocalCache.php
r205642 r205753 7 7 Description: Local cache for gravatar images (saves dnsqueries and let you control cache/proxysettings of the images). 8 8 Author: Oliver Schaal 9 Version: 0.9. 49 Version: 0.9.5 10 10 11 11 This is a WordPress plugin (http://wordpress.org) and widget … … 19 19 } 20 20 21 // downloadfunction of wordpress21 // we need the downloadfunction of wordpress 22 22 require_once(ABSPATH . 'wp-admin/includes/file.php'); 23 23 … … 136 136 @unlink($_tmp); 137 137 138 // lets try to fetch the default avatar 139 // preg_match('/&d=(.*)/i',$_imageurl,$_defaultavatar); 140 // $_tmp = download_url(urldecode($_defaultavatar[1])); 141 if ( self::$defaultAvatar == 'mystery') { 142 $_defavatar = 'http://www.gravatar.com/avatar/'.md5('unknown@gravatar.com').'?s='.$_img[2]; 143 } elseif (self::$defaultAvatar == 'blank') { 144 $_defavatar = includes_url('images/blank.gif'); 145 } else { 146 // should never reach this point 147 $_defavatar = 'http://www.gravatar.com/avatar/?d='.self::$defaultAvatar.'&s='.$_img[2]; 148 } 149 $_tmp = download_url($_defavatar); 138 // lets try to fetch the default avatar in the url 139 preg_match('/&d=(.*)/i',$_imageurl,$_defaultavatar); 140 $_tmp = download_url(urldecode($_defaultavatar[1])); 150 141 if ( is_wp_error($_tmp) ) { 151 // print '<!-- GravatarLocalCache: default image couldn't be fetched -->';142 // print '<!-- GravatarLocalCache: default image (url param) couldn't be fetched -->'; 152 143 @unlink($_tmp); 153 return $matches[0]; 144 145 // last chance, lets try the default gravatar set in wordpress 146 if ( self::$defaultAvatar == 'mystery') { 147 $_defavatar = 'http://www.gravatar.com/avatar/'.md5('unknown@gravatar.com').'?s='.$_img[2]; 148 } elseif (self::$defaultAvatar == 'blank') { 149 $_defavatar = includes_url('images/blank.gif'); 150 } else { 151 // should never reach this point 152 $_defavatar = 'http://www.gravatar.com/avatar/?d='.self::$defaultAvatar.'&s='.$_img[2]; 153 } 154 155 $_tmp = download_url($_defavatar); 156 if ( is_wp_error($_tmp) ) { 157 // print '<!-- GravatarLocalCache: default image (wordpress setting) couldn't be fetched -->'; 158 @unlink($_tmp); 159 return $matches[0]; 160 } 154 161 } 155 162 } -
gravatarlocalcache/trunk/readme.txt
r205642 r205753 10 10 Requires at least: 2.8 11 11 Tested up to: 2.9.1 12 Stable tag: 0.9. 412 Stable tag: 0.9.5 13 13 14 14 Local cache for gravatar images (saves dnsqueries and let you control cache/proxysettings of the images). … … 38 38 If your plugin/theme doesn't use this function, GLC can't fetch the gravatar requests. Ask the author of the plugin/theme to use "get_avatar()". 39 39 40 = How can i change the cache/proxy-settings ifimages? =40 = How can i change the cache/proxy-settings of the images? = 41 41 If you use apache as your webserver, you can set the options throught .htacces as described [here (german)](http://blog.splash.de/2010/01/29/cache-kontrolle-beim-apache-via-htaccess/) , [here](http://www.samaxes.com/2009/01/more-on-compressing-and-caching-your-site-with-htaccess/) or [here](http://www.realityloop.com/blog/2009/08/19/optimizing-page-load-times-using-moddeflate-modexpires-etag-apache2). 42 42 For other webservers you have to check the manual. … … 45 45 46 46 == Changelog == 47 48 = 0.9.5 (1.0.0 RC4) = 49 * [FIX] default gravatar 50 * [more information](http://blog.splash.de/2010/02/15/gravatarlocalcache-0-9-3-0-9-5/) 47 51 48 52 = 0.9.4 (1.0.0 RC3) =
Note: See TracChangeset
for help on using the changeset viewer.