configurability for avatars
This commit is contained in:
		
							parent
							
								
									3b2a05ac2d
								
							
						
					
					
						commit
						e0fd446d84
					
				@ -131,9 +131,13 @@ class User {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	public function get_avatar_html() {
 | 
						public function get_avatar_html() {
 | 
				
			||||||
		// FIXME: configurable
 | 
							// FIXME: configurable
 | 
				
			||||||
 | 
							global $config;
 | 
				
			||||||
 | 
							if($config->get_string("avatar_host") == "gravatar") {
 | 
				
			||||||
			if(!empty($this->email)) {
 | 
								if(!empty($this->email)) {
 | 
				
			||||||
				$hash = md5(strtolower($this->email));
 | 
									$hash = md5(strtolower($this->email));
 | 
				
			||||||
			return "<img src=\"http://www.gravatar.com/avatar/$hash.jpg\">";
 | 
									$args = $config->get_string("avatar_gravatar_options");
 | 
				
			||||||
 | 
									return "<img src=\"http://www.gravatar.com/avatar/$hash.jpg?$args\">";
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return "";
 | 
							return "";
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
@ -44,6 +44,8 @@ class UserPage extends SimpleExtension {
 | 
				
			|||||||
		global $config;
 | 
							global $config;
 | 
				
			||||||
		$config->set_default_bool("login_signup_enabled", true);
 | 
							$config->set_default_bool("login_signup_enabled", true);
 | 
				
			||||||
		$config->set_default_int("login_memory", 365);
 | 
							$config->set_default_int("login_memory", 365);
 | 
				
			||||||
 | 
							$config->set_default_string("avatar_host", "gravatar");
 | 
				
			||||||
 | 
							$config->set_default_string("avatar_gravatar_options", "");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public function onPageRequest(Event $event) {
 | 
						public function onPageRequest(Event $event) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user