'href' => $subs->profileurl,
'class' => 'subscription'));
$avatar = $subs->getAvatar(AVATAR_MINI_SIZE);
- common_element('img', array('src' => (($avatar) ? $avatar->url : $config['avatar']['default']['mini']),
+ common_element('img', array('src' => (($avatar) ? $avatar->url : common_default_avatar(AVATAR_MINI_SIZE),
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'class' => 'avatar mini',
'href' => $subs->profileurl,
'class' => 'subscription'));
$avatar = $subs->getAvatar(AVATAR_STREAM_SIZE);
- common_element('img', array('src' => (($avatar) ? $avatar->url : $config['avatar']['default']['stream']),
+ common_element('img', array('src' => (($avatar) ? $avatar->url : common_default_avatar(AVATAR_STREAM_SIZE)),
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
'class' => 'avatar stream',
common_element('img',
array('src' =>
(($avatar) ? $avatar->url :
- $config['avatar']['default']['stream']),
+ common_default_avatar(AVATAR_STREAM_SIZE)),
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
'class' => 'avatar stream',
'image' => 'http://i.creativecommons.org/l/by/3.0/88x31.png'),
'avatar' =>
array('directory' => INSTALLDIR . '/avatar',
- 'path' => '/avatar'));
-
-# these depend on defaults above
-$config['avatar']['default'] =
- array('profile' => "http://".$config['site']['server'].$config['site']['path'].'/'.'theme/default/image/default-avatar-profile.png',
- 'stream' => "http://".$config['site']['server'].$config['site']['path'].'/'.'theme/default/image/default-avatar-stream.png',
- 'mini' => "http://".$config['site']['server'].$config['site']['path'].'/'.'theme/default/image/default-avatar-mini.png');
+ 'path' => '/avatar',
+ 'default' =>
+ array('profile' => 'theme/default/image/default-avatar-profile.png',
+ 'stream' => 'theme/default/image/default-avatar-stream.png',
+ 'mini' => 'theme/default/image/default-avatar-mini.png')));
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
'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 : $config['avatar']['default']['stream'],
+ common_element('img', array('src' => ($avatar) ? $avatar->url : common_default_avatar(AVATAR_STREAM_SIZE),
'class' => 'avatar stream',
'width' => AVATAR_STREAM_SIZE,
'height' => AVATAR_STREAM_SIZE,
return "http://".$config['site']['server'].$config['avatar']['path'].'/'.$filename;
}
+function common_default_avatar($size) {
+ static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
+ AVATAR_STREAM_SIZE => 'stream',
+ AVATAR_MINI_SIZE => 'mini');
+ global $config;
+ return "http://".$config['site']['server'].$config['avatar']['path'].'/'.$config['avatar']['default'][$sizenames[$size]];
+}
+
function common_local_url($action, $args=NULL) {
global $config;
/* XXX: pretty URLs */