----------------------- phpBB/includes/acp/acp_board.php -----------------------
index 7db361b..58fd2b1 100644
@@ -118,6 +118,7 @@ class acp_board
 						'allow_avatar'			=> array('lang' => 'ALLOW_AVATARS',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_avatar_local'	=> array('lang' => 'ALLOW_LOCAL',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_avatar_remote'	=> array('lang' => 'ALLOW_REMOTE',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
+						'allow_avatar_gravatar'	=> array('lang' => 'ALLOW_GRAVATAR',		'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'allow_avatar_upload'	=> array('lang' => 'ALLOW_UPLOAD',			'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => false),
 						'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool',	'type' => 'radio:yes_no', 'explain' => true),
 						'avatar_filesize'		=> array('lang' => 'MAX_FILESIZE',			'validate' => 'int:0',	'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),

------------------------- phpBB/includes/constants.php -------------------------
index ff57286..3f3ff12 100644
@@ -41,6 +41,7 @@ define('USER_ACTIVATION_DISABLE', 3);
 define('AVATAR_UPLOAD', 1);
 define('AVATAR_REMOTE', 2);
 define('AVATAR_GALLERY', 3);
+define('AVATAR_GRAVATAR', 4);
 
 define('USER_NORMAL', 0);
 define('USER_INACTIVE', 1);

--------------------- phpBB/includes/functions_display.php ---------------------
index 5e6239b..ab23ccb 100644
@@ -1275,6 +1275,14 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
 				return '';
 			}
 		break;
+
+		case AVATAR_GRAVATAR:
+			if (!$config['allow_avatar_gravatar'] && !$ignore_config)
+			{
+				return '';
+			}
+			$avatar_img = 'http://www.gravatar.com/avatar/';
+		break;
 	}
 
 	$avatar_img .= $avatar;

---------------------- phpBB/includes/functions_user.php ----------------------
index 6f6d752..fb5dfe7 100644
@@ -2054,6 +2054,39 @@ function avatar_remote($data, &$error)
 }
 
 /**
+* Gravatar avatar linking
+*/
+function avatar_gravatar($data, &$error)
+{
+	global $user, $config;
+
+	// Hieght and width, Gravatars are /always/ square, and we are using  80 is Gravatar default.
+	$size = ($data['width'] > 0) ? $data['width'] : 80; 
+
+	if ($config['avatar_max_width'] || $config['avatar_max_height'])
+	{
+		if ($size > $config['avatar_max_width'] || $size > $config['avatar_max_height'])
+		{
+			$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $size, $size);
+			return false;
+		}
+	}
+
+	if ($config['avatar_min_width'] || $config['avatar_min_height'])
+	{
+		if ($size < $config['avatar_min_width'] || $size < $config['avatar_min_height'])
+		{
+			$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], $size, $size);
+			return false;
+		}
+	}
+
+	// According to the specifications at http://gravatar.com/site/implement/url, md5() of an strtolower()'d and trim()'d email address
+	// This allows the storage only the 'slug' portion, the URL portion is applied when displaying the gravatar.
+	return array(AVATAR_GRAVATAR, md5($user->data['user_email']) . '?s=' . $size, $size, $size);
+}
+
+/**
 * Avatar upload using the upload class
 */
 function avatar_upload($data, &$error)
@@ -2241,6 +2274,10 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
 		case AVATAR_REMOTE :
 			break;
 
+		case AVATAR_GRAVATAR:
+			$avatar = 'http://www.gravatar.com/avatar/' . $avatar;
+		break;
+
 		case AVATAR_UPLOAD :
 			$avatar = $phpbb_root_path . $config['avatar_path'] . '/' . get_avatar_filename($avatar);
 			break;
@@ -2294,6 +2331,7 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu
 		'remotelink'	=> request_var('remotelink', ''),
 		'width'			=> request_var('width', 0),
 		'height'		=> request_var('height', 0),
+		'usegravatar'	=> request_var('gravatar', 0),
 	);
 
 	$error = validate_data($data, array(
@@ -2301,6 +2339,7 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu
 		'remotelink'	=> array('string', true, 5, 255),
 		'width'			=> array('string', true, 1, 3),
 		'height'		=> array('string', true, 1, 3),
+		'usegravatar'	=> array('num', true, 0, 1),
 	));
 
 	if (sizeof($error))
@@ -2337,6 +2376,10 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu
 	{
 		list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_remote($data, $error);
 	}
+	else if ($data['usegravatar'] && $change_avatar && $config['allow_avatar_gravatar'])
+	{
+		list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_gravatar($data, $error);
+	}
 	else if ($avatar_select && $change_avatar && $config['allow_avatar_local'])
 	{
 		$category = basename(request_var('category', ''));

---------------------- phpBB/includes/ucp/ucp_profile.php ----------------------
index 363a480..fd0b4ef 100644
@@ -616,7 +616,7 @@ class ucp_profile
 				}
 				else if ($config['allow_avatar'])
 				{
-					$avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
+					$avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']  || $config['allow_avatar_gravatar']))) ? true : false;
 
 					$template->assign_vars(array(
 						'AVATAR_WIDTH'	=> request_var('width', $user->data['user_avatar_width']),
@@ -626,7 +626,8 @@ class ucp_profile
 						'S_UPLOAD_AVATAR_FILE'	=> ($can_upload && $config['allow_avatar_upload']) ? true : false,
 						'S_UPLOAD_AVATAR_URL'	=> ($can_upload && $config['allow_avatar_remote_upload']) ? true : false,
 						'S_LINK_AVATAR'			=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
-						'S_DISPLAY_GALLERY'		=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
+						'S_DISPLAY_GALLERY'		=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false,
+						'S_GRAVATAR'			=> ($auth->acl_get('u_chgavatar') && $config['allow_avatar_gravatar']) ? true : false)
 					);
 				}
 

-------------------- phpBB/install/schemas/schema_data.sql --------------------
index e815615..26133dd 100644
@@ -12,6 +12,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '0'
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1');
 INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1');

----------------------- phpBB/language/en/acp/board.php -----------------------
index 80db816..5f2747f 100644
@@ -101,6 +101,8 @@ $lang = array_merge($lang, array(
 	'ALLOW_REMOTE_UPLOAD'			=> 'Enable remote avatar uploading',
 	'ALLOW_REMOTE_UPLOAD_EXPLAIN'	=> 'Allow uploading of avatars from another website.',
 	'ALLOW_UPLOAD'					=> 'Enable avatar uploading',
+	'ALLOW_GRAVATAR'				=> 'Enable Gravatar avatars',
+	'ALLOW_GRAVATAR_EXPLAIN'		=> 'Allow users to use the Gravatar attached to their email address.',
 	'AVATAR_GALLERY_PATH'			=> 'Avatar gallery path',
 	'AVATAR_GALLERY_PATH_EXPLAIN'	=> 'Path under your phpBB root directory for pre-loaded images, e.g. <samp>images/avatars/gallery</samp>.',
 	'AVATAR_STORAGE_PATH'			=> 'Avatar storage path',

-------------------------- phpBB/language/en/ucp.php --------------------------
index 02b8a28..eed5fe3 100644
@@ -474,6 +474,8 @@ $lang = array_merge($lang, array(
 	'USERNAME_CHARS_ANY_EXPLAIN'	=> 'Length must be between %1$d and %2$d characters.',
 	'USERNAME_TAKEN_USERNAME'		=> 'The username you entered is already in use, please select an alternative.',
 	'USERNAME_DISALLOWED_USERNAME'	=> 'The username you entered has been disallowed or contains a disallowed word. Please choose a different name.',
+	'USE_GRAVATAR'					=> 'Use Gravatar',
+	'USE_GRAVATAR_EXPLAIN'			=> 'Use the Gravatar linked with the email to this forum account. Visit <a href="http://gravatar.com/">Gravatar.com</a> to get one today.',
 	'USER_NOT_FOUND_OR_INACTIVE'	=> 'The usernames you specified could either not be found or are not activated users.',
 
 	'VIEW_AVATARS'				=> 'Display avatars',

----------- phpBB/styles/prosilver/template/ucp_avatar_options.html -----------
index 7012c42..7d5ea43 100644
@@ -32,6 +32,16 @@
 			<dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
 			<dd><input type="text" name="remotelink" id="remotelink" value="{AVATAR_REMOTE}" class="inputbox" /></dd>
 		</dl>
+	<!-- ENDIF -->
+
+	<!-- IF S_GRAVATAR -->
+		<dl>
+			<dt><label for="gravatar">{L_USE_GRAVATAR}:</label><br /><span>{L_USE_GRAVATAR_EXPLAIN}</span></dt>
+			<dd><input type="checkbox" name="gravatar" id="gravatar" value="1" /></dd>
+		</dl>
+	<!-- ENDIF -->
+
+	<!-- IF S_LINK_AVATAR or S_GRAVATAR -->
 		<dl>
 			<dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
 			<dd>
