$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
common_element_start('div', array('id' => 'profile_avatar'));
- common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_PROFILE_SIZE),
+ common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE),
'class' => 'avatar profile',
'width' => AVATAR_PROFILE_SIZE,
'height' => AVATAR_PROFILE_SIZE,
'href' => $other->profileurl,
'class' => 'subscription'));
$avatar = $other->getAvatar(AVATAR_MINI_SIZE);
- common_element('img', array('src' => (($avatar) ? $avatar->url : common_default_avatar(AVATAR_MINI_SIZE)),
+ common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar mini',
$avatar = $other->getAvatar(AVATAR_STREAM_SIZE);
common_element('img',
array('src' =>
- (($avatar) ? $avatar->url :
+ (($avatar) ? common_avatar_display_url($avatar) :
common_default_avatar(AVATAR_STREAM_SIZE)),
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
'id' => 'notice-' . $notice->id));
$avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
common_element_start('a', array('href' => $profile->profileurl));
- common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_STREAM_SIZE),
+ common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE),
'class' => 'avatar stream',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
}
function common_avatar_url($filename) {
- $server = common_config('avatar', 'server');
- if ($server) {
- return 'http://'.$server.'/'.$filename;
- } else {
return common_path('avatar/'.$filename);
- }
+}
+
+function common_avatar_display_url($avatar) {
+ $server = common_config('avatar', 'server');
+ if ($server) {
+ return 'http://'.$server.'/'.$avatar->filename;
+ } else {
+ return $avatar->url;
+ }
}
function common_default_avatar($size) {