summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-07-13 23:44:43 -0400
committerEvan Prodromou <evan@prodromou.name>2008-07-13 23:44:43 -0400
commit8c42fac88a7fbceeabded35303b4a0ad0d677346 (patch)
treefd0e1116233dc0f7baca233e805dd2c3d176b2aa
parent3cf477850f96ea26e1bcb20a2f27c72bd2cfe3f5 (diff)
utility for getting avatar or default avatar
darcs-hash:20080714034443-84dde-f443b04e6733b22709d746a700c0ba032d7afb60.gz
-rw-r--r--lib/util.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index b6ff34fb7..9d66c1ca1 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -1269,3 +1269,13 @@ function common_markup_to_html($c) {
$c = preg_replace('/%%(\w+).(\w+)%%/e', 'common_config(\'\\1\', \'\\2\')', $c);
return Markdown($c);
}
+
+function common_profile_avatar_url($profile, $size=AVATAR_PROFILE_SIZE) {
+ $avatar = $profile->getAvatar($size);
+ if ($avatar) {
+ return common_avatar_display_url($avatar);
+ } else {
+ return common_default_avatar($size);
+ }
+}
+ \ No newline at end of file